MCPcopy Create free account
hub / github.com/adobe/react-spectrum / updateLocale

Function updateLocale

packages/react-aria/src/i18n/useDefaultLocale.ts:45–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43let listeners = new Set<(locale: Locale) => void>();
44
45function updateLocale() {
46 currentLocale = getDefaultLocale();
47 for (let listener of listeners) {
48 listener(currentLocale);
49 }
50}
51
52/**
53 * Returns the current browser/system language, and updates when it changes.

Callers

nothing calls this directly

Calls 2

getDefaultLocaleFunction · 0.85
listenerFunction · 0.85

Tested by

no test coverage detected