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 | ------------- |
Michael Bestas | 44fbb35 | 2015-12-17 02:01:42 +0200 | [diff] [blame] | 11 | The Ruby variant of crowdin-cli >= 0.5.2 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 | |
Michael Bestas | 42e25e3 | 2016-03-12 20:18:39 +0200 | [diff] [blame^] | 21 | Copy <cm_version>_extra_packages.xml to .repo/local_manifests of each <cm_version> tree |
| 22 | to make sure you sync all the extra packages not included in the main manifest. |
| 23 | |
Marco Brohet | 3e5334a | 2014-02-28 01:16:37 +0100 | [diff] [blame] | 24 | Executing |
| 25 | --------- |
Michael Bestas | f40f439 | 2015-06-05 17:02:35 +0300 | [diff] [blame] | 26 | Export the following environment variables to set the API keys and the base path. |
| 27 | Base path should contain all CM trees in subfolders, named after CM branches: |
| 28 | |
| 29 | export CM_CROWDIN_API_KEY=your_api_key |
| 30 | export CM_AOSP_CROWDIN_API_KEY=your_aosp_api_key |
| 31 | export CM_CROWDIN_BASE_PATH=your_base_path |
| 32 | |
Michael Bestas | 26376ba | 2014-07-27 22:40:56 +0300 | [diff] [blame] | 33 | Execute: |
Michael Bestas | 2ea4e10 | 2014-04-05 13:25:33 +0300 | [diff] [blame] | 34 | |
Michael Bestas | fd5d136 | 2015-12-18 20:34:32 +0200 | [diff] [blame] | 35 | ./crowdin_sync.py --username your_gerrit_username --branch cm_version [--upload-sources] [--upload-translations] [--download] |
Marco Brohet (cobje) | 9229f9a | 2014-02-28 12:39:03 +0100 | [diff] [blame] | 36 | |
| 37 | Bugs |
| 38 | ---- |
Marco Brohet | 8b78a1b | 2014-02-28 21:01:26 +0100 | [diff] [blame] | 39 | - When committing fails, the reason of it cannot be determined. Often this is just when there |
| 40 | 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] | 41 | |
| 42 | Submitting changes |
| 43 | ------------------ |
| 44 | This repository is preconfigured to use the git-review plugin. More information can be found at: |
| 45 | https://pypi.python.org/pypi/git-review |
| 46 | |
| 47 | You can upload your change to gerrit with commands like these: |
| 48 | |
| 49 | git add * |
| 50 | git commit |
| 51 | git review |