Index: trunk/extensions/Translate/groups/FreeCol/setup.php |
— | — | @@ -1,6 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Support FreeCol: http://www.freecol.org/. |
| 4 | + * Support for FreeCol |
| 5 | + * http://www.freecol.org |
5 | 6 | * |
6 | 7 | * @file |
7 | 8 | * @ingroup Extensions |
— | — | @@ -12,4 +13,8 @@ |
13 | 14 | |
14 | 15 | |
15 | 16 | $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 @@ |
2 | 2 | <?php |
3 | | - /** |
| 3 | +/** |
| 4 | + * Implements MessageChecker for FreeCol. |
| 5 | + * |
4 | 6 | * @file |
| 7 | + * @author Niklas Laxström |
5 | 8 | * @copyright Copyright © 2009, Niklas Laxström |
6 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
7 | 10 | */ |
| 11 | + |
| 12 | +/** |
| 13 | + * Message checks for FreeCol |
| 14 | + * |
| 15 | + * @ingroup MessageCheckers |
| 16 | + */ |
8 | 17 | class FreeColMessageChecker extends MessageChecker { |
9 | | - |
10 | 18 | /** |
11 | 19 | * Checks for missing and unknown variables in translations. |
12 | 20 | * |
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. |
16 | 24 | */ |
17 | 25 | protected function FreeColVariablesCheck( $messages, $code, &$warnings ) { |
18 | 26 | foreach ( $messages as $message ) { |
— | — | @@ -52,9 +60,9 @@ |
53 | 61 | /** |
54 | 62 | * Checks for bad escapes in translations. |
55 | 63 | * |
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. |
59 | 67 | */ |
60 | 68 | protected function FreeColEscapesCheck( $messages, $code, &$warnings ) { |
61 | 69 | foreach ( $messages as $message ) { |
— | — | @@ -77,5 +85,4 @@ |
78 | 86 | } |
79 | 87 | } |
80 | 88 | } |
81 | | - |
82 | | -} |
\ No newline at end of file |
| 89 | +} |
Index: trunk/extensions/Translate/groups/Shapado/Checker.php |
— | — | @@ -1,17 +1,25 @@ |
2 | 2 | <?php |
3 | | - /** |
| 3 | +/** |
| 4 | + * Implements MessageChecker for Shapado. |
| 5 | + * |
4 | 6 | * @file |
| 7 | + * @author Niklas Laxström |
5 | 8 | * @copyright Copyright © 2009-2010, Niklas Laxström |
6 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
7 | 10 | */ |
| 11 | + |
| 12 | +/** |
| 13 | + * Message checks for Shapado |
| 14 | + * |
| 15 | + * @ingroup MessageCheckers |
| 16 | + */ |
8 | 17 | class ShapadoMessageChecker extends MessageChecker { |
9 | | - |
10 | 18 | /** |
11 | 19 | * Checks for missing and unknown variables in translations. |
12 | 20 | * |
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. |
16 | 24 | */ |
17 | 25 | protected function ShapadoVariablesCheck( $messages, $code, &$warnings ) { |
18 | 26 | foreach ( $messages as $message ) { |
— | — | @@ -48,4 +56,4 @@ |
49 | 57 | } |
50 | 58 | } |
51 | 59 | } |
52 | | -} |
\ No newline at end of file |
| 60 | +} |
Index: trunk/extensions/Translate/groups/OpenStreetMap/Checker.php |
— | — | @@ -1,17 +1,26 @@ |
2 | 2 | <?php |
3 | | - /** |
| 3 | +/** |
| 4 | + * Implements MessageChecker for Ruby style messages. |
| 5 | + * |
4 | 6 | * @file |
| 7 | + * @author Niklas Laxström |
5 | 8 | * @copyright Copyright © 2009, Niklas Laxström |
6 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
7 | 10 | */ |
| 11 | + |
| 12 | +/** |
| 13 | + * Message checks for Ruby style messages. |
| 14 | + * |
| 15 | + * @ingroup MessageCheckers |
| 16 | + */ |
8 | 17 | class RubyMessageChecker extends MessageChecker { |
9 | 18 | |
10 | 19 | /** |
11 | 20 | * Checks for missing and unknown variables in translations. |
12 | 21 | * |
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. |
16 | 25 | */ |
17 | 26 | protected function RubyVariablesCheck( $messages, $code, &$warnings ) { |
18 | 27 | foreach ( $messages as $message ) { |
Index: trunk/extensions/Translate/groups/FUDforum/Checker.php |
— | — | @@ -1,17 +1,25 @@ |
2 | 2 | <?php |
3 | | - /** |
| 3 | +/** |
| 4 | + * Implements MessageChecker for FUDforum. |
| 5 | + * |
4 | 6 | * @file |
| 7 | + * @author Niklas Laxström |
5 | 8 | * @copyright Copyright © 2009, Niklas Laxström |
6 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
7 | 10 | */ |
| 11 | + |
| 12 | +/** |
| 13 | + * Message checks for FUDforum |
| 14 | + * |
| 15 | + * @ingroup MessageCheckers |
| 16 | + */ |
8 | 17 | class FUDforumMessageChecker extends MessageChecker { |
9 | | - |
10 | 18 | /** |
11 | 19 | * Checks for missing and unknown variables in translations. |
12 | 20 | * |
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. |
16 | 24 | */ |
17 | 25 | protected function FUDforumVariablesCheck( $messages, $code, &$warnings ) { |
18 | 26 | foreach ( $messages as $message ) { |
— | — | @@ -49,6 +57,13 @@ |
50 | 58 | } |
51 | 59 | } |
52 | 60 | |
| 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 | + */ |
53 | 68 | protected function FUDforumSyntaxCheck( $messages, $code, &$warnings ) { |
54 | 69 | foreach ( $messages as $message ) { |
55 | 70 | $key = $message->key(); |
— | — | @@ -65,5 +80,4 @@ |
66 | 81 | } |
67 | 82 | } |
68 | 83 | } |
69 | | - |
70 | | -} |
\ No newline at end of file |
| 84 | +} |
Index: trunk/extensions/Translate/groups/Okawix/Okawix-dtd.php |
— | — | @@ -1,9 +1,20 @@ |
2 | 2 | <?php |
3 | 3 | /** |
| 4 | + * Implements FFS for Okawix DTD file format. |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @author Guillaume Duhamel |
| 8 | + * @author Niklas Laxström |
| 9 | + * @author Siebrand Mazeland |
4 | 10 | * @copyright Copyright © 2009, Guillaume Duhamel |
5 | 11 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
6 | 12 | */ |
7 | 13 | |
| 14 | +/** |
| 15 | + * File format support for Okawix DTD. |
| 16 | + * |
| 17 | + * @ingroup FFS |
| 18 | + */ |
8 | 19 | class OkawixDtdFFS extends SimpleFFS { |
9 | 20 | public function readFromVariable( $data ) { |
10 | 21 | preg_match_all( ',AUTHOR: ([^\n]+)\n,', $data, $matches ); |
— | — | @@ -51,7 +62,9 @@ |
52 | 63 | $trans = $m->translation(); |
53 | 64 | $trans = str_replace( TRANSLATE_FUZZY, '', $trans ); |
54 | 65 | |
55 | | - if ( $trans === '' ) continue; |
| 66 | + if ( $trans === '' ) { |
| 67 | + continue; |
| 68 | + } |
56 | 69 | |
57 | 70 | $trans = str_replace( '"', '"', $trans ); |
58 | 71 | $output .= "<!ENTITY $key \"$trans\">\n"; |
Index: trunk/extensions/Translate/groups/MediaWiki/Checker.php |
— | — | @@ -1,16 +1,26 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | | - * MediaWiki specific message checks. |
6 | | - * @ingroup MessageCheckers |
| 4 | + * Implements MessageChecker for MediaWiki. |
| 5 | + * |
| 6 | + * @file |
7 | 7 | * @author Niklas Laxström |
8 | 8 | * @copyright Copyright © 2008-2009, Niklas Laxström |
9 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
10 | 10 | */ |
| 11 | + |
| 12 | +/** |
| 13 | + * MediaWiki specific message checks. |
| 14 | + * |
| 15 | + * @ingroup MessageCheckers |
| 16 | + */ |
11 | 17 | class MediaWikiMessageChecker extends MessageChecker { |
12 | 18 | /** |
13 | 19 | * Checks if the translation uses all variables $[1-9] that the definition |
14 | 20 | * 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. |
15 | 25 | */ |
16 | 26 | protected function wikiParameterCheck( $messages, $code, &$warnings ) { |
17 | 27 | // @todo Gives false positive on (some?) languages for which a |
— | — | @@ -56,6 +66,10 @@ |
57 | 67 | * those that link to Special: or {{ns:special}}: or project pages trough |
58 | 68 | * MediaWiki messages like {{MediaWiki:helppage-url}}:. Also links in the |
59 | 69 | * 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. |
60 | 74 | */ |
61 | 75 | protected function wikiLinksCheck( $messages, $code, &$warnings ) { |
62 | 76 | $tc = Title::legalChars() . '#%{}'; |
— | — | @@ -113,6 +127,10 @@ |
114 | 128 | |
115 | 129 | /** |
116 | 130 | * 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. |
117 | 135 | */ |
118 | 136 | protected function XhtmlCheck( $messages, $code, &$warnings ) { |
119 | 137 | foreach ( $messages as $message ) { |
— | — | @@ -154,6 +172,10 @@ |
155 | 173 | |
156 | 174 | /** |
157 | 175 | * 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. |
158 | 180 | */ |
159 | 181 | protected function pluralCheck( $messages, $code, &$warnings ) { |
160 | 182 | foreach ( $messages as $message ) { |
— | — | @@ -176,6 +198,10 @@ |
177 | 199 | |
178 | 200 | /** |
179 | 201 | * 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. |
180 | 206 | */ |
181 | 207 | protected function pagenameMessagesCheck( $messages, $code, &$warnings ) { |
182 | 208 | foreach ( $messages as $message ) { |
— | — | @@ -199,6 +225,10 @@ |
200 | 226 | |
201 | 227 | /** |
202 | 228 | * 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. |
203 | 233 | */ |
204 | 234 | protected function miscMWChecks( $messages, $code, &$warnings ) { |
205 | 235 | $timeList = array( 'protect-expiry-options', 'ipboptions' ); |
Index: trunk/extensions/Translate/groups/Wikia/WikiaExtensions.php |
— | — | @@ -1,5 +1,16 @@ |
2 | 2 | <?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 | + */ |
3 | 11 | |
| 12 | +/** |
| 13 | + * @todo Needs documentation. |
| 14 | + */ |
4 | 15 | class PremadeWikiaExtensionGroups extends PremadeMediawikiExtensionGroups { |
5 | 16 | protected $useConfigure = false; |
6 | 17 | protected $idPrefix = 'wikia-'; |
— | — | @@ -28,6 +39,12 @@ |
29 | 40 | } |
30 | 41 | } |
31 | 42 | |
| 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 | + */ |
32 | 49 | class AllWikiaExtensionsGroup extends AllMediawikiExtensionsGroup { |
33 | 50 | protected $description = '{{int:translate-group-desc-wikiaextensions}}'; |
34 | 51 | protected $label = 'Extensions used by Wikia'; // currently using 1.14.0 |
Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php |
— | — | @@ -233,7 +233,7 @@ |
234 | 234 | } |
235 | 235 | |
236 | 236 | /** |
237 | | - * Adds a message group containing all supported MediaWiki extensions in the |
| 237 | + * Adds a message group containing all supported MediaWiki extensions in the |
238 | 238 | * Wikimedia Subversion repository. |
239 | 239 | * |
240 | 240 | * @todo Needs documentation. |