From 41f41d2ab6ce9d942b9eefe4c77d3d4ecd981db5 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Wed, 13 Jul 2011 17:57:30 +0000 Subject: [PATCH] jquery.localize: * Added support for message parameters in jquery.localize since I needed that in order to replace $1 with sitename in MoodBar. See: Bug 29868 - Add support for passing parameters to mw.msg in jquery.localize --- RELEASE-NOTES-1.19 | 5 +++-- resources/jquery/jquery.localize.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index eaf304eb3e..7345f7e61f 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -65,13 +65,14 @@ production. * (bug 29109) Allow the automatic edit summary for redirect creation show the first bit of the new redirect page. * (bug 5800) Added $formCallback as a parameter to the hook - EditPage::showEditForm:initial + EditPage::showEditForm:initial. * (bug 29723) mw.util.wikiGetlink() now defaults to wgPageName. * (bug 29680) Add GetDefaultSortkey hook to override the default sortkey. * (bug 16699) {{#language:}} accepts second parameter to specify the language in which the language name is wanted. Coverage depends on the cldr extension. * (bug 15802) An easy way to look up messages: language qqx which returns - the message keys + the message keys. +* (bug 29868) Add support for passing parameters to mw.msg in jquery.localize. === Bug fixes in 1.19 === * (bug 28868) Show total pages in the subtitle of an image on the diff --git a/resources/jquery/jquery.localize.js b/resources/jquery/jquery.localize.js index 56e82d2704..23b02dddca 100644 --- a/resources/jquery/jquery.localize.js +++ b/resources/jquery/jquery.localize.js @@ -32,9 +32,9 @@ */ $.fn.localize = function( options ) { - options = $.extend( { 'prefix': '', 'keys': {} }, options ); + options = $.extend( { 'prefix': '', 'keys': {}, 'params': {} }, options ); function msg( key ) { - return mw.msg( options.prefix + ( key in options.keys ? options.keys[key] : key ) ) + return mw.msg( options.prefix + ( key in options.keys ? options.keys[key] : key ), ( key in options.params ? options.params[key] : [] ) ) }; return $(this) .find( 'msg,html\\:msg' ) -- 2.20.1