Valhalla supports localized instructions in multiple languages for both textual and verbal phrases. All localized text is managed in JSON files in the locales directory. We rely on external contributors to provide translations of these phrases to other languages.
The recommended way to contribute translations is on Transifex. If you prefer you may also skip Transifex and edit the language files directly.
Follow these steps to start contributing a translation:
- Sign up for a free account at https://www.transifex.com/.
- Navigate to https://www.transifex.com/explore/projects/ and search for the
Valhalla Phrases
project. - Submit a request to join the team for the languages you know. You may also request a new language if yours does not appear in the list.
- Wait for an email with an invitation to start translating.
- From the dashboard, navigate to the Translate page for your chosen language.
- Select the
en-US.json
source file to translate from. - Before you start translating make sure to filter out any phrases with the
notranslate
tag. Apply this filter by selecting Tag > Doesn't contain tag > notranslate. - For more information on how to use Transifex, check out the getting started guide.
Once a language is 100% translated, the project maintainers will be notified and we will make a PR with your updates. Thank you for your contribution!
Follow these instructions if you prefer to edit the JSON files directly without Transifex.
-
Copy the en-US.json to
<NEW_LANGUAGE_TAG>.json
Using IETF BCP 47 as reference - the typical format for the<NEW_LANGUAGE_TAG>
is: <ISO 639 two-letter language code>-<ISO 3166 two-letter country code> Czech/Czech Republic example:cs-CZ
-
Update the
posix_locale
value in your new file. The character encoding must be UTF-8. The typical format is: <ISO 639 two-letter language code>_<ISO 3166 two-letter country code>.UTF-8 Czech/Czech Republicposix_locale
example:cs_CZ.UTF-8
-
Update the
aliases
array in your new file. A typical alias entry is the ISO 639 two-letter language code without the ISO 3166 two-letter country code. The alias entry must be unique across language files. Czechaliases
entry example:cs
-
Do not translate the JSON keys or phrase tags. An example using the ramp instruction:
-
Please translate the JSON values. As needed, reorder the phrase words and tags - the tags must remain in the phrase. An example using the ramp instruction:
-
Run
make check
to verify the tests pass OR move on to step#7 and we can help verify. -
Submit a pull request for review. Thank you!
-
First add the new strings in en-US.json. The JSON keys are used by narrative_builder to select the instruction template string.
-
Sync the new strings to each new narrative language file by running
./merge-en.sh
. This will copy the new English strings to each new language. -
Update the English strings in each language file.
TODO
TODO