r47593 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47592‎ | r47593 | r47594 >
Date:23:35, 20 February 2009
Author:siebrand
Status:ok
Tags:
Comment:
Revert r47578. Causing Fatal error: Call to undefined method languages::getMessagesWithoutVariables() in /home/siebrand/phase3/maintenance/language/transstat.php on line 99
(http://www.mediawiki.org/?diff=prev&oldid=240025)
Modified paths:
  • /trunk/phase3/maintenance/language/checkLanguage.inc (modified) (history)
  • /trunk/phase3/maintenance/language/languages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/checkLanguage.inc
@@ -110,7 +110,7 @@
111111 'untranslated' => 'getUntranslatedMessages',
112112 'duplicate' => 'getDuplicateMessages',
113113 'obsolete' => 'getObsoleteMessages',
114 - 'variables' => 'getMessagesWithMismatchVariables',
 114+ 'variables' => 'getMessagesWithoutVariables',
115115 'plural' => 'getMessagesWithoutPlural',
116116 'empty' => 'getEmptyMessages',
117117 'whitespace' => 'getMessagesWithWhitespace',
@@ -157,7 +157,7 @@
158158 'untranslated' => '$1 message(s) of $2 are not translated to $3, but exist in en:',
159159 'duplicate' => '$1 message(s) of $2 are translated the same in en and $3:',
160160 'obsolete' => '$1 message(s) of $2 do not exist in en or are in the ignore list, but exist in $3:',
161 - 'variables' => '$1 message(s) of $2 in $3 don\'t match the variables used in en:',
 161+ 'variables' => '$1 message(s) of $2 in $3 don\'t use some variables that en uses:',
162162 'plural' => '$1 message(s) of $2 in $3 don\'t use {{plural}} while en uses:',
163163 'empty' => '$1 message(s) of $2 in $3 are empty or -:',
164164 'whitespace' => '$1 message(s) of $2 in $3 have trailing whitespace:',
@@ -199,7 +199,7 @@
200200 * untranslated: Messages which are required to translate, but are not translated.
201201 * duplicate: Messages which translation equal to fallback
202202 * obsolete: Messages which are untranslatable or do not exist, but are translated.
203 - * variables: Messages without variables which should be used, or with variables which shouldn't be used.
 203+ * variables: Messages without variables which should be used.
204204 * empty: Empty messages and messages that contain only -.
205205 * whitespace: Messages which have trailing whitespace.
206206 * xhtml: Messages which are not well-formed XHTML (checks only few common errors).
@@ -587,7 +587,7 @@
588588 * untranslated: Messages which are required to translate, but are not translated.
589589 * duplicate: Messages which translation equal to fallback
590590 * obsolete: Messages which are untranslatable, but translated.
591 - * variables: Messages without variables which should be used, or with variables which shouldn't be used.
 591+ * variables: Messages without variables which should be used.
592592 * empty: Empty messages.
593593 * whitespace: Messages which have trailing whitespace.
594594 * xhtml: Messages which are not well-formed XHTML (checks only few common errors).
Index: trunk/phase3/maintenance/language/languages.inc
@@ -300,17 +300,17 @@
301301 }
302302
303303 /**
304 - * Get the messages whose variables do not match the original ones.
 304+ * Get the messages which do not use some variables.
305305 *
306306 * @param $code The language code.
307307 *
308 - * @return The messages whose variables do not match the original ones.
 308+ * @return The messages which do not use some variables in this language.
309309 */
310 - public function getMessagesWithMismatchVariables( $code ) {
 310+ public function getMessagesWithoutVariables( $code ) {
311311 $this->loadGeneralMessages();
312312 $this->loadMessages( $code );
313313 $variables = array( '\$1', '\$2', '\$3', '\$4', '\$5', '\$6', '\$7', '\$8', '\$9' );
314 - $mismatchMessages = array();
 314+ $messagesWithoutVariables = array();
315315 foreach ( $this->mMessages[$code]['translated'] as $key => $value ) {
316316 $missing = false;
317317 foreach ( $variables as $var ) {
@@ -318,16 +318,12 @@
319319 !preg_match( "/$var/sU", $value ) ) {
320320 $missing = true;
321321 }
322 - if ( !preg_match( "/$var/sU", $this->mGeneralMessages['translatable'][$key] ) &&
323 - preg_match( "/$var/sU", $value ) ) {
324 - $missing = true;
325 - }
326322 }
327323 if ( $missing ) {
328 - $mismatchMessages[$key] = $value;
 324+ $messagesWithoutVariables[$key] = $value;
329325 }
330326 }
331 - return $mismatchMessages;
 327+ return $messagesWithoutVariables;
332328 }
333329
334330 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r47578Language script: Extend variables check to cover also variables which should ...rotem20:18, 20 February 2009

Status & tagging log