[Weblate configuration] Automatic language adding

Following up on this:

I think it’d be handy if for the website we can just add one language, and then it gets applied to all other website components. Especially if we drop md2po which currently collates all our website texts into 4 files (which would mean we’ll have a gazillion components in Weblate to which the languages have to be applied).

However, the ‘Add missing languages’ add-on applies to the whole project - all components where this plugin is enabled. This means Android’s language code specifics would conflict with our website language codes: with the add-on enabled on all components, we’d get Android-specific language codes in our website and generic strings in our Android translations.

Solution

a) Set Language filter

Set a language filter on the components:

  • App
  • Play store
  • Website

For the app and website, in principle only all two-letter codes, with exceptions where languages differ greatly between countries (this is of course up for discussion)

  • Portuguese / Portuguese Brazil
  • Norwegian: only Bokmal

In RegEx: ^(?!no$)(..|(nb|pt-BR))$

For Play store, there is a specific list of languages that can be supported: Translate and localize your app | Play console help

b) Activate ‘Add missing languages’ add-on

We can start with doing this only on the website components.

Later we can enable it also for the app and app store components, so that we get app store descriptions for all languages that we have in the app. For this we would need to:


WDYT @ByteHamster @delthia?

Other thoughts

I see we currently support down to Android 5.0 (API level 21). Would it simplify matters if we move up to Android 7.0 (API level 24), given that this version and up has better language resolution?

I see we have a languages list in common.gradle - how is that constructed again? Is it coming from Weblate? (I’m wondering if we could apply that list to Weblate, and maybe update it automatically like Grist did. But if the list is coming from the languages on Weblate in the first place, there would be no point.)

Resources / related:

1 Like