Jason Young 38565b63a9 Multilang: add German (#26411) 1 年之前
..
README.md 493bda546b Fix broken url in translations README (#25546) 2 年之前
create_badges.py 215c16d661 Multilang badges: assert width exists in xml 1 年之前
languages.json 38565b63a9 Multilang: add German (#26411) 1 年之前
main_ar.ts 8c981ed847 Toggle titles: proper capitalization (#26438) 1 年之前
main_de.ts 38565b63a9 Multilang: add German (#26411) 1 年之前
main_en.ts 9b10593c8f translations: remove locations (#25826) 2 年之前
main_ja.ts dcf61d2203 Multilang: add missing Japanese translations (#26556) 1 年之前
main_ko.ts 8b1e10a580 Multilang: kor translation update (#26522) 1 年之前
main_nl.ts 8c981ed847 Toggle titles: proper capitalization (#26438) 1 年之前
main_pl.ts 8c981ed847 Toggle titles: proper capitalization (#26438) 1 年之前
main_pt-BR.ts 23ca1049fe Multilang: Update pt-BR translations (#26549) 1 年之前
main_th.ts 8c981ed847 Toggle titles: proper capitalization (#26438) 1 年之前
main_zh-CHS.ts 87b94afb3b Updated main_zh-CHS.ts (#26524) 1 年之前
main_zh-CHT.ts e9b92c7cb5 Update CHT translations (#26537) 1 年之前

README.md

Multilanguage

languages

Contributing

Before getting started, make sure you have set up the openpilot Ubuntu development environment by reading the tools README.md.

Policy

Most of the languages supported by openpilot come from and are maintained by the community via pull requests. A pull request likely to be merged is one that fixes a translation or adds missing translations.

We also generally merge pull requests adding support for a new language if there are community members willing to maintain it. Maintaining a language is ensuring quality and completion of translations before each openpilot release.

comma may remove or hide language support from releases depending on translation quality and completeness.

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 with the appropriate language code and the localized language name (Traditional Chinese is 中文(繁體)).
  2. Generate the XML translation file (*.ts):

    selfdrive/ui/update_translations.py
    
    1. Edit the translation file, marking each translation as completed: shell linguist selfdrive/ui/translations/your_language_file.ts
  3. 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

multilanguage_onroad