MCPcopy Create free account
hub / github.com/UI5/webcomponents / getLocale

Function getLocale

packages/base/src/locale/getLocale.ts:32–44  ·  view source on GitHub ↗
(lang?: string)

Source from the content-addressed store, hash-verified

30 * If no language has been configured - a new locale based on browser language is returned
31 */
32const getLocale = (lang?: string): Locale => {
33 if (lang) {
34 return convertToLocaleOrNull(lang);
35 }
36
37 const configLanguage = getConfigLanguage();
38
39 if (configLanguage) {
40 return getLocaleInstance(configLanguage);
41 }
42
43 return convertToLocaleOrNull(detectNavigatorLanguage());
44};
45
46export default getLocale;

Callers 15

getDateInstanceMethod · 0.85
getLocaleDataFunction · 0.85
Formatting.tsFile · 0.85
Localization.tsFile · 0.85
_formatPatternMethod · 0.85
_formatPatternMethod · 0.85
_primaryCalendarTypeMethod · 0.85
delimiterMethod · 0.85
groupSeparatorMethod · 0.85
onAfterRenderingMethod · 0.85

Calls 3

convertToLocaleOrNullFunction · 0.85
getLocaleInstanceFunction · 0.85
detectNavigatorLanguageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…