From da05b4e305a26588c01bcd4a3157108476d681ef Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Wed, 10 Oct 2012 17:53:19 +0530 Subject: [PATCH 1/2] Load the fallback locales To avoid message keys appearing for non-translated strings in a locale Change-Id: I898bcf6ee4085054ae956740ba8d87f8e5ebee27 --- resources/js/ext.uls.init.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/js/ext.uls.init.js b/resources/js/ext.uls.init.js index 74ab38b0..e1ff9247 100644 --- a/resources/js/ext.uls.init.js +++ b/resources/js/ext.uls.init.js @@ -91,8 +91,8 @@ }; $( document ).ready( function () { - var extensionPath = mw.config.get( 'wgExtensionAssetsPath' ) + - '/UniversalLanguageSelector/'; + var extensionPath = mw.config.get( 'wgExtensionAssetsPath' ) + + '/UniversalLanguageSelector/'; // i18n initialization var i18n = $.i18n( { locale: currentLang, @@ -102,8 +102,13 @@ } ); // localization for jquery.uls i18n.load( extensionPath + 'lib/jquery.uls/i18n/' + currentLang + ".json", currentLang ); + // localization for jquery.uls- fallback locale + i18n.load( extensionPath + 'lib/jquery.uls/i18n/en.json', 'en' ); // localization for mediaWiki ULS i18n.load( extensionPath + 'i18n/' + currentLang + ".json", currentLang ); + // localization for mediaWiki ULS- fallback locale + i18n.load( extensionPath + 'i18n/en.json', 'en' ); + var $ulsTrigger = $( '.uls-trigger' ), previousLanguages = mw.uls.getPreviousLanguages() || [], previousLang = previousLanguages.slice( -1 )[0]; From f667c41d51d6a38d6e4f28e54ebec312a9f7b781 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Wed, 10 Oct 2012 17:54:51 +0530 Subject: [PATCH 2/2] Update jquery.i18n from upstream Change-Id: I1e913e08a45a899343eef84595374afdc76dff20 --- lib/jquery.i18n.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jquery.i18n.js b/lib/jquery.i18n.js index d8d2cfe9..fb0b60f5 100644 --- a/lib/jquery.i18n.js +++ b/lib/jquery.i18n.js @@ -1647,7 +1647,7 @@ * @return {String} */ convertGrammar: function ( word, form ) { - return word + form; + return word; }, /**