MCPcopy Create free account
hub / github.com/esmBot/esmBot / getAllLocalizations

Function getAllLocalizations

src/utils/i18n.ts:39–53  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

37}
38
39export function getAllLocalizations(key: string) {
40 const obj: { [key: string]: string } = {};
41 const splitKey = key.split(".");
42 for (const [locale, data] of locales.entries()) {
43 let str: string | undefined;
44 try {
45 str = splitKey.reduce((prev, cur) => prev[cur], data);
46 } catch {
47 /* empty */
48 }
49 if (!str) continue;
50 obj[locale] = str;
51 }
52 return obj;
53}

Callers 5

loadFunction · 0.90
extendFlagsFunction · 0.90
updateFunction · 0.90
addTextParamMethod · 0.85
initMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected