mirror of
https://github.com/plankanban/planka.git
synced 2025-07-26 00:29:48 +02:00
fix: Fix core locale loading
This commit is contained in:
parent
fe62180cda
commit
a3f33d0361
1 changed files with 8 additions and 10 deletions
|
@ -79,21 +79,19 @@ i18n
|
||||||
debug: process.env.NODE_ENV !== 'production',
|
debug: process.env.NODE_ENV !== 'production',
|
||||||
});
|
});
|
||||||
|
|
||||||
i18n.loadCoreLocale = (language = i18n.resolvedLanguage) => {
|
i18n.loadCoreLocale = async (language = i18n.resolvedLanguage) => {
|
||||||
if (language === 'en') {
|
if (language === 'en') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
import(`./locales/${language}/core`).then((module) => {
|
const { default: locale } = await import(`./locales/${language}/core`);
|
||||||
const locale = module.default;
|
|
||||||
|
|
||||||
Object.keys(locale).forEach((namespace) => {
|
Object.keys(locale).forEach((namespace) => {
|
||||||
if (namespace === 'dateFns') {
|
if (namespace === 'dateFns') {
|
||||||
i18n.dateFns.addLocale(language, locale[namespace]);
|
i18n.dateFns.addLocale(language, locale[namespace]);
|
||||||
} else {
|
} else {
|
||||||
i18n.addResourceBundle(language, namespace, locale[namespace], true, true);
|
i18n.addResourceBundle(language, namespace, locale[namespace], true, true);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue