availableLocales

fun availableLocales(vararg locales: Locale): Tolgee.Config.Builder(source)

Sets the available locales configuration for the builder and returns the instance for further customization.

Parameters

locales

A list of locales to be set for the configuration.


A list of available locales. If specified, the app won't try to fetch a manifest from the server. Instead, it will use the provided list of locales. Can be used to save on network requests.

This list is used when determining the fallback language for translations. The SDK performs progressive fallback through intermediate locale variations:

  • If "zh-Hans-CN" doesn't exist, tries "zh-Hans"

  • If "zh-Hans" doesn't exist, tries "zh"

  • Finally uses the default language if configured

If we don't have a list of available locales and manifest fetching fails, the fallback mechanism will be disabled and only exactly matching locale will be used.