r96007 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96006‎ | r96007 | r96008 >
Date:16:11, 1 September 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Migrate messages to resource loader
Modified paths:
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/js/quickedit.js (modified) (history)
  • /trunk/extensions/Translate/utils/TranslationHelpers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/js/quickedit.js
@@ -11,13 +11,11 @@
1212 *
1313 * TODO list:
1414 * * On succesful save, update the MessageTable display too.
15 - * * Integrate the (new) edittoolbar
1615 * * Autoload ui classes
1716 * * Instead of hc'd onscript, give them a class and use necessary triggers
18 - * * Live-update the checks assistant
1917 *
2018 * @author Niklas Laxström
21 - * @copyright Copyright © 2009-2010 Niklas Laxström
 19+ * @copyright Copyright © 2009-2011 Niklas Laxström
2220 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
2321 */
2422
@@ -152,11 +150,11 @@
153151 if ( json.error ) {
154152 alert( json.error.info + ' (' + json.error.code +')' );
155153 } else if ( json.edit.result === 'Failure' ) {
156 - alert( trlMsgSaveFailed );
 154+ alert( mw.msg( 'translate-js-save-failed' ) );
157155 } else if ( json.edit.result === 'Success' ) {
158156 dialog.dialog( 'close' );
159157 } else {
160 - alert( trlMsgSaveFailed );
 158+ alert( mw.msg( 'translate-js-save-failed' ) );
161159 }
162160 }
163161 } );
@@ -197,7 +195,7 @@
198196 found = true;
199197 }
200198 }
201 - alert(trlMsgNoNext);
 199+ alert( mw.msg( 'translate-js-nonext' ) );
202200 return;
203201 }
204202
Index: trunk/extensions/Translate/Translate.php
@@ -143,6 +143,7 @@
144144 $wgResourceModules['ext.translate.quickedit'] = array(
145145 'scripts' => 'js/quickedit.js',
146146 'styles' => 'js/ext.translate.quickedit.css',
 147+ 'messages' => array( 'translate-js-nonext', 'translate-js-save-failed' ),
147148 ) + $resourcePaths;
148149
149150 $wgResourceModules['ext.translate.messagetable'] = array(
Index: trunk/extensions/Translate/utils/TranslationHelpers.php
@@ -1213,13 +1213,6 @@
12141214 $out->addExtensionStyle( TranslateUtils::assetPath( 'js/base/custom-theme/jquery-ui-1.7.2.custom.css' ) );
12151215 }
12161216
1217 - $vars = array(
1218 - 'trlMsgNoNext' => wfMsg( 'translate-js-nonext' ),
1219 - 'trlMsgSaveFailed' => wfMsg( 'translate-js-save-failed' ),
1220 - );
1221 -
1222 - $out->addScript( Skin::makeVariablesScript( $vars ) );
1223 -
12241217 // Might be needed, but ajax doesn't load it
12251218 // Globals :(
12261219 $diff = new DifferenceEngine;

Status & tagging log