Skip to content

Commit

Permalink
Fixes #548 - Exception thrown when using Japanese display language
Browse files Browse the repository at this point in the history
  • Loading branch information
PKief committed Oct 4, 2019
1 parent 3f8a018 commit 1675790
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ export const initTranslations = async () => {
try {
currentTranslation = await loadTranslation(getCurrentLanguage());
fallbackTranslation = await loadTranslation('en');
}
catch (error) {
} catch (error) {
console.error(error);
}
};
Expand All @@ -25,20 +24,14 @@ const loadTranslation = async (language: string) => {
try {
return await getTranslationObject(language);
} catch (error) {
console.error(error);
return await getTranslationObject('en');
}
};

/** Get the translation object of the separated translation files */
const getTranslationObject = async (language: string) => {
try {
const lang = await import(/* webpackMode: "eager" */ `./lang-${language}`);
return lang.translation;
}
catch (error) {
console.error(error);
}
const lang = await import(/* webpackMode: "eager" */ `./lang-${language}`);
return lang.translation;
};

/**
Expand Down

0 comments on commit 1675790

Please sign in to comment.