blob: f88b7ae926239b9e87e1e4bb7f0316789ea01861 [file] [log] [blame]
Michael Bestas26376ba2014-07-27 22:40:56 +03001crowdin_sync.py
Marco Brohet3e5334a2014-02-28 01:16:37 +01002==================
3
4Introduction
5------------
6This script is used to synchronize CyanogenMod's translations with Crowdin's. It automatically creates cm_caf.xml files, containing
7CAF 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 Bestas26376ba2014-07-27 22:40:56 +03008automatic commiting to Gerrit and pushing/downloading to/from Crowdin.
Marco Brohet3e5334a2014-02-28 01:16:37 +01009
Marco Brohet3e5334a2014-02-28 01:16:37 +010010Prerequisites
11-------------
12The Ruby variant of crowdin-cli is required for this to work.
Marco Brohet680098c2014-02-28 01:21:52 +010013
Marco Brohet3e5334a2014-02-28 01:16:37 +010014 \curl -sSL https://get.rvm.io | bash -s stable --ruby
Michael Bestas26376ba2014-07-27 22:40:56 +030015 source /home/your_username/.rvm/scripts/rvm # Add this to your .bashrc file!
Marco Brohet3e5334a2014-02-28 01:16:37 +010016 rvm all do gem install crowdin-cli
Marco Brohet680098c2014-02-28 01:21:52 +010017
Marco Brohet3e5334a2014-02-28 01:16:37 +010018python-git is used for Git integration.
Marco Brohet680098c2014-02-28 01:21:52 +010019
Marco Brohet3e5334a2014-02-28 01:16:37 +010020 sudo apt-get install python-git
Marco Brohet680098c2014-02-28 01:21:52 +010021
Marco Brohet3e5334a2014-02-28 01:16:37 +010022The script is currently only python2 supported.
23
24Executing
25---------
Michael Bestas26376ba2014-07-27 22:40:56 +030026Copy all files to the root of your local copy of CyanogenMod's source code.
27Edit crowdin/config_cm.yaml to set the api key & your current CyanogenMod path.
28Execute:
Michael Bestas2ea4e102014-04-05 13:25:33 +030029
Michael Bestas26376ba2014-07-27 22:40:56 +030030 ./crowdin_sync.py --username your_gerrit_username
Marco Brohet (cobje)9229f9a2014-02-28 12:39:03 +010031
32Bugs
33----
Marco Brohet8b78a1b2014-02-28 21:01:26 +010034 - 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 Bestas2ea4e102014-04-05 13:25:33 +030036
37Submitting changes
38------------------
39This repository is preconfigured to use the git-review plugin. More information can be found at:
40https://pypi.python.org/pypi/git-review
41
42You can upload your change to gerrit with commands like these:
43
44 git add *
45 git commit
46 git review