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

Function convertToLocaleOrNull

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

Source from the content-addressed store, hash-verified

14};
15
16const convertToLocaleOrNull = (lang: string) => {
17 try {
18 if (lang && typeof lang === "string") {
19 return getLocaleInstance(lang);
20 }
21 } catch (e) {
22 // ignore
23 }
24
25 return new Locale(DEFAULT_LOCALE);
26};
27
28/**
29 * Returns the locale based on the parameter or configured language Configuration#getLanguage

Callers 1

getLocaleFunction · 0.85

Calls 1

getLocaleInstanceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…