r71392 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71391‎ | r71392 | r71393 >
Date:09:24, 21 August 2010
Author:siebrand
Status:deferred (Comments)
Tags:
Comment:
Modified paths:
  • /trunk/extensions/Translate/groups/FUDforum/Checker.php (modified) (history)
  • /trunk/extensions/Translate/groups/FreeCol/Checker.php (modified) (history)
  • /trunk/extensions/Translate/groups/FreeCol/setup.php (modified) (history)
  • /trunk/extensions/Translate/groups/MediaWiki/Checker.php (modified) (history)
  • /trunk/extensions/Translate/groups/MediaWikiExtensions.php (modified) (history)
  • /trunk/extensions/Translate/groups/Okawix/Okawix-dtd.php (modified) (history)
  • /trunk/extensions/Translate/groups/OpenStreetMap/Checker.php (modified) (history)
  • /trunk/extensions/Translate/groups/Shapado/Checker.php (modified) (history)
  • /trunk/extensions/Translate/groups/Wikia/WikiaExtensions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/groups/FreeCol/setup.php
@@ -1,6 +1,7 @@
22 <?php
33 /**
4 - * Support FreeCol: http://www.freecol.org/.
 4+ * Support for FreeCol
 5+ * http://www.freecol.org
56 *
67 * @file
78 * @ingroup Extensions
@@ -12,4 +13,8 @@
1314
1415
1516 $dir = dirname( __FILE__ );
16 -$wgAutoloadClasses['FreeColMessageChecker'] = dirname( __FILE__ ) . '/Checker.php';
\ No newline at end of file
 17+
 18+/**
 19+ * Add the FreeColMessageChecker class to the autoloader.
 20+ */
 21+$wgAutoloadClasses['FreeColMessageChecker'] = dirname( __FILE__ ) . '/Checker.php';
Index: trunk/extensions/Translate/groups/FreeCol/Checker.php
@@ -1,17 +1,25 @@
22 <?php
3 - /**
 3+/**
 4+ * Implements MessageChecker for FreeCol.
 5+ *
46 * @file
 7+ * @author Niklas Laxström
58 * @copyright Copyright © 2009, Niklas Laxström
69 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
710 */
 11+
 12+/**
 13+ * Message checks for FreeCol
 14+ *
 15+ * @ingroup MessageCheckers
 16+ */
817 class FreeColMessageChecker extends MessageChecker {
9 -
1018 /**
1119 * Checks for missing and unknown variables in translations.
1220 *
13 - * @param $messages Iterable list of TMessages.
14 - * @param $code Language code of the translations.
15 - * @param $warnings Array where warnings are appended to.
 21+ * @param $messages \array Iterable list of TMessages.
 22+ * @param $code \string Language code of the translations.
 23+ * @param $warnings \array Array where warnings are appended to.
1624 */
1725 protected function FreeColVariablesCheck( $messages, $code, &$warnings ) {
1826 foreach ( $messages as $message ) {
@@ -52,9 +60,9 @@
5361 /**
5462 * Checks for bad escapes in translations.
5563 *
56 - * @param $messages Iterable list of TMessages.
57 - * @param $code Language code of the translations.
58 - * @param $warnings Array where warnings are appended to.
 64+ * @param $messages \array Iterable list of TMessages.
 65+ * @param $code \string Language code of the translations.
 66+ * @param $warnings \array Array where warnings are appended to.
5967 */
6068 protected function FreeColEscapesCheck( $messages, $code, &$warnings ) {
6169 foreach ( $messages as $message ) {
@@ -77,5 +85,4 @@
7886 }
7987 }
8088 }
81 -
82 -}
\ No newline at end of file
 89+}
Index: trunk/extensions/Translate/groups/Shapado/Checker.php
@@ -1,17 +1,25 @@
22 <?php
3 - /**
 3+/**
 4+ * Implements MessageChecker for Shapado.
 5+ *
46 * @file
 7+ * @author Niklas Laxström
58 * @copyright Copyright © 2009-2010, Niklas Laxström
69 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
710 */
 11+
 12+/**
 13+ * Message checks for Shapado
 14+ *
 15+ * @ingroup MessageCheckers
 16+ */
817 class ShapadoMessageChecker extends MessageChecker {
9 -
1018 /**
1119 * Checks for missing and unknown variables in translations.
1220 *
13 - * @param $messages Iterable list of TMessages.
14 - * @param $code Language code of the translations.
15 - * @param $warnings Array where warnings are appended to.
 21+ * @param $messages \array Iterable list of TMessages.
 22+ * @param $code \string Language code of the translations.
 23+ * @param $warnings \array Array where warnings are appended to.
1624 */
1725 protected function ShapadoVariablesCheck( $messages, $code, &$warnings ) {
1826 foreach ( $messages as $message ) {
@@ -48,4 +56,4 @@
4957 }
5058 }
5159 }
52 -}
\ No newline at end of file
 60+}
Index: trunk/extensions/Translate/groups/OpenStreetMap/Checker.php
@@ -1,17 +1,26 @@
22 <?php
3 - /**
 3+/**
 4+ * Implements MessageChecker for Ruby style messages.
 5+ *
46 * @file
 7+ * @author Niklas Laxström
58 * @copyright Copyright © 2009, Niklas Laxström
69 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
710 */
 11+
 12+/**
 13+ * Message checks for Ruby style messages.
 14+ *
 15+ * @ingroup MessageCheckers
 16+ */
817 class RubyMessageChecker extends MessageChecker {
918
1019 /**
1120 * Checks for missing and unknown variables in translations.
1221 *
13 - * @param $messages Iterable list of TMessages.
14 - * @param $code Language code of the translations.
15 - * @param $warnings Array where warnings are appended to.
 22+ * @param $messages \array Iterable list of TMessages.
 23+ * @param $code \string Language code of the translations.
 24+ * @param $warnings \array Array where warnings are appended to.
1625 */
1726 protected function RubyVariablesCheck( $messages, $code, &$warnings ) {
1827 foreach ( $messages as $message ) {
Index: trunk/extensions/Translate/groups/FUDforum/Checker.php
@@ -1,17 +1,25 @@
22 <?php
3 - /**
 3+/**
 4+ * Implements MessageChecker for FUDforum.
 5+ *
46 * @file
 7+ * @author Niklas Laxström
58 * @copyright Copyright © 2009, Niklas Laxström
69 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
710 */
 11+
 12+/**
 13+ * Message checks for FUDforum
 14+ *
 15+ * @ingroup MessageCheckers
 16+ */
817 class FUDforumMessageChecker extends MessageChecker {
9 -
1018 /**
1119 * Checks for missing and unknown variables in translations.
1220 *
13 - * @param $messages Iterable list of TMessages.
14 - * @param $code Language code of the translations.
15 - * @param $warnings Array where warnings are appended to.
 21+ * @param $messages \array Iterable list of TMessages.
 22+ * @param $code \string Language code of the translations.
 23+ * @param $warnings \array Array where warnings are appended to.
1624 */
1725 protected function FUDforumVariablesCheck( $messages, $code, &$warnings ) {
1826 foreach ( $messages as $message ) {
@@ -49,6 +57,13 @@
5058 }
5159 }
5260
 61+ /**
 62+ * Checks for incorrect syntax in translations.
 63+ *
 64+ * @param $messages \array Iterable list of TMessages.
 65+ * @param $code \string Language code of the translations.
 66+ * @param $warnings \array Array where warnings are appended to.
 67+ */
5368 protected function FUDforumSyntaxCheck( $messages, $code, &$warnings ) {
5469 foreach ( $messages as $message ) {
5570 $key = $message->key();
@@ -65,5 +80,4 @@
6681 }
6782 }
6883 }
69 -
70 -}
\ No newline at end of file
 84+}
Index: trunk/extensions/Translate/groups/Okawix/Okawix-dtd.php
@@ -1,9 +1,20 @@
22 <?php
33 /**
 4+ * Implements FFS for Okawix DTD file format.
 5+ *
 6+ * @file
 7+ * @author Guillaume Duhamel
 8+ * @author Niklas Laxström
 9+ * @author Siebrand Mazeland
410 * @copyright Copyright © 2009, Guillaume Duhamel
511 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
612 */
713
 14+/**
 15+ * File format support for Okawix DTD.
 16+ *
 17+ * @ingroup FFS
 18+ */
819 class OkawixDtdFFS extends SimpleFFS {
920 public function readFromVariable( $data ) {
1021 preg_match_all( ',AUTHOR: ([^\n]+)\n,', $data, $matches );
@@ -51,7 +62,9 @@
5263 $trans = $m->translation();
5364 $trans = str_replace( TRANSLATE_FUZZY, '', $trans );
5465
55 - if ( $trans === '' ) continue;
 66+ if ( $trans === '' ) {
 67+ continue;
 68+ }
5669
5770 $trans = str_replace( '"', '&quot;', $trans );
5871 $output .= "<!ENTITY $key \"$trans\">\n";
Index: trunk/extensions/Translate/groups/MediaWiki/Checker.php
@@ -1,16 +1,26 @@
22 <?php
3 -
43 /**
5 - * MediaWiki specific message checks.
6 - * @ingroup MessageCheckers
 4+ * Implements MessageChecker for MediaWiki.
 5+ *
 6+ * @file
77 * @author Niklas Laxström
88 * @copyright Copyright © 2008-2009, Niklas Laxström
99 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1010 */
 11+
 12+/**
 13+ * MediaWiki specific message checks.
 14+ *
 15+ * @ingroup MessageCheckers
 16+ */
1117 class MediaWikiMessageChecker extends MessageChecker {
1218 /**
1319 * Checks if the translation uses all variables $[1-9] that the definition
1420 * uses and vice versa.
 21+ *
 22+ * @param $messages \array Iterable list of TMessages.
 23+ * @param $code \string Language code of the translations.
 24+ * @param $warnings \array Array where warnings are appended to.
1525 */
1626 protected function wikiParameterCheck( $messages, $code, &$warnings ) {
1727 // @todo Gives false positive on (some?) languages for which a
@@ -56,6 +66,10 @@
5767 * those that link to Special: or {{ns:special}}: or project pages trough
5868 * MediaWiki messages like {{MediaWiki:helppage-url}}:. Also links in the
5969 * definition are allowed.
 70+ *
 71+ * @param $messages \array Iterable list of TMessages.
 72+ * @param $code \string Language code of the translations.
 73+ * @param $warnings \array Array where warnings are appended to.
6074 */
6175 protected function wikiLinksCheck( $messages, $code, &$warnings ) {
6276 $tc = Title::legalChars() . '#%{}';
@@ -113,6 +127,10 @@
114128
115129 /**
116130 * Checks if the \<br /> and \<hr /> tags are using the correct syntax.
 131+ *
 132+ * @param $messages \array Iterable list of TMessages.
 133+ * @param $code \string Language code of the translations.
 134+ * @param $warnings \array Array where warnings are appended to.
117135 */
118136 protected function XhtmlCheck( $messages, $code, &$warnings ) {
119137 foreach ( $messages as $message ) {
@@ -154,6 +172,10 @@
155173
156174 /**
157175 * Checks if the translation doesn't use plural while the definition has one.
 176+ *
 177+ * @param $messages \array Iterable list of TMessages.
 178+ * @param $code \string Language code of the translations.
 179+ * @param $warnings \array Array where warnings are appended to.
158180 */
159181 protected function pluralCheck( $messages, $code, &$warnings ) {
160182 foreach ( $messages as $message ) {
@@ -176,6 +198,10 @@
177199
178200 /**
179201 * Checks for page names that they have an untranslated namespace.
 202+ *
 203+ * @param $messages \array Iterable list of TMessages.
 204+ * @param $code \string Language code of the translations.
 205+ * @param $warnings \array Array where warnings are appended to.
180206 */
181207 protected function pagenameMessagesCheck( $messages, $code, &$warnings ) {
182208 foreach ( $messages as $message ) {
@@ -199,6 +225,10 @@
200226
201227 /**
202228 * Checks for some miscellaneous messages with special syntax.
 229+ *
 230+ * @param $messages \array Iterable list of TMessages.
 231+ * @param $code \string Language code of the translations.
 232+ * @param $warnings \array Array where warnings are appended to.
203233 */
204234 protected function miscMWChecks( $messages, $code, &$warnings ) {
205235 $timeList = array( 'protect-expiry-options', 'ipboptions' );
Index: trunk/extensions/Translate/groups/Wikia/WikiaExtensions.php
@@ -1,5 +1,16 @@
22 <?php
 3+/**
 4+ * Classes for Wikia extension translation.
 5+ *
 6+ * @file
 7+ * @author Niklas Laxstr�m
 8+ * @copyright Copyright � 2008-2010, Niklas Laxstr�m
 9+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 10+ */
311
 12+/**
 13+ * @todo Needs documentation.
 14+ */
415 class PremadeWikiaExtensionGroups extends PremadeMediawikiExtensionGroups {
516 protected $useConfigure = false;
617 protected $idPrefix = 'wikia-';
@@ -28,6 +39,12 @@
2940 }
3041 }
3142
 43+/**
 44+ * Adds a message group containing all supported Wikia extensions in the
 45+ * Wikia Subversion repository and the Wikimedia Subversion.
 46+ *
 47+ * @todo Needs documentation.
 48+ */
3249 class AllWikiaExtensionsGroup extends AllMediawikiExtensionsGroup {
3350 protected $description = '{{int:translate-group-desc-wikiaextensions}}';
3451 protected $label = 'Extensions used by Wikia'; // currently using 1.14.0
Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php
@@ -233,7 +233,7 @@
234234 }
235235
236236 /**
237 - * Adds a message group containing all supported MediaWiki extensions in the
 237+ * Adds a message group containing all supported MediaWiki extensions in the
238238 * Wikimedia Subversion repository.
239239 *
240240 * @todo Needs documentation.

Follow-up revisions

RevisionCommit summaryAuthorDate
r71404Fix encoding per CR for r71392.siebrand14:54, 21 August 2010

Comments

#Comment by Reedy (talk | contribs)   14:17, 21 August 2010

No commit summary? ;)

#Comment by Siebrand (talk | contribs)   14:55, 21 August 2010

Oops. Summary: "Documentation update.".

#Comment by MZMcBride (talk | contribs)   14:33, 21 August 2010

/trunk/extensions/Translate/groups/Wikia/WikiaExtensions.php isn't using UTF-8, as far as I can see.

#Comment by Siebrand (talk | contribs)   14:55, 21 August 2010

Fixed in r71404. Thanks.

Status & tagging log