MCPcopy Create free account
hub / github.com/VirtualHotBar/NetMount / setLocalized

Function setLocalized

src/controller/language/localized.ts:9–17  ·  view source on GitHub ↗
(lang: string)

Source from the content-addressed store, hash-verified

7import { normalizeI18nPack } from '../../services/i18nPack'
8
9async function setLocalized(lang: string) {
10 lang = lang.toLowerCase()
11
12 const rawPack: Record<string, string> = await invoke('get_language_pack')
13 const pack = normalizeI18nPack(rawPack)
14 i18n.addResourceBundle(lang, 'translation', pack)
15 i18n.changeLanguage(lang)
16 hooks.setLocaleStr(getLangCode(lang))
17}
18
19function getLangCode(lang: string): string {
20 for (const value of roConfig.options.setting.language.select) {

Callers 2

Setting_pageFunction · 0.90
initFunction · 0.90

Calls 2

normalizeI18nPackFunction · 0.90
getLangCodeFunction · 0.85

Tested by

no test coverage detected