crowdin_sync: Add crowdin branch feature support
Change-Id: Id86be9ebba7bfe39953691b4afa3488f7787cc3b
diff --git a/crowdin_sync.py b/crowdin_sync.py
index ed6a0d9..d09b8a6 100755
--- a/crowdin_sync.py
+++ b/crowdin_sync.py
@@ -164,19 +164,19 @@
print('\nUploading Crowdin source translations (custom config)')
check_run(['crowdin-cli',
'--config=%s/crowdin/%s' % (_DIR, config),
- 'upload', 'sources'])
+ 'upload', 'sources', '--branch=%s' % branch])
else:
print('\nUploading Crowdin source translations '
'(AOSP supported languages)')
check_run(['crowdin-cli',
'--config=%s/crowdin/crowdin_%s.yaml' % (_DIR, branch),
- 'upload', 'sources'])
+ 'upload', 'sources', '--branch=%s' % branch])
print('\nUploading Crowdin source translations '
'(non-AOSP supported languages)')
check_run(['crowdin-cli',
'--config=%s/crowdin/crowdin_%s_aosp.yaml' % (_DIR, branch),
- 'upload', 'sources'])
+ 'upload', 'sources', '--branch=%s' % branch])
def download_crowdin(base_path, branch, xml, username, config,
@@ -189,18 +189,18 @@
print('\nDownloading Crowdin translations (custom config)')
check_run(['crowdin-cli',
'--config=%s/crowdin/%s' % (_DIR, config),
- 'download', '--ignore-match'])
+ 'download', '--branch=%s' % branch])
else:
print('\nDownloading Crowdin translations (AOSP supported languages)')
check_run(['crowdin-cli',
'--config=%s/crowdin/crowdin_%s.yaml' % (_DIR, branch),
- 'download', '--ignore-match'])
+ 'download', '--branch=%s' % branch])
print('\nDownloading Crowdin translations '
'(non-AOSP supported languages)')
check_run(['crowdin-cli',
'--config=%s/crowdin/crowdin_%s_aosp.yaml' % (_DIR, branch),
- 'download', '--ignore-match'])
+ 'download', '--branch=%s' % branch])
print('\nRemoving useless empty translation files')
empty_contents = {
@@ -230,10 +230,10 @@
files = ['%s/crowdin/%s' % (_DIR, config)]
else:
files = ['%s/crowdin/crowdin_%s.yaml' % (_DIR, branch),
- '%s/crowdin/crowdin_%s_aosp.yaml' % (_DIR, branch)
- ]
+ '%s/crowdin/crowdin_%s_aosp.yaml' % (_DIR, branch)]
for c in files:
- cmd = ['crowdin-cli', '--config=%s' % c, 'list', 'sources']
+ cmd = ['crowdin-cli', '--config=%s' % c, 'list', 'project',
+ '--branch=%s' % branch]
comm, ret = run_subprocess(cmd)
if ret != 0:
sys.exit(ret)
@@ -319,8 +319,7 @@
files = ['%s/crowdin/%s' % (_DIR, args.config)]
else:
files = ['%s/crowdin/crowdin_%s.yaml' % (_DIR, default_branch),
- '%s/crowdin/crowdin_%s_aosp.yaml' % (_DIR, default_branch)
- ]
+ '%s/crowdin/crowdin_%s_aosp.yaml' % (_DIR, default_branch)]
if not check_files(files):
sys.exit(1)