From 8002c02c7e97d686d002b9282bd19ff0365a2dca Mon Sep 17 00:00:00 2001 From: Davis Raymond Muro Date: Fri, 8 Jul 2022 11:41:32 +0300 Subject: [PATCH] Update to use correct translate function - https://docs.djangoproject.com/en/3.2/topics/i18n/translation/#translate-template-tag --- .../templates/api_password_reset_email.html | 8 +- .../templates/bulk_submission_form.html | 2 +- onadata/apps/logger/templates/form.html | 2 +- .../apps/logger/templates/list_xforms.html | 16 +- onadata/apps/logger/templates/submission.html | 6 +- .../templates/submission_test_form.html | 4 +- onadata/apps/main/static/js/lightmodal.js | 2 +- onadata/apps/main/templates/activity.html | 2 +- onadata/apps/main/templates/api_token.html | 2 +- onadata/apps/main/templates/dashboard.html | 28 +-- onadata/apps/main/templates/form_gallery.html | 14 +- .../apps/main/templates/getting_started.html | 20 +- onadata/apps/main/templates/home.html | 10 +- onadata/apps/main/templates/people.html | 12 +- onadata/apps/main/templates/profile.html | 50 ++-- .../main/templates/published_surveys.html | 30 +-- onadata/apps/main/templates/resources.html | 14 +- onadata/apps/main/templates/settings.html | 2 +- onadata/apps/main/templates/show.html | 224 +++++++++--------- .../templates/templated_email/notice.email | 10 +- onadata/apps/main/templates/tutorial.html | 20 +- onadata/apps/main/templates/xls2xform.html | 4 +- .../restservice/templates/add-service.html | 2 +- .../apps/restservice/templates/service.html | 2 +- onadata/apps/viewer/templates/data_view.html | 2 +- .../apps/viewer/templates/export_list.html | 46 ++-- onadata/apps/viewer/templates/instance.html | 14 +- onadata/apps/viewer/templates/map.html | 10 +- onadata/apps/viewer/templates/survey.html | 2 +- onadata/libs/templates/404.html | 2 +- onadata/libs/templates/405.html | 2 +- onadata/libs/templates/500.html | 4 +- .../account_lockout/lockout_email_subject.txt | 2 +- .../templates/account_lockout/lockout_end.txt | 4 +- .../account_lockout/lockout_start.txt | 4 +- onadata/libs/templates/browser_message.html | 14 +- onadata/libs/templates/footer.html | 4 +- onadata/libs/templates/home_topbar.html | 8 +- onadata/libs/templates/main_index.html | 2 +- .../templates/oauth2_provider/authorize.html | 8 +- .../libs/templates/registration/activate.html | 6 +- .../registration/activation_complete.html | 6 +- .../registration/activation_email.txt | 4 +- .../registration/activation_email_subject.txt | 2 +- .../libs/templates/registration/login.html | 8 +- .../libs/templates/registration/logout.html | 4 +- .../registration/password_change_done.html | 2 +- .../registration/password_change_form.html | 4 +- .../registration/password_reset_complete.html | 6 +- .../registration/password_reset_confirm.html | 4 +- .../registration/password_reset_done.html | 4 +- .../registration/password_reset_email.html | 8 +- .../registration/password_reset_form.html | 8 +- .../registration/registration_complete.html | 10 +- .../registration/registration_form.html | 8 +- .../registration/verification_email.txt | 4 +- .../verification_email_subject.txt | 2 +- onadata/libs/templates/topbar.html | 34 +-- 58 files changed, 369 insertions(+), 369 deletions(-) diff --git a/onadata/apps/api/templates/api_password_reset_email.html b/onadata/apps/api/templates/api_password_reset_email.html index 48bede0f60..04305726a5 100644 --- a/onadata/apps/api/templates/api_password_reset_email.html +++ b/onadata/apps/api/templates/api_password_reset_email.html @@ -1,16 +1,16 @@ {% load i18n %} -{% blocktrans %} +{% blocktranslate %} Hi {{ username }}, You recently requested a link to reset your {{ site_name }} password for the username {{ username }}. Please set a new password by following the link below: -{% endblocktrans %} +{% endblocktranslate %} {% block reset_link %} {{ protocol }}://{{ domain }}{{ path }}?uid={{ uid }}&token={{ token }}&username={{ encoded_username }} {% endblock %} -{% blocktrans %} +{% blocktranslate %} Thanks, - The {{ site_name }} Team. -{% endblocktrans %} +{% endblocktranslate %} diff --git a/onadata/apps/logger/templates/bulk_submission_form.html b/onadata/apps/logger/templates/bulk_submission_form.html index 708adc3ec9..12873ed3ec 100644 --- a/onadata/apps/logger/templates/bulk_submission_form.html +++ b/onadata/apps/logger/templates/bulk_submission_form.html @@ -12,7 +12,7 @@

Bulk Upload Form

- +
{% csrf_token %} diff --git a/onadata/apps/logger/templates/form.html b/onadata/apps/logger/templates/form.html index ddf3445893..bf64392018 100644 --- a/onadata/apps/logger/templates/form.html +++ b/onadata/apps/logger/templates/form.html @@ -15,7 +15,7 @@ {% csrf_token %} - + diff --git a/onadata/apps/logger/templates/list_xforms.html b/onadata/apps/logger/templates/list_xforms.html index da0e381b13..d8aed738db 100644 --- a/onadata/apps/logger/templates/list_xforms.html +++ b/onadata/apps/logger/templates/list_xforms.html @@ -3,11 +3,11 @@ - - - - - + + + + + @@ -16,9 +16,9 @@ @@ -29,7 +29,7 @@ {{ xform.time_of_last_submission }} {% endif %} - + {% endfor %} diff --git a/onadata/apps/logger/templates/submission.html b/onadata/apps/logger/templates/submission.html index 811bb7f7d2..33e376e530 100644 --- a/onadata/apps/logger/templates/submission.html +++ b/onadata/apps/logger/templates/submission.html @@ -1,9 +1,9 @@ {% load i18n %} -

{% trans "Your submission was successful!" %}

+

{% translate "Your submission was successful!" %}

- {% trans "Browser Error" %} + {% translate "Browser Error" %} - {% trans "close" %} + {% translate "close" %}

- {% trans "Recommended Browser Alert" %} + {% translate "Recommended Browser Alert" %}

- {% trans "Dear Sir or Madam," %} + {% translate "Dear Sir or Madam," %}

- {% trans "Our tests indicate that you are currently using a browser that does not support complex navigation. We highly recommend that you switch to one of the browsers below in order to take full advantage of the Nigeria MDGs Information System." %} + {% translate "Our tests indicate that you are currently using a browser that does not support complex navigation. We highly recommend that you switch to one of the browsers below in order to take full advantage of the Nigeria MDGs Information System." %}

  • @@ -39,10 +39,10 @@

- {% trans "Thank You," %} + {% translate "Thank You," %}

- {% trans "The NMIS Support Team" %} + {% translate "The NMIS Support Team" %}

diff --git a/onadata/libs/templates/footer.html b/onadata/libs/templates/footer.html index e9fd74f97f..adf0a02e57 100644 --- a/onadata/libs/templates/footer.html +++ b/onadata/libs/templates/footer.html @@ -2,10 +2,10 @@ diff --git a/onadata/libs/templates/home_topbar.html b/onadata/libs/templates/home_topbar.html index 18aee57c6d..a93c734d21 100644 --- a/onadata/libs/templates/home_topbar.html +++ b/onadata/libs/templates/home_topbar.html @@ -11,12 +11,12 @@ diff --git a/onadata/libs/templates/main_index.html b/onadata/libs/templates/main_index.html index 88101b4a39..2efabbcc73 100644 --- a/onadata/libs/templates/main_index.html +++ b/onadata/libs/templates/main_index.html @@ -6,7 +6,7 @@ diff --git a/onadata/libs/templates/oauth2_provider/authorize.html b/onadata/libs/templates/oauth2_provider/authorize.html index 8487a82237..f4ed55f4dd 100644 --- a/onadata/libs/templates/oauth2_provider/authorize.html +++ b/onadata/libs/templates/oauth2_provider/authorize.html @@ -5,7 +5,7 @@
{% if not error %}
-

{% trans "Authorize" %} {{ application.name }}?

+

{% translate "Authorize" %} {{ application.name }}?

{% csrf_token %} {% for field in form %} @@ -15,11 +15,11 @@

{% trans "Authorize" %} {{ application.name }}? {% endfor %}

- {% trans "You are signed in as:" %} {{user.get_full_name}} ({{user.username}}). - {% trans "Sign in as another user" %}. + {% translate "You are signed in as:" %} {{user.get_full_name}} ({{user.username}}). + {% translate "Sign in as another user" %}.

-

{% trans "Application requires following permissions" %}

+

{% translate "Application requires following permissions" %}

    {% for scope in scopes_descriptions %}
  • {{ scope }}
  • diff --git a/onadata/libs/templates/registration/activate.html b/onadata/libs/templates/registration/activate.html index e35e2db590..c2a7adadbf 100644 --- a/onadata/libs/templates/registration/activate.html +++ b/onadata/libs/templates/registration/activate.html @@ -4,16 +4,16 @@ {% block content %}

    {% url "auth_login" as login_url %} - {% blocktrans %} + {% blocktranslate %} Your account has been successfully activated. You may log in - here.{% endblocktrans %} + here.{% endblocktranslate %}

    diff --git a/onadata/libs/templates/registration/activation_complete.html b/onadata/libs/templates/registration/activation_complete.html index e35e2db590..c2a7adadbf 100644 --- a/onadata/libs/templates/registration/activation_complete.html +++ b/onadata/libs/templates/registration/activation_complete.html @@ -4,16 +4,16 @@ {% block content %}

    {% url "auth_login" as login_url %} - {% blocktrans %} + {% blocktranslate %} Your account has been successfully activated. You may log in - here.{% endblocktrans %} + here.{% endblocktranslate %}

    diff --git a/onadata/libs/templates/registration/activation_email.txt b/onadata/libs/templates/registration/activation_email.txt index 488e98dc5d..d21d0efa6e 100644 --- a/onadata/libs/templates/registration/activation_email.txt +++ b/onadata/libs/templates/registration/activation_email.txt @@ -1,9 +1,9 @@ {% load i18n %} {% url "registration_activate" activation_key as register_url %} -{% blocktrans with site_name=site.name site_domain=site.domain expiration_days=expiration_days expiration_days_p=expiration_days|pluralize %}You have registered on {{ site_name }}. To activate your account +{% blocktranslate with site_name=site.name site_domain=site.domain expiration_days=expiration_days expiration_days_p=expiration_days|pluralize %}You have registered on {{ site_name }}. To activate your account please click on the link below: http://{{ site_domain }}{{ register_url }} The link above is valid for {{ expiration_days }} day{{ expiration_days_p }}. -{% endblocktrans %} +{% endblocktranslate %} diff --git a/onadata/libs/templates/registration/activation_email_subject.txt b/onadata/libs/templates/registration/activation_email_subject.txt index a4dd575242..fd469d77a2 100644 --- a/onadata/libs/templates/registration/activation_email_subject.txt +++ b/onadata/libs/templates/registration/activation_email_subject.txt @@ -1 +1 @@ -{% load i18n %}{% blocktrans with site_name=site.name %}Account activation on {{ site_name }}{% endblocktrans %} +{% load i18n %}{% blocktranslate with site_name=site.name %}Account activation on {{ site_name }}{% endblocktranslate %} diff --git a/onadata/libs/templates/registration/login.html b/onadata/libs/templates/registration/login.html index 8ac923f2c5..1feff7f272 100644 --- a/onadata/libs/templates/registration/login.html +++ b/onadata/libs/templates/registration/login.html @@ -4,7 +4,7 @@
    @@ -15,7 +15,7 @@

    {% trans "Sign in" %}

- +
{% trans "Downloadable by Phone" %}{% trans "Form ID" %}{% trans "Number of Submissions" %}{% trans "Time of Last Submission" %}{% trans "CSV" %}{% translate "Downloadable by Phone" %}{% translate "Form ID" %}{% translate "Number of Submissions" %}{% translate "Time of Last Submission" %}{% translate "CSV" %}
{% if xform.downloadable %} - [ {% trans 'yes' %} ] + [ {% translate 'yes' %} ] {% else %} - [ {% trans 'no' %} ] + [ {% translate 'no' %} ] {% endif %} {% trans "Download CSV" %}{% translate "Download CSV" %}
 
@@ -23,9 +23,9 @@

{% trans "Sign in" %}

{% url "auth_password_reset" as reset_url %} -

{% blocktrans %}Can't access your account? Reset your password.{% endblocktrans %}

+

{% blocktranslate %}Can't access your account? Reset your password.{% endblocktranslate %}

{% url "registration_register" as registration_url %} -

{% blocktrans %}New to ona.io? Create an account.{% endblocktrans %}

+

{% blocktranslate %}New to ona.io? Create an account.{% endblocktranslate %}

diff --git a/onadata/libs/templates/registration/logout.html b/onadata/libs/templates/registration/logout.html index 8221ff7572..6547bc9094 100644 --- a/onadata/libs/templates/registration/logout.html +++ b/onadata/libs/templates/registration/logout.html @@ -4,10 +4,10 @@ {% block content %}

- {% trans "Thank you for using Ona, please come again!" %} + {% translate "Thank you for using Ona, please come again!" %}

{% endblock %} diff --git a/onadata/libs/templates/registration/password_change_done.html b/onadata/libs/templates/registration/password_change_done.html index 7506f8a9b8..aaeaf621cf 100644 --- a/onadata/libs/templates/registration/password_change_done.html +++ b/onadata/libs/templates/registration/password_change_done.html @@ -3,6 +3,6 @@ {% block content %}

- {% trans "Password changed" %} + {% translate "Password changed" %}

{% endblock %} diff --git a/onadata/libs/templates/registration/password_change_form.html b/onadata/libs/templates/registration/password_change_form.html index 48c0691a88..4efe3748fc 100644 --- a/onadata/libs/templates/registration/password_change_form.html +++ b/onadata/libs/templates/registration/password_change_form.html @@ -4,7 +4,7 @@ {% block content %}
@@ -14,7 +14,7 @@

{% trans "Change Password" %}

{{ form.as_table }}
- +
diff --git a/onadata/libs/templates/registration/password_reset_complete.html b/onadata/libs/templates/registration/password_reset_complete.html index 3a2902f8f2..b64ff7be1c 100644 --- a/onadata/libs/templates/registration/password_reset_complete.html +++ b/onadata/libs/templates/registration/password_reset_complete.html @@ -1,12 +1,12 @@ {% extends "base.html" %} {% load i18n %} -{% block page_title %}{% trans "Log In" %}{% endblock %} +{% block page_title %}{% translate "Log In" %}{% endblock %} {% block content %} -

{% trans "Password reset successfully" %}

+

{% translate "Password reset successfully" %}

-

{% trans "Log in" %}

+

{% translate "Log in" %}

{% endblock %} diff --git a/onadata/libs/templates/registration/password_reset_confirm.html b/onadata/libs/templates/registration/password_reset_confirm.html index ee4ebe534b..4d869f17a4 100644 --- a/onadata/libs/templates/registration/password_reset_confirm.html +++ b/onadata/libs/templates/registration/password_reset_confirm.html @@ -9,12 +9,12 @@ {{ form.as_p }} {% csrf_token %} - + {% else %} -

{% trans "Password reset failed" %}

+

{% translate "Password reset failed" %}

{% endif %} diff --git a/onadata/libs/templates/registration/password_reset_done.html b/onadata/libs/templates/registration/password_reset_done.html index f7b05282d2..1cbc40c6c0 100644 --- a/onadata/libs/templates/registration/password_reset_done.html +++ b/onadata/libs/templates/registration/password_reset_done.html @@ -4,9 +4,9 @@ {% block content %}
-

{% trans "An email with password reset instructions has been sent." %}

+

{% translate "An email with password reset instructions has been sent." %}

{% endblock %} diff --git a/onadata/libs/templates/registration/password_reset_email.html b/onadata/libs/templates/registration/password_reset_email.html index 463b1ca854..363674483a 100644 --- a/onadata/libs/templates/registration/password_reset_email.html +++ b/onadata/libs/templates/registration/password_reset_email.html @@ -1,16 +1,16 @@ {% load i18n %} -{% blocktrans %} +{% blocktranslate %} Hi {{ user }}, You recently requested a link to reset your {{ site_name }} password for the username {{ user }}. Please set a new password by following the link below: -{% endblocktrans %} +{% endblocktranslate %} {% block reset_link %} {{ protocol }}://{{ domain }}{% url "auth_password_reset_confirm" uidb64=uid token=token %} {% endblock %} -{% blocktrans %} +{% blocktranslate %} Thanks, - The {{ site_name }} Team. -{% endblocktrans %} +{% endblocktranslate %} diff --git a/onadata/libs/templates/registration/password_reset_form.html b/onadata/libs/templates/registration/password_reset_form.html index ba0da3ca89..1d19817874 100644 --- a/onadata/libs/templates/registration/password_reset_form.html +++ b/onadata/libs/templates/registration/password_reset_form.html @@ -4,13 +4,13 @@ {% block content %}

- {% blocktrans %}To reset your password please enter your email address below. A + {% blocktranslate %}To reset your password please enter your email address below. A message will be sent to your email address with a link for you to - reset your password.{% endblocktrans %} + reset your password.{% endblocktranslate %}

@@ -19,7 +19,7 @@

{% trans "Password Reset" %}

{% csrf_token %} {{ form.as_table }} - +
diff --git a/onadata/libs/templates/registration/registration_complete.html b/onadata/libs/templates/registration/registration_complete.html index a093dc47e6..5b00a4975f 100644 --- a/onadata/libs/templates/registration/registration_complete.html +++ b/onadata/libs/templates/registration/registration_complete.html @@ -4,15 +4,15 @@ {% block content %}

- {% blocktrans %}A user account has been created for you and an email message has - been sent to the email address you provided.{% endblocktrans %} + {% blocktranslate %}A user account has been created for you and an email message has + been sent to the email address you provided.{% endblocktranslate %}

- {% blocktrans %}To activate your account and complete the registration process, - you must click the activation link provided in the email.{% endblocktrans %} + {% blocktranslate %}To activate your account and complete the registration process, + you must click the activation link provided in the email.{% endblocktranslate %}

{% endblock %} diff --git a/onadata/libs/templates/registration/registration_form.html b/onadata/libs/templates/registration/registration_form.html index 4cb09e0396..18e08c2a1e 100644 --- a/onadata/libs/templates/registration/registration_form.html +++ b/onadata/libs/templates/registration/registration_form.html @@ -4,14 +4,14 @@ {% block content %}
{% csrf_token %} -

{% trans "Fields marked wth an asterisk (*) are required." %}

+

{% translate "Fields marked wth an asterisk (*) are required." %}

{% for field in form %} @@ -26,8 +26,8 @@

{% trans "Register" %}

{% endfor %}
-

{% blocktrans %}By clicking the button, you agree to our privacy policy and terms of service.{% endblocktrans %}

- +

{% blocktranslate %}By clicking the button, you agree to our privacy policy and terms of service.{% endblocktranslate %}

+
diff --git a/onadata/libs/templates/registration/verification_email.txt b/onadata/libs/templates/registration/verification_email.txt index e6a4db9607..8c915eb18d 100644 --- a/onadata/libs/templates/registration/verification_email.txt +++ b/onadata/libs/templates/registration/verification_email.txt @@ -1,5 +1,5 @@ {% load i18n %} -{% blocktrans with expiration_days=expiration_days username=username expiration_days_p=expiration_days|pluralize %} +{% blocktranslate with expiration_days=expiration_days username=username expiration_days_p=expiration_days|pluralize %} Hi {{ username }}, You're almost done! Please make sure to verify your email address and we'll finish setting up your account on Ona for you. @@ -9,4 +9,4 @@ Please contact us with any questions, we're always happy to help. Thanks, The Team at Ona -{% endblocktrans %} +{% endblocktranslate %} diff --git a/onadata/libs/templates/registration/verification_email_subject.txt b/onadata/libs/templates/registration/verification_email_subject.txt index 5bc72e0673..4b12e0ebb2 100644 --- a/onadata/libs/templates/registration/verification_email_subject.txt +++ b/onadata/libs/templates/registration/verification_email_subject.txt @@ -1 +1 @@ -{% load i18n %}{% blocktrans %}Ona Email Verification{% endblocktrans %} \ No newline at end of file +{% load i18n %}{% blocktranslate %}Ona Email Verification{% endblocktranslate %} \ No newline at end of file diff --git a/onadata/libs/templates/topbar.html b/onadata/libs/templates/topbar.html index da765f5ef6..dfdb06da0d 100644 --- a/onadata/libs/templates/topbar.html +++ b/onadata/libs/templates/topbar.html @@ -29,11 +29,11 @@
  • {{ xform.title }}
  • -
  • {% blocktrans with nb_sub=xform.submission_count %}{{ nb_sub}} submissions{% endblocktrans %}
  • +
  • {% blocktranslate with nb_sub=xform.submission_count %}{{ nb_sub}} submissions{% endblocktranslate %}