r80509 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80508‎ | r80509 | r80510 >
Date:19:19, 18 January 2011
Author:roberthl
Status:deferred
Tags:
Comment:
Translate: Add message check for missing and unknown python string interpolation operators, enabled for Pywikipedia group.
Modified paths:
  • /trunk/extensions/Translate/MessageChecks.php (modified) (history)
  • /trunk/extensions/Translate/groups/Pywikipedia/Pywikipedia.yaml (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/groups/Pywikipedia/Pywikipedia.yaml
@@ -3,6 +3,11 @@
44 namespace: NS_PYWIKIPEDIA
55 class: FileBasedMessageGroup
66 description: "{{int:translate-group-desc-pywikipedia}}"
 7+
 8+ CHECKER:
 9+ class: MessageChecker
 10+ checks:
 11+ - pythonInterpolationCheck
712 ---
813 BASIC:
914 id: out-pywikipedia-0-all
Index: trunk/extensions/Translate/MessageChecks.php
@@ -264,6 +264,17 @@
265265 }
266266
267267 /**
 268+ * Checks for missing and unknown python string interpolation operators in
 269+ * translations.
 270+ * @param $messages \mixed Iterable list of TMessage objects.
 271+ * @param $code \string Language code
 272+ * @param $warnings \array Array where warnings are appended to.
 273+ */
 274+ protected function pythonInterpolationCheck( $messages, $code, &$warnings ) {
 275+ return $this->parameterCheck( $messages, $code, $warnings, '/\%\([a-zA-Z0-9]*?\)[diouxXeEfFgGcrs]/U' );
 276+ }
 277+
 278+ /**
268279 * Checks if the translation has even number of opening and closing
269280 * parentheses. {, [ and ( are checked.
270281 * @param $messages \mixed Iterable list of TMessage objects.

Status & tagging log