From 50913c4dc5c394b55fa5d62e6ab3cc72f3959c5d Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Mon, 28 Feb 2022 01:04:04 -0500 Subject: [PATCH] Make password reset pages translatable --- .../password/invalid_token.html.eex | 2 +- .../twitter_api/password/reset.html.eex | 6 +-- .../password/reset_failed.html.eex | 8 +++- .../password/reset_success.html.eex | 4 +- .../web/twitter_api/views/password_view.ex | 1 + priv/gettext/static_pages.pot | 48 +++++++++++++++++++ 6 files changed, 61 insertions(+), 8 deletions(-) diff --git a/lib/pleroma/web/templates/twitter_api/password/invalid_token.html.eex b/lib/pleroma/web/templates/twitter_api/password/invalid_token.html.eex index ee84750c7..5ac0aa4e0 100644 --- a/lib/pleroma/web/templates/twitter_api/password/invalid_token.html.eex +++ b/lib/pleroma/web/templates/twitter_api/password/invalid_token.html.eex @@ -1 +1 @@ -

Invalid Token

+

<%= Gettext.dpgettext("static_pages", "password reset invalid token message", "Invalid Token") %>

diff --git a/lib/pleroma/web/templates/twitter_api/password/reset.html.eex b/lib/pleroma/web/templates/twitter_api/password/reset.html.eex index fbcacdc14..6a544af51 100644 --- a/lib/pleroma/web/templates/twitter_api/password/reset.html.eex +++ b/lib/pleroma/web/templates/twitter_api/password/reset.html.eex @@ -1,13 +1,13 @@

Password Reset for <%= @user.nickname %>

<%= form_for @conn, Routes.reset_password_path(@conn, :do_reset), [as: "data"], fn f -> %>
- <%= label f, :password, "Password" %> + <%= label f, :password, Gettext.dpgettext("static_pages", "password reset form password prompt", "Password") %> <%= password_input f, :password %>
- <%= label f, :password_confirmation, "Confirmation" %> + <%= label f, :password_confirmation, Gettext.dpgettext("static_pages", "password reset form confirm password prompt", "Confirmation") %> <%= password_input f, :password_confirmation %>
<%= hidden_input f, :token, value: @token.token %> - <%= submit "Reset" %> + <%= submit Gettext.dpgettext("static_pages", "password reset button", "Reset") %> <% end %> diff --git a/lib/pleroma/web/templates/twitter_api/password/reset_failed.html.eex b/lib/pleroma/web/templates/twitter_api/password/reset_failed.html.eex index 4ed4ac8bc..774e3462a 100644 --- a/lib/pleroma/web/templates/twitter_api/password/reset_failed.html.eex +++ b/lib/pleroma/web/templates/twitter_api/password/reset_failed.html.eex @@ -1,2 +1,6 @@ -

Password reset failed

-

Homepage

+

<%= Gettext.dpgettext("static_pages", "password reset failed message", "Password reset failed") %>

+

+ + <%= Gettext.dpgettext("static_pages", "password reset failed homepage link", "Homepage") %> + +

diff --git a/lib/pleroma/web/templates/twitter_api/password/reset_success.html.eex b/lib/pleroma/web/templates/twitter_api/password/reset_success.html.eex index 086d4e08b..40f6bb3fc 100644 --- a/lib/pleroma/web/templates/twitter_api/password/reset_success.html.eex +++ b/lib/pleroma/web/templates/twitter_api/password/reset_success.html.eex @@ -1,2 +1,2 @@ -

Password changed!

-

Homepage

+

<%= Gettext.dpgettext("static_pages", "password reset successful message", "Password changed!") %>

+

<%= Gettext.dpgettext("static_pages", "password reset successful homepage link", "Homepage") %>

diff --git a/lib/pleroma/web/twitter_api/views/password_view.ex b/lib/pleroma/web/twitter_api/views/password_view.ex index a9bb95a2c..40e7fca49 100644 --- a/lib/pleroma/web/twitter_api/views/password_view.ex +++ b/lib/pleroma/web/twitter_api/views/password_view.ex @@ -5,4 +5,5 @@ defmodule Pleroma.Web.TwitterAPI.PasswordView do use Pleroma.Web, :view import Phoenix.HTML.Form + alias Pleroma.Web.Gettext end diff --git a/priv/gettext/static_pages.pot b/priv/gettext/static_pages.pot index 72e5c00d9..8b56ad7b4 100644 --- a/priv/gettext/static_pages.pot +++ b/priv/gettext/static_pages.pot @@ -105,3 +105,51 @@ msgstr "" msgctxt "remote follow header" msgid "Remotely follow %{nickname}" msgstr "" + +#, elixir-format +#: lib/pleroma/web/templates/twitter_api/password/reset.html.eex:12 +msgctxt "password reset button" +msgid "Reset" +msgstr "" + +#, elixir-format +#: lib/pleroma/web/templates/twitter_api/password/reset_failed.html.eex:4 +msgctxt "password reset failed homepage link" +msgid "Homepage" +msgstr "" + +#, elixir-format +#: lib/pleroma/web/templates/twitter_api/password/reset_failed.html.eex:1 +msgctxt "password reset failed message" +msgid "Password reset failed" +msgstr "" + +#, elixir-format +#: lib/pleroma/web/templates/twitter_api/password/reset.html.eex:8 +msgctxt "password reset form confirm password prompt" +msgid "Confirmation" +msgstr "" + +#, elixir-format +#: lib/pleroma/web/templates/twitter_api/password/reset.html.eex:4 +msgctxt "password reset form password prompt" +msgid "Password" +msgstr "" + +#, elixir-format +#: lib/pleroma/web/templates/twitter_api/password/invalid_token.html.eex:1 +msgctxt "password reset invalid token message" +msgid "Invalid Token" +msgstr "" + +#, elixir-format +#: lib/pleroma/web/templates/twitter_api/password/reset_success.html.eex:2 +msgctxt "password reset successful homepage link" +msgid "Homepage" +msgstr "" + +#, elixir-format +#: lib/pleroma/web/templates/twitter_api/password/reset_success.html.eex:1 +msgctxt "password reset successful message" +msgid "Password changed!" +msgstr ""