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
This commit is contained in:
Santhosh Thottingal
2013-05-22 16:44:18 +05:30
committed by Gerrit Code Review
parent c4536a063c
commit 540ada592d

View File

@@ -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,