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