http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89449
Revision: 89449
Author: siebrand
Date: 2011-06-03 22:32:12 +0000 (Fri, 03 Jun 2011)
Log Message:
-----------
Add rubyVariableCheck() in MessageChecks class and remove old style checker for
EOL.
Modified Paths:
--------------
trunk/extensions/Translate/MessageChecks.php
trunk/extensions/Translate/groups/EOL/EOL.yaml
Removed Paths:
-------------
trunk/extensions/Translate/groups/EOL/Checker.php
Modified: trunk/extensions/Translate/MessageChecks.php
===================================================================
--- trunk/extensions/Translate/MessageChecks.php 2011-06-03 22:32:06 UTC
(rev 89448)
+++ trunk/extensions/Translate/MessageChecks.php 2011-06-03 22:32:12 UTC
(rev 89449)
@@ -264,6 +264,17 @@
}
/**
+ * Checks for missing and unknown Ruby variables (%{var}) in
+ * translations.
+ * @param $messages \mixed Iterable list of TMessage objects.
+ * @param $code \string Language code
+ * @param $warnings \array Array where warnings are appended to.
+ */
+ protected function rubyVariableCheck( $messages, $code, &$warnings ) {
+ return $this->parameterCheck( $messages, $code, $warnings,
'/%{[a-zA-Z_]+}/' );
+ }
+
+ /**
* Checks for missing and unknown python string interpolation operators
in
* translations.
* @param $messages \mixed Iterable list of TMessage objects.
Deleted: trunk/extensions/Translate/groups/EOL/Checker.php
===================================================================
--- trunk/extensions/Translate/groups/EOL/Checker.php 2011-06-03 22:32:06 UTC
(rev 89448)
+++ trunk/extensions/Translate/groups/EOL/Checker.php 2011-06-03 22:32:12 UTC
(rev 89449)
@@ -1,27 +0,0 @@
-<?php
-/**
- * Implements MessageChecker for EOL.
- *
- * @file
- * @author Niklas Laxström
- * @copyright Copyright © 2009-2010, Niklas Laxström
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
2.0 or later
- */
-
-/**
- * Message checks for EOL
- *
- * @ingroup MessageCheckers
- */
-class EOLMessageChecker extends MessageChecker {
- /**
- * Checks for missing and unknown variables in translations.
- *
- * @param $messages \array Iterable list of TMessage objects.
- * @param $code \string Language code of the translations.
- * @param $warnings \array Array where warnings are appended to.
- */
- protected function EOLVariablesCheck( $messages, $code, &$warnings ) {
- return parent::parameterCheck( $messages, $code, $warnings,
'/%{[a-zA-Z_]+}/' );
- }
-}
Modified: trunk/extensions/Translate/groups/EOL/EOL.yaml
===================================================================
--- trunk/extensions/Translate/groups/EOL/EOL.yaml 2011-06-03 22:32:06 UTC
(rev 89448)
+++ trunk/extensions/Translate/groups/EOL/EOL.yaml 2011-06-03 22:32:12 UTC
(rev 89449)
@@ -16,13 +16,10 @@
zh-hant: zh-TW
CHECKER:
- class: EOLMessageChecker
+ class: MessageChecker
checks:
- - EOLVariablesCheck
+ - rubyVariableCheck
- AUTOLOAD:
- EOLMessageChecker: Checker.php
-
---
BASIC:
id: out-eol-0-all
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs