TolgeeContextWrapper
A custom ContextWrapper that overrides string retrieval to fetch translations from the Tolgee platform.
This class intercepts calls to getString and attempts to load the string from Tolgee. If no translation is loaded or found, it falls back to the default Context.getString implementation. Calls to getText are also intercepted, if the string is found in Tolgee. The returned value is not formatted. (behaves like Context.getText)
Additionally, this wrapper installs a TolgeeLayoutInflaterFactory to automatically translate text attributes during layout inflation.
Parameters
The base Context to wrap.
The Tolgee translation service used for retrieving localized strings.
Constructors
Functions
Returns a localized formatted string from Tolgee cache or the application's package's default string table, substituting the format arguments as defined in java.util.Formatter and java.lang.String.format.
Returns a localized formatted string from Tolgee cache or the application's package's default string table, substituting the format arguments as defined in java.util.Formatter and java.lang.String.format.