blob: 9d13beebc011ac29f2985f71768a98129a5105c9 [file] [log] [blame]
Michael Bestas26376ba2014-07-27 22:40:56 +03001crowdin_sync.py
Marco Brohet3e5334a2014-02-28 01:16:37 +01002==================
3
4Introduction
5------------
Michael Bestas1ec9e712014-12-14 21:57:00 +02006This script is used to synchronize CyanogenMod's translations with Crowdin's. Also, it can handle
Michael Bestas26376ba2014-07-27 22:40:56 +03007automatic commiting to Gerrit and pushing/downloading to/from Crowdin.
Marco Brohet3e5334a2014-02-28 01:16:37 +01008
Marco Brohet3e5334a2014-02-28 01:16:37 +01009Prerequisites
10-------------
Michael Bestas44fbb352015-12-17 02:01:42 +020011The Ruby variant of crowdin-cli >= 0.5.2 is required for this to work.
Marco Brohet680098c2014-02-28 01:21:52 +010012
Marco Brohet3e5334a2014-02-28 01:16:37 +010013 \curl -sSL https://get.rvm.io | bash -s stable --ruby
Michael Bestas26376ba2014-07-27 22:40:56 +030014 source /home/your_username/.rvm/scripts/rvm # Add this to your .bashrc file!
Marco Brohet3e5334a2014-02-28 01:16:37 +010015 rvm all do gem install crowdin-cli
Marco Brohet680098c2014-02-28 01:21:52 +010016
Marco Brohet3e5334a2014-02-28 01:16:37 +010017python-git is used for Git integration.
Marco Brohet680098c2014-02-28 01:21:52 +010018
Marco Brohet3e5334a2014-02-28 01:16:37 +010019 sudo apt-get install python-git
Marco Brohet680098c2014-02-28 01:21:52 +010020
Marco Brohet3e5334a2014-02-28 01:16:37 +010021Executing
22---------
Michael Bestasf40f4392015-06-05 17:02:35 +030023Export the following environment variables to set the API keys and the base path.
24Base path should contain all CM trees in subfolders, named after CM branches:
25
26 export CM_CROWDIN_API_KEY=your_api_key
27 export CM_AOSP_CROWDIN_API_KEY=your_aosp_api_key
28 export CM_CROWDIN_BASE_PATH=your_base_path
29
Michael Bestas26376ba2014-07-27 22:40:56 +030030Execute:
Michael Bestas2ea4e102014-04-05 13:25:33 +030031
Michael Bestas5bd992c2015-02-07 00:28:41 +020032 ./crowdin_sync.py --username your_gerrit_username --branch cm_version [--no-download|--no-upload]
Marco Brohet (cobje)9229f9a2014-02-28 12:39:03 +010033
34Bugs
35----
Marco Brohet8b78a1b2014-02-28 21:01:26 +010036 - When committing fails, the reason of it cannot be determined. Often this is just when there
37 are no new translations, so the script will not exit when this happens.
Michael Bestas2ea4e102014-04-05 13:25:33 +030038
39Submitting changes
40------------------
41This repository is preconfigured to use the git-review plugin. More information can be found at:
42https://pypi.python.org/pypi/git-review
43
44You can upload your change to gerrit with commands like these:
45
46 git add *
47 git commit
48 git review