mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 05:09:43 +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,13 +79,12 @@ 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') {
|
||||||
|
@ -94,7 +93,6 @@ i18n.loadCoreLocale = (language = i18n.resolvedLanguage) => {
|
||||||
i18n.addResourceBundle(language, namespace, locale[namespace], true, true);
|
i18n.addResourceBundle(language, namespace, locale[namespace], true, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default i18n;
|
export default i18n;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue