r71437 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71436‎ | r71437 | r71438 >
Date:18:09, 22 August 2010
Author:siebrand
Status:deferred
Tags:
Comment:
Documentation update.
Modified paths:
  • /trunk/extensions/Translate/Doxyfile (modified) (history)
  • /trunk/extensions/Translate/FFS.php (modified) (history)
  • /trunk/extensions/Translate/MessageChecks.php (modified) (history)
  • /trunk/extensions/Translate/RcFilter.php (modified) (history)
  • /trunk/extensions/Translate/SpecialTranslationChanges.php (modified) (history)
  • /trunk/extensions/Translate/SpecialTranslationStats.php (modified) (history)
  • /trunk/extensions/Translate/SpecialTranslations.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/TranslatePage.php (modified) (history)
  • /trunk/extensions/Translate/ffs/Wiki.php (modified) (history)
  • /trunk/extensions/Translate/scripts/cli.inc (modified) (history)
  • /trunk/extensions/Translate/scripts/createCheckIndex.php (modified) (history)
  • /trunk/extensions/Translate/scripts/createMessageIndex.php (modified) (history)
  • /trunk/extensions/Translate/scripts/export.php (modified) (history)
  • /trunk/extensions/Translate/scripts/fuzzy.php (modified) (history)
  • /trunk/extensions/Translate/scripts/groupStatistics.php (modified) (history)
  • /trunk/extensions/Translate/scripts/languageeditstats.php (modified) (history)
  • /trunk/extensions/Translate/scripts/magic-export-2.php (modified) (history)
  • /trunk/extensions/Translate/scripts/magic-export.php (modified) (history)
  • /trunk/extensions/Translate/scripts/messageDust.php (modified) (history)
  • /trunk/extensions/Translate/scripts/mwcore-export.php (modified) (history)
  • /trunk/extensions/Translate/scripts/pagetranslation-check-database.php (modified) (history)
  • /trunk/extensions/Translate/scripts/pagetranslation-test-parser.php (modified) (history)
  • /trunk/extensions/Translate/scripts/poimport.php (modified) (history)
  • /trunk/extensions/Translate/scripts/sync-group.php (modified) (history)
  • /trunk/extensions/Translate/tag/MoveJob.php (modified) (history)
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)
  • /trunk/extensions/Translate/tag/RenderJob.php (modified) (history)
  • /trunk/extensions/Translate/tag/SpecialPageTranslation.php (modified) (history)
  • /trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php (modified) (history)
  • /trunk/extensions/Translate/tag/TPParse.php (modified) (history)
  • /trunk/extensions/Translate/tag/TPSection.php (modified) (history)
  • /trunk/extensions/Translate/tag/TranslatablePage.php (modified) (history)
  • /trunk/extensions/Translate/utils/Font.php (modified) (history)
  • /trunk/extensions/Translate/utils/HTMLJsSelectToInputField.php (modified) (history)
  • /trunk/extensions/Translate/utils/Html.php (modified) (history)
  • /trunk/extensions/Translate/utils/JsSelectToInput.php (modified) (history)
  • /trunk/extensions/Translate/utils/MemProfile.php (modified) (history)
  • /trunk/extensions/Translate/utils/MemoryCache.php (modified) (history)
  • /trunk/extensions/Translate/utils/MessageGroupCache.php (modified) (history)
  • /trunk/extensions/Translate/utils/MessageIndexRebuilder.php (modified) (history)
  • /trunk/extensions/Translate/utils/MessageTable.php (modified) (history)
  • /trunk/extensions/Translate/utils/MessageWebImporter.php (modified) (history)
  • /trunk/extensions/Translate/utils/ResourceLoader.php (modified) (history)
  • /trunk/extensions/Translate/utils/StringMatcher.php (modified) (history)
  • /trunk/extensions/Translate/utils/ToolBox.php (modified) (history)
  • /trunk/extensions/Translate/utils/TranslateYaml.php (modified) (history)
  • /trunk/extensions/Translate/utils/TranslationEditPage.php (modified) (history)
  • /trunk/extensions/Translate/utils/TranslationHelpers.php (modified) (history)
  • /trunk/extensions/Translate/utils/TranslationMemoryUpdater.php (modified) (history)
  • /trunk/extensions/Translate/utils/TranslationStats.php (modified) (history)
  • /trunk/extensions/Translate/utils/UserToggles.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/utils/TranslateYaml.php
@@ -1,4 +1,13 @@
22 <?php
 3+/**
 4+ * Contains wrapper class for interface to parse and generate YAML files.
 5+ *
 6+ * @file
 7+ * @author Ævar Arnfjörð Bjarmason
 8+ * @author Niklas Laxström
 9+ * @copyright Copyright © 2009, Niklas Laxström, Ævar Arnfjörð Bjarmason
 10+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 11+ */
312
413 /**
514 * This class is a wrapper class to provide interface to parse
@@ -152,4 +161,3 @@
153162 return $yaml;
154163 }
155164 }
156 -
Index: trunk/extensions/Translate/utils/TranslationHelpers.php
@@ -1,14 +1,19 @@
22 <?php
3 -
43 /**
5 - * Provides the nice boxes that aid the translators to do their job.
6 - * Boxes contain definition, documentation, other languages, translation memory
7 - * suggestions, highlighted changes etc.
 4+ * Contains helper class for interface parts that aid translations in doing
 5+ * their thing.
86 *
 7+ * @file
98 * @author Niklas Laxström
109 * @copyright Copyright © 2010 Niklas Laxström
1110 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1211 */
 12+
 13+/**
 14+ * Provides the nice boxes that aid the translators to do their job.
 15+ * Boxes contain definition, documentation, other languages, translation memory
 16+ * suggestions, highlighted changes etc.
 17+ */
1318 class TranslationHelpers {
1419 /**
1520 * Title of the message
Index: trunk/extensions/Translate/utils/MessageGroupCache.php
@@ -1,5 +1,15 @@
22 <?php
 3+/**
 4+ * @todo Needs documentation.
 5+ * @file
 6+ * @author Niklas Laxström
 7+ * @copyright Copyright © 2009 Niklas Laxström
 8+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 9+ */
310
 11+/**
 12+ * @todo Needs documentation.
 13+ */
414 class MessageGroupCache {
515 protected $group;
616 protected $cache;
Index: trunk/extensions/Translate/utils/ToolBox.php
@@ -1,5 +1,17 @@
22 <?php
 3+/**
 4+ * Classes for adding extension specific toolbox menu items.
 5+ *
 6+ * @file
 7+ * @author Siebrand Mazeland
 8+ * @author Niklas Laxström
 9+ * @copyright Copyright © 2008-2010, Siebrand Mazeland, Niklas Laxström
 10+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 11+ */
312
 13+/**
 14+ * Adds extension specific context aware toolbox menu items.
 15+ */
416 class TranslateToolbox {
517 /**
618 * Adds link in toolbox to Special:Prefixindex to show all other
Index: trunk/extensions/Translate/utils/HTMLJsSelectToInputField.php
@@ -1,5 +1,12 @@
22 <?php
 3+/**
 4+ * @todo Needs documentation.
 5+ * @file
 6+ */
37
 8+/**
 9+ * @todo Needs documentation.
 10+ */
411 class HTMLJsSelectToInputField extends HTMLTextField {
512 function getInputHTML( $value ) {
613 $input = parent::getInputHTML( $value );
Index: trunk/extensions/Translate/utils/MemoryCache.php
@@ -1,5 +1,16 @@
22 <?php
 3+/**
 4+ * @todo Needs documentation.
 5+ *
 6+ * @file
 7+ * @author Niklas Laxström
 8+ * @copyright Copyright © 2009, 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 ArrayMemoryCache {
516 protected $table;
617 protected $key;
Index: trunk/extensions/Translate/utils/MessageTable.php
@@ -1,12 +1,16 @@
22 <?php
33 /**
4 - * Pretty-formatter for message collections
 4+ * Contains classes to build tables for MessageCollection objects.
55 *
 6+ * @file
67 * @author Niklas Laxström
7 - * @copyright Copyright © 2007-2009 Niklas Laxström
 8+ * @copyright Copyright © 2007-2010 Niklas Laxström
89 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
910 */
1011
 12+/**
 13+ * Pretty formatter for MessageCollection objects.
 14+ */
1115 class MessageTable {
1216 protected $reviewMode = false;
1317 protected $collection = null;
Index: trunk/extensions/Translate/utils/JsSelectToInput.php
@@ -1,5 +1,15 @@
22 <?php
 3+/**
 4+ * @todo Needs documentation.
 5+ * @file
 6+ * @author Niklas Laxström
 7+ * @copyright Copyright © 2010 Niklas Laxström
 8+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 9+ */
310
 11+/**
 12+ * @todo Needs documentation.
 13+ */
414 class JsSelectToInput {
515 protected $targetId, $sourceId;
616 protected $select;
Index: trunk/extensions/Translate/utils/MemProfile.php
@@ -4,8 +4,6 @@
55 * Helper functions to locate when memory is consumed
66 *
77 * @file
8 - * @ingroup Extensions
9 - *
108 * @author Niklas Laxström
119 * @copyright Copyright © 2008, Niklas Laxström
1210 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
@@ -14,6 +12,9 @@
1513 $wgMemUse = array();
1614 $wgMemStack = 0;
1715
 16+/**
 17+ * @todo Needs documentation.
 18+ */
1819 function wfMemIn( $a ) {
1920 global $wgLang, $wgMemUse, $wgMemStack;
2021
@@ -30,6 +31,9 @@
3132 $wgMemStack++;
3233 }
3334
 35+/**
 36+ * @todo Needs documentation.
 37+ */
3438 function wfMemOut( $a ) {
3539 global $wgLang, $wgMemUse, $wgMemStack;
3640
Index: trunk/extensions/Translate/utils/TranslationEditPage.php
@@ -1,13 +1,17 @@
22 <?php
33 /**
4 - * This class together with some javascript implements the ajax translation
5 - * page.
 4+ * Contains classes doe the AJAX translation page.
65 *
 6+ * @file
77 * @author Niklas Laxström
88 * @copyright Copyright © 2009 Niklas Laxström
99 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1010 */
1111
 12+/**
 13+ * This class together with some JavaScript implements the AJAX translation
 14+ * page.
 15+ */
1216 class TranslationEditPage {
1317 // Instance of an Title object
1418 protected $title;
@@ -33,7 +37,6 @@
3438 return $obj;
3539 }
3640
37 -
3841 public function setTitle( Title $title ) { $this->title = $title; }
3942 public function getTitle() { return $this->title; }
4043
@@ -115,7 +118,7 @@
116119 /**
117120 * Gets the edit token and timestamps in some ugly array structure. Needs to
118121 * be cleaned up.
119 - * @return Array
 122+ * @return \array
120123 */
121124 protected function getEditInfo() {
122125 $params = new FauxRequest( array(
Index: trunk/extensions/Translate/utils/UserToggles.php
@@ -1,12 +1,27 @@
22 <?php
 3+/**
 4+ * Contains classes for addition of extension specific preference settings.
 5+ *
 6+ * @file
 7+ * @author Siebrand Mazeland
 8+ * @author Niklas Laxström
 9+ * @copyright Copyright © 2008-2010 Siebrand Mazeland, Niklas Laxström
 10+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 11+ */
312
 13+/**
 14+ * Class to add Translate specific preference settings.
 15+ */
416 class TranslatePreferences {
517 /**
6 - * Add preferences for Translate
 18+ * Add 'translate-pref-nonewsletter' preference.
 19+ *
 20+ * @return \bool true
721 */
822 public static function onGetPreferences( $user, &$preferences ) {
923 global $wgEnableEmail, $wgUser, $wgEnotifRevealEditorAddress;
1024
 25+ // Only show is e-mail is enabled and user has a confirmed e-mail address.
1126 if ( $wgEnableEmail && $wgUser->isEmailConfirmed() ) {
1227 // 'translate-pref-nonewsletter' is used as opt-out for
1328 // users with a confirmed e-mail address
@@ -26,10 +41,17 @@
2742 return true;
2843 }
2944
 45+ /**
 46+ * Add 'translate-editlangs' preference.
 47+ *
 48+ * @return \bool true
 49+ */
3050 public static function translationAssistLanguages( $user, &$preferences ) {
 51+ // Get selector.
3152 $select = self::languageSelector();
 53+ // Set target ID.
3254 $select->setTargetId( 'mw-input-translate-editlangs' );
33 -
 55+ // Get available languages.
3456 $languages = Language::getLanguageNames( false );
3557
3658 $preferences['translate-editlangs'] = array(
@@ -44,6 +66,11 @@
4567 return true;
4668 }
4769
 70+ /**
 71+ * Add 'translate-jsedit' preference.
 72+ *
 73+ * @return \bool true
 74+ */
4875 public static function translationJsedit( $user, &$preferences ) {
4976 $preferences['translate-jsedit'] = array(
5077 'class' => 'HTMLCheckField',
@@ -54,6 +81,9 @@
5582 return true;
5683 }
5784
 85+ /**
 86+ * JavsScript selector for language codes.
 87+ */
5888 protected static function languageSelector() {
5989 global $wgLang;
6090
Index: trunk/extensions/Translate/utils/MessageWebImporter.php
@@ -3,21 +3,27 @@
44 * Class which encapsulates message importing. It scans for changes (new, changed, deleted),
55 * displays them in pretty way with diffs and finally executes the actions the user choices.
66 *
7 - * @ingroup Extensions
8 - *
 7+ * @file
98 * @author Niklas Laxström
109 * @author Siebrand Mazeland
1110 * @copyright Copyright © 2009-2010, Niklas Laxström, Siebrand Mazeland
1211 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1312 */
1413
 14+/**
 15+ * Class which encapsulates message importing. It scans for changes (new, changed, deleted),
 16+ * displays them in pretty way with diffs and finally executes the actions the user choices.
 17+ */
1518 class MessageWebImporter {
1619 protected $title;
1720 protected $user;
1821 protected $group;
1922 protected $code;
2023
21 - protected $processingTime = 60; // Seconds
 24+ /**
 25+ * Maximum processing time in seconds.
 26+ */
 27+ protected $processingTime = 60;
2228
2329 public function __construct( Title $title = null, $group = null, $code = 'en' ) {
2430 $this->setTitle( $title );
@@ -278,16 +284,15 @@
279285 /**
280286 * Perform an action on a given group/key/code
281287 *
282 - * @param $action String: import/conflict/ignore
283 - * @param $group Object: group object
284 - * @param $key String: message key
285 - * @param $code String: language code
286 - * @param $message String: contents for the $key/code combination
287 - * @param $comment String: edit summary (default: empty) - see Article::doEdit
288 - * @param $user Object: object of user that will make the edit (default: null - $wgUser) - see Article::doEdit
 288+ * @param $action \string Import/conflict/ignore
 289+ * @param $group MessageGroup Group object
 290+ * @param $key \string Message key
 291+ * @param $code \string Language code
 292+ * @param $message \string: contents for the $key/code combination
 293+ * @param $comment \string: edit summary (default: empty) - see Article::doEdit
 294+ * @param $user User User that will make the edit (default: null - $wgUser) - see Article::doEdit
289295 * @param $editFlags Integer bitfield: see Article::doEdit
290 - *
291 - * @return String: action result
 296+ * @return \string Action result
292297 */
293298 public static function doAction( $action, $group, $key, $code, $message, $comment = '', $user = null, $editFlags = 0 ) {
294299 $title = self::makeTranslationTitle( $group, $key, $code );
@@ -413,9 +418,10 @@
414419 /**
415420 * Given a group, message key and language code, creates a title for the
416421 * translation page.
 422+ *
417423 * @param $group MessageGroup
418 - * @param $key String: Message key
419 - * @param $code String: Language code
 424+ * @param $key \string Message key
 425+ * @param $code \string Language code
420426 * @return Title
421427 */
422428 public static function makeTranslationTitle( $group, $key, $code ) {
@@ -425,13 +431,12 @@
426432 }
427433
428434 /**
429 - * Make section elements
 435+ * Make section elements.
430436 *
431 - * @param $legend String: legend
432 - * @param $type String: contents of type class
433 - * @param $content String: contents
434 - *
435 - * @return section element
 437+ * @param $legend \string Legend
 438+ * @param $type\string Contents of type class
 439+ * @param $content \string Contents
 440+ * @return \string Section element
436441 */
437442 public static function makeSectionElement( $legend, $type, $content ) {
438443 $containerParams = array( 'class' => "mw-tpt-sp-section mw-tpt-sp-section-type-{$type}" );
@@ -449,8 +454,7 @@
450455 * Prepends translation with fuzzy tag and ensures there is only one of them.
451456 *
452457 * @param $message String: message content
453 - *
454 - * @return $message prefixed with TRANSLATE_FUZZY tag
 458+ * @return $message \string Message prefixed with TRANSLATE_FUZZY tag
455459 */
456460 public static function makeTextFuzzy( $message ) {
457461 $message = str_replace( TRANSLATE_FUZZY, '', $message );
Index: trunk/extensions/Translate/utils/Html.php
@@ -1,5 +1,14 @@
22 <?php
33 /**
 4+ * Contains HTML builder class which wraps around Html::rawElement().
 5+ *
 6+ * @file
 7+ * @author Niklas Laxström
 8+ * @copyright Copyright © 2010, Niklas Laxström
 9+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 10+ */
 11+
 12+/**
413 * HTML builder class which wraps around Html::rawElement().
514 * Most of the functions are dual purpose. With no value (or null value) they
615 * return the current value of asked property. If the value is not null, it
@@ -8,7 +17,6 @@
918 * <code>$tag = new HtmlTag( 'div' ); $div = $div->content( 'foo' )->style( 'color', 'red' );</code>
1019 * Note: relies on implicit toString conversion (PHP >= 5.2)
1120 */
12 -
1321 class HtmlTag {
1422 public $tag = 'div';
1523 public $content = '';
@@ -20,9 +28,10 @@
2129 /**
2230 * Constructs a html tag. See the notes about handling contentless tags in
2331 * HTML class.
24 - * @param $tag string Optional. The name of the tag, if null defaults to div.
25 - * @param $content string Optional. The contents of the tag, if null defaults to empty string.
26 - * @param $params array Optional. The html parameters for this tag, if null defaults to no tags.
 32+ *
 33+ * @param $tag \string Optional. The name of the tag, if null defaults to div.
 34+ * @param $content \string Optional. The contents of the tag, if null defaults to empty string.
 35+ * @param $params \array Optional. The html parameters for this tag, if null defaults to no tags.
2736 */
2837 public function __construct( $tag = null, $content = null, $params = null ) {
2938 $this->tag( $tag );
@@ -32,8 +41,9 @@
3342
3443 /**
3544 * Sets tag type. Chain-accessor.
36 - * @param $value Mixed Optional. Null to view and string to set the tag.
37 - * @return Mixed The tag name or self;
 45+ *
 46+ * @param $value \mixed Optional. Null to view and string to set the tag.
 47+ * @return \mixed The tag name or self;
3848 */
3949 public function tag( $value = null ) {
4050 if ( $value === null ) {
@@ -47,8 +57,9 @@
4858
4959 /**
5060 * Sets the tag content. Chain-accessor.
51 - * @param $value Mixed Optional. Null to view and string to set the content.
52 - * @return Mixed The content as a string or self.
 61+ *
 62+ * @param $value \mixed Optional. Null to view and string to set the content.
 63+ * @return \mixed The content as a string or self.
5364 */
5465 public function content( $value = null ) {
5566 if ( $value === null ) {
@@ -66,8 +77,9 @@
6778
6879 /**
6980 * Sets all parameters. Chain-accessor.
70 - * @param $value Mixed Optional. Null to view and array to set the values.
71 - * @return Array The paramater array.
 81+ *
 82+ * @param $value \mixed Optional. Null to view and array to set the values.
 83+ * @return \array The paramater array.
7284 */
7385 public function params( $value = null ) {
7486 if ( $value === null ) {
@@ -81,9 +93,10 @@
8294
8395 /**
8496 * Sets or unsets a parameter. Chain-accessor.
85 - * @param $name String The name of the parameter.
86 - * @param $value Mixed Optional. False to unset, null to view and string to set the value.
87 - * @return Mixed The value of the parameter or null if not set.
 97+ *
 98+ * @param $name \string The name of the parameter.
 99+ * @param $value \mixed Optional. False to unset, null to view and string to set the value.
 100+ * @return \mixed The value of the parameter or null if not set.
88101 */
89102 public function param( $name, $value = null ) {
90103 $name = (string) $this->assert( 'is_string', $name );
@@ -104,9 +117,10 @@
105118 /**
106119 * Sets or unsets one CSS style parameter. Chain-accessor. These will be
107120 * appended to style paramerer set in tag parameters.
108 - * @param $name String The name of the parameter.
109 - * @param $value Mixed Optional. False to unset, null to view and string to set the value.
110 - * @return Mixed The value of the parameter or null if not set.
 121+ *
 122+ * @param $name \string The name of the parameter.
 123+ * @param $value \mixed Optional. False to unset, null to view and string to set the value.
 124+ * @return \mixed The value of the parameter or null if not set.
111125 */
112126 public function style( $name, $value = null ) {
113127 $name = (string) $this->assert( 'is_string', $name );
@@ -132,9 +146,10 @@
133147 }
134148
135149 /**
136 - * Returns the html output. Use this when you don't want to use
 150+ * Returns the html output. Use this when you do not want to use
137151 * implicit string conversion.
138 - * @return string html
 152+ *
 153+ * @return \string HTML
139154 */
140155 public function html() {
141156 // Collapse styles
@@ -154,7 +169,8 @@
155170
156171 /**
157172 * Wrapper for html method, for implicit conversion to string.
158 - * @return string html
 173+ *
 174+ * @return \string html
159175 */
160176 public function __toString() {
161177 return $this->html();
@@ -162,7 +178,8 @@
163179
164180 /**
165181 * Constructs the value for style parameter.
166 - * @return string The value for style parameter.
 182+ *
 183+ * @return \string The value for style parameter.
167184 */
168185 public function collapseStyles() {
169186 $style = '';
@@ -185,10 +202,11 @@
186203
187204 /**
188205 * Simple type checker for input. Simple types are silently converted to string for convenience.
189 - * @param $function string Function to use as type checker, for example is_string.
190 - * @param $value Mixed The value to to check.
191 - * @param $result Mixed The value to compare to the result of the check.
192 - * @return The value given.
 206+ *
 207+ * @param $function \string Function to use as type checker, for example is_string.
 208+ * @param $value \mixed The value to to check.
 209+ * @param $result \mixed The value to compare to the result of the check.
 210+ * @return \string The value given.
193211 */
194212 protected function assert( $function, $value, $result = true ) {
195213 if ( $function === 'is_string' ) {
Index: trunk/extensions/Translate/utils/Font.php
@@ -1,11 +1,18 @@
22 <?php
33 /**
 4+ * Contains class with wrapper around font-config.
 5+ *
 6+ * @file
 7+ * @author Niklas Laxström, 2008
 8+ * @license Public Domain
 9+ */
 10+
 11+/**
412 * Wrapper around font-config to get useful ttf font given a language code.
513 * Uses wfShellExec, wfEscapeShellArg and wfDebugLog from MediaWiki.
6 - * @author Niklas Laxström, 2008
7 - * @license PD
 14+ *
 15+ * @todo Needs documentation.
816 */
9 -
1017 class FCFontFinder {
1118 public static function find( $code ) {
1219 if ( ini_get( 'open_basedir' ) ) {
Index: trunk/extensions/Translate/utils/StringMatcher.php
@@ -1,5 +1,15 @@
22 <?php
 3+/**
 4+ * @todo Needs documentation.
 5+ * @file
 6+ * @author Niklas Laxström
 7+ * @copyright Copyright © 2008-2010, Niklas Laxström
 8+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 9+ */
310
 11+/**
 12+ * @todo Needs documentation.
 13+ */
414 interface StringMangler {
515 public static function EmptyMatcher();
616 public function setConf( $configuration );
@@ -10,6 +20,9 @@
1121 public function unMangle( $data );
1222 }
1323
 24+/**
 25+ * @todo Needs documentation.
 26+ */
1427 class StringMatcher implements StringMangler {
1528 protected $sPrefix = '';
1629 protected $aExact = array();
Index: trunk/extensions/Translate/utils/MessageIndexRebuilder.php
@@ -1,17 +1,19 @@
22 <?php
33 /**
 4+ * Contains classes for rebuilding the message index.
 5+ *
 6+ * @file
 7+ * @author Niklas Laxstrom
 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+ */
 11+
 12+/**
413 * Creates a database of keys in all groups, so that namespace and key can be
514 * used to get the group they belong to. This is used as a fallback when
615 * loadgroup parameter is not provided in the request, which happens if someone
716 * reaches a messages from somewhere else than Special:Translate.
8 - *
9 - * @author Niklas Laxstrom
10 - *
11 - * @copyright Copyright © 2008-2009, Niklas Laxström
12 - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
13 - * @file
1417 */
15 -
1618 class MessageIndexRebuilder {
1719 public static function execute() {
1820 $groups = MessageGroups::singleton()->getGroups();
Index: trunk/extensions/Translate/utils/TranslationMemoryUpdater.php
@@ -1,8 +1,16 @@
22 <?php
33 /**
4 -* Class for updating the Translation Memory
5 -*/
 4+ * Contains classes for updating the Translation Memory.
 5+ *
 6+ * @file
 7+ * @author Niklas Laxström
 8+ * @copyright Copyright © 2010, Niklas Laxström
 9+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 10+ */
611
 12+/**
 13+ * Class for updating the Translation Memory runtime.
 14+ */
715 class TranslationMemoryUpdater {
816 public static function update( $article, $user, $text, $summary, $minor, $_, $_, $flags, $revision ) {
917 global $wgContLang;
@@ -70,7 +78,7 @@
7179
7280 // Purge old translations for this message
7381 $dbw->delete( '`targets`', $delete, __METHOD__ );
74 - // We only do SQlite which doesn't need to know unique indexes
 82+ // We only do SQlite which does not need to know unique indexes
7583 $dbw->replace( '`targets`', null, $insert, __METHOD__ );
7684 wfDebugLog( 'tmserver', "Inserted new tm-translation for $ns_text:$key/$code" );
7785
Index: trunk/extensions/Translate/utils/TranslationStats.php
@@ -1,15 +1,17 @@
22 <?php
33 /**
4 - * Class which offers functionality for statistics reporting.
 4+ * Contains class which offers functionality for statistics reporting.
55 *
6 - * @ingroup Extensions
7 - *
 6+ * @file
87 * @author Niklas Laxström
98 * @author Siebrand Mazeland
109 * @copyright Copyright © 2010, Niklas Laxström, Siebrand Mazeland
1110 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1211 */
1312
 13+/**
 14+ * Contains methods that provide statistics for message groups.
 15+ */
1416 class TranslationStats {
1517 /**
1618 * Returns translated percentage for message group in given
Index: trunk/extensions/Translate/utils/ResourceLoader.php
@@ -1,5 +1,15 @@
22 <?php
 3+/**
 4+ * @todo Needs documentation.
 5+ * @file
 6+ * @author Niklas Laxström
 7+ * @copyright Copyright © 2010 Niklas Laxström
 8+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 9+ */
310
 11+/**
 12+ * @todo Needs documentation.
 13+ */
414 class ResourceLoader {
515 public static function loadVariableFromPHPFile( $_filename, $_variable ) {
616 if ( !file_exists( $_filename ) ) {
Index: trunk/extensions/Translate/SpecialTranslations.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Contains logic for special page Special:Translations
 4+ * Contains logic for special page Special:Translations.
55 *
66 * @file
77 * @author Siebrand Mazeland
Index: trunk/extensions/Translate/ffs/Wiki.php
@@ -155,7 +155,7 @@
156156 * not be exported.
157157 *
158158 * @param $messages MessageCollection Reference of MessageArray.
159 - * @return Array of key-translation pairs.
 159+ * @return Array of key-translation pairs.
160160 */
161161 public function makeExportArray( MessageCollection $messages ) {
162162 // We copy only relevant translations to this new array
Index: trunk/extensions/Translate/TranslatePage.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Contains logic for special page Special:Translate
 4+ * Contains logic for special page Special:Translate.
55 *
66 * @file
77 * @author Niklas Laxström
Index: trunk/extensions/Translate/scripts/export.php
@@ -3,8 +3,7 @@
44 * Script to export translations of one message group to file(s).
55 *
66 * @author Niklas Laxstrom
7 - *
8 - * @copyright Copyright © 2008, Niklas Laxström
 7+ * @copyright Copyright © 2008-2010, Niklas Laxström
98 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
109 * @file
1110 */
Index: trunk/extensions/Translate/scripts/messageDust.php
@@ -1,14 +1,17 @@
22 <?php
 3+/**
 4+ * This scripts finds messages that are invalid or unused.
 5+ *
 6+ * @file
 7+ */
38
4 -/* This scripts finds messages that are invalid or unused */
5 -
69 require( dirname( __FILE__ ) . '/cli.inc' );
710
811 $dbr = wfGetDB( DB_SLAVE );
912 $rows = $dbr->select( array( 'page' ),
1013 array( 'page_title', 'page_namespace' ),
1114 array(
12 - 'page_namespace' => $wgTranslateMessageNamespaces,
 15+ 'page_namespace' => $wgTranslateMessageNamespaces,
1316 ),
1417 __METHOD__
1518 );
@@ -27,6 +30,7 @@
2831
2932 $mg = TranslateUtils::messageKeyToGroup( $row->page_namespace, $key );
3033 $ns = $wgContLang->getNsText( $row->page_namespace );
 34+
3135 if ( is_null( $mg ) ) {
3236 $keys["$ns:$key"][] = $code;
3337 $owner = 'xx-unknown';
@@ -51,6 +55,7 @@
5256
5357 if ( count( $invalid ) ) {
5458 echo "==Invalid language codes==\n" . implode( ', ', array_keys( $invalid ) ) . "\n";
 59+
5560 foreach ( $invalid as $key => $pages ) {
5661 echo "# $key: " . implode( ', ', $pages ) . "\n";
5762 }
@@ -58,6 +63,7 @@
5964
6065 if ( count( $owners ) ) {
6166 echo "\n==Messages claimed==\n";
 67+
6268 foreach ( $owners as $o => $count ) {
6369 echo "# $o: $count\n";
6470 }
@@ -65,6 +71,7 @@
6672
6773 if ( count( $keys ) ) {
6874 echo "\n==Unclaimed messages==\n";
 75+
6976 foreach ( $keys as $page => $langs ) {
7077 echo "* $page: " . implode( ', ', $langs ) . "\n";
7178 }
Index: trunk/extensions/Translate/scripts/fuzzy.php
@@ -3,12 +3,9 @@
44 * Command line script to mark translations fuzzy (similar to gettext fuzzy).
55 *
66 * @file
7 - * @ingroup Extensions
8 - *
97 * @author Niklas Laxström
108 * @copyright Copyright © 2007-2009, Niklas Laxström
119 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
12 - * @file
1310 */
1411
1512 require( dirname( __FILE__ ) . '/cli.inc' );
@@ -57,6 +54,9 @@
5855
5956 $bot->execute();
6057
 58+/**
 59+ * @todo Needs documentation.
 60+ */
6161 class FuzzyBot {
6262 private $titles = array();
6363 private $allclear = false;
Index: trunk/extensions/Translate/scripts/cli.inc
@@ -4,8 +4,7 @@
55 * translate extension.
66 *
77 * @author Niklas Laxstrom
8 - *
9 - * @copyright Copyright © 2008, Niklas Laxström
 8+ * @copyright Copyright © 2008-2010, Niklas Laxström
109 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1110 * @file
1211 */
@@ -57,6 +56,9 @@
5857
5958 register_shutdown_function('STDOUT', false);
6059
 60+/**
 61+ * @todo Needs documentation.
 62+ */
6163 class Cli {
6264 public static function parseLanguageCodes( /* string */ $codes ) {
6365 $langs = array_map( 'trim', explode( ',', $codes ) );
Index: trunk/extensions/Translate/scripts/createCheckIndex.php
@@ -3,8 +3,7 @@
44 * Creates serialised database of messages that need checking for problems.
55 *
66 * @author Niklas Laxstrom
7 - *
8 - * @copyright Copyright © 2008, Niklas Laxström
 7+ * @copyright Copyright © 2008-2010, Niklas Laxström
98 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
109 * @file
1110 */
Index: trunk/extensions/Translate/scripts/magic-export-2.php
@@ -3,7 +3,6 @@
44 * Script to export special page aliases and magic words of extensions.
55 *
66 * @author Robert Leverington <robert@rhl.me.uk>
7 - *
87 * @copyright Copyright © 2010 Robert Leverington
98 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
109 * @file
@@ -55,7 +54,9 @@
5655 $handles = array();
5756 $keys = array(); error_reporting( E_ALL | E_STRICT );
5857 foreach ( $groups as $group ) {
59 - if ( !$group instanceof ExtensionMessageGroup ) continue;
 58+ if ( !$group instanceof ExtensionMessageGroup ) {
 59+ continue;
 60+ }
6061
6162 if ( $type === 'special' ) {
6263 $filename = $group->getAliasFile();
@@ -63,13 +64,20 @@
6465 $filename = $group->getMagicFile();
6566 }
6667
67 - if ( $filename === null ) continue;
 68+ if ( $filename === null ) {
 69+ continue;
 70+ }
6871
6972 $file = "$wgTranslateExtensionDirectory/$filename";
70 - if ( !file_exists( $file ) ) continue;
 73+ if ( !file_exists( $file ) ) {
 74+ continue;
 75+ }
7176
7277 include( $file );
73 - if ( !isset( $aliases ) ) continue;
 78+ if ( !isset( $aliases ) ) {
 79+ continue;
 80+ }
 81+
7482 $keys[$group->getId()] = array_keys( $aliases['en'] );
7583 unset( $aliases );
7684
@@ -97,6 +105,7 @@
98106 } else {
99107 STDOUT( "Processing $l..." );
100108 }
 109+
101110 $article = new Article( $title );
102111 $data = $article->getContent();
103112
@@ -106,7 +115,9 @@
107116 array_shift( $segments );
108117 unset( $segments[count( $segments ) -1] );
109118 unset( $segments[count( $segments ) -1] );
 119+
110120 $messages = array();
 121+
111122 foreach ( $segments as $segment ) {
112123 $parts = explode( '=', $segment );
113124 $key = trim( array_shift( $parts ) );
@@ -119,10 +130,12 @@
120131 STDOUT( "\t{$group}... " );
121132 $thismessages = $messages; // TODO: Reduce.
122133 $out = "\$aliases['{$group} '] = array(\n";
 134+
123135 foreach ( $thismessages as $key => $translations ) {
124136 $translations = implode( "', '", $translations );
125137 $out .= "\t'$key' => array( '$translations' ),\n";
126138 }
 139+
127140 $out .= ");\n\n";
128141 fwrite( $handle, $out );
129142 }
Index: trunk/extensions/Translate/scripts/magic-export.php
@@ -3,7 +3,6 @@
44 * Script to export special page aliases of extensions.
55 *
66 * @author Niklas Laxstrom
7 - *
87 * @copyright Copyright © 2008-2009, Niklas Laxström
98 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
109 * @file
@@ -73,9 +72,7 @@
7473 STDOUT( "Processing {$group->getLabel()}... ", $group->getId() );
7574
7675 $input = file_get_contents( $file ) . "\n";
77 -
7876 $headerEnd = strpos( $input, "\n);\n" );
79 -
8077 $output = substr( $input, 0, $headerEnd + 3 ) . "\n\n";
8178
8279 foreach ( $langs as $l ) {
Index: trunk/extensions/Translate/scripts/createMessageIndex.php
@@ -6,7 +6,6 @@
77 * reaches a messages from somewhere else than Special:Translate.
88 *
99 * @author Niklas Laxstrom
10 - *
1110 * @copyright Copyright © 2008-2009, Niklas Laxström
1211 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1312 * @file
Index: trunk/extensions/Translate/scripts/pagetranslation-test-parser.php
@@ -17,6 +17,9 @@
1818 }
1919 require_once( "$IP/maintenance/Maintenance.php" );
2020
 21+/**
 22+ * @todo Needs documentation.
 23+ */
2124 class PageTranslationParserTester extends Maintenance {
2225 public function __construct() {
2326 parent::__construct();
Index: trunk/extensions/Translate/scripts/sync-group.php
@@ -129,6 +129,9 @@
130130 unset( $group );
131131 }
132132
 133+/**
 134+ * @todo Needs documentation.
 135+ */
133136 class ChangeSyncer {
134137 public $group;
135138 public $norc = false;
Index: trunk/extensions/Translate/scripts/groupStatistics.php
@@ -4,13 +4,14 @@
55 *
66 * @author Niklas Laxstrom
77 * @author Siebrand Mazeland
8 - *
9 - * @copyright Copyright © 2007-2008, Niklas Laxström
10 - * @copyright Copyright © 2009, Siebrand Mazeland
 8+ * @copyright Copyright © 2007-2010, Niklas Laxström, Siebrand Mazeland
119 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1210 * @file
1311 */
1412
 13+/**
 14+ * @todo Needs documentation.
 15+ */
1516 $mostSpokenLanguages = array(
1617 // 'language code' => array( position, speakers in millions, continent ),
1718 // Source: http://stats.wikimedia.org/EN/Sitemap.htm
@@ -70,6 +71,9 @@
7172 'ku-latn' => array( 50, 26, 'asia' ),
7273 );
7374
 75+/**
 76+ * @todo Needs documentation.
 77+ */
7478 $localisedWeights = array(
7579 'wikimedia' => array(
7680 'core-0-mostused' => 40,
@@ -158,6 +162,9 @@
159163 $optionsWithArgs = array( 'groups', 'output', 'skiplanguages', 'legenddetail', 'legendsummary' );
160164 require( dirname( __FILE__ ) . '/cli.inc' );
161165
 166+/**
 167+ * @todo Needs documentation.
 168+ */
162169 class TranslateStatsOutput extends wikiStatsOutput {
163170 function heading() {
164171 echo '{| class="sortable wikitable" border="2" cellpadding="4" cellspacing="0" style="background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear:both;" width="100%"' . "\n";
Index: trunk/extensions/Translate/scripts/languageeditstats.php
@@ -30,7 +30,8 @@
3131 exit( 1 );
3232 }
3333
34 -/** Process command line parameters
 34+/**
 35+ * Process command line parameters
3536 */
3637 if ( isset( $options['help'] ) ) {
3738 showUsage();
@@ -73,12 +74,14 @@
7475 return array( $key, $code );
7576 }
7677
77 -/** Select set of edits to report on
 78+/**
 79+ * Select set of edits to report on
7880 */
7981 $rows = TranslateUtils::translationChanges( $hours, $bots, $namespaces );
8082
81 -/** Get counts for edits per language code after filtering out edits by
82 - * $wgTranslateFuzzyBotName
 83+/**
 84+ * Get counts for edits per language code after filtering out edits by
 85+ * $wgTranslateFuzzyBotName.
8386 */
8487 $codes = array();
8588 foreach ( $rows as $_ ) {
@@ -96,7 +99,8 @@
97100 $codes[$code]++;
98101 }
99102
100 -/** Sort counts and report descending up to $top rows.
 103+/**
 104+ * Sort counts and report descending up to $top rows.
101105 */
102106 arsort( $codes );
103107 $i = 0;
Index: trunk/extensions/Translate/scripts/pagetranslation-check-database.php
@@ -17,6 +17,9 @@
1818 }
1919 require_once( "$IP/maintenance/Maintenance.php" );
2020
 21+/**
 22+ * @todo Needs documentation.
 23+ */
2124 class PTCheckDB extends Maintenance {
2225 public function __construct() {
2326 parent::__construct();
@@ -31,17 +34,18 @@
3235 $dbw = wfGetDB( DB_MASTER );
3336 if ( $this->getOption( 'fix' ) ) {
3437 $this->output( "Performing the following fixes:\n" );
 38+
3539 foreach ( $fixes as $name => $data ) {
3640 $this->output( "$name: $data[0]...", $name );
3741 $dbw->delete( $data[1], '*', $data[2], __METHOD__ );
3842 }
3943 } else {
4044 $this->output( "Use --fix to perform following fixes:\n" );
 45+
4146 foreach ( $fixes as $name => $data ) {
4247 $sql = $dbw->selectSQLtext( $data[1], '*', $data[2] );
4348 $sql = preg_replace( '~^SELECT~', 'DELETE', $sql );
4449 $this->output( "$name: $data[0] - $sql\n" );
45 -
4650 }
4751 }
4852 }
@@ -51,8 +55,10 @@
5256
5357 $dbr = wfGetDB( DB_SLAVE );
5458 $pages = $dbr->select( 'translate_sections', 'trs_page', null, __METHOD__, array( 'GROUP BY' => 'trs_page' ) );
 59+
5560 $this->output( "Found {$pages->numRows()} pages in the section table\n" );
5661 $this->output( "Checking that they match a valid translatable page...\n\n" );
 62+
5763 foreach ( $pages as $row ) {
5864 $id = $row->trs_page;
5965 $sections = $dbr->select( 'translate_sections', 'trs_key', array( 'trs_page' => $id ), __METHOD__ );
@@ -87,6 +93,7 @@
8894
8995 $this->output( "\n" );
9096 }
 97+
9198 return $fixes;
9299 }
93100
@@ -97,11 +104,16 @@
98105
99106 $result = $dbr->select( 'revtag_type', '*', null, __METHOD__ );
100107 $idToTag = array();
101 - foreach ( $result as $_ ) $idToTag[$_->rtt_id] = $_->rtt_name;
 108+
 109+ foreach ( $result as $_ ) {
 110+ $idToTag[$_->rtt_id] = $_->rtt_name;
 111+ }
 112+
102113 $tagToId = array_flip( $idToTag );
103114
104115 $pages = $dbr->select( 'revtag', 'rt_page', null, __METHOD__, array( 'GROUP BY' => 'rt_page' ) );
105116 $this->output( "Checking that tags match a valid page...\n\n" );
 117+
106118 foreach ( $pages as $row ) {
107119 $id = $row->rt_page;
108120 $title = Title::newFromID( $id );
@@ -145,12 +157,14 @@
146158 }
147159
148160 $this->output( "Checked {$result->numRows()} tags in the revtag table\n\n\n" );
 161+
149162 return $fixes;
150163 }
151164
152165 protected function idToName( $id ) {
153166 $title = Title::newFromID( $id );
154167 $name = $title ? $title->getPrefixedText() : "#$id";
 168+
155169 if ( !$title ) {
156170 $name .= $this->findDeletedPage( $id );
157171 }
@@ -160,6 +174,7 @@
161175
162176 protected function getSectionNames( $result ) {
163177 $names = array();
 178+
164179 foreach ( $result as $section ) {
165180 $names[] = $section->trs_key;
166181 }
@@ -171,19 +186,24 @@
172187 $dbr = wfGetDB( DB_SLAVE );
173188 $page = $dbr->selectRow( 'archive', array( 'ar_namespace', 'ar_title' ),
174189 array( 'ar_page_id' => $id ), __METHOD__ );
 190+
175191 if ( $page ) {
176192 $title = Title::makeTitleSafe( $page->ar_namespace, $page->ar_title );
177193 if ( $title ) {
178194 return $title->getPrefixedText();
179195 }
180196 }
 197+
181198 return false;
182199 }
183200
184201 protected function checkTransrevRevision( $revId ) {
185202 static $cache = array();
186 - if ( isset( $cache[$revId] ) ) return $cache[$revId];
187203
 204+ if ( isset( $cache[$revId] ) ) {
 205+ return $cache[$revId];
 206+ }
 207+
188208 $revision = Revision::newFromId( $revId );
189209 if ( !$revision ) {
190210 $cache[$revId] = 'no such revision';
Index: trunk/extensions/Translate/scripts/poimport.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Imports po files exported from Special:Translate back.
 4+ * Imports gettext files exported from Special:Translate back.
55 *
66 * @author Niklas Laxström
77 * @copyright Copyright © 2007-2008 Niklas Laxström
Index: trunk/extensions/Translate/scripts/mwcore-export.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Script to export special core feature of MediaWiki
 4+ * Script to export special core features of MediaWiki.
55 *
66 * @author Niklas Laxstrom
77 *
@@ -57,6 +57,7 @@
5858
5959 foreach ( $langs as $l ) {
6060 $o = null;
 61+
6162 switch ( $options['type'] ) {
6263 case 'special':
6364 $o = new SpecialPageAliasesCM( $l );
Index: trunk/extensions/Translate/MessageChecks.php
@@ -26,7 +26,7 @@
2727 * }
2828 * }
2929 * @endcode
30 - *
 30+ *
3131 * Warnings are of format: <pre>
3232 * $warnings[$key][] = array(
3333 * array( 'printf', $subcheck, $key, $code ), # check idenfitication
Index: trunk/extensions/Translate/RcFilter.php
@@ -1,15 +1,18 @@
22 <?php
33 /**
4 - * Adds a new filter to Special:RecentChanges which makes it possible to filter
5 - * translations away or show them only.
 4+ * Contains class with filter to Special:RecentChanges to enable additional
 5+ * filtering.
66 *
77 * @file
88 * @author Niklas Laxström
9 - *
109 * @copyright Copyright © 2010, Niklas Laxström
1110 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1211 */
1312
 13+/**
 14+ * Adds a new filter to Special:RecentChanges which makes it possible to filter
 15+ * translations away or show them only.
 16+ */
1417 class TranslateRcFilter {
1518 /**
1619 * Default action for the filter: ('', 'only', 'filter', 'site')
@@ -21,7 +24,7 @@
2225 * documentation of the function parameters.
2326 *
2427 * Appends SQL filter conditions into $conds.
25 - * @return Boolean true
 28+ * @return \bool true
2629 */
2730 public static function translationFilter( &$conds, &$tables, &$join_conds, $opts ) {
2831 global $wgRequest, $wgTranslateMessageNamespaces;
@@ -57,7 +60,7 @@
5861 * documentation of the function parameters.
5962 *
6063 * Adds a HTMl selector into $items
61 - * @return Boolean true
 64+ * @return \bool true
6265 */
6366 public static function translationFilterForm( &$items, $opts ) {
6467 $opts->consumeValue( 'translations' );
Index: trunk/extensions/Translate/SpecialTranslationStats.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Contains logic for special page Special:TranslationStats
 4+ * Contains logic for special page Special:TranslationStats.
55 *
66 * @file
77 * @author Niklas Laxström
Index: trunk/extensions/Translate/FFS.php
@@ -32,7 +32,7 @@
3333 public function getWritePath();
3434
3535 /**
36 - * Will parse messages, authors, and any custom data from the file
 36+ * Will parse messages, authors, and any custom data from the file
3737 * and return it in associative array with keys like \c AUTHORS and
3838 * \c MESSAGES.
3939 * @param $code \string Languge code.
Index: trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php
@@ -1,15 +1,20 @@
22 <?php
33 /**
 4+ * Contains class to override Special:MovePage for page translation.
 5+ *
 6+ * @file
 7+ * @author Niklas Laxström
 8+ * @copyright Copyright © 2010, Niklas Laxström
 9+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 10+ */
 11+
 12+/**
413 * Overrides Special:Movepage to to allow renaming a page translation page and
514 * all related translations and derivative pages.
615 *
716 * @ingroup SpecialPage
817 * @ingroup PageTranslation
9 - * @author Niklas Laxström
10 - * @copyright Copyright © 2010, Niklas Laxström
11 - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1218 */
13 -
1419 class SpecialPageTranslationMovePage extends UnlistedSpecialPage {
1520 // Basif form parameters both as text and as titles
1621 protected $newText, $newTitle, $oldText, $oldTitle;
@@ -289,7 +294,9 @@
290295
291296 protected function printChangeLine( $base, $old, $target, $enabled = true ) {
292297 global $wgOut;
 298+
293299 $to = $this->newPageTitle( $base, $old, $target );
 300+
294301 if ( $enabled ) {
295302 $wgOut->addWikiText( '* ' . $old->getPrefixedText() . ' → ' . $to );
296303 } else {
@@ -319,7 +326,10 @@
320327 if ( $this->moveSubpages ) {
321328 $subpages = $this->getSubpages();
322329 foreach ( $subpages as $old ) {
323 - if ( TranslatablePage::isTranslationPage( $old ) ) continue;
 330+ if ( TranslatablePage::isTranslationPage( $old ) ) {
 331+ continue;
 332+ }
 333+
324334 $to = $this->newPageTitle( $base, $old, $target );
325335 $jobs[$old->getPrefixedText()] = MoveJob::newJob( $old, $to, $base, $this->user );
326336 }
@@ -341,6 +351,7 @@
342352
343353 $newTpage = TranslatablePage::newFromTitle( $this->newTitle );
344354 $newTpage->addReadyTag( $this->newTitle->getLatestRevId( GAID_FOR_UPDATE ) );
 355+
345356 if ( $newTpage->getMarkedTag() === $oldLatest ) {
346357 $newTpage->addMarkedTag( $this->newTitle->getLatestRevId( GAID_FOR_UPDATE ) );
347358 }
@@ -409,8 +420,12 @@
410421 if ( $this->moveSubpages ) {
411422 $subpages = $this->getSubpages();
412423 foreach ( $subpages as $old ) {
413 - if ( TranslatablePage::isTranslationPage( $old ) ) continue;
 424+ if ( TranslatablePage::isTranslationPage( $old ) ) {
 425+ continue;
 426+ }
 427+
414428 $new = $this->newPageTitle( $base, $old, $target );
 429+
415430 if ( !$new ) {
416431 $blockers[] = array( 'pt-movepage-block-subpage-invalid', $old->getPrefixedText() );
417432 } elseif ( $new->exists() ) {
@@ -435,6 +450,7 @@
436451 */
437452 protected function newPageTitle( $base, Title $old, Title $target ) {
438453 $search = preg_quote( $base, '~' );
 454+
439455 if ( $old->getNamespace() == NS_TRANSLATIONS ) {
440456 $new = $old->getText();
441457 $new = preg_replace( "~^$search~", $target->getPrefixedText(), $new, 1 );
@@ -482,5 +498,4 @@
483499 protected function getSubpages() {
484500 return $this->page->getTitle()->getSubpages();
485501 }
486 -
487502 }
Index: trunk/extensions/Translate/tag/MoveJob.php
@@ -1,14 +1,18 @@
22 <?php
33 /**
4 - * Job for moving translation pages.
 4+ * Contains class with job for moving translation pages.
55 *
6 - * @ingroup Extensions
7 - *
 6+ * @file
87 * @author Niklas Laxström
98 * @copyright Copyright © 2008-2010, Niklas Laxström
109 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1110 */
1211
 12+/**
 13+ * Contains class with job for moving translation pages.
 14+ *
 15+ * @ingroup PageTranslation
 16+ */
1317 class MoveJob extends Job {
1418 public static function newJob( Title $source, Title $target, $base, /*User*/ $performer ) {
1519 global $wgTranslateFuzzyBotName;
@@ -182,6 +186,4 @@
183187 }
184188 $wgUser->clearInstanceCache();
185189 }
186 -
187 -
188190 }
Index: trunk/extensions/Translate/tag/TPSection.php
@@ -2,11 +2,16 @@
33 /**
44 * This class represents one section of a translatable page.
55 *
 6+ * @file
67 * @author Niklas Laxström
7 - * @copyright Copyright © 2009 Niklas Laxström
 8+ * @copyright Copyright © 2009-2010 Niklas Laxström
89 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
910 */
1011
 12+/**
 13+ * @todo Needs documentation.
 14+ * @ingroup PageTranslation
 15+ */
1116 class TPSection {
1217 public $id, $name, $text, $type;
1318
Index: trunk/extensions/Translate/tag/TranslatablePage.php
@@ -1,6 +1,7 @@
22 <?php
33 /**
44 * Translatable page model.
 5+
56 * @defgroup PageTranslation Page Translation
67 * @file
78 * @author Niklas Laxström
@@ -295,6 +296,7 @@
296297 *
297298 * May throw a TPException if there is error with existing section
298299 * markers.
 300+ *
299301 * @param $content string Content of one section
300302 * @return TPSection
301303 */
@@ -421,7 +423,6 @@
422424 }
423425 }
424426
425 -
426427 public function getTranslationUrl( $code = false ) {
427428 $translate = SpecialPage::getTitleFor( 'Translate' );
428429 $params = array(
Index: trunk/extensions/Translate/tag/RenderJob.php
@@ -9,6 +9,10 @@
1010 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1111 */
1212
 13+/**
 14+ * @todo Needs documentation.
 15+ * @ingroup PageTranslation
 16+ */
1317 class RenderJob extends Job {
1418 public static function newJob( Title $target ) {
1519 global $wgTranslateFuzzyBotName;
@@ -52,7 +56,7 @@
5357
5458 $article = new Article( $title );
5559
56 - // TODO: fuzzybot hack
 60+ // @todo Fuzzybot hack
5761 PageTranslationHooks::$allowTargetEdit = true;
5862
5963 // User hack
Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php
@@ -1,4 +1,13 @@
22 <?php
 3+/**
 4+ * Contains logic for special page Special:ImportTranslations.
 5+ *
 6+ * @file
 7+ * @author Niklas Laxström
 8+ * @author Siebrand Mazeland
 9+ * @copyright Copyright © 2008-2010 Niklas Laxström, Siebrand Mazeland
 10+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 11+ */
312
413 /**
514 * A special page for marking revisions of pages for translation.
@@ -9,10 +18,6 @@
1019 *
1120 * @ingroup SpecialPage
1221 * @ingroup PageTranslation
13 - * @author Niklas Laxström
14 - * @author Siebrand Mazeland
15 - * @copyright Copyright © 2009-2010 Niklas Laxström, Siebrand Mazeland
16 - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1722 */
1823 class SpecialPageTranslation extends SpecialPage {
1924 function __construct() {
Index: trunk/extensions/Translate/tag/TPParse.php
@@ -3,11 +3,16 @@
44 * This class represents the results of parsed source page, that is, the
55 * extracted sections and a template.
66 *
 7+ * @file
78 * @author Niklas Laxström
89 * @copyright Copyright © 2009-2010 Niklas Laxström
910 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1011 */
1112
 13+/**
 14+ * @todo Needs documentation.
 15+ * @ingroup PageTranslation
 16+ */
1217 class TPParse {
1318 protected $title = null;
1419
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -1,5 +1,19 @@
22 <?php
 3+/**
 4+ * Contains class with page translation feature hooks.
 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+ * Hooks for page translation.
 14+ *
 15+ * @todo Methods need documentation.
 16+ * @ingroup PageTranslation
 17+ */
418 class PageTranslationHooks {
519 // Uuugly hack
620 static $allowTargetEdit = false;
@@ -564,7 +578,4 @@
565579
566580 return true;
567581 }
568 -
569 -
570 -
571582 }
Index: trunk/extensions/Translate/SpecialTranslationChanges.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Contains logic for special page Special:TranslationChanges
 4+ * Contains logic for special page Special:TranslationChanges.
55 *
66 * @file
77 * @author Niklas Laxström
Index: trunk/extensions/Translate/Doxyfile
@@ -39,7 +39,7 @@
4040 GENERATE_TESTLIST = YES
4141 GENERATE_BUGLIST = YES
4242 GENERATE_DEPRECATEDLIST= YES
43 -ENABLED_SECTIONS =
 43+ENABLED_SECTIONS =
4444 MAX_INITIALIZER_LINES = 30
4545 SHOW_USED_FILES = YES
4646 SHOW_DIRECTORIES = NO
@@ -56,18 +56,18 @@
5757 #---------------------------------------------------------------------------
5858 # configuration options related to the input files
5959 #---------------------------------------------------------------------------
60 -INPUT =
 60+INPUT =
6161 FILE_PATTERNS = *.php
6262 RECURSIVE = YES
6363 EXCLUDE = spyc
6464 EXCLUDE_SYMLINKS = YES
6565 EXCLUDE_PATTERNS = *.i18n.php .svn {{EXCLUDE}}
66 -EXAMPLE_PATH =
 66+EXAMPLE_PATH =
6767 EXAMPLE_PATTERNS = *
6868 EXAMPLE_RECURSIVE = NO
69 -IMAGE_PATH =
70 -INPUT_FILTER =
71 -FILTER_PATTERNS =
 69+IMAGE_PATH =
 70+INPUT_FILTER =
 71+FILTER_PATTERNS =
7272 FILTER_SOURCE_FILES = NO
7373 #---------------------------------------------------------------------------
7474 # configuration options related to source browsing
@@ -84,20 +84,20 @@
8585 #---------------------------------------------------------------------------
8686 ALPHABETICAL_INDEX = NO
8787 COLS_IN_ALPHA_INDEX = 5
88 -IGNORE_PREFIX =
 88+IGNORE_PREFIX =
8989 #---------------------------------------------------------------------------
9090 # configuration options related to the HTML output
9191 #---------------------------------------------------------------------------
9292 GENERATE_HTML = YES
9393 HTML_OUTPUT = html
9494 HTML_FILE_EXTENSION = .html
95 -HTML_HEADER =
96 -HTML_FOOTER =
97 -HTML_STYLESHEET =
 95+HTML_HEADER =
 96+HTML_FOOTER =
 97+HTML_STYLESHEET =
9898 HTML_ALIGN_MEMBERS = YES
9999 GENERATE_HTMLHELP = NO
100 -CHM_FILE =
101 -HHC_LOCATION =
 100+CHM_FILE =
 101+HHC_LOCATION =
102102 GENERATE_CHI = NO
103103 BINARY_TOC = NO
104104 TOC_EXPAND = YES
@@ -114,8 +114,8 @@
115115 MAKEINDEX_CMD_NAME = makeindex
116116 COMPACT_LATEX = NO
117117 PAPER_TYPE = a4wide
118 -EXTRA_PACKAGES =
119 -LATEX_HEADER =
 118+EXTRA_PACKAGES =
 119+LATEX_HEADER =
120120 PDF_HYPERLINKS = YES
121121 USE_PDFLATEX = YES
122122 LATEX_BATCHMODE = NO
@@ -127,8 +127,8 @@
128128 RTF_OUTPUT = rtf
129129 COMPACT_RTF = NO
130130 RTF_HYPERLINKS = NO
131 -RTF_STYLESHEET_FILE =
132 -RTF_EXTENSIONS_FILE =
 131+RTF_STYLESHEET_FILE =
 132+RTF_EXTENSIONS_FILE =
133133 #---------------------------------------------------------------------------
134134 # configuration options related to the man page output
135135 #---------------------------------------------------------------------------
@@ -141,8 +141,8 @@
142142 #---------------------------------------------------------------------------
143143 GENERATE_XML = NO
144144 XML_OUTPUT = xml
145 -XML_SCHEMA =
146 -XML_DTD =
 145+XML_SCHEMA =
 146+XML_DTD =
147147 XML_PROGRAMLISTING = YES
148148 #---------------------------------------------------------------------------
149149 # configuration options for the AutoGen Definitions output
@@ -154,29 +154,29 @@
155155 GENERATE_PERLMOD = NO
156156 PERLMOD_LATEX = NO
157157 PERLMOD_PRETTY = YES
158 -PERLMOD_MAKEVAR_PREFIX =
 158+PERLMOD_MAKEVAR_PREFIX =
159159 #---------------------------------------------------------------------------
160 -# Configuration options related to the preprocessor
 160+# Configuration options related to the preprocessor
161161 #---------------------------------------------------------------------------
162162 ENABLE_PREPROCESSING = YES
163163 MACRO_EXPANSION = NO
164164 EXPAND_ONLY_PREDEF = NO
165165 SEARCH_INCLUDES = YES
166 -INCLUDE_PATH =
167 -INCLUDE_FILE_PATTERNS =
168 -PREDEFINED =
169 -EXPAND_AS_DEFINED =
 166+INCLUDE_PATH =
 167+INCLUDE_FILE_PATTERNS =
 168+PREDEFINED =
 169+EXPAND_AS_DEFINED =
170170 SKIP_FUNCTION_MACROS = YES
171171 #---------------------------------------------------------------------------
172 -# Configuration::additions related to external references
 172+# Configuration::additions related to external references
173173 #---------------------------------------------------------------------------
174 -TAGFILES =
175 -GENERATE_TAGFILE =
 174+TAGFILES =
 175+GENERATE_TAGFILE =
176176 ALLEXTERNALS = NO
177177 EXTERNAL_GROUPS = YES
178178 PERL_PATH = /usr/bin/perl
179179 #---------------------------------------------------------------------------
180 -# Configuration options related to the dot tool
 180+# Configuration options related to the dot tool
181181 #---------------------------------------------------------------------------
182182 CLASS_DIAGRAMS = NO
183183 HIDE_UNDOC_RELATIONS = YES
@@ -192,15 +192,15 @@
193193 GRAPHICAL_HIERARCHY = YES
194194 DIRECTORY_GRAPH = YES
195195 DOT_IMAGE_FORMAT = png
196 -DOT_PATH =
197 -DOTFILE_DIRS =
 196+DOT_PATH =
 197+DOTFILE_DIRS =
198198 MAX_DOT_GRAPH_DEPTH = 1000
199199 DOT_TRANSPARENT = NO
200200 DOT_MULTI_TARGETS = NO
201201 GENERATE_LEGEND = YES
202202 DOT_CLEANUP = YES
203203 #---------------------------------------------------------------------------
204 -# Configuration::additions related to the search engine
 204+# Configuration::additions related to the search engine
205205 #---------------------------------------------------------------------------
206206 SEARCHENGINE = NO
207207
Index: trunk/extensions/Translate/Translate.php
@@ -592,7 +592,7 @@
593593 */
594594 $field = array( 'rtt_name' => $tag );
595595 $ret = $dbw->selectField( 'revtag_type', 'rtt_name', $field, __METHOD__ );
596 -
 596+
597597 if ( $ret !== $tag ) {
598598 $dbw->insert( 'revtag_type', $field, __METHOD__ );
599599 }

Status & tagging log