* Test badge * fix? * Test * debug * debug * debug * debug * debug * debug * debug * try this * need to build * a minute for what * download and commit test badge * get dynamically * fix * Add to readme * force push * should work * one step * Update badge * draft * clean up * remove these * one line is fine * Adding badges will have to be manual, but that should be fine * cause error * continue on error * hope this doesn't delete the badges * ugh, allow-failures would be so nice * whoops * yep need this * do this * now try a push * clean up * rm line * need this * see if this works * orange * does this work? * ? * do dis * needs to be global? * cool, this works cool, this works * run only on master * add back workflows * remove that * sorting * sorting * print badge markdown * it is bytes though? * run once more * revert * looks nicer * strange * no decimals * run again run once more * nice workflow_dispatch * only run on a schedule and remove error handling * make links absolute * adjust badge text old-commit-hash: 9ab1c492dd051276a422fbac38f754c4e6633f32
Multilanguage
Contributing
Before getting started, make sure you have set up the openpilot Ubuntu development environment by reading the 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:
- Add your new language to languages.json with the appropriate language code and the localized language name (Traditional Chinese is
中文(繁體)). - Generate the XML translation file (
*.ts):selfdrive/ui/update_translations.py - Edit the translation file, marking each translation as completed:
linguist selfdrive/ui/translations/your_language_file.ts - View your finished translations by compiling and starting the UI, then find it in the language selector:
scons -j$(nproc) selfdrive/ui && selfdrive/ui/ui
Improving an Existing Language
Follow step 3. above, you can review existing translations and add missing ones. Once you're done, just open a pull request to openpilot.
Updating the UI
Any time you edit source code in the UI, you need to update the translations to ensure the line numbers and contexts are up to date (first step above).
Testing
openpilot has a few unit tests to make sure all translations are up to date and that all strings are wrapped in a translation marker. They are run in CI, but you can also run them locally.
Tests translation files up to date:
selfdrive/ui/tests/test_translations.py
Tests all static source strings are wrapped:
selfdrive/ui/tests/create_test_translations.sh && selfdrive/ui/tests/test_translations
