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 b6195f3 commit 36d5cdc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
16 changes: 7 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
clean_translations_temp_directory:
rm -rf I18N/

create_virtual_env:
rm -rf .venv
python3 -m venv .venv
. .venv/bin/activate && pip install -r i18n_scripts/requirements.txt
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

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
4 changes: 2 additions & 2 deletions i18n_scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Package dependencies
# Translation processing dependencies
openedx-atlas==0.6.0
# TODO: Publish new version on pypi as `python3-localizable`
# TODO: Publish new version on pypi as `python3-localizable` https://github.com/chrisballinger/python-localizable/pull/4
git+https://github.com/Amr-Nash/python-localizable.git@15d3bf2466d0de1a826d3f0ff1f365b0c1910f56
2 changes: 1 addition & 1 deletion i18n_scripts/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,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 36d5cdc

Please sign in to comment.