blob: d52a17d967f20551e5e3ae546a0750436ed0cbe9 [file] [log] [blame]
crowdin_sync.py
==================
Introduction
------------
This script is used to synchronize BlissRoms's translations with Crowdin's. Also, it can handle
automatic commiting to Gerrit and pushing/downloading to/from Crowdin.
Prerequisites
-------------
The Java variant of crowdin is required for this to work.
wget -qO - https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
echo 'deb https://artifacts.crowdin.com/repo/deb/ /' | sudo tee /etc/apt/sources.list.d/crowdin.list > /dev/null
sudo apt-get update && sudo apt-get install crowdin
The following tools are also required to run the tool:
sudo apt-get install python-git python-yaml python-lxml
Copy <bliss_version>_extra_packages.xml to .repo/local_manifests of each <bliss_version> tree
to make sure you sync all the extra packages not included in the main manifest.
Executing
---------
Export the following environment variables to set the API keys and the base path.
Each BlissRoms version requires a different environment variable set for the base path that depends on the branch name.
export BLISS_CROWDIN_API_KEY=your_api_key
export BLISS_CROWDIN_BASE_PATH_Q=base_path_for_q_branch
Example:
export BLISS_CROWDIN_API_KEY=1234567890
export BLISS_CROWDIN_BASE_PATH_Q=/home/user/bliss/q
Execute:
./crowdin_sync.py --username your_gerrit_username --branch bliss_version [--upload-sources] [--upload-translations] [--download] [--submit]
Bugs
----
- When committing fails, the reason of it cannot be determined. Often this is just when there
are no new translations, so the script will not exit when this happens.