From 540ada592d05523700707f1751e270ca410a9ef8 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Wed, 22 May 2013 16:44:18 +0530 Subject: [PATCH] Access i18n json files from same domain for IE8 and IE9 IE8 and IE9 does not support ajax with CORS. So make sure they load json files from same domain. See http://bugs.jquery.com/ticket/8283 Bug: 45958 Change-Id: I8442a5efbd4ca7db0f0a407ff94772ea8e213b29 --- resources/js/ext.uls.init.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/resources/js/ext.uls.init.js b/resources/js/ext.uls.init.js index 0b1bb2e5..3faa2999 100644 --- a/resources/js/ext.uls.init.js +++ b/resources/js/ext.uls.init.js @@ -111,10 +111,15 @@ */ function i18nInit() { var extensionPath, locales, i18n; - - extensionPath = mw.config.get( 'wgExtensionAssetsPath' ) + - '/UniversalLanguageSelector/'; - + if ( window.XDomainRequest ) { + // IE8 and IE9 does not support ajax with CORS. So make sure they + // load json files from same domain ( http://bugs.jquery.com/ticket/8283 ) + extensionPath = mw.config.get( 'wgScriptPath' ) + + '/extensions/UniversalLanguageSelector/'; + } else { + extensionPath = mw.config.get( 'wgExtensionAssetsPath' ) + + '/UniversalLanguageSelector/'; + } locales = mw.config.get( 'wgULSi18nLocales' ); i18n = $.i18n( { locale: currentLang,