r71362 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71361‎ | r71362 | r71363 >
Date:15:14, 20 August 2010
Author:siebrand
Status:deferred
Tags:
Comment:
More doxygen pleasing. How do you like our documentation now? http://translatewiki.net/docs/Translate/html/
Modified paths:
  • /trunk/extensions/Translate/TranslateUtils.php (modified) (history)
  • /trunk/extensions/Translate/ffs/Wiki.php (modified) (history)
  • /trunk/extensions/Translate/groups/ComplexMessages.php (modified) (history)
  • /trunk/extensions/Translate/groups/MediaWiki/Checker.php (modified) (history)
  • /trunk/extensions/Translate/scripts/autoexport.php (modified) (history)
  • /trunk/extensions/Translate/scripts/poimport.php (modified) (history)
  • /trunk/extensions/Translate/scripts/sync-group.php (modified) (history)
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)
  • /trunk/extensions/Translate/tag/TranslatablePage.php (modified) (history)
  • /trunk/extensions/Translate/utils/TranslationStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/sync-group.php
@@ -190,7 +190,7 @@
191191 continue;
192192 }
193193
194 - // FIXME: temporary exception. Should be fixed elsewhere more generically
 194+ // @todo Temporary exception. Should be fixed elsewhere more generically.
195195 if ( $translation == '{{PLURAL:GETTEXT|}}' ) {
196196 return;
197197 }
Index: trunk/extensions/Translate/scripts/poimport.php
@@ -181,9 +181,10 @@
182182 private $group = null;
183183
184184 /**
185 - * @param $changes Array of key/langcode => translation.
186 - * @param $user User who makes the edits in wiki.
187 - * @param $dryrun Don't do anything that affects the database.
 185+ * @param $changes \array Array of key/langcode => translation.
 186+ * @param $groupId \string Group ID.
 187+ * @param $user \string User who makes the edits in wiki.
 188+ * @param $dryrun \bool Do not do anything that affects the database.
188189 */
189190 public function __construct( $changes, $groupId, $user, $dryrun = true ) {
190191 $this->changes = $changes;
Index: trunk/extensions/Translate/scripts/autoexport.php
@@ -85,7 +85,7 @@
8686 $group = false;
8787 $code = false;
8888
89 - // TODO: fixme
 89+ // @todo Fixme
9090 list( $pieces, ) = explode( '/', $wgContLang->lcfirst( $row->rc_title ), 2 );
9191
9292 $mg = TranslateUtils::messageKeyToGroup( $row->rc_namespace, $pieces );
Index: trunk/extensions/Translate/tag/TranslatablePage.php
@@ -379,7 +379,7 @@
380380 /**
381381 * Removes all page translation feature data from the database.
382382 * Does not remove translated sections or translation pages.
383 - * FIXME: Change name to something better.
 383+ * @todo Change name to something better.
384384 */
385385 public function removeTags() {
386386 $dbw = wfGetDB( DB_MASTER );
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -141,8 +141,10 @@
142142 $article->doPurge();
143143 }
144144
 145+ /**
 146+ * @todo NOOP now.
 147+ */
145148 public static function addSidebar( $out, $tpl ) {
146 - // TODO: fixme
147149 /*
148150 global $wgLang;
149151
@@ -152,7 +154,7 @@
153155 foreach ( $status as $code => $percent ) {
154156 $name = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() );
155157 $percent = $wgLang->formatNum( round( 100 * $percent ) );
156 - $label = "$name ($percent%)"; // FIXME: i18n
 158+ $label = "$name ($percent%)"; // @todo i18n missing.
157159
158160 $_title = TranslateTagUtils::codefyTitle( $title, $code );
159161
@@ -221,8 +223,8 @@
222224
223225 $percent = Xml::element( 'img', array(
224226 'src' => TranslateUtils::assetPath( "images/prog-$image.png" ),
225 - 'alt' => "$percent%", // FIXME: i18n
226 - 'title' => "$percent%", // FIXME: i18n
 227+ 'alt' => "$percent%", // @todo i18n missing.
 228+ 'title' => "$percent%", // @todo i18n missing.
227229 'width' => '9',
228230 'height' => '9',
229231 ) );
Index: trunk/extensions/Translate/groups/ComplexMessages.php
@@ -458,7 +458,7 @@
459459
460460 // Remove duplicated entries, causes problems with magic words
461461 // Just to be sure, it should not be possible to save invalid data anymore
462 - $val = array_unique( $val /*FIXME:SORT_REGULAR*/ );
 462+ $val = array_unique( $val /* @todo SORT_REGULAR */ );
463463
464464 // So do empty elements...
465465 foreach ( $val as $k => $v ) {
Index: trunk/extensions/Translate/groups/MediaWiki/Checker.php
@@ -13,7 +13,7 @@
1414 * uses and vice versa.
1515 */
1616 protected function wikiParameterCheck( $messages, $code, &$warnings ) {
17 - // FIXME: gives false positive on (some?) languages for which a
 17+ // @todo Gives false positive on (some?) languages for which a
1818 // parameter is completely left out. Example:
1919 // http://translatewiki.net/w/i.php?title=MediaWiki:Configure-ext-ext-dependencies/zh-hant&action=edit
2020 foreach ( $messages as $message ) {
@@ -220,7 +220,7 @@
221221 $warnings[$key][] = array(
222222 array( 'miscmw', $subcheck, $key, $code ),
223223 'translate-checks-format',
224 - "Parameter count is $traCount; should be $defCount", // FIXME: missing i18n.
 224+ "Parameter count is $traCount; should be $defCount", // @todo Missing i18n.
225225 );
226226 continue;
227227 }
@@ -234,7 +234,7 @@
235235 $warnings[$key][] = array(
236236 array( 'miscmw', $subcheck, $key, $code ),
237237 'translate-checks-format',
238 - "<nowiki>$traArray[$i]</nowiki> is malformed", // FIXME: missing i18n.
 238+ "<nowiki>$traArray[$i]</nowiki> is malformed", // @todo Missing i18n.
239239 );
240240 continue;
241241 }
Index: trunk/extensions/Translate/utils/TranslationStats.php
@@ -15,16 +15,16 @@
1616 * Returns translated percentage for message group in given
1717 * languages
1818 *
19 - * @param $group String: Unique key identifying the group
20 - * @param $languages Array: array of language codes
21 - * @param $threshold Int: Minimum required percentage translated to
 19+ * @todo Add ability to return localised fuzzy percentage.
 20+ * @param $group \string Unique key identifying the group
 21+ * @param $languages \array List of language codes
 22+ * @param $threshold \int Minimum required percentage translated to
2223 * return. Other given language codes will not be returned.
23 - * @param $simple Bool: Return only codes or code/pecentage pairs
 24+ * @param $simple \bool Return only codes or code/pecentage pairs
2425 *
25 - * @return Array: array of key value pairs code (string)/percentage
 26+ * @return \array Array of key value pairs code (string)/percentage
2627 * (float) or array of codes, depending on $simple
2728 */
28 - // FIXME: add ability to return fuzzy percentage.
2929 public static function getPercentageTranslated( $group, $languages, $threshold = false, $simple = false ) {
3030 $stats = array();
3131
Index: trunk/extensions/Translate/TranslateUtils.php
@@ -269,7 +269,7 @@
270270 /**
271271 * Escapes the message, and does some mangling to whitespace, so that it is
272272 * preserved when outputted as-is to html page. Line feeds are converted to
273 - * <br /> and occurances of leading and trailing and multiple consecutive
 273+ * \<br /> and occurances of leading and trailing and multiple consecutive
274274 * spaces to non-breaking spaces.
275275 *
276276 * @param $msg Plain text string.
Index: trunk/extensions/Translate/ffs/Wiki.php
@@ -15,8 +15,7 @@
1616 /**
1717 * Reads all \@author tags from the file and returns array of authors.
1818 *
19 - * @param $filename From which file to get the authors.
20 - * @return Array of authors.
 19+ * @return \array List of authors.
2120 */
2221 public function parseAuthors() {
2322 if ( $this->filename === false ) {
@@ -36,7 +35,7 @@
3736
3837 $contents = file_get_contents( $this->filename );
3938
40 - /** FIXME: handle the case where the first comment is missing */
 39+ // @todo Handle the case where the first comment is missing */
4140 // $dollarstart = strpos( $contents, '$' );
4241
4342 $start = strpos( $contents, '*/' );
@@ -149,7 +148,8 @@
150149 * Preprocesses MessageArray to suitable format and filters things that should
151150 * not be exported.
152151 *
153 - * @param $array Reference of MessageArray.
 152+ * @param $messages MessageCollection Reference of MessageArray.
 153+ * @return Array of key-translation pairs.
154154 */
155155 public function makeExportArray( MessageCollection $messages ) {
156156 // We copy only relevant translations to this new array

Status & tagging log