Crowdin CLI doesn't extract into a temporary .crowdin-tmp folder so that can be removed. (.crowdin-tmp was used in prior Bash scripts). Also moved note about using a VPN to the wiki https://github.com/keymanapp/keyman/wiki/Crowdin-CLI |
||
|---|---|---|
| .. | ||
| README.md | ||
Localization Maintenance
Localization for Keyman is maintained at https://crowdin.com/project/keyman
The Crowdin CLI (v3) tool is used to automate downloading and updating files
between Keyman and Crowdin. The configuration file for each platform is a YAML file named crowdin.yml.
On Windows, use crowdin.bat instead of crowdin for all the syntax below.
Add File
When adding new files to https://crowdin.com/project/keyman/settings#files also go to the file "Settings" and edit Resulting file after translations export:. This is where the translated files will appear in the Crowdin download (Keyman.zip) which also determines where the translated files get extracted locally into the Keyman project.
For example, android/KMEA/strings.xml string uses
/KMEA/app/src/main/res/values-%android_code%/strings.xml
Setup
Install the Crowdin CLI (v3) for your OS. Note, it has a prerequisite on Java 8.
Environment Variables
In Crowdin, create a personal access token
and set it as an environment variable CROWDIN_PERSONAL_TOKEN.
Also copy the project id
from API v2 and set it as an environment variable CROWDIN_PROJECT_ID.
Testing Crowdin CLI is Set Up Correctly
To check your CLI setup,
crowdin list project
You should see the CLI fetching project info and generating a list of files associated with the project.
Downloading from Crowdin
To download a platform's latest translations from Crowdin, open a command line at a platform's folder and run:
crowdin download
To download latest translations for the specific language:
crowdin download -l {language_code}
To display a list of latest translations from Crowdin:
crowdin download --dryrun
Uploading to crowdin
To upload source files to Crowdin:
crowdin upload sources