Skip to content

Commit

Permalink
fix: add make translation_requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarIthawi committed May 18, 2024
1 parent 320548c commit 468850a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
18 changes: 7 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
clean_translations_temp_directory:
rm -rf I18N/

create_virtual_env:
rm -rf .venv
python3 -m venv .venv
# TODO: Publish new version on pypi as `python3-localizable`
. .venv/bin/activate && pip install git+https://github.com/Amr-Nash/python-localizable.git@15d3bf2
. .venv/bin/activate && pip install openedx-atlas==0.6.0
translation_requirements:
pip install -r i18n_scripts/requirements.txt

pull_translations: clean_translations_temp_directory create_virtual_env
. .venv/bin/activate && atlas pull $(ATLAS_OPTIONS) translations/openedx-app-ios/I18N:I18N
. .venv/bin/activate && python i18n_scripts/translation.py --split
pull_translations: clean_translations_temp_directory
atlas pull $(ATLAS_OPTIONS) translations/openedx-app-ios/I18N:I18N
python i18n_scripts/translation.py --split
make clean_translations_temp_directory


extract_translations: clean_translations_temp_directory create_virtual_env
. .venv/bin/activate && python i18n_scripts/translation.py --combine
extract_translations: clean_translations_temp_directory
python i18n_scripts/translation.py --combine
3 changes: 3 additions & 0 deletions i18n_scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# TODO: Publish new version on pypi as `python3-localizable` https://github.com/chrisballinger/python-localizable/pull/4
https://github.com/Amr-Nash/python-localizable/archive/15d3bf2466d0de1a826d3f0ff1f365b0c1910f56.zip
openedx-atlas==0.6.0
2 changes: 1 addition & 1 deletion i18n_scripts/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def combine_translation_files(modules_dir=None):
Combine translation files from different modules into a single file.
"""
if not modules_dir:
modules_dir = os.path.dirname(os.path.dirname(__file__))
modules_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
combined_translation_dict = get_translations(modules_dir)
write_combined_translation_file(modules_dir, combined_translation_dict)

Expand Down

0 comments on commit 468850a

Please sign in to comment.