From c11cf67f50437ac6f6701dab807f79a1e9380e89 Mon Sep 17 00:00:00 2001 From: Shadi Naif Date: Thu, 20 Apr 2023 17:57:11 +0300 Subject: [PATCH] feat: make extract_translations to use i18n_tool Refs: FC-0012 OEP-58 --- Makefile | 14 ++++++++------ .../{ => conf}/locale/config.yaml | 0 .../{ => conf}/locale/en/LC_MESSAGES/django.mo | Bin .../{ => conf}/locale/en/LC_MESSAGES/django.po | 0 .../{ => conf}/locale/eo/LC_MESSAGES/django.mo | Bin .../{ => conf}/locale/eo/LC_MESSAGES/django.po | 0 .../locale/es_419/LC_MESSAGES/django.mo | Bin .../locale/es_419/LC_MESSAGES/django.po | 0 edx_credentials_themes/locale | 1 + 9 files changed, 9 insertions(+), 6 deletions(-) rename edx_credentials_themes/{ => conf}/locale/config.yaml (100%) rename edx_credentials_themes/{ => conf}/locale/en/LC_MESSAGES/django.mo (100%) rename edx_credentials_themes/{ => conf}/locale/en/LC_MESSAGES/django.po (100%) rename edx_credentials_themes/{ => conf}/locale/eo/LC_MESSAGES/django.mo (100%) rename edx_credentials_themes/{ => conf}/locale/eo/LC_MESSAGES/django.po (100%) rename edx_credentials_themes/{ => conf}/locale/es_419/LC_MESSAGES/django.mo (100%) rename edx_credentials_themes/{ => conf}/locale/es_419/LC_MESSAGES/django.po (100%) create mode 120000 edx_credentials_themes/locale diff --git a/Makefile b/Makefile index 73396b54..c3c2c79e 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,8 @@ NODE_BIN=$(CURDIR)/node_modules/.bin +THEME_NAME := edx_credentials_themes + # Generates a help message. Borrowed from https://github.com/pydanny/cookiecutter-djangopackage. help: ## display this help message @echo "Please use \`make \` where is one of" @@ -18,16 +20,16 @@ build.watch: $(NODE_BIN)/webpack --config webpack.config.js --progress --watch compile_translations: - cd edx_credentials_themes && django-admin.py compilemessages + cd $(THEME_NAME) && i18n_tool generate detect_changed_source_translations: - cd edx_credentials_themes && i18n_tool changed + cd $(THEME_NAME) && i18n_tool changed dummy_translations: - cd edx_credentials_themes && i18n_tool dummy + cd $(THEME_NAME) && i18n_tool dummy -extract_translations: - cd edx_credentials_themes && django-admin.py makemessages -l en -d django +extract_translations: ## extract strings to be translated, outputting .po files + cd $(THEME_NAME) && i18n_tool extract --no-segment generate_translations: extract_translations dummy_translations compile_translations @@ -47,7 +49,7 @@ requirements: base_requirements test: # Confirm compiled assets have not changed, indicating SASS matches CSS. - git diff --exit-code edx_credentials_themes/ + git diff --exit-code $(THEME_NAME)/ ":(exclude)$(THEME_NAME)/conf" upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in diff --git a/edx_credentials_themes/locale/config.yaml b/edx_credentials_themes/conf/locale/config.yaml similarity index 100% rename from edx_credentials_themes/locale/config.yaml rename to edx_credentials_themes/conf/locale/config.yaml diff --git a/edx_credentials_themes/locale/en/LC_MESSAGES/django.mo b/edx_credentials_themes/conf/locale/en/LC_MESSAGES/django.mo similarity index 100% rename from edx_credentials_themes/locale/en/LC_MESSAGES/django.mo rename to edx_credentials_themes/conf/locale/en/LC_MESSAGES/django.mo diff --git a/edx_credentials_themes/locale/en/LC_MESSAGES/django.po b/edx_credentials_themes/conf/locale/en/LC_MESSAGES/django.po similarity index 100% rename from edx_credentials_themes/locale/en/LC_MESSAGES/django.po rename to edx_credentials_themes/conf/locale/en/LC_MESSAGES/django.po diff --git a/edx_credentials_themes/locale/eo/LC_MESSAGES/django.mo b/edx_credentials_themes/conf/locale/eo/LC_MESSAGES/django.mo similarity index 100% rename from edx_credentials_themes/locale/eo/LC_MESSAGES/django.mo rename to edx_credentials_themes/conf/locale/eo/LC_MESSAGES/django.mo diff --git a/edx_credentials_themes/locale/eo/LC_MESSAGES/django.po b/edx_credentials_themes/conf/locale/eo/LC_MESSAGES/django.po similarity index 100% rename from edx_credentials_themes/locale/eo/LC_MESSAGES/django.po rename to edx_credentials_themes/conf/locale/eo/LC_MESSAGES/django.po diff --git a/edx_credentials_themes/locale/es_419/LC_MESSAGES/django.mo b/edx_credentials_themes/conf/locale/es_419/LC_MESSAGES/django.mo similarity index 100% rename from edx_credentials_themes/locale/es_419/LC_MESSAGES/django.mo rename to edx_credentials_themes/conf/locale/es_419/LC_MESSAGES/django.mo diff --git a/edx_credentials_themes/locale/es_419/LC_MESSAGES/django.po b/edx_credentials_themes/conf/locale/es_419/LC_MESSAGES/django.po similarity index 100% rename from edx_credentials_themes/locale/es_419/LC_MESSAGES/django.po rename to edx_credentials_themes/conf/locale/es_419/LC_MESSAGES/django.po diff --git a/edx_credentials_themes/locale b/edx_credentials_themes/locale new file mode 120000 index 00000000..618b7e29 --- /dev/null +++ b/edx_credentials_themes/locale @@ -0,0 +1 @@ +conf/locale \ No newline at end of file