r92069 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92068‎ | r92069 | r92070 >
Date:17:57, 13 July 2011
Author:krinkle
Status:ok (Comments)
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.localize.js (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -65,13 +65,14 @@
6666 * (bug 29109) Allow the automatic edit summary for redirect creation
6767 show the first bit of the new redirect page.
6868 * (bug 5800) Added $formCallback as a parameter to the hook
69 - EditPage::showEditForm:initial
 69+ EditPage::showEditForm:initial.
7070 * (bug 29723) mw.util.wikiGetlink() now defaults to wgPageName.
7171 * (bug 29680) Add GetDefaultSortkey hook to override the default sortkey.
7272 * (bug 16699) {{#language:}} accepts second parameter to specify the language in
7373 which the language name is wanted. Coverage depends on the cldr extension.
7474 * (bug 15802) An easy way to look up messages: language qqx which returns
75 - the message keys
 75+ the message keys.
 76+* (bug 29868) Add support for passing parameters to mw.msg in jquery.localize.
7677
7778 === Bug fixes in 1.19 ===
7879 * (bug 28868) Show total pages in the subtitle of an image on the
Index: trunk/phase3/resources/jquery/jquery.localize.js
@@ -32,9 +32,9 @@
3333 */
3434
3535 $.fn.localize = function( options ) {
36 - options = $.extend( { 'prefix': '', 'keys': {} }, options );
 36+ options = $.extend( { 'prefix': '', 'keys': {}, 'params': {} }, options );
3737 function msg( key ) {
38 - return mw.msg( options.prefix + ( key in options.keys ? options.keys[key] : key ) )
 38+ return mw.msg( options.prefix + ( key in options.keys ? options.keys[key] : key ), ( key in options.params ? options.params[key] : [] ) )
3939 };
4040 return $(this)
4141 .find( 'msg,html\\:msg' )

Follow-up revisions

RevisionCommit summaryAuthorDate
r92113Unit tests for jquery.localize...krinkle22:37, 13 July 2011

Comments

#Comment by Krinkle (talk | contribs)   17:59, 13 July 2011

Since this module doesn't have any unit test suite at all, I'll commit those separately in a minute.

Status & tagging log