From 5e84b5cd15cf76a9c4c350d7dfa50fcc48767d24 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Mon, 16 Jan 2017 15:08:35 -0500 Subject: Don't initialize i18n until the document is loaded --- scripts/main.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'scripts') 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(); -- cgit 1.4.1