thunderbird-android/docs/translations.md

2 KiB

Managing translations

Right now we're using the resourceConfigurations mechanism provided by the Android Gradle Plugin to limit which languages are included in builds of the app. See e.g. 176a520e86/app-k9mail/build.gradle.kts (L40-L48)

This list needs to be kept in sync with the string array supported_languages, so the in-app language picker offers exactly the languages that are included in the app.

Removing a language

  1. Remove the language code from the resourceConfigurations list in app-k9mail/build.gradle.kts.
  2. Remove the entry from supported_languages in app/core/src/main/res/values/arrays_general_settings_values.xml.

Adding a language

  1. Add the language code to the resourceConfigurations list in app-k9mail/build.gradle.kts.
  2. Add an entry to supported_languages in app/core/src/main/res/values/arrays_general_settings_values.xml.
  3. Make sure that language_values in app/core/src/main/res/values/arrays_general_settings_values.xml contains an entry for the language code you just added. If not:
    1. Add the language name (in its native script) to language_entries in app/ui/legacy/src/main/res/values/arrays_general_settings_strings.xml. Please note that this list should be ordered using the Unicode default collation order.
    2. Add the language code to language_values in app/core/src/main/res/values/arrays_general_settings_values.xml so that the index in the list matches that of the newly added entry in language_entries.

Things to note

For some languages Android uses different language codes that typical translation tools, e.g. Hebrew's code is he on Weblate, but iw on Android. When writing automation tools, there needs to be a mapping step involved.

Weblate's code that might be relevant for this: bdbc725b50/weblate/formats/base.py

More research and careful testing is necessary when automating any of these steps.