Function: useI18n()
useI18n():
object
Defined in: useI18n.ts:6
Returns
defaultLocale
defaultLocale:
string
The locale the defaultMessages are written in. Defaults to en, the
source locale of every @ttoss/* package; an app authoring in another
language sets it, or every untranslated message reports
MISSING_TRANSLATION and its fallback text is formatted with English
rules.
intl
intl:
IntlShape
locale?
optionallocale?:string
The locale to render. Changing it after mount loads that locale, exactly
as setLocale does.
messages?
optionalmessages?:Messages
onError?
optionalonError?: (err) =>void
Receives formatting errors from react-intl and errors thrown by
loadLocaleData.
Parameters
| Parameter | Type |
|---|---|
err | Error |
Returns
void
setLocale
setLocale: (
language) =>void
Parameters
| Parameter | Type |
|---|---|
language | string |
Returns
void