The target locale code (e.g. "pl").
Nothing.
setLocale("pl"); // UI re-renders in Polish
export function setLocale(locale: string): void {
const next = messageTables[locale] ? locale : DEFAULT_LOCALE;
if (next === currentLocale) return;
currentLocale = next;
for (const listener of listeners) listener();
}
Switches the active UI locale and notifies subscribers so the React tree re-renders with the new language. A locale without a bundled
messages.jsonfalls back to the default; a no-op when the locale is unchanged.