Function setLocale

Source
setLocale(newLocale: string): boolean

Set the selected locale

Returns false if the locale is not supported.

onBeforeChange hook is called regardless of if the new locale is the same as the current locale. If the hook is asynchronous and another setLocale is called before it finishes, the locale will not be set with the current call and will be set with the new call instead.