Switching language
To change language use changeLanguage
method.
await tolgee.changeLanguage('es');
Getting current language
When Tolgee is running, this will first change pendingLanguage
property, loads required translation file(s) (when they are not already in the cache) and then changes language
property.
Use getLanguage
or getPendingLanguage
methods to read current state.
You can also listen to language
and pendingLanguage
events.
When Tolgee is not running,
changeLanguage
won't fetch translations, it only changes the internal state
info
For language storage or automatic language detection check the Plugins section