Fix custom locale imports

merge-requests/1071/head
Alex Gleason 2022-03-03 22:45:22 -06:00
rodzic 4cd56d7fda
commit 4543e943dd
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 6 dodań i 5 usunięć

1
.gitignore vendored
Wyświetl plik

@ -19,6 +19,7 @@ yarn-error.log*
# Custom build files
/custom/**/*
!/custom/*
/custom/*.*
!/custom/.gitkeep
!/custom/**/.gitkeep

Wyświetl plik

@ -1,10 +1,7 @@
// Import custom messages
const importCustom = locale => {
try {
return import(/* webpackChunkName: "locale_[request]" */`custom/locales/${locale}.json`);
} catch(e) {
return new Promise(resolve => resolve({ default: {} }));
}
return import(/* webpackChunkName: "locale_[request]" */`custom/locales/${locale}.json`)
.catch(error => ({ default: {} }));
};
// Import git-checked messages
@ -20,6 +17,9 @@ const importMessagesWithCustom = locale => {
]).then(messages => {
const [native, custom] = messages;
return Object.assign(native.default, custom.default);
}).catch(error => {
console.error(error);
throw error;
});
};