Skip to content

Come tradurre

This is the guide for adding a language to the watch app. "Come tradurre" is Italian for "how to translate".

What you translate

The English source is android/wear/src/main/res/values/strings.xml. It has 200 translatable <string> entries and 4 <plurals>, plus 6 entries marked translatable="false" (app_name, model_3, model_y, channel_ble, channel_cloud, temperature) that stay as they are.

Do not edit values/, values-it/ or values-es/. Spanish landed in #45 and is a good shape to look at.

Steps

  1. Copy values/strings.xml to values-xx/strings.xml, where xx is the Android language code (pt, nl, nb, pl, ...).
  2. Translate every <string> and <plurals> that is not translatable="false".
  3. Keep each name, every placeholder and the plural quantities exactly as in English. The placeholders in use are %1$s, %1$d, %1$.1f, %1$.2f, %1$.0f, %2$.0f, %2$s, %3$s, %4$s and %d. A wrong placeholder crashes the formatted text at runtime.
  4. Check it from android/:

    ./gradlew :wear:lintPublicRelease
    

    In android/wear/build.gradle.kts, MissingTranslation, ExtraTranslation, StringFormatMatches and StringFormatInvalid are errors. HardcodedStringsTest only compares English with Italian, so lint is what covers a new language. 5. On a watch or emulator set to your language, walk through onboarding, the home screen, hold to confirm and Settings, and add screenshots to the pull request.

Languages that need a volunteer

Language Issue
German (values-de) #23
French (values-fr) #24
Portuguese (values-pt) #46
Dutch (values-nl) #47
Norwegian Bokmål (values-nb) #48
Polish (values-pl) #49

Another language? Open an issue first, or just send the pull request.

More