blob: 11cfbf8aa1e0d08337f36b064d6e4e6fca0d306a [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
Michael Bestas42e25e32016-03-12 20:18:39 +020021Copy <cm_version>_extra_packages.xml to .repo/local_manifests of each <cm_version> tree
22to make sure you sync all the extra packages not included in the main manifest.
23
Marco Brohet3e5334a2014-02-28 01:16:37 +010024Executing
25---------
Michael Bestasf40f4392015-06-05 17:02:35 +030026Export the following environment variables to set the API keys and the base path.
27Base 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 Bestas26376ba2014-07-27 22:40:56 +030033Execute:
Michael Bestas2ea4e102014-04-05 13:25:33 +030034
Michael Bestasfd5d1362015-12-18 20:34:32 +020035 ./crowdin_sync.py --username your_gerrit_username --branch cm_version [--upload-sources] [--upload-translations] [--download]
Marco Brohet (cobje)9229f9a2014-02-28 12:39:03 +010036
37Bugs
38----
Marco Brohet8b78a1b2014-02-28 21:01:26 +010039 - 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 Bestas2ea4e102014-04-05 13:25:33 +030041
42Submitting changes
43------------------
44This repository is preconfigured to use the git-review plugin. More information can be found at:
45https://pypi.python.org/pypi/git-review
46
47You can upload your change to gerrit with commands like these:
48
49 git add *
50 git commit
51 git review