MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / getLocale

Function getLocale

tests/test_code/js/moment/moment.js:2231–2252  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

2229
2230 // returns locale data
2231 function getLocale(key) {
2232 var locale;
2233
2234 if (key && key._locale && key._locale._abbr) {
2235 key = key._locale._abbr;
2236 }
2237
2238 if (!key) {
2239 return globalLocale;
2240 }
2241
2242 if (!isArray(key)) {
2243 //short-circuit everything else
2244 locale = loadLocale(key);
2245 if (locale) {
2246 return locale;
2247 }
2248 key = [key];
2249 }
2250
2251 return chooseLocale(key);
2252 }
2253
2254 function listLocales() {
2255 return keys(locales);

Callers 7

getSetGlobalLocaleFunction · 0.85
prepareConfigFunction · 0.85
DurationFunction · 0.85
localeFunction · 0.85
localeErasFunction · 0.85
get$1Function · 0.85
listWeekdaysImplFunction · 0.85

Calls 3

isArrayFunction · 0.85
loadLocaleFunction · 0.85
chooseLocaleFunction · 0.85

Tested by

no test coverage detected