Michael Bestas | 26376ba | 2014-07-27 22:40:56 +0300 | [diff] [blame] | 1 | crowdin_sync.py |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 2 | ================== |
| 3 | |
| 4 | Introduction |
| 5 | ------------ |
| 6 | This script is used to synchronize CyanogenMod's translations with Crowdin's. It automatically creates cm_caf.xml files, containing |
| 7 | CAF additions that cannot be seperated in CM source, based on the AOSP base file, and removes them after the push. Also, it can handle |
Michael Bestas | 26376ba | 2014-07-27 22:40:56 +0300 | [diff] [blame] | 8 | automatic commiting to Gerrit and pushing/downloading to/from Crowdin. |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 9 | |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 10 | Prerequisites |
| 11 | ------------- |
| 12 | The Ruby variant of crowdin-cli is required for this to work. |
Marco Brohet | 680098c | 2014-02-28 01:21:52 +0100 | [diff] [blame] | 13 | |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 14 | \curl -sSL https://get.rvm.io | bash -s stable --ruby |
Michael Bestas | 26376ba | 2014-07-27 22:40:56 +0300 | [diff] [blame] | 15 | source /home/your_username/.rvm/scripts/rvm # Add this to your .bashrc file! |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 16 | rvm all do gem install crowdin-cli |
Marco Brohet | 680098c | 2014-02-28 01:21:52 +0100 | [diff] [blame] | 17 | |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 18 | python-git is used for Git integration. |
Marco Brohet | 680098c | 2014-02-28 01:21:52 +0100 | [diff] [blame] | 19 | |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 20 | sudo apt-get install python-git |
Marco Brohet | 680098c | 2014-02-28 01:21:52 +0100 | [diff] [blame] | 21 | |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 22 | The script is currently only python2 supported. |
| 23 | |
| 24 | Executing |
| 25 | --------- |
Michael Bestas | 26376ba | 2014-07-27 22:40:56 +0300 | [diff] [blame] | 26 | Copy all files to the root of your local copy of CyanogenMod's source code. |
| 27 | Edit crowdin/config_cm.yaml to set the api key & your current CyanogenMod path. |
| 28 | Execute: |
Michael Bestas | 2ea4e10 | 2014-04-05 13:25:33 +0300 | [diff] [blame] | 29 | |
Michael Bestas | 26376ba | 2014-07-27 22:40:56 +0300 | [diff] [blame] | 30 | ./crowdin_sync.py --username your_gerrit_username |
Marco Brohet (cobje) | 9229f9a | 2014-02-28 12:39:03 +0100 | [diff] [blame] | 31 | |
| 32 | Bugs |
| 33 | ---- |
Marco Brohet | 8b78a1b | 2014-02-28 21:01:26 +0100 | [diff] [blame] | 34 | - When committing fails, the reason of it cannot be determined. Often this is just when there |
| 35 | are no new translations, so the script will not exit when this happens. |
Michael Bestas | 2ea4e10 | 2014-04-05 13:25:33 +0300 | [diff] [blame] | 36 | |
| 37 | Submitting changes |
| 38 | ------------------ |
| 39 | This repository is preconfigured to use the git-review plugin. More information can be found at: |
| 40 | https://pypi.python.org/pypi/git-review |
| 41 | |
| 42 | You can upload your change to gerrit with commands like these: |
| 43 | |
| 44 | git add * |
| 45 | git commit |
| 46 | git review |