From 09c8acf1a2c1bfcd22df534054d8eb6bd82bc48b Mon Sep 17 00:00:00 2001 From: David Date: Sun, 9 Aug 2020 22:44:35 -0700 Subject: [PATCH] i18n asset recovery i18n files that fail to download cause an error loading the library. This change will recover from the failure and supply the default dictionary. --- src/i18n.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/i18n.js b/src/i18n.js index 4f1918f9f..273d0aaec 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -41,6 +41,10 @@ export function initI18n(m) { assertLanguage(m, overrided.toJS(), enDictionary); return set(m, 'strings', defaultDictionary.mergeDeep(overrided)); + }, + recoverResult: m, + errorFn: (m, error) => { + l.warn(m, error.message + ' Falling back to default dictionary.'); } }); } else {