Skip to content

Commit

Permalink
Merge pull request #119 from openedx/diana/new-flag
Browse files Browse the repository at this point in the history
fix: Update transifex pull command.
  • Loading branch information
dianakhuang authored Oct 17, 2022
2 parents 2438683 + 5c0f0cf commit b5c9568
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions i18n/transifex.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def pull(configuration, *resources):
print("Pulling conf/locale/config.yaml:locales from Transifex...")

for lang in configuration.translated_locales:
cmd = f'tx pull -f --mode=reviewed --minimum-perc=3 -l {lang}'
cmd = f'tx pull -t -f --mode=reviewed --minimum-perc=3 -l {lang}'
if resources:
for resource in resources:
execute(cmd + f' -r {resource}')
Expand All @@ -70,7 +70,7 @@ def pull_all(configuration):
Only cleans locales: listed in conf/locale/config.yaml
"""
print("Pulling all translations for all languages, reviewed or not, from transifex...")
execute('tx pull --all')
execute('tx pull --all --translations')
clean_translated_locales(configuration)


Expand All @@ -82,7 +82,7 @@ def pull_all_ltr(configuration):
for lang in configuration.ltr_langs:
print('rm -rf conf/locale/' + lang)
execute('rm -rf conf/locale/' + lang)
execute('tx pull -l ' + lang)
execute('tx pull -t -l ' + lang)
clean_translated_locales(configuration, langs=configuration.ltr_langs)


Expand All @@ -94,7 +94,7 @@ def pull_all_rtl(configuration):
for lang in configuration.rtl_langs:
print('rm -rf conf/locale/' + lang)
execute('rm -rf conf/locale/' + lang)
execute('tx pull -l ' + lang)
execute('tx pull -t -l ' + lang)
clean_translated_locales(configuration, langs=configuration.rtl_langs)


Expand Down
18 changes: 9 additions & 9 deletions tests/test_transifex.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def test_pull_command(self):
transifex.pull(self.configuration)

call_args = [
('tx pull -f --mode=reviewed --minimum-perc=3 -l en',),
('tx pull -f --mode=reviewed --minimum-perc=3 -l fr',),
('tx pull -f --mode=reviewed --minimum-perc=3 -l zh_CN',),
('tx pull -t -f --mode=reviewed --minimum-perc=3 -l en',),
('tx pull -t -f --mode=reviewed --minimum-perc=3 -l fr',),
('tx pull -t -f --mode=reviewed --minimum-perc=3 -l zh_CN',),
]
self.assertEqual(
call_args,
Expand All @@ -74,12 +74,12 @@ def test_pull_command_with_resources(self):

# conf/locale/config.yaml specifies two non-source locales, 'fr' and 'zh_CN'
call_args = [
('tx pull -f --mode=reviewed --minimum-perc=3 -l en -r foo.1',),
('tx pull -f --mode=reviewed --minimum-perc=3 -l en -r foo.2',),
('tx pull -f --mode=reviewed --minimum-perc=3 -l fr -r foo.1',),
('tx pull -f --mode=reviewed --minimum-perc=3 -l fr -r foo.2',),
('tx pull -f --mode=reviewed --minimum-perc=3 -l zh_CN -r foo.1',),
('tx pull -f --mode=reviewed --minimum-perc=3 -l zh_CN -r foo.2',),
('tx pull -t -f --mode=reviewed --minimum-perc=3 -l en -r foo.1',),
('tx pull -t -f --mode=reviewed --minimum-perc=3 -l en -r foo.2',),
('tx pull -t -f --mode=reviewed --minimum-perc=3 -l fr -r foo.1',),
('tx pull -t -f --mode=reviewed --minimum-perc=3 -l fr -r foo.2',),
('tx pull -t -f --mode=reviewed --minimum-perc=3 -l zh_CN -r foo.1',),
('tx pull -t -f --mode=reviewed --minimum-perc=3 -l zh_CN -r foo.2',),
]
self.assertEqual(
call_args,
Expand Down

0 comments on commit b5c9568

Please sign in to comment.