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 | ------------ |
Michael Bestas | 1ec9e71 | 2014-12-14 21:57:00 +0200 | [diff] [blame] | 6 | This script is used to synchronize CyanogenMod's translations with Crowdin's. Also, it can handle |
Michael Bestas | 26376ba | 2014-07-27 22:40:56 +0300 | [diff] [blame] | 7 | automatic commiting to Gerrit and pushing/downloading to/from Crowdin. |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 8 | |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 9 | Prerequisites |
| 10 | ------------- |
| 11 | The Ruby variant of crowdin-cli is required for this to work. |
Marco Brohet | 680098c | 2014-02-28 01:21:52 +0100 | [diff] [blame] | 12 | |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 13 | \curl -sSL https://get.rvm.io | bash -s stable --ruby |
Michael Bestas | 26376ba | 2014-07-27 22:40:56 +0300 | [diff] [blame] | 14 | 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] | 15 | rvm all do gem install crowdin-cli |
Marco Brohet | 680098c | 2014-02-28 01:21:52 +0100 | [diff] [blame] | 16 | |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 17 | python-git is used for Git integration. |
Marco Brohet | 680098c | 2014-02-28 01:21:52 +0100 | [diff] [blame] | 18 | |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 19 | sudo apt-get install python-git |
Marco Brohet | 680098c | 2014-02-28 01:21:52 +0100 | [diff] [blame] | 20 | |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 21 | The script is currently only python2 supported. |
| 22 | |
| 23 | Executing |
| 24 | --------- |
Michael Bestas | 26376ba | 2014-07-27 22:40:56 +0300 | [diff] [blame] | 25 | Copy all files to the root of your local copy of CyanogenMod's source code. |
| 26 | Edit crowdin/config_cm.yaml to set the api key & your current CyanogenMod path. |
| 27 | Execute: |
Michael Bestas | 2ea4e10 | 2014-04-05 13:25:33 +0300 | [diff] [blame] | 28 | |
Michael Bestas | 1ec9e71 | 2014-12-14 21:57:00 +0200 | [diff] [blame] | 29 | ./crowdin_sync.py --username your_gerrit_username [--no-download|--no-upload] |
Marco Brohet (cobje) | 9229f9a | 2014-02-28 12:39:03 +0100 | [diff] [blame] | 30 | |
| 31 | Bugs |
| 32 | ---- |
Marco Brohet | 8b78a1b | 2014-02-28 21:01:26 +0100 | [diff] [blame] | 33 | - When committing fails, the reason of it cannot be determined. Often this is just when there |
| 34 | 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] | 35 | |
| 36 | Submitting changes |
| 37 | ------------------ |
| 38 | This repository is preconfigured to use the git-review plugin. More information can be found at: |
| 39 | https://pypi.python.org/pypi/git-review |
| 40 | |
| 41 | You can upload your change to gerrit with commands like these: |
| 42 | |
| 43 | git add * |
| 44 | git commit |
| 45 | git review |