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/config_aosp.yaml b/crowdin/config_aosp.yaml
new file mode 100644
index 0000000..af2e56e
--- /dev/null
+++ b/crowdin/config_aosp.yaml
@@ -0,0 +1,21 @@
+# config_aosp.yaml
+#
+# Crowdin configuration file for CyanogenMod's
+# additional languages not supported by AOSP
+#
+# Copyright (C) 2014 The CyanogenMod Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+api_key: your_api_key
+base_path: your/path
diff --git a/crowdin/config_cm.yaml b/crowdin/config_cm.yaml
new file mode 100644
index 0000000..37dd46c
--- /dev/null
+++ b/crowdin/config_cm.yaml
@@ -0,0 +1,20 @@
+# config_cm.yaml
+#
+# Crowdin configuration file for CyanogenMod
+#
+# Copyright (C) 2014 The CyanogenMod Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+api_key: your_api_key
+base_path: your/path
diff --git a/crowdin/crowdin_aosp.yaml b/crowdin/crowdin_aosp.yaml
index 061cdf8..f9540bf 100644
--- a/crowdin/crowdin_aosp.yaml
+++ b/crowdin/crowdin_aosp.yaml
@@ -18,8 +18,6 @@
# limitations under the License.
project_identifier: cyanogenmod-aosp
-api_key: your_api_key
-base_path: your/path
preserve_hierarchy: true
files:
diff --git a/crowdin/crowdin_cm.yaml b/crowdin/crowdin_cm.yaml
index f2da699..f0aa848 100644
--- a/crowdin/crowdin_cm.yaml
+++ b/crowdin/crowdin_cm.yaml
@@ -17,8 +17,6 @@
# limitations under the License.
project_identifier: cyanogenmod
-api_key: your_api_key
-base_path: your/path
preserve_hierarchy: true
files:
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 #############################################