From 93a1ca8351d93adfc18d5a9c99ce2bb908cb43b6 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 13 Jul 2022 23:51:32 -0700 Subject: [PATCH] Multilanguage Contributing README (#25170) * Create README.md * Update README.md * Update README.md * Update README.md * Update README.md * typo --- selfdrive/ui/translations/README.md | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 selfdrive/ui/translations/README.md diff --git a/selfdrive/ui/translations/README.md b/selfdrive/ui/translations/README.md new file mode 100644 index 0000000000..0ddb03a24c --- /dev/null +++ b/selfdrive/ui/translations/README.md @@ -0,0 +1,39 @@ +# Multilanguage + +![multilanguage_onroad](https://user-images.githubusercontent.com/25857203/178912800-2c798af8-78e3-498e-9e19-35906e0bafff.png) + +## Contributing + +Before getting started, make sure you have set up the openpilot Ubuntu development environment by reading the [tools README.md](/tools/README.md). + +### Adding a New Language + +openpilot provides a few tools to help contributors manage their translations and to ensure quality. To get started: + +1. Add your new language to [languages.json](/selfdrive/ui/translations/languages.json) with the appropriate [language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) and the localized language name (Simplified Chinese is `中文(繁體)`). +2. Generate the translation file (`*.ts`): + ```shell + selfdrive/ui/update_translations.py + ``` +3. Edit the translation file, marking each translation as completed: + ```shell + linguist selfdrive/ui/translations/your_language_file.ts + ``` +4. Save your file and generate the compiled QM file used by the Qt UI: + ```shell + selfdrive/ui/update_translations.py --release + ``` + +### Improving an Existing Language + +Follow the steps above, omitting steps 1. and 2. Any time you edit translations you'll want to make sure to compile them. + +### Testing + +openpilot has a unit test to make sure all translations are up to date with the text in openpilot and that all translations are completed. + +Run and fix any issues: + +```python +selfdrive/ui/tests/test_translations.py +```