blob: 101ea78bb8812778ac458d9148850b4ed755eef2 [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-------------
11The Ruby variant of crowdin-cli 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 +010021The script is currently only python2 supported.
22
23Executing
24---------
Michael Bestas26376ba2014-07-27 22:40:56 +030025Copy all files to the root of your local copy of CyanogenMod's source code.
26Edit crowdin/config_cm.yaml to set the api key & your current CyanogenMod path.
27Execute:
Michael Bestas2ea4e102014-04-05 13:25:33 +030028
Michael Bestas5bd992c2015-02-07 00:28:41 +020029 ./crowdin_sync.py --username your_gerrit_username --branch cm_version [--no-download|--no-upload]
Marco Brohet (cobje)9229f9a2014-02-28 12:39:03 +010030
31Bugs
32----
Marco Brohet8b78a1b2014-02-28 21:01:26 +010033 - 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 Bestas2ea4e102014-04-05 13:25:33 +030035
36Submitting changes
37------------------
38This repository is preconfigured to use the git-review plugin. More information can be found at:
39https://pypi.python.org/pypi/git-review
40
41You can upload your change to gerrit with commands like these:
42
43 git add *
44 git commit
45 git review