Skip to content

Commit

Permalink
feat(ecommerce): add js force translations
Browse files Browse the repository at this point in the history
Add JS force translations for ecommerce.
  • Loading branch information
igobranco committed Jul 26, 2024
1 parent 177cd17 commit adbb955
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 10 deletions.
1 change: 1 addition & 0 deletions ecommerce/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions ecommerce/nau/conf/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -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 ""
Expand Down
Binary file added ecommerce/nau/conf/locale/en/LC_MESSAGES/djangojs.mo
Binary file not shown.
40 changes: 40 additions & 0 deletions ecommerce/nau/conf/locale/en/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\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 ""
14 changes: 6 additions & 8 deletions ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -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 ""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Binary file not shown.
40 changes: 40 additions & 0 deletions ecommerce/nau/conf/locale/pt_PT/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\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"
11 changes: 11 additions & 0 deletions ecommerce/nau/templates/force_translations.js
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit adbb955

Please sign in to comment.