MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / setLanguage

Function setLanguage

frontend/src/lang/i18n.ts:130–135  ·  view source on GitHub ↗
(lang: string, reload = true)

Source from the content-addressed store, hash-verified

128};
129
130const setLanguage = (lang: string, reload = true) => {
131 lang = toStandardLang(lang);
132 localStorage.setItem(LANGUAGE_KEY, lang);
133 i18n.global.locale = lang;
134 if (reload) window.location.reload();
135};
136
137const getCurrentLang = (): string => {
138 const curLang = String(i18n.global.locale).toLowerCase();

Callers 1

changeLanguageFunction · 0.90

Calls 1

toStandardLangFunction · 0.85

Tested by

no test coverage detected