This script is used to synchronize Cardinal-AOSP's translations with Crowdin's. Also, it can handle automatic commiting to Github and pushing/downloading to/from Crowdin.
The Ruby variant of crowdin-cli >= 0.5.2 is required for this to work.
\curl -sSL https://get.rvm.io | bash -s stable --ruby
source /home/your_username/.rvm/scripts/rvm # Add this to your .bashrc file!
rvm all do gem install crowdin-cli
python-git is used for Git integration.
sudo apt-get install python-git
Export the following environment variables to set the API keys and the base path. Base path should contain all Cardinal-AOSP trees in subfolders, named after Cardinal-AOSP branches:
export CARDINAL_CROWDIN_API_KEY=your_api_key
export CARDINAL_CROWDIN_BASE_PATH=your_base_path
Execute:
./crowdin_sync.py --username your_github_username --branch branch_name [--upload-sources] [--upload-translations] [--download]
- 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.