r97844 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97843‎ | r97844 | r97845 >
Date:20:02, 22 September 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Backing out r85131 for now. See CR for the reasons.
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/Translate.i18n.php (modified) (history)
  • /trunk/extensions/Translate/groups/MediaWiki/Checker.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/MessageGroups.php
@@ -361,8 +361,7 @@
362362 array( $checker, 'XhtmlCheck' ),
363363 array( $checker, 'braceBalanceCheck' ),
364364 array( $checker, 'pagenameMessagesCheck' ),
365 - array( $checker, 'miscMWChecks' ),
366 - array( $checker, 'prefMessagesCheck' ),
 365+ array( $checker, 'miscMWChecks' )
367366 ) );
368367
369368 return $checker;
Index: trunk/extensions/Translate/groups/MediaWiki/Checker.php
@@ -247,65 +247,4 @@
248248 }
249249 }
250250 }
251 -
252 - /**
253 - * Checks that messages used for some preferences are not equal, otherwise Special:Preferences may explode
254 - * (bug 28152).
255 - *
256 - * @param $messages \array Iterable list of TMessage objects.
257 - * @param $code \string Language code of the translations.
258 - * @param $warnings \array Array where warnings are appended to.
259 - */
260 - protected function prefMessagesCheck( $messages, $code, &$warnings ) {
261 - $prefs = self::getPrefMessages();
262 -
263 - foreach ( $messages as $message ) {
264 - foreach ( $prefs as $group ) {
265 - if ( !in_array( $message->key(), $group ) ) {
266 - continue;
267 - }
268 - $conflicts = array();
269 - foreach ( $group as $key ) {
270 - if ( $key == $message->key() ) {
271 - continue;
272 - }
273 - if ( $message->translation() == wfMessage( $key )->inLanguage( $code )->text() ) {
274 - $conflicts[] = $key;
275 - }
276 - }
277 - if ( count( $conflicts ) ) {
278 - $conflicts = preg_replace( '/^(.*)$/', "[[MediaWiki:$1/$code|$1]]", $conflicts );
279 - global $wgLang;
280 - $warnings[$message->key()][] = array(
281 - array( 'prefmessages', 'match', $message->key(), $code ),
282 - 'translate-checks-prefs',
283 - $wgLang->listToText( $conflicts ),
284 - );
285 - }
286 - }
287 - }
288 - }
289 -
290 - /**
291 - * Returns an array of message keys that may cause conflicts for prefMessagesCheck()
292 - * @return \array
293 - */
294 - protected static function getPrefMessages() {
295 - // @todo: moar?
296 - return array(
297 - array(
298 - 'Mw_math_png',
299 - 'Mw_math_simple',
300 - 'Mw_math_html',
301 - 'Mw_math_source',
302 - 'Mw_math_modern',
303 - 'Mw_math_mathml',
304 - ),
305 - array(
306 - 'Gender-male',
307 - 'Gender-female',
308 - 'Gender-unknown',
309 - ),
310 - );
311 - }
312251 }
Index: trunk/extensions/Translate/Translate.i18n.php
@@ -146,7 +146,6 @@
147147 'translate-checks-format' => 'This translation does not follow the definition or has invalid syntax: $1',
148148 'translate-checks-escape' => 'The following escapes may be accidental: <strong>$1</strong>',
149149 'translate-checks-fudforum-syntax' => 'Use <nowiki>$1</nowiki> instead of <nowiki>$2</nowiki> in this project.',
150 - 'translate-checks-prefs' => 'Message conflicts with $1. These messages must not be the same.',
151150
152151 'translate-pref-nonewsletter' => 'Do not send me e-mail newsletters',
153152 'translate-pref-editassistlang' => 'Assistant languages:',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85131Translate: check for bug 28152 (Special:Preferences explode if some messages ...maxsem16:07, 1 April 2011

Status & tagging log