From 30f3e117840b2d7929822c7436ac47ab66a755e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Fri, 2 Oct 2015 17:02:26 +0200 Subject: Remove the deprecated codeq.chooseTranslation(). --- js/codeq/core.js | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'js/codeq/core.js') diff --git a/js/codeq/core.js b/js/codeq/core.js index b54095f..03c5539 100644 --- a/js/codeq/core.js +++ b/js/codeq/core.js @@ -357,23 +357,6 @@ codeq.fire('langchange', {'lang': newLang}); }, - 'chooseTranslation': function (translations, language) { - var tr, lang; - if ((typeof translations !== 'object') || (translations === null)) return {}; - tr = translations[language || codeq.lang]; - if ((typeof tr === 'object') && (tr !== null)) return tr; - // default fallback - tr = translations['en']; - if ((typeof tr === 'object') && (tr !== null)) return tr; - // fallback to whatever is available - for (lang in translations) { - tr = translations[lang]; - if ((typeof tr === 'object') && (tr !== null)) return tr; - } - // all options were exhausted, we have nothing - return {}; - }, - 'escapeHtml': function (s) { return ('' + s).replace(regexpAmp, '&').replace(regexpLt, '<').replace(regexpGt, '>'); }, @@ -541,10 +524,6 @@ } }; - // ================================================================================ - // The boot sequence - // ================================================================================ - var loadGuiTranslations = function () { var langs = codeq.availableLangs, loaders = [], @@ -588,6 +567,10 @@ }); }; + // ================================================================================ + // The boot sequence + // ================================================================================ + $(document).ready(function () { // set the language var navigatorLang = navigator.language || navigator.browserLanguage, // language reported by browser @@ -603,7 +586,7 @@ codeq.availableLangs.push(key); } - // the boot chain: must be a sequence of .then() terminated with a .fail().done() + // the boot chain of async handlers: must be a sequence of .then() terminated with a .fail().done() loadGuiTranslations() .then(codeq.comms.getResourceTree) .then(function (resourceTree) { -- cgit v1.2.1