From 3207aa0e22d35ec0827fd46840de226a04a01d49 Mon Sep 17 00:00:00 2001 From: Bat Date: Sun, 17 Jun 2018 16:26:15 +0100 Subject: [PATCH] Make the UI translatable --- po/en.po | 3 + po/en.po~ | 5 + po/fr.po | 3 + po/fr.po~ | 5 + po/plume.pot | 221 ++++++++++++++++++++++++ src/main.rs | 6 +- templates/base.html.tera | 18 +- templates/blogs/details.html.tera | 6 +- templates/blogs/new.html.tera | 10 +- templates/comments/new.html.tera | 8 +- templates/errors/500.html.tera | 4 +- templates/instance/configure.html.tera | 8 +- templates/instance/index.html.tera | 2 +- templates/notifications/index.html.tera | 4 +- templates/posts/details.html.tera | 22 +-- templates/posts/new.html.tera | 12 +- templates/session/login.html.tera | 10 +- templates/users/dashboard.tera | 10 +- templates/users/details.html.tera | 16 +- templates/users/edit.html.tera | 12 +- templates/users/followers.html.tera | 16 +- templates/users/new.html.tera | 14 +- 22 files changed, 326 insertions(+), 89 deletions(-) diff --git a/po/en.po b/po/en.po index bbe17a7..450ac62 100644 --- a/po/en.po +++ b/po/en.po @@ -12,6 +12,9 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +msgid "Latest articles" +msgstr "" + msgid "Welcome on {{ instance_name }}" msgstr "Welcome on {{ instance_name }}" diff --git a/po/en.po~ b/po/en.po~ index 01a565e..bbe17a7 100644 --- a/po/en.po~ +++ b/po/en.po~ @@ -14,3 +14,8 @@ msgstr "" msgid "Welcome on {{ instance_name }}" msgstr "Welcome on {{ instance_name }}" + +msgid "One follower" +msgid_plural "{{ count }} followers" +msgstr[0] "One follower" +msgstr[1] "{{ count }} followers" diff --git a/po/fr.po b/po/fr.po index ad0a929..e621c36 100644 --- a/po/fr.po +++ b/po/fr.po @@ -12,6 +12,9 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +msgid "Latest articles" +msgstr "Derniers articles" + msgid "Welcome on {{ instance_name }}" msgstr "Bienvenue sur {{ instance_name }}" diff --git a/po/fr.po~ b/po/fr.po~ index 2e3a767..ad0a929 100644 --- a/po/fr.po~ +++ b/po/fr.po~ @@ -14,3 +14,8 @@ msgstr "" msgid "Welcome on {{ instance_name }}" msgstr "Bienvenue sur {{ instance_name }}" + +msgid "One follower" +msgid_plural "{{ count }} followers" +msgstr[0] "{{ count }} abonné⋅e" +msgstr[1] "{{ count }} abonné⋅e⋅s" diff --git a/po/plume.pot b/po/plume.pot index e654621..30bad45 100644 --- a/po/plume.pot +++ b/po/plume.pot @@ -12,10 +12,231 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +msgid "Latest articles" +msgstr "" + +msgid "No posts to see here yet." +msgstr "" + +msgid "New article" +msgstr "" + +msgid "New blog" +msgstr "" + +msgid "Create a blog" +msgstr "" + +msgid "Title" +msgstr "" + +msgid "Create blog" +msgstr "" + +msgid "Comment \"{{ post }}\"" +msgstr "" + +msgid "Content" +msgstr "" + +msgid "Submit comment" +msgstr "" + +msgid "Something broke on our side." +msgstr "" + +msgid "Sorry about that. If you think this is a bug, please report it." +msgstr "" + +msgid "Configuration" +msgstr "" + +msgid "Configure your instance" +msgstr "" + +msgid "Name" +msgstr "" + +msgid "Let's go!" +msgstr "" + msgid "Welcome on {{ instance_name }}" msgstr "" +msgid "Notifications" +msgstr "" + +msgid "Written by {{ link_start }}{{ name }}{{ link_end }}" +msgstr "" + +msgid "This article is under the {{ license }} license." +msgstr "" + +msgid "One like" +msgid_plural "{{ count }} likes" +msgstr[0] "" +msgstr[1] "" + +msgid "I don't like this anymore" +msgstr "" + +msgid "Add yours" +msgstr "" + +msgid "One reshare" +msgid_plural "{{ count }} reshares" +msgstr[0] "" +msgstr[1] "" + +msgid "I don't want to reshare this anymore" +msgstr "" + +msgid "Reshare" +msgstr "" + +msgid "Comments" +msgstr "" + +msgid "Respond" +msgstr "" + +msgid "Comment" +msgstr "" + +msgid "New post" +msgstr "" + +msgid "Create a post" +msgstr "" + +msgid "Title" +msgstr "" + +msgid "Content" +msgstr "" + +msgid "License" +msgstr "" + +msgid "Publish" +msgstr "" + +msgid "Login" +msgstr "" + +msgid "Username or email" +msgstr "" + +msgid "Password" +msgstr "" + +msgid "Dashboard" +msgstr "" + +msgid "Your Dashboard" +msgstr "" + +msgid "Your Blogs" +msgstr "" + +msgid "You don't have any blog yet. Create your own, or ask to join one." +msgstr "" + +msgid "Start a new blog" +msgstr "" + +msgid "Admin" +msgstr "" + +msgid "It is you" +msgstr "" + +msgid "Edit your profile" +msgstr "" + +msgid "Open on {{ instance_url }}" +msgstr "" + +msgid "Follow" +msgstr "" + +msgid "Unfollow" +msgstr "" + +msgid "Recently reshared" +msgstr "" + msgid "One follower" msgid_plural "{{ count }} followers" msgstr[0] "" msgstr[1] "" + +msgid "Edit your account" +msgstr "" + +msgid "Your Profile" +msgstr "" + +msgid "Display Name" +msgstr "" + +msgid "Email" +msgstr "" + +msgid "Summary" +msgstr "" + +msgid "Update account" +msgstr "" + +msgid "{{ name }}'s followers" +msgstr "" + +msgid "Followers" +msgstr "" + +msgid "New Account" +msgstr "" + +msgid "Create an account" +msgstr "" + +msgid "Username" +msgstr "" + +msgid "Email" +msgstr "" + +msgid "Password" +msgstr "" + +msgid "Password confirmation" +msgstr "" + +msgid "Create account" +msgstr "" + +msgid "Plume" +msgstr "" + +msgid "Menu" +msgstr "" + +msgid "Dashboard" +msgstr "" + +msgid "Notifications" +msgstr "" + +msgid "My account" +msgstr "" + +msgid "Log Out" +msgstr "" + +msgid "Log In" +msgstr "" + +msgid "Register" +msgstr "" + diff --git a/src/main.rs b/src/main.rs index a1ffd40..69df18e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -69,8 +69,8 @@ fn main() { rocket::ignite() .mount("/", routes![ routes::blogs::details, - routes::blogs::activity_details, - routes::blogs::outbox, + routes::blogs::activity_details, + routes::blogs::outbox, routes::blogs::new, routes::blogs::new_auth, routes::blogs::create, @@ -111,7 +111,7 @@ fn main() { routes::user::details, routes::user::dashboard, routes::user::dashboard_auth, - routes::user::followers, + routes::user::followers, routes::user::edit, routes::user::edit_auth, routes::user::update, diff --git a/templates/base.html.tera b/templates/base.html.tera index 491ff4b..bdb1121 100644 --- a/templates/base.html.tera +++ b/templates/base.html.tera @@ -2,27 +2,27 @@ - {% block title %}{% endblock title %} ⋅ Plume + {% block title %}{% endblock title %} ⋅ {{ "Plume" | _ }}
- +
diff --git a/templates/blogs/details.html.tera b/templates/blogs/details.html.tera index f976a61..ed9994a 100644 --- a/templates/blogs/details.html.tera +++ b/templates/blogs/details.html.tera @@ -10,12 +10,12 @@

{{ blog.summary }}

-

Latest articles

+

{{ "Latest articles" | _ }}

{% if recents | length < 1 %} -

No posts to see here yet.

+

{{ "No posts to see here yet." | _ }}

{% endif %} {% if is_author %} - New article + {{ "New article" | _ }} {% endif %}
{% for article in recents %} diff --git a/templates/blogs/new.html.tera b/templates/blogs/new.html.tera index 5f44f92..0f89bce 100644 --- a/templates/blogs/new.html.tera +++ b/templates/blogs/new.html.tera @@ -1,15 +1,15 @@ {% extends "base" %} {% block title %} -New blog +{{ "New blog" | _ }} {% endblock title %} {% block content %} -

Create a blog

+

{{ "Create a blog" | _ }}

- + - +
-{% endblock content %} + | _ {% endblock content %} diff --git a/templates/comments/new.html.tera b/templates/comments/new.html.tera index 2dc1448..847eb2a 100644 --- a/templates/comments/new.html.tera +++ b/templates/comments/new.html.tera @@ -1,15 +1,15 @@ {% extends "base" %} {% block title %} -Comment "{{ post.title }}" +{{ "Comment \"{{ post }}\"" | _(post=post.title) }} {% endblock title %} {% block content %} -

Comment "{{ post.title }}"

+

{{ "Comment \"{{ post }}\"" | _(post=post.title) }}

- + - +
{% endblock content %} diff --git a/templates/errors/500.html.tera b/templates/errors/500.html.tera index f72d88a..0999868 100644 --- a/templates/errors/500.html.tera +++ b/templates/errors/500.html.tera @@ -1,6 +1,6 @@ {% extends "errors/base" %} {% block error %} -

Something broke on our side.

-

Sorry about that. If you think this is a bug, please report it.

+

{{ "Something broke on our side." | _ }}

+

{{ "Sorry about that. If you think this is a bug, please report it." | _ }}

{% endblock error %} diff --git a/templates/instance/configure.html.tera b/templates/instance/configure.html.tera index 4fd83a0..d7b3bfd 100644 --- a/templates/instance/configure.html.tera +++ b/templates/instance/configure.html.tera @@ -1,15 +1,15 @@ {% extends "base" %} {% block title %} -Configuration +{{ "Configuration" | _ }} {% endblock title %} {% block content %} -

Configure your instance

+

{{ "Configure your instance" | _ }}

- + - +
{% endblock content %} diff --git a/templates/instance/index.html.tera b/templates/instance/index.html.tera index b859fc8..0bd0734 100644 --- a/templates/instance/index.html.tera +++ b/templates/instance/index.html.tera @@ -8,7 +8,7 @@ {% block content %}

{{ "Welcome on {{ instance_name }}" | _(instance_name=instance.name) }}

-

Latest articles

+

{{ "Latest articles" }}

{% for article in recents %} {{ macros::post_card(article=article) }} diff --git a/templates/notifications/index.html.tera b/templates/notifications/index.html.tera index d25dedb..bbe7961 100644 --- a/templates/notifications/index.html.tera +++ b/templates/notifications/index.html.tera @@ -1,11 +1,11 @@ {% extends "base" %} {% block title %} -Notifications +{{ "Notifications" | _ }} {% endblock title %} {% block content %} -

Notifications

+

{{ "Notifications" | _ }}

{% for notification in notifications %}
diff --git a/templates/posts/details.html.tera b/templates/posts/details.html.tera index 8b4043c..f4f0a69 100644 --- a/templates/posts/details.html.tera +++ b/templates/posts/details.html.tera @@ -16,7 +16,7 @@ {% endif %}

- Written by {{ name }} + {{ "Written by {{ link_start }}{{ name }}{{ link_end }}" | _(link_start="", name=name, link_end="")}}{{ date | date(format="%B %e, %Y") }}

@@ -26,33 +26,33 @@ {% endblock content %} diff --git a/templates/posts/new.html.tera b/templates/posts/new.html.tera index f6d8ae0..4608e9d 100644 --- a/templates/posts/new.html.tera +++ b/templates/posts/new.html.tera @@ -1,21 +1,21 @@ {% extends "base" %} {% block title %} -New post +{{ "New post" | _ }} {% endblock title %} {% block content %} -

Create a post

+

{{ "Create a post" | _ }}

- + - + - + - +
{% endblock content %} diff --git a/templates/session/login.html.tera b/templates/session/login.html.tera index 35da145..eee9b40 100644 --- a/templates/session/login.html.tera +++ b/templates/session/login.html.tera @@ -1,21 +1,21 @@ {% extends "base" %} {% block title %} -Login +{{ "Login" | _ }} {% endblock title %} {% block content %} -

Login

+

{{ "Login" | _ }}

{% if message %}

{{ message }}

{% endif %}
- + - + - +
{% endblock content %} diff --git a/templates/users/dashboard.tera b/templates/users/dashboard.tera index 763684c..72fc568 100644 --- a/templates/users/dashboard.tera +++ b/templates/users/dashboard.tera @@ -2,18 +2,18 @@ {% import "macros" as macros %} {% block title %} -Dashboard +{{ "Dashboard" | _ }} {% endblock title %} {% block content %} -

Your Dashboard

+

{{ "Your Dashboard" | _ }}

-

Your Blogs

+

{{ "Your Blogs" | _ }}

{% if blogs | length < 1 %} -

You don't have any blog yet. Create your own, or ask to join one.

+

{{ "You don't have any blog yet. Create your own, or ask to join one." | _ }}

{% endif %} - Start a new blog + {{ "Start a new blog" | _ }}
{% for blog in blogs %}
diff --git a/templates/users/details.html.tera b/templates/users/details.html.tera index 524754d..e34f8a7 100644 --- a/templates/users/details.html.tera +++ b/templates/users/details.html.tera @@ -16,27 +16,27 @@

{{ name }} {% if user.is_admin %} - Admin + {{ "Admin" | _ }} {% endif %} {% if is_self %} - It is you + {{ "It is you" | _ }} {% endif %}

{% if is_self %} - Edit your profile + {{ "Edit your profile" | _ }} {% endif %} {% if is_remote %} - Open on {{ instance_url }} + {{ "Open on {{ instance_url }}" | _(instance_url=instance_url) }} {% endif %} {% if not is_self and account %} {% if follows %} - Follow + {{ "Follow" | _ }} {% else %} - Unfollow + {{ "Unfollow" | _ }} {% endif %} {% endif %}
@@ -50,7 +50,7 @@
{% if recents | length != 0 %} -

Latest articles

+

{{ "Latest articles" | _ }}

{% for article in recents %} {{ macros::post_card(article=article) }} @@ -59,7 +59,7 @@ {% endif %} {% if reshares | length != 0 %} -

Recently reshared

+

{{ "Recently reshared" | _ }}

{% for article in reshares %} {{ macros::post_card(article=article) }} diff --git a/templates/users/edit.html.tera b/templates/users/edit.html.tera index d1bf95a..d7725ae 100644 --- a/templates/users/edit.html.tera +++ b/templates/users/edit.html.tera @@ -1,24 +1,24 @@ {% extends "base" %} {% block title %} -Edit your account +{{ "Edit your account" | _ }} {% endblock title %} {% block content %} -

Your Profile

+

{{ "Your Profile" | _ }}

- + - + - + - +
{% endblock content %} diff --git a/templates/users/followers.html.tera b/templates/users/followers.html.tera index 827813c..6ce08eb 100644 --- a/templates/users/followers.html.tera +++ b/templates/users/followers.html.tera @@ -7,7 +7,7 @@ {% set name = user.username %} {% endif %} -{{ name }}'s Followers +{{ "{{ name }}'s followers" | _(name=name) }} {% endblock title %} {% block content %} @@ -15,28 +15,28 @@

{{ name }} {% if user.is_admin %} - Admin + {{ "Admin" | _ }} {% endif %} {% if is_self %} - It is you + {{ "It is you" | _ }} {% endif %}

{% if is_remote %} - Open on {{ instance_url }} + {{ "Open on {{ instance_url }}" | _(instance_url=instance_url) }} {% endif %} - {% if not is_self and account %} + {% if (not is_self) and account %} {% if follows %} - Follow + {{ "Follow" | _ }} {% else %} - Unfollow + {{ "Unfollow" | _ }} {% endif %} {% endif %}
-

Followers

+

{{ "Followers" | _ }}

{% for follower in followers %} {% if follower.display_name %} diff --git a/templates/users/new.html.tera b/templates/users/new.html.tera index e1cd748..607306d 100644 --- a/templates/users/new.html.tera +++ b/templates/users/new.html.tera @@ -1,24 +1,24 @@ {% extends "base" %} {% block title %} -New Account +{{ "New Account" | _ }} {% endblock title %} {% block content %} -

Create an account

+

{{ "Create an account" | _ }}

- + - + - + - + - +
{% endblock content %}