Skip to content

Commit

Permalink
#1049 nice error message
Browse files Browse the repository at this point in the history
  • Loading branch information
eharkins committed Oct 20, 2020
1 parent 7245c6d commit 26c048e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/controls/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ class Language extends React.Component {
async ensureLanguageResources(lang) {
for (const ns of ["language", "sidebar", "translation"]) {
if (!i18n.hasResourceBundle(lang, ns)) {
const res = await import(/* webpackMode: "lazy-once" */ `../../locales/${lang}/${ns}.json`); // eslint-disable-line
i18n.addResourceBundle(lang, ns, res.default);
try {
const res = await import(/* webpackMode: "lazy-once" */ `../../locales/${lang}/${ns}.json`); // eslint-disable-line
i18n.addResourceBundle(lang, ns, res.default);
}
catch(err) {
console.error(`Language ${lang} not found!`);
}
}
}
}
Expand Down

0 comments on commit 26c048e

Please sign in to comment.