From adbb9551393b4924341c1cf738cdb3ecbec5b656 Mon Sep 17 00:00:00 2001 From: Ivo Branco Date: Wed, 17 Jul 2024 18:10:02 +0100 Subject: [PATCH] feat(ecommerce): add js force translations Add JS force translations for ecommerce. --- ecommerce/Makefile | 1 + .../nau/conf/locale/en/LC_MESSAGES/django.po | 4 +- .../conf/locale/en/LC_MESSAGES/djangojs.mo | Bin 0 -> 337 bytes .../conf/locale/en/LC_MESSAGES/djangojs.po | 40 ++++++++++++++++++ .../conf/locale/pt_PT/LC_MESSAGES/django.po | 14 +++--- .../conf/locale/pt_PT/LC_MESSAGES/djangojs.mo | Bin 0 -> 544 bytes .../conf/locale/pt_PT/LC_MESSAGES/djangojs.po | 40 ++++++++++++++++++ ecommerce/nau/templates/force_translations.js | 11 +++++ 8 files changed, 100 insertions(+), 10 deletions(-) create mode 100644 ecommerce/nau/conf/locale/en/LC_MESSAGES/djangojs.mo create mode 100644 ecommerce/nau/conf/locale/en/LC_MESSAGES/djangojs.po create mode 100644 ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/djangojs.mo create mode 100644 ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/djangojs.po create mode 100644 ecommerce/nau/templates/force_translations.js diff --git a/ecommerce/Makefile b/ecommerce/Makefile index a82d2d0..336e1f2 100644 --- a/ecommerce/Makefile +++ b/ecommerce/Makefile @@ -28,6 +28,7 @@ clean: ## clean extract_translations: ## Extract translations from source code @for lang in $(lang_targets) ; do \ cd $(ROOT_DIR)/$(theme) && DJANGO_SETTINGS_MODULE="" django-admin makemessages --locale $$lang -d django ; \ + cd $(ROOT_DIR)/$(theme) && DJANGO_SETTINGS_MODULE="" django-admin makemessages --locale $$lang -d djangojs ; \ done .PHONY: extract_translations diff --git a/ecommerce/nau/conf/locale/en/LC_MESSAGES/django.po b/ecommerce/nau/conf/locale/en/LC_MESSAGES/django.po index 9da3b06..58cff87 100644 --- a/ecommerce/nau/conf/locale/en/LC_MESSAGES/django.po +++ b/ecommerce/nau/conf/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-23 14:58+0100\n" +"POT-Creation-Date: 2024-07-18 11:09+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -300,7 +300,7 @@ msgid "Please read our FAQs to view common questions about our certificates." msgstr "" #: templates/oscar/communication/email_base.html:189 -#: templates/oscar/customer/email_base.html:195 +#: templates/oscar/customer/email_base.html:189 #, python-format msgid "Copyright © %(year)s %(platform_name)s. All rights reserved." msgstr "" diff --git a/ecommerce/nau/conf/locale/en/LC_MESSAGES/djangojs.mo b/ecommerce/nau/conf/locale/en/LC_MESSAGES/djangojs.mo new file mode 100644 index 0000000000000000000000000000000000000000..6c5906d1cd061dff54de8b533942893de34efc9e GIT binary patch literal 337 zcmYL@Jx{|h5Qd9j%E-dP;DHUUz!pqFHI3Uw*h!U-O0b#M1fyU_j*H-j@b~yFTo(FD zk8Zg4bkFbc(a#8TfSe*{$RTop42h8wT;AXuI{#UD_pUbq(k-mD?~SvRtk~?4EjU^8 zqD=EFDs<<30NFQY3lF=dhsseBt#T;zrx|V_Q9)Dk#909{hlG)3PGx%joM$`|st-_k zW&2hI=P8-jLXeC}P9|KkR7_ct6ud0&v1*&0YBW?@eNZA;wx|b_i4fD)jGb@x9W;=s z, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-18 11:09+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Translators: Original on ecommerce/static/templates/_offer_course_list.html +#: templates/force_translations.js:2 +msgid "Enroll Now" +msgstr "" + +#. Translators: Original on ecommerce/static/js/views/offer_view.js +#: templates/force_translations.js:5 +#, javascript-format +msgid "Course starts: %s" +msgstr "" + +#. Translators: Original on ecommerce/static/js/views/offer_view.js +#: templates/force_translations.js:8 +#, javascript-format +msgid "Discount valid until %s" +msgstr "" + +#. Translators: Original on: ecommerce/static/templates/_offer_course_list.html +#: templates/force_translations.js:11 +msgid "off" +msgstr "" diff --git a/ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/django.po b/ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/django.po index 1f2674c..d7cdc39 100644 --- a/ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/django.po +++ b/ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-23 14:58+0100\n" +"POT-Creation-Date: 2024-07-18 11:09+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -331,7 +331,7 @@ msgstr "" "certificados." #: templates/oscar/communication/email_base.html:189 -#: templates/oscar/customer/email_base.html:195 +#: templates/oscar/customer/email_base.html:189 #, python-format msgid "Copyright © %(year)s %(platform_name)s. All rights reserved." msgstr "" @@ -507,15 +507,12 @@ msgstr "Para Empresas" #: templates/oscar/communication/emails/commtype_order_with_csv_body.html:26 #: templates/oscar/communication/emails/commtype_order_with_csv_body.txt:6 #, fuzzy, python-format -#| msgid "" -#| "Thank you for purchasing access to %%(course_name)s. Let's get your group " -#| "ready to learn with edX:" msgid "" "Thank you for purchasing access to %(course_name)s. Let's get your group " "ready to learn with %(platform_name)s:" msgstr "" "Obrigado por adquirir acesso a %(course_name)s. Vamos preparar o seu grupo " -"para começar a aprender com a NAU:" +"para começar a aprender com %(platform_name)s:" #: templates/oscar/communication/emails/commtype_order_with_csv_body.html:29 #, python-brace-format @@ -543,10 +540,11 @@ msgstr "Dica: Registe qual o código associado a cada pessoa." #: templates/oscar/communication/emails/commtype_order_with_csv_body.html:36 #: templates/oscar/communication/emails/commtype_order_with_csv_body.txt:11 #, fuzzy -#| msgid "Learners sign-in/register with edX and enroll for the course." msgid "" "Learners sign-in/register with {{platform_name}} and enroll for the course." -msgstr "Os estudantes assinam/registam-se na NAU e inscrevem-se no curso." +msgstr "" +"Os estudantes assinam/registam-se em {{platform_name}} e inscrevem-se no " +"curso." #: templates/oscar/communication/emails/commtype_order_with_csv_body.html:39 #, python-brace-format diff --git a/ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/djangojs.mo b/ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/djangojs.mo new file mode 100644 index 0000000000000000000000000000000000000000..202e8937b153b66acd155c75abdd2721f0fffb6b GIT binary patch literal 544 zcmYL`zit#U5XKEj1lkT1DN#f*O)BI7U9?G1mRl#RvVTr{cacJ8c72PZjptaBo48SKt*g28kQ#r_b`v*q^_>d%FIWQEd>Pa8h88bX<9XKdb7h@I6T>hWoF%6M&P6@Ssxqq8 z46Wyd>vYTC%sa=&7(+Cyc&!#X%5wdrEmf3JPS xGPAsGG(wBeP_*>kkg1|fjYn84zfq_N(l5V<51Da|RSU`KAIJ`^WLL_dWB0>QkGKE; literal 0 HcmV?d00001 diff --git a/ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/djangojs.po b/ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/djangojs.po new file mode 100644 index 0000000..1305899 --- /dev/null +++ b/ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/djangojs.po @@ -0,0 +1,40 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-18 11:09+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Translators: Original on ecommerce/static/templates/_offer_course_list.html +#: templates/force_translations.js:2 +msgid "Enroll Now" +msgstr "Inscreva-se agora" + +#. Translators: Original on ecommerce/static/js/views/offer_view.js +#: templates/force_translations.js:5 +#, javascript-format +msgid "Course starts: %s" +msgstr "Início do curso: %s" + +#. Translators: Original on ecommerce/static/js/views/offer_view.js +#: templates/force_translations.js:8 +#, javascript-format +msgid "Discount valid until %s" +msgstr "Desconto válido até %s" + +#. Translators: Original on: ecommerce/static/templates/_offer_course_list.html +#: templates/force_translations.js:11 +msgid "off" +msgstr "menos" diff --git a/ecommerce/nau/templates/force_translations.js b/ecommerce/nau/templates/force_translations.js new file mode 100644 index 0000000..6441bb2 --- /dev/null +++ b/ecommerce/nau/templates/force_translations.js @@ -0,0 +1,11 @@ +// Translators: Original on ecommerce/static/templates/_offer_course_list.html +gettext("Enroll Now") + +// Translators: Original on ecommerce/static/js/views/offer_view.js +gettext("Course starts: %s") + +// Translators: Original on ecommerce/static/js/views/offer_view.js +gettext("Discount valid until %s") + +// Translators: Original on: ecommerce/static/templates/_offer_course_list.html +gettext('off')