From f61d1432c7b57da5725a94c7b308ebacfe0af085 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sat, 15 Oct 2011 01:19:19 +0200 Subject: Translate the application using Flask-babel. The only translation so far is french, but more can be added. The browser language is used thanks to the HTTP languages headers. There are still some problems with the translation of some strings, I don't know why this is. See #12 --- budget/templates/add_bill.html | 2 +- budget/templates/authenticate.html | 4 ++-- budget/templates/create_project.html | 2 +- budget/templates/edit_bill.html | 4 ++-- budget/templates/edit_project.html | 2 +- budget/templates/forms.html | 16 ++++++++-------- budget/templates/home.html | 16 ++++++++-------- budget/templates/invitation_mail | 10 ---------- budget/templates/invitation_mail.en | 10 ++++++++++ budget/templates/invitation_mail.fr | 9 +++++++++ budget/templates/layout.html | 18 +++++++++--------- budget/templates/list_bills.html | 20 ++++++++++---------- budget/templates/password_reminder | 8 -------- budget/templates/password_reminder.en | 8 ++++++++ budget/templates/password_reminder.fr | 7 +++++++ budget/templates/password_reminder.html | 2 +- budget/templates/recent_projects.html | 2 +- budget/templates/reminder_mail | 9 --------- budget/templates/reminder_mail.en | 9 +++++++++ budget/templates/reminder_mail.fr | 8 ++++++++ budget/templates/send_invites.html | 14 +++++++------- 21 files changed, 102 insertions(+), 78 deletions(-) delete mode 100644 budget/templates/invitation_mail create mode 100644 budget/templates/invitation_mail.en create mode 100644 budget/templates/invitation_mail.fr delete mode 100644 budget/templates/password_reminder create mode 100644 budget/templates/password_reminder.en create mode 100644 budget/templates/password_reminder.fr delete mode 100644 budget/templates/reminder_mail create mode 100644 budget/templates/reminder_mail.en create mode 100644 budget/templates/reminder_mail.fr (limited to 'budget/templates') diff --git a/budget/templates/add_bill.html b/budget/templates/add_bill.html index 3b29896..6349730 100644 --- a/budget/templates/add_bill.html +++ b/budget/templates/add_bill.html @@ -1,7 +1,7 @@ {% extends "layout.html" %} {% block top_menu %} -Back to the list +{{ _("Back to the list") }} {% endblock %} {% block content %} diff --git a/budget/templates/authenticate.html b/budget/templates/authenticate.html index 83839e1..7af2440 100644 --- a/budget/templates/authenticate.html +++ b/budget/templates/authenticate.html @@ -3,8 +3,8 @@

Authentication

{% if create_project %} -

The project you are trying to access do not exist, do you want -to create it? +

{{ _("The project you are trying to access do not exist, do you want +to") }} {{ _("create it") }}{{ _("?") }}

{% endif %}
diff --git a/budget/templates/create_project.html b/budget/templates/create_project.html index 41b8fd0..cbf1622 100644 --- a/budget/templates/create_project.html +++ b/budget/templates/create_project.html @@ -1,7 +1,7 @@ {% extends "layout.html" %} {% block content %} -

Create a new project

+

{{ _("Create a new project") }}

{{ forms.create_project(form) }}
diff --git a/budget/templates/edit_bill.html b/budget/templates/edit_bill.html index 9c272ae..cb55d69 100644 --- a/budget/templates/edit_bill.html +++ b/budget/templates/edit_bill.html @@ -1,11 +1,11 @@ {% extends "layout.html" %} {% block top_menu %} -Back to the list +{{ _("Back to the list") }} {% endblock %} {% block content %} -

Edit a bill

+

{{ _("Edit a bill") }}

diff --git a/budget/templates/edit_project.html b/budget/templates/edit_project.html index c69045d..0349fe7 100644 --- a/budget/templates/edit_project.html +++ b/budget/templates/edit_project.html @@ -1,7 +1,7 @@ {% extends "layout.html" %} {% block content %} -

Edit this project

+

{{ _("Edit this project") }}

{{ forms.edit_project(form) }}
diff --git a/budget/templates/forms.html b/budget/templates/forms.html index beb714b..3a3d5ba 100644 --- a/budget/templates/forms.html +++ b/budget/templates/forms.html @@ -21,10 +21,10 @@
{% if home %} - Can't remember the password? + {{ _("Can't remember the password?") }} {% endif %} {% if cancel %} - + {% endif %}
{% endmacro %} @@ -72,7 +72,7 @@ {% macro add_bill(form, edit=False) %}
- {% if edit %}Edit this {% else %}Add a {% endif %}bill + {% if edit %}{{ _("Edit this bill") }} {% else %}{{ _("Add a bill") }} {% endif %} {% include "display_errors.html" %} {{ form.hidden_tag() }} {{ input(form.date) }} @@ -88,7 +88,7 @@ {% macro add_member(form) %} {{ form.hidden_tag() }} {{ form.name }} - + {% endmacro %} @@ -96,20 +96,20 @@ {{ form.hidden_tag() }} {{ input(form.emails) }}
- - No, thanks + + {{ _("No, thanks") }}
{% endmacro %} {% macro create_archive(form) %}
- Create an archive + {{ _("Create an archive") }} {{ form.hidden_tag() }} {{ input(form.start_date) }} {{ input(form.end_date) }}
- +
{% endmacro %} diff --git a/budget/templates/home.html b/budget/templates/home.html index bf74767..1073a49 100644 --- a/budget/templates/home.html +++ b/budget/templates/home.html @@ -6,11 +6,11 @@ {% block header %} @@ -23,17 +23,17 @@
-

Log to an existing project...

+

{{ _("Log to an existing project") }}...

{{ forms.authenticate(auth_form, home=True) }} - - can't remember your password? + + {{ _("can't remember your password?") }}
-

...or create a new one

+

...{{ _("or create a new one") }}

{{ forms.create_project(project_form, home=True) }} - +
diff --git a/budget/templates/invitation_mail b/budget/templates/invitation_mail deleted file mode 100644 index 4f5bbf0..0000000 --- a/budget/templates/invitation_mail +++ /dev/null @@ -1,10 +0,0 @@ -Hi, - -Someone using the email address {{ g.project.contact_email }} invited you to share your expenses for "{{ g.project.name }}". - -It's as simple as saying what did you paid for, for who, and how much did it cost you, we are caring about the rest. - -You can access it here: {{ config['SITE_URL'] }}{{ url_for(".list_bills") }}, the private code is "{{ g.project.password }}". - -Enjoy, -Some weird guys (with beards) diff --git a/budget/templates/invitation_mail.en b/budget/templates/invitation_mail.en new file mode 100644 index 0000000..4f5bbf0 --- /dev/null +++ b/budget/templates/invitation_mail.en @@ -0,0 +1,10 @@ +Hi, + +Someone using the email address {{ g.project.contact_email }} invited you to share your expenses for "{{ g.project.name }}". + +It's as simple as saying what did you paid for, for who, and how much did it cost you, we are caring about the rest. + +You can access it here: {{ config['SITE_URL'] }}{{ url_for(".list_bills") }}, the private code is "{{ g.project.password }}". + +Enjoy, +Some weird guys (with beards) diff --git a/budget/templates/invitation_mail.fr b/budget/templates/invitation_mail.fr new file mode 100644 index 0000000..3a2b956 --- /dev/null +++ b/budget/templates/invitation_mail.fr @@ -0,0 +1,9 @@ +Salut, + +Quelqu'un avec l'addresse email "{{ g.project.contact_email }}" vuos à invité à partager vos dépenses pour "{{ g.project.name }}". + +C'est aussi simple que de dire qui à payé pour quoi, pour qui, et combien celà à coûté, on s'occuppe du reste. + +Vous pouvez accéder à la page ici: {{ config['SITE_URL'] }}{{ url_for(".list_bills") }}, le code est "{{ g.project.password }}". + +Have fun, diff --git a/budget/templates/layout.html b/budget/templates/layout.html index 2b7c11e..1406bd9 100644 --- a/budget/templates/layout.html +++ b/budget/templates/layout.html @@ -2,7 +2,7 @@ - Account manager + {{ _("Account manager") }} @@ -45,23 +45,23 @@

{% if g.project %} @@ -82,7 +82,7 @@ {% endblock %} {% block footer %} {% endblock %} diff --git a/budget/templates/list_bills.html b/budget/templates/list_bills.html index f37e1fe..0325a94 100644 --- a/budget/templates/list_bills.html +++ b/budget/templates/list_bills.html @@ -27,7 +27,7 @@ if ($(this).hasClass("confirm")){ return true; } - $(this).html("you sure?"); + $(this).html("{{_("you sure?")}}"); $(this).addClass("confirm"); return false; }); @@ -42,7 +42,7 @@ {% endblock %} {% block sidebar %} -

Balance

+

{{ _("Balance") }}

{% set balance = g.project.get_balance() %} @@ -53,7 +53,7 @@ - + {% endif %} {% endfor %} @@ -65,17 +65,17 @@ {% endblock %} {% block content %} -
The project identifier is {{ g.project.id }}, remember it or add this page to you bookmarks!
+
{{ _("The project identifier is") }} {{ g.project.id }}, {{ _("remember it or add this page to you bookmarks!") }}


-Add a new bill +{{ _("Add a new bill") }} - hide this form + {{ _("hide this form") }} {{ forms.add_bill(bill_form) }} {% if bills.count() > 0 %}
{% if balance[member] > 0 %}+{% endif %}{{ balance[member] }} {% if member.activated %}delete{% else %}reactivate{% endif %} {% if member.activated %}{{ _("delete") }}{% else %}{{ _("reactivate") }}{% endif %}
- + {% for bill in bills %} @@ -84,15 +84,15 @@ - + {% endfor %}
When?Who paid?For what?OwersHow much?Actions
{{ _("When?") }}{{ _("Who paid?") }}{{ _("For what?") }}{{ _("Owers") }}{{ _("How much?") }}{{ _("Actions") }}
{{ bill.what }} {% for ower in bill.owers %}{{ ower.name }} {% endfor %} {{ bill.amount }} ({{ bill.pay_each() }} each)edit - delete{{ _("edit") }} + {{ _("delete") }}
{% else %} -

Nothing to list yet. You probably want to add a bill ?

+

{{ _("Nothing to list yet. You probably want to") }} {{ _("add a bill") }} ?

{% endif %}
{% endblock %} diff --git a/budget/templates/password_reminder b/budget/templates/password_reminder deleted file mode 100644 index fc24a6f..0000000 --- a/budget/templates/password_reminder +++ /dev/null @@ -1,8 +0,0 @@ -Hi, - -You requested to be reminded about your password for "{{ project.name }}". - -You can access it here: {{ config['SITE_URL'] }}{{ url_for(".list_bills", project_id=project.id) }}, the private code is "{{ project.password }}". - -Hope this helps, -Some weird guys (with beards) diff --git a/budget/templates/password_reminder.en b/budget/templates/password_reminder.en new file mode 100644 index 0000000..fc24a6f --- /dev/null +++ b/budget/templates/password_reminder.en @@ -0,0 +1,8 @@ +Hi, + +You requested to be reminded about your password for "{{ project.name }}". + +You can access it here: {{ config['SITE_URL'] }}{{ url_for(".list_bills", project_id=project.id) }}, the private code is "{{ project.password }}". + +Hope this helps, +Some weird guys (with beards) diff --git a/budget/templates/password_reminder.fr b/budget/templates/password_reminder.fr new file mode 100644 index 0000000..58f04e3 --- /dev/null +++ b/budget/templates/password_reminder.fr @@ -0,0 +1,7 @@ +Salut, + +Vous avez demandez des informations sur votre mot de passe pour "{{ project.name }}". + +Vous pouvez y accéder ici {{ config['SITE_URL'] }}{{ url_for(".list_bills", project_id=project.id) }}, le code d'accès est "{{ project.password }}". + +Faites en bon usage ! diff --git a/budget/templates/password_reminder.html b/budget/templates/password_reminder.html index 0110cb8..89e399e 100644 --- a/budget/templates/password_reminder.html +++ b/budget/templates/password_reminder.html @@ -1,7 +1,7 @@ {% extends "layout.html" %} {% block content %} -

Password reminder

+

{{ _("Password reminder") }}

{{ forms.remind_password(form) }}
diff --git a/budget/templates/recent_projects.html b/budget/templates/recent_projects.html index 91e1dd6..df4972d 100644 --- a/budget/templates/recent_projects.html +++ b/budget/templates/recent_projects.html @@ -1,5 +1,5 @@ {% if 'projects' in session %} -

Your projects

+

{{ _("Your projects") }}