diff options
| author | Alex Jordan <alex@strugee.net> | 2017-01-16 15:08:35 -0500 |
|---|---|---|
| committer | Alex Jordan <alex@strugee.net> | 2017-01-16 15:08:35 -0500 |
| commit | 5e84b5cd15cf76a9c4c350d7dfa50fcc48767d24 (patch) | |
| tree | 15113c64522a6608225857169fd9d1cdf854d5bd /scripts/main.js | |
| parent | 1c14861891a24afb412aac1e3d1c8ed684f7a384 (diff) | |
| download | php-xmpp-invitation-5e84b5cd15cf76a9c4c350d7dfa50fcc48767d24.tar.gz | |
Don't initialize i18n until the document is loaded
Diffstat (limited to 'scripts/main.js')
| -rw-r--r-- | scripts/main.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/main.js b/scripts/main.js index 632925d..afcda7b 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -2,13 +2,7 @@ 'use strict'; var initialized = false; - - // load i18n and perform translation - var i18n = new I18nText({path: 'lang'}); - i18n.once(I18nText.EVT_LOCALE_CHANGE, function (data) { - translate_ui(); - }); - i18n.setLocale('en'); + var i18n; // i18n key prefix for MUC ("muc.") or 1:1 chat ("chat.") var key_prefix; @@ -86,6 +80,13 @@ if (initialized) return; initialized = true; + // load i18n and perform translation + i18n = new I18nText({path: 'lang'}); + i18n.once(I18nText.EVT_LOCALE_CHANGE, function (data) { + translate_ui(); + }); + i18n.setLocale('en'); + // functionality load_clients(); rehash(); |
