blob: ff518c42adac4954a52079775ba21fa555555cfa [file] [log] [blame]
Michael Bestas26376ba2014-07-27 22:40:56 +03001crowdin_sync.py
Marco Brohet3e5334a2014-02-28 01:16:37 +01002==================
3
4Introduction
5------------
Abhisek Devkotab78def42016-12-27 13:06:52 -08006This script is used to synchronize LineageOS' 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.
Michael Bestas602fab22018-11-14 23:14:33 +020027Base path should contain all LineageOS trees in subfolders, named after LineageOS branches:
Michael Bestasf40f4392015-06-05 17:02:35 +030028
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
Michael Bestas432919a2016-03-12 21:16:20 +020032
33Example:
Michael Bestas09c7c0a2016-03-14 23:12:22 +020034
Michael Bestas432919a2016-03-12 21:16:20 +020035 export CM_CROWDIN_API_KEY=1234567890
36 export CM_AOSP_CROWDIN_API_KEY=0987654321
Abhisek Devkotab78def42016-12-27 13:06:52 -080037 export CM_CROWDIN_BASE_PATH=/mnt/android/lineageos
Michael Bestasf40f4392015-06-05 17:02:35 +030038
Michael Bestas26376ba2014-07-27 22:40:56 +030039Execute:
Michael Bestas2ea4e102014-04-05 13:25:33 +030040
Michael Bestas80b22ef2018-11-14 23:12:33 +020041 ./crowdin_sync.py --username your_gerrit_username --branch cm_version [--upload-sources] [--upload-translations] [--download]
Marco Brohet (cobje)9229f9a2014-02-28 12:39:03 +010042
43Bugs
44----
Marco Brohet8b78a1b2014-02-28 21:01:26 +010045 - When committing fails, the reason of it cannot be determined. Often this is just when there
46 are no new translations, so the script will not exit when this happens.