From 0960e654ab6f8fd63e9db6d456a71ea306e0d184 Mon Sep 17 00:00:00 2001 From: Vishnu Ks Date: Tue, 18 Dec 2018 07:59:56 +0000 Subject: [PATCH] emails: Tag notify_new_login email for translation. --- .../emails/notify_new_login.source.html | 26 +++++++++---------- .../emails/notify_new_login.subject.txt | 2 +- templates/zerver/emails/notify_new_login.txt | 24 +++++++++-------- tools/lib/capitalization.py | 2 ++ 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/templates/zerver/emails/notify_new_login.source.html b/templates/zerver/emails/notify_new_login.source.html index 24dfe68cc7..e7d1cfac6d 100644 --- a/templates/zerver/emails/notify_new_login.source.html +++ b/templates/zerver/emails/notify_new_login.source.html @@ -1,7 +1,7 @@ {% extends "zerver/emails/compiled/email_base_default.html" %} {% block preheader %} -Server: {{ realm_uri }} Account: {{ user_email }} Time: {{ login_time }} + {% trans organization_url=realm_uri %}Server: {{ organization_url }} Account: {{ user_email }} Time: {{ login_time }}{% endtrans %} {% endblock %} {% block illustration %} @@ -9,21 +9,21 @@ Server: {{ realm_uri }} Account: {{ user_email }} Time: {{ login_time }} {% endblock %} {% block content %} -

Hi,

-

This is a notification that a new login to your Zulip account has just occurred.

-

Login details:

+

{{ _("Hi,") }}

+

{{ _("This is a notification that a new login to your Zulip account has just occurred.") }}

+

{{ _("Login details:") }}

-

Server: {{ realm_uri }}

-

Account: {{ user_email }}

-

Time: {{ login_time }}

-

Device: {{ device_browser }} on {{ device_os }}.

-

IP Address: {{ device_ip }}

+

{% trans %}Server: {{ realm_uri }}{% endtrans %}

+

{% trans %}Account: {{ user_email }}{% endtrans %}

+

{% trans %}Time: {{ login_time }}{% endtrans %}

+

{% trans %}Device: {{ device_browser }} on {{ device_os }}.{% endtrans %}

+

{% trans %}IP address: {{ device_ip }}{% endtrans %}

-

If you do not recognize this login activity, or think your account may have been compromised, please reset your password or contact us immediately at {{ support_email }}.

-

If you recognize this login activity, you can archive this notice.

-

Thanks,
Zulip Account Security

+

{% trans %}If you do not recognize this login activity, or think your account may have been compromised, please reset your password or contact us immediately at {{ support_email }}.{% endtrans %}

+

{{ _("If you recognize this login activity, you can archive this notice.") }}

+

{{ _("Thanks,") }}
{{ _("Zulip Account Security") }}

{% endblock %} {% block manage_preferences %} -

Manage email preferences | Unsubscribe from login notifications

+

{{ _("Manage email preferences") }} | {{ _("Unsubscribe from login notifications") }}

{% endblock %} diff --git a/templates/zerver/emails/notify_new_login.subject.txt b/templates/zerver/emails/notify_new_login.subject.txt index e9402cba7e..c4bd2dc31b 100644 --- a/templates/zerver/emails/notify_new_login.subject.txt +++ b/templates/zerver/emails/notify_new_login.subject.txt @@ -1 +1 @@ -New login from {{ device_browser }} on {{ device_os if device_os }} +{% trans %}New login from {{ device_browser }} on {{ device_os }}{% endtrans %} diff --git a/templates/zerver/emails/notify_new_login.txt b/templates/zerver/emails/notify_new_login.txt index 27ed663044..a50ef4d098 100644 --- a/templates/zerver/emails/notify_new_login.txt +++ b/templates/zerver/emails/notify_new_login.txt @@ -1,20 +1,22 @@ -Hi, +{{ _("Hi,") }}" -This is a notification that a new login to your Zulip account has just occurred. +{{ _("This is a notification that a new login to your Zulip account has just occurred.") }} -Login details: -Server: {{ realm_uri }} -Account: {{ user_email }} -Time: {{ login_time }} -Device: {{ device_browser }} on {{ device_os }}. -IP Address: {{ device_ip }} +{{ _("Login details:") }} +{% trans organization_url=realm_uri %}Server: {{ organization_url }}{% endtrans %} +{% trans %}Account: {{ user_email }}{% endtrans %} +{% trans %}Time: {{ login_time }}{% endtrans %} +{% trans %}Device: {{ device_browser }} on {{ device_os }}.{% endtrans %} +{% trans %}IP address: {{ device_ip }}{% endtrans %} +{% trans %} If you do not recognize this login activity, or think your account may have been compromised, please reset your password at {{ realm_uri }}/accounts/password/reset/ or contact us immediately at {{ support_email }}. +{% endtrans %} -If you recognize this login activity, you can archive this notice. +{{ _("If you recognize this login activity, you can archive this notice.") }} -Thanks, -Zulip Account Security +{{ _("Thanks,") }} +{{ _("Zulip Account Security") }} diff --git a/tools/lib/capitalization.py b/tools/lib/capitalization.py index ddc7e01b8b..3c753e45da 100644 --- a/tools/lib/capitalization.py +++ b/tools/lib/capitalization.py @@ -54,6 +54,7 @@ IGNORED_PHRASES = [ r"Zephyr", r"Zulip", r"Zulip Team", + r"Zulip Account Security", r"iPhone", r"iOS", r"Emoji One", @@ -96,6 +97,7 @@ IGNORED_PHRASES = [ r"a-z", r"organization administrator", r"user", + r"an unknown operating system", # SPECIAL CASES # Enter is usually capitalized