mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-28 05:08:00 +02:00
closes #136
This commit is contained in:
parent
be45a401b7
commit
27126b64be
6 changed files with 169 additions and 181 deletions
|
@ -136,12 +136,13 @@ export const useI18n = defineStore('i18n', () => {
|
|||
}
|
||||
|
||||
function setupLocale(code) {
|
||||
import(`@/locales/${code}.json`)
|
||||
.then(mod => mod.default)
|
||||
.then(mod => {
|
||||
map.value[code] = mod;
|
||||
locale.value = code;
|
||||
});
|
||||
if (SUPPORTED_LOCALES.some(i => i.code == code))
|
||||
import(`@/locales/${code}.json`)
|
||||
.then(mod => mod.default)
|
||||
.then(mod => {
|
||||
map.value[code] = mod;
|
||||
locale.value = code;
|
||||
});
|
||||
}
|
||||
|
||||
return { locale, map, t, setupLocale };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue