From bc3b06bc17ad05ff10220bd40a2f6172b4773ff5 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Mon, 25 Apr 2022 23:04:49 +0200 Subject: [PATCH] Translate app --- src/common/locale/en/LC_MESSAGES/django.po | 61 +++++ src/common/locale/fr/LC_MESSAGES/django.po | 62 +++++ src/common/templates/403.html | 5 +- src/common/templates/404.html | 5 +- src/common/templates/500.html | 5 +- src/common/templates/common/navbar.html | 9 +- src/purchase/admin.py | 7 + src/purchase/forms.py | 3 +- src/purchase/locale/en/LC_MESSAGES/django.po | 210 +++++++++++++++++ src/purchase/locale/fr/LC_MESSAGES/django.po | 223 ++++++++++++++++++ src/purchase/models.py | 49 +++- .../purchase/basket_confirm_delete.html | 3 +- .../templates/purchase/basket_form.html | 7 +- .../templates/purchase/basket_list.html | 7 +- src/purchase/templates/purchase/reports.html | 15 +- .../snippets/report_no_payment_method.html | 5 +- .../snippets/report_payment_methods.html | 7 +- .../purchase/snippets/report_products.html | 7 +- src/purchase/views/basket.py | 8 +- 19 files changed, 651 insertions(+), 47 deletions(-) create mode 100644 src/common/locale/en/LC_MESSAGES/django.po create mode 100644 src/common/locale/fr/LC_MESSAGES/django.po create mode 100644 src/purchase/locale/en/LC_MESSAGES/django.po create mode 100644 src/purchase/locale/fr/LC_MESSAGES/django.po diff --git a/src/common/locale/en/LC_MESSAGES/django.po b/src/common/locale/en/LC_MESSAGES/django.po new file mode 100644 index 0000000..ae16cee --- /dev/null +++ b/src/common/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,61 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-04-25 23:04+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/common/templates/403.html:4 +msgid "Permission denied" +msgstr "" + +#: src/common/templates/403.html:5 +msgid "You're not allowed to access this page." +msgstr "" + +#: src/common/templates/404.html:4 +msgid "Page not found" +msgstr "" + +#: src/common/templates/404.html:5 +msgid "We tried and tried but couldn't find the page you're looking for." +msgstr "" + +#: src/common/templates/500.html:11 +msgid "Server error (500)" +msgstr "" + +#: src/common/templates/500.html:12 +msgid "" +"There's an error on our end. Don't worry though, our engineers are already " +"working to fix it!" +msgstr "" + +#: src/common/templates/common/navbar.html:12 +msgid "New basket" +msgstr "" + +#: src/common/templates/common/navbar.html:17 +msgid "Baskets" +msgstr "" + +#: src/common/templates/common/navbar.html:20 +msgid "Reports" +msgstr "" + +#: src/common/templates/common/navbar.html:25 +msgid "Admin" +msgstr "" diff --git a/src/common/locale/fr/LC_MESSAGES/django.po b/src/common/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 0000000..238f537 --- /dev/null +++ b/src/common/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,62 @@ +# Copyright (C) 2022 Gabriel Augendre +# This file is distributed under the same license as the package. +# Gabriel Augendre , 2022. +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-04-25 23:04+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: src/common/templates/403.html:4 +msgid "Permission denied" +msgstr "Permission refusée" + +#: src/common/templates/403.html:5 +msgid "You're not allowed to access this page." +msgstr "Vous n'avez pas le droit d'accéder à cette page" + +#: src/common/templates/404.html:4 +msgid "Page not found" +msgstr "Page non trouvée" + +#: src/common/templates/404.html:5 +msgid "We tried and tried but couldn't find the page you're looking for." +msgstr "" +"Nous avons cherché partout mais nous n'avons pas trouvé la page que vous " +"cherchiez." + +#: src/common/templates/500.html:11 +msgid "Server error (500)" +msgstr "Erreur serveur (500)" + +#: src/common/templates/500.html:12 +msgid "" +"There's an error on our end. Don't worry though, our engineers are already " +"working to fix it!" +msgstr "" +"Il y a une erreur de notre côté. Ne vous inquiétez pas, nos ingénieurs " +"travaillent déjà à sa résolution !" + +#: src/common/templates/common/navbar.html:12 +msgid "New basket" +msgstr "Nouveau panier" + +#: src/common/templates/common/navbar.html:17 +msgid "Baskets" +msgstr "Paniers" + +#: src/common/templates/common/navbar.html:20 +msgid "Reports" +msgstr "Rapports" + +#: src/common/templates/common/navbar.html:25 +msgid "Admin" +msgstr "Admin" diff --git a/src/common/templates/403.html b/src/common/templates/403.html index 0512cd6..a1127b0 100644 --- a/src/common/templates/403.html +++ b/src/common/templates/403.html @@ -1,5 +1,6 @@ {% extends "common/base.html" %} +{% load i18n %} {% block content %} -

Permission denied

-

You're not allowed to access this page.

+

{% translate "Permission denied" %}

+

{% translate "You're not allowed to access this page." %}

{% endblock %} diff --git a/src/common/templates/404.html b/src/common/templates/404.html index 1112d54..2034d8e 100644 --- a/src/common/templates/404.html +++ b/src/common/templates/404.html @@ -1,5 +1,6 @@ {% extends "common/base.html" %} +{% load i18n %} {% block content %} -

Page not found

-

We tried and tried but couldn't find the page you're looking for.

+

{% translate "Page not found" %}

+

{% translate "We tried and tried but couldn't find the page you're looking for." %}

{% endblock %} diff --git a/src/common/templates/500.html b/src/common/templates/500.html index d308d98..728ce18 100644 --- a/src/common/templates/500.html +++ b/src/common/templates/500.html @@ -1,3 +1,4 @@ +{% load i18n %} @@ -7,7 +8,7 @@ -

Server error (500)

-

There's an error on our end. Don't worry, our engineers are already working on it!

+

{% translate "Server error (500)" %}

+

{% translate "There's an error on our end. Don't worry though, our engineers are already working to fix it!" %}

diff --git a/src/common/templates/common/navbar.html b/src/common/templates/common/navbar.html index 7e4989e..0ff0ba5 100644 --- a/src/common/templates/common/navbar.html +++ b/src/common/templates/common/navbar.html @@ -1,3 +1,4 @@ +{% load i18n %}