TolgeeAndroid
A specialized implementation of the Tolgee class for Android that provides methods for retrieving and formatting translations associated with string resources within an Android application. The class uses Kotlin Flows and instant methods for localized text retrieval and dynamic text formatting based on string resources.
Parameters
The configuration object providing settings for Tolgee.
Types
Properties
Functions
Registers a listener to be notified when translations change.
Preloads the required languages and their translations for the current Tolgee instance.
Unregisters a previously registered change listener.
Sets the current locale for the Tolgee instance, updating it in the reactive locale flow.
Adjusts the current locale used for translations.
Immediate Tolgee translation for a key with parameters.
Provides an immediate translation for the given string resource ID within the given context. If a translation key is derived from the string resource, it retrieves the translation using Tolgee. Otherwise, it falls back to returning the default string resource value.
Provides an immediate translation for a given string resource ID with optional format arguments. If the translation key is found in the string resource, it retrieves the translation; otherwise, the default string resource value is returned.
Updating Tolgee translation for a key with parameters.
Retrieves a translation for the given string resource ID and emits the localized text as a Flow.
Provides a flow of translated strings for a given string resource ID with optional formatting arguments. The method first emits the string resolved from the context's resources. If the key corresponding to the string resource ID exists, it emits translations for the key using the provided formatting arguments.
Provides an immediate translation for the given string resource ID within the given context. If a translation key is derived from the string resource, it retrieves the translation using Tolgee. Otherwise, it falls back to returning the default string resource value.