fix: Fixing bug where Strapi UI is crashing when no locale is found

pull/150/head
Michael Razmgah 2024-10-14 09:49:14 +02:00 committed by GitHub
parent 79a4a0b41c
commit e74594a970
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 4 deletions

View File

@ -52,6 +52,16 @@ export default {
locales.map((locale) => { locales.map((locale) => {
return import( return import(
/* webpackChunkName: "config-sync-translation-[request]" */ `./translations/${locale}.json` /* webpackChunkName: "config-sync-translation-[request]" */ `./translations/${locale}.json`
)
.then(({ default: data }) => {
return {
data: prefixPluginTranslations(data, pluginId),
locale,
};
})
.catch(() => {
return import(
/* webpackChunkName: "config-sync-translation-[request]" */ `./translations/en.json`
) )
.then(({ default: data }) => { .then(({ default: data }) => {
return { return {
@ -65,6 +75,7 @@ export default {
locale, locale,
}; };
}); });
});
}), }),
); );