From b3d7259f4107a0d964a0542f432101d576589fbd Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 20 Feb 2009 23:35:50 +0000 Subject: [PATCH] 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) --- maintenance/language/checkLanguage.inc | 8 ++++---- maintenance/language/languages.inc | 16 ++++++---------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/maintenance/language/checkLanguage.inc b/maintenance/language/checkLanguage.inc index 52281b575b..34d4d40e85 100644 --- a/maintenance/language/checkLanguage.inc +++ b/maintenance/language/checkLanguage.inc @@ -110,7 +110,7 @@ class CheckLanguageCLI { 'untranslated' => 'getUntranslatedMessages', 'duplicate' => 'getDuplicateMessages', 'obsolete' => 'getObsoleteMessages', - 'variables' => 'getMessagesWithMismatchVariables', + 'variables' => 'getMessagesWithoutVariables', 'plural' => 'getMessagesWithoutPlural', 'empty' => 'getEmptyMessages', 'whitespace' => 'getMessagesWithWhitespace', @@ -157,7 +157,7 @@ class CheckLanguageCLI { 'untranslated' => '$1 message(s) of $2 are not translated to $3, but exist in en:', 'duplicate' => '$1 message(s) of $2 are translated the same in en and $3:', 'obsolete' => '$1 message(s) of $2 do not exist in en or are in the ignore list, but exist in $3:', - 'variables' => '$1 message(s) of $2 in $3 don\'t match the variables used in en:', + 'variables' => '$1 message(s) of $2 in $3 don\'t use some variables that en uses:', 'plural' => '$1 message(s) of $2 in $3 don\'t use {{plural}} while en uses:', 'empty' => '$1 message(s) of $2 in $3 are empty or -:', 'whitespace' => '$1 message(s) of $2 in $3 have trailing whitespace:', @@ -199,7 +199,7 @@ Check codes (ideally, all of them should result 0; all the checks are executed b * untranslated: Messages which are required to translate, but are not translated. * duplicate: Messages which translation equal to fallback * obsolete: Messages which are untranslatable or do not exist, but are translated. - * variables: Messages without variables which should be used, or with variables which shouldn't be used. + * variables: Messages without variables which should be used. * empty: Empty messages and messages that contain only -. * whitespace: Messages which have trailing whitespace. * xhtml: Messages which are not well-formed XHTML (checks only few common errors). @@ -587,7 +587,7 @@ Check codes (ideally, all of them should result 0; all the checks are executed b * untranslated: Messages which are required to translate, but are not translated. * duplicate: Messages which translation equal to fallback * obsolete: Messages which are untranslatable, but translated. - * variables: Messages without variables which should be used, or with variables which shouldn't be used. + * variables: Messages without variables which should be used. * empty: Empty messages. * whitespace: Messages which have trailing whitespace. * xhtml: Messages which are not well-formed XHTML (checks only few common errors). diff --git a/maintenance/language/languages.inc b/maintenance/language/languages.inc index 6159e8449d..61ad287fd6 100644 --- a/maintenance/language/languages.inc +++ b/maintenance/language/languages.inc @@ -300,17 +300,17 @@ class languages { } /** - * Get the messages whose variables do not match the original ones. + * Get the messages which do not use some variables. * * @param $code The language code. * - * @return The messages whose variables do not match the original ones. + * @return The messages which do not use some variables in this language. */ - public function getMessagesWithMismatchVariables( $code ) { + public function getMessagesWithoutVariables( $code ) { $this->loadGeneralMessages(); $this->loadMessages( $code ); $variables = array( '\$1', '\$2', '\$3', '\$4', '\$5', '\$6', '\$7', '\$8', '\$9' ); - $mismatchMessages = array(); + $messagesWithoutVariables = array(); foreach ( $this->mMessages[$code]['translated'] as $key => $value ) { $missing = false; foreach ( $variables as $var ) { @@ -318,16 +318,12 @@ class languages { !preg_match( "/$var/sU", $value ) ) { $missing = true; } - if ( !preg_match( "/$var/sU", $this->mGeneralMessages['translatable'][$key] ) && - preg_match( "/$var/sU", $value ) ) { - $missing = true; - } } if ( $missing ) { - $mismatchMessages[$key] = $value; + $messagesWithoutVariables[$key] = $value; } } - return $mismatchMessages; + return $messagesWithoutVariables; } /** -- 2.20.1