jquery.localize:
authorKrinkle <krinkle@users.mediawiki.org>
Wed, 13 Jul 2011 17:57:30 +0000 (17:57 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Wed, 13 Jul 2011 17:57:30 +0000 (17:57 +0000)
* 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
resources/jquery/jquery.localize.js

index eaf304e..7345f7e 100644 (file)
@@ -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
index 56e82d2..23b02dd 100644 (file)
@@ -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' )