crowdin: Externalize user-specific configuration
This will generate a warning at the moment:
(Warning: Configuration file misses parameter `base_path` that defines your project root directory.)
since the user-specific configuration doesn't support base_path yet.
The script still works and uses 'pwd' as base_path
Change-Id: Ib684dcac79204a3f8f3b2c48c361b70b114dc745
diff --git a/crowdin_sync.py b/crowdin_sync.py
index f1dfe4d..b9f10a1 100755
--- a/crowdin_sync.py
+++ b/crowdin_sync.py
@@ -413,7 +413,7 @@
print('\nSTEP 2: Upload Crowdin source translations (non-AOSP supported languages)')
# Execute 'crowdin-cli upload sources' and show output
-print(subprocess.check_output(['crowdin-cli', '-c', 'crowdin/crowdin_aosp.yaml', 'upload', 'sources']))
+print(subprocess.check_output(['crowdin-cli', '--config=crowdin/crowdin_aosp.yaml', '--identity=crowdin/config_aosp.yaml', 'upload', 'sources']))
############################################## STEP 3 ##############################################
@@ -486,16 +486,16 @@
############################################## STEP 6 ##############################################
print('\nSTEP 6: Upload Crowdin source translations (AOSP supported languages)')
# Execute 'crowdin-cli upload sources' and show output
-print(subprocess.check_output(['crowdin-cli', '-c', 'crowdin/crowdin_cm.yaml', 'upload', 'sources']))
+print(subprocess.check_output(['crowdin-cli', '--config=crowdin/crowdin_cm.yaml', '--identity=crowdin/config_cm.yaml', 'upload', 'sources']))
############################################## STEP 7 ##############################################
print('\nSTEP 7A: Download Crowdin translations (AOSP supported languages)')
# Execute 'crowdin-cli download' and show output
-print(subprocess.check_output(['crowdin-cli', '-c', 'crowdin/crowdin_cm.yaml', 'download']))
+print(subprocess.check_output(['crowdin-cli', '--config=crowdin/crowdin_cm.yaml', '--identity=crowdin/config_cm.yaml', 'download']))
print('\nSTEP 7B: Download Crowdin translations (non-AOSP supported languages)')
# Execute 'crowdin-cli download' and show output
-print(subprocess.check_output(['crowdin-cli', '-c', 'crowdin/crowdin_aosp.yaml', 'download']))
+print(subprocess.check_output(['crowdin-cli', '--config=crowdin/crowdin_aosp.yaml', '--identity=crowdin/config_aosp.yaml', 'download']))
############################################## STEP 8 ##############################################
print('\nSTEP 8: Remove temp dir')
@@ -520,7 +520,7 @@
############################################## STEP 10 #############################################
print('\nSTEP 10: Create a list of pushable translations')
# Get all files that Crowdin pushed
-proc = subprocess.Popen(['crowdin-cli -c crowdin/crowdin_cm.yaml list sources && crowdin-cli -c crowdin/crowdin_aosp.yaml list sources'], stdout=subprocess.PIPE, shell=True)
+proc = subprocess.Popen(['crowdin-cli --config=crowdin/crowdin_cm.yaml --identity=crowdin/config_cm.yaml list sources && crowdin-cli --config=crowdin/crowdin_aosp.yaml --identity=crowdin/config_aosp.yaml list sources'], stdout=subprocess.PIPE, shell=True)
proc.wait() # Wait for the above to finish
############################################## STEP 11 #############################################