MCPcopy
hub / github.com/grafana/grafana / initDefaultI18nInstance

Function initDefaultI18nInstance

packages/grafana-i18n/src/i18n.tsx:59–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57
58// exported for testing
59export function initDefaultI18nInstance() {
60 // If the resources are not an object, we need to initialize the plugin translations
61 if (getI18nInstance().options?.resources && typeof getI18nInstance().options.resources === 'object') {
62 return;
63 }
64
65 const initPromise = getI18nInstance().use(initReactI18next).init({
66 resources: {},
67 returnEmptyString: false,
68 lng: DEFAULT_LANGUAGE, // this should be the locale of the phrases in our source JSX
69 });
70 initTFuncAndTransComponent();
71 return initPromise;
72}
73
74// exported for testing
75export function initDefaultReactI18nInstance() {

Callers 4

i18n.test.tsxFile · 0.90
initPluginTranslationsFunction · 0.85
tFunction · 0.85
TransFunction · 0.85

Calls 3

getI18nInstanceFunction · 0.85
initMethod · 0.45

Tested by

no test coverage detected