blob: 44a1f4a289b137d024bd92e14e20a548eb84af20 [file] [log] [blame]
crowdin_sync.py
==================
Introduction
------------
This script is used to synchronize LineageOS' 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
python-git is used for Git integration.
sudo apt-get install python-git
Copy <lineage_version>_extra_packages.xml to .repo/local_manifests of each <lineage_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 LineageOS version requires a different environment variable set for the base path that depends on the branch name:
export LINEAGE_CROWDIN_API_KEY=your_api_key
export LINEAGE_AOSP_CROWDIN_API_KEY=your_aosp_api_key
export LINEAGE_CROWDIN_BASE_PATH_CM_13_0=your_13.0_base_path
export LINEAGE_CROWDIN_BASE_PATH_CM_14_1=your_14.1_base_path
export LINEAGE_CROWDIN_BASE_PATH_LINEAGE_15_1=your_15.1_base_path
Example:
export LINEAGE_CROWDIN_API_KEY=1234567890
export LINEAGE_AOSP_CROWDIN_API_KEY=0987654321
export LINEAGE_CROWDIN_BASE_PATH_CM_13_0=/mnt/android/lineageos/cm-13.0
export LINEAGE_CROWDIN_BASE_PATH_CM_14_1=/mnt/android/lineageos/cm-14.1
export LINEAGE_CROWDIN_BASE_PATH_LINEAGE_15_1=/mnt/android/lineageos/cm-15.1
Execute:
./crowdin_sync.py --username your_gerrit_username --branch lineage_version [--upload-sources] [--upload-translations] [--download]
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.