Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update transifex pull command. #119

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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