forked from open-webui/open-webui
fix: load languages in an exported function
This commit is contained in:
parent
c724e19e62
commit
f55525c680
4 changed files with 18 additions and 14 deletions
|
@ -51,7 +51,7 @@ i18next
|
|||
lookupLocalStorage: 'locale'
|
||||
},
|
||||
fallbackLng: {
|
||||
default: ['en-US']
|
||||
default: ['en']
|
||||
},
|
||||
ns: 'translation',
|
||||
interpolation: {
|
||||
|
@ -62,6 +62,9 @@ i18next
|
|||
const i18n = createI18nStore(i18next);
|
||||
const isLoadingStore = createIsLoadingStore(i18next);
|
||||
|
||||
export const languages = (await import(`./locales/languages.json`)).default;
|
||||
export const getLanguages = async () => {
|
||||
const languages = (await import(`./locales/languages.json`)).default;
|
||||
return languages;
|
||||
};
|
||||
export default i18n;
|
||||
export const isLoading = isLoadingStore;
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
[
|
||||
{
|
||||
"title": "English",
|
||||
"code": "en-US"
|
||||
"code": "en",
|
||||
"title": "English"
|
||||
},
|
||||
{
|
||||
"title": "فارسی",
|
||||
"code": "fa"
|
||||
"code": "fa",
|
||||
"title": "فارسی"
|
||||
},
|
||||
{
|
||||
"title": "Deutsch",
|
||||
"code": "de"
|
||||
"code": "de",
|
||||
"title": "Deutsch"
|
||||
},
|
||||
{
|
||||
"title": "French",
|
||||
"code": "fr"
|
||||
"code": "fr",
|
||||
"title": "French"
|
||||
},
|
||||
{
|
||||
"title": "Ukrainian",
|
||||
"code": "uk"
|
||||
"code": "uk",
|
||||
"title": "Ukrainian"
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue