diff options
author | David Renshaw <david@sandstorm.io> | 2016-11-10 10:10:06 -0500 |
---|---|---|
committer | David Renshaw <david@sandstorm.io> | 2016-11-15 15:03:12 -0500 |
commit | 1c206d0d367cbb4b6aa2e350ce944397bd48b988 (patch) | |
tree | 3cd61a99ee04ad6e1c1e5fa4f8b3158a60b1656d /client | |
parent | afca7ce6dab51636b5a6bf9e50719c3d0dc47f4d (diff) | |
download | wekan-1c206d0d367cbb4b6aa2e350ce944397bd48b988.tar.gz wekan-1c206d0d367cbb4b6aa2e350ce944397bd48b988.tar.bz2 wekan-1c206d0d367cbb4b6aa2e350ce944397bd48b988.zip |
Fix startup for clients using Finnish and Chinese.
Diffstat (limited to 'client')
-rw-r--r-- | client/lib/i18n.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/client/lib/i18n.js b/client/lib/i18n.js index a03fb398..b8b8609d 100644 --- a/client/lib/i18n.js +++ b/client/lib/i18n.js @@ -14,8 +14,14 @@ Tracker.autorun(() => { if (language) { TAPi18n.setLanguage(language); - // XXX - const shortLanguage = language.split('-')[0]; - T9n.setLanguage(shortLanguage); + // For languages such as Finnish (Suomi) that are not supported by meteor-accounts-t9n, + // the following may throw an exception. On the initial run of this `autorun()` callback, + // such an exception could cause the entire app to fail to load. Therefore, we catch + // the exception and log it as an error. + try { + T9n.setLanguage(language); + } catch (e) { + console.error(e); + } } }); |