Index: trunk/extensions/Translate/utils/TranslateYaml.php |
— | — | @@ -1,4 +1,13 @@ |
2 | 2 | <?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 | + */ |
3 | 12 | |
4 | 13 | /** |
5 | 14 | * This class is a wrapper class to provide interface to parse |
— | — | @@ -152,4 +161,3 @@ |
153 | 162 | return $yaml; |
154 | 163 | } |
155 | 164 | } |
156 | | - |
Index: trunk/extensions/Translate/utils/TranslationHelpers.php |
— | — | @@ -1,14 +1,19 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
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. |
8 | 6 | * |
| 7 | + * @file |
9 | 8 | * @author Niklas Laxström |
10 | 9 | * @copyright Copyright © 2010 Niklas Laxström |
11 | 10 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
12 | 11 | */ |
| 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 | + */ |
13 | 18 | class TranslationHelpers { |
14 | 19 | /** |
15 | 20 | * Title of the message |
Index: trunk/extensions/Translate/utils/MessageGroupCache.php |
— | — | @@ -1,5 +1,15 @@ |
2 | 2 | <?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 | + */ |
3 | 10 | |
| 11 | +/** |
| 12 | + * @todo Needs documentation. |
| 13 | + */ |
4 | 14 | class MessageGroupCache { |
5 | 15 | protected $group; |
6 | 16 | protected $cache; |
Index: trunk/extensions/Translate/utils/ToolBox.php |
— | — | @@ -1,5 +1,17 @@ |
2 | 2 | <?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 | + */ |
3 | 12 | |
| 13 | +/** |
| 14 | + * Adds extension specific context aware toolbox menu items. |
| 15 | + */ |
4 | 16 | class TranslateToolbox { |
5 | 17 | /** |
6 | 18 | * Adds link in toolbox to Special:Prefixindex to show all other |
Index: trunk/extensions/Translate/utils/HTMLJsSelectToInputField.php |
— | — | @@ -1,5 +1,12 @@ |
2 | 2 | <?php |
| 3 | +/** |
| 4 | + * @todo Needs documentation. |
| 5 | + * @file |
| 6 | + */ |
3 | 7 | |
| 8 | +/** |
| 9 | + * @todo Needs documentation. |
| 10 | + */ |
4 | 11 | class HTMLJsSelectToInputField extends HTMLTextField { |
5 | 12 | function getInputHTML( $value ) { |
6 | 13 | $input = parent::getInputHTML( $value ); |
Index: trunk/extensions/Translate/utils/MemoryCache.php |
— | — | @@ -1,5 +1,16 @@ |
2 | 2 | <?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 | + */ |
3 | 11 | |
| 12 | +/** |
| 13 | + * @todo Needs documentation. |
| 14 | + */ |
4 | 15 | class ArrayMemoryCache { |
5 | 16 | protected $table; |
6 | 17 | protected $key; |
Index: trunk/extensions/Translate/utils/MessageTable.php |
— | — | @@ -1,12 +1,16 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Pretty-formatter for message collections |
| 4 | + * Contains classes to build tables for MessageCollection objects. |
5 | 5 | * |
| 6 | + * @file |
6 | 7 | * @author Niklas Laxström |
7 | | - * @copyright Copyright © 2007-2009 Niklas Laxström |
| 8 | + * @copyright Copyright © 2007-2010 Niklas Laxström |
8 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
9 | 10 | */ |
10 | 11 | |
| 12 | +/** |
| 13 | + * Pretty formatter for MessageCollection objects. |
| 14 | + */ |
11 | 15 | class MessageTable { |
12 | 16 | protected $reviewMode = false; |
13 | 17 | protected $collection = null; |
Index: trunk/extensions/Translate/utils/JsSelectToInput.php |
— | — | @@ -1,5 +1,15 @@ |
2 | 2 | <?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 | + */ |
3 | 10 | |
| 11 | +/** |
| 12 | + * @todo Needs documentation. |
| 13 | + */ |
4 | 14 | class JsSelectToInput { |
5 | 15 | protected $targetId, $sourceId; |
6 | 16 | protected $select; |
Index: trunk/extensions/Translate/utils/MemProfile.php |
— | — | @@ -4,8 +4,6 @@ |
5 | 5 | * Helper functions to locate when memory is consumed |
6 | 6 | * |
7 | 7 | * @file |
8 | | - * @ingroup Extensions |
9 | | - * |
10 | 8 | * @author Niklas Laxström |
11 | 9 | * @copyright Copyright © 2008, Niklas Laxström |
12 | 10 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
— | — | @@ -14,6 +12,9 @@ |
15 | 13 | $wgMemUse = array(); |
16 | 14 | $wgMemStack = 0; |
17 | 15 | |
| 16 | +/** |
| 17 | + * @todo Needs documentation. |
| 18 | + */ |
18 | 19 | function wfMemIn( $a ) { |
19 | 20 | global $wgLang, $wgMemUse, $wgMemStack; |
20 | 21 | |
— | — | @@ -30,6 +31,9 @@ |
31 | 32 | $wgMemStack++; |
32 | 33 | } |
33 | 34 | |
| 35 | +/** |
| 36 | + * @todo Needs documentation. |
| 37 | + */ |
34 | 38 | function wfMemOut( $a ) { |
35 | 39 | global $wgLang, $wgMemUse, $wgMemStack; |
36 | 40 | |
Index: trunk/extensions/Translate/utils/TranslationEditPage.php |
— | — | @@ -1,13 +1,17 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * This class together with some javascript implements the ajax translation |
5 | | - * page. |
| 4 | + * Contains classes doe the AJAX translation page. |
6 | 5 | * |
| 6 | + * @file |
7 | 7 | * @author Niklas Laxström |
8 | 8 | * @copyright Copyright © 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 | 11 | |
| 12 | +/** |
| 13 | + * This class together with some JavaScript implements the AJAX translation |
| 14 | + * page. |
| 15 | + */ |
12 | 16 | class TranslationEditPage { |
13 | 17 | // Instance of an Title object |
14 | 18 | protected $title; |
— | — | @@ -33,7 +37,6 @@ |
34 | 38 | return $obj; |
35 | 39 | } |
36 | 40 | |
37 | | - |
38 | 41 | public function setTitle( Title $title ) { $this->title = $title; } |
39 | 42 | public function getTitle() { return $this->title; } |
40 | 43 | |
— | — | @@ -115,7 +118,7 @@ |
116 | 119 | /** |
117 | 120 | * Gets the edit token and timestamps in some ugly array structure. Needs to |
118 | 121 | * be cleaned up. |
119 | | - * @return Array |
| 122 | + * @return \array |
120 | 123 | */ |
121 | 124 | protected function getEditInfo() { |
122 | 125 | $params = new FauxRequest( array( |
Index: trunk/extensions/Translate/utils/UserToggles.php |
— | — | @@ -1,12 +1,27 @@ |
2 | 2 | <?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 | + */ |
3 | 12 | |
| 13 | +/** |
| 14 | + * Class to add Translate specific preference settings. |
| 15 | + */ |
4 | 16 | class TranslatePreferences { |
5 | 17 | /** |
6 | | - * Add preferences for Translate |
| 18 | + * Add 'translate-pref-nonewsletter' preference. |
| 19 | + * |
| 20 | + * @return \bool true |
7 | 21 | */ |
8 | 22 | public static function onGetPreferences( $user, &$preferences ) { |
9 | 23 | global $wgEnableEmail, $wgUser, $wgEnotifRevealEditorAddress; |
10 | 24 | |
| 25 | + // Only show is e-mail is enabled and user has a confirmed e-mail address. |
11 | 26 | if ( $wgEnableEmail && $wgUser->isEmailConfirmed() ) { |
12 | 27 | // 'translate-pref-nonewsletter' is used as opt-out for |
13 | 28 | // users with a confirmed e-mail address |
— | — | @@ -26,10 +41,17 @@ |
27 | 42 | return true; |
28 | 43 | } |
29 | 44 | |
| 45 | + /** |
| 46 | + * Add 'translate-editlangs' preference. |
| 47 | + * |
| 48 | + * @return \bool true |
| 49 | + */ |
30 | 50 | public static function translationAssistLanguages( $user, &$preferences ) { |
| 51 | + // Get selector. |
31 | 52 | $select = self::languageSelector(); |
| 53 | + // Set target ID. |
32 | 54 | $select->setTargetId( 'mw-input-translate-editlangs' ); |
33 | | - |
| 55 | + // Get available languages. |
34 | 56 | $languages = Language::getLanguageNames( false ); |
35 | 57 | |
36 | 58 | $preferences['translate-editlangs'] = array( |
— | — | @@ -44,6 +66,11 @@ |
45 | 67 | return true; |
46 | 68 | } |
47 | 69 | |
| 70 | + /** |
| 71 | + * Add 'translate-jsedit' preference. |
| 72 | + * |
| 73 | + * @return \bool true |
| 74 | + */ |
48 | 75 | public static function translationJsedit( $user, &$preferences ) { |
49 | 76 | $preferences['translate-jsedit'] = array( |
50 | 77 | 'class' => 'HTMLCheckField', |
— | — | @@ -54,6 +81,9 @@ |
55 | 82 | return true; |
56 | 83 | } |
57 | 84 | |
| 85 | + /** |
| 86 | + * JavsScript selector for language codes. |
| 87 | + */ |
58 | 88 | protected static function languageSelector() { |
59 | 89 | global $wgLang; |
60 | 90 | |
Index: trunk/extensions/Translate/utils/MessageWebImporter.php |
— | — | @@ -3,21 +3,27 @@ |
4 | 4 | * Class which encapsulates message importing. It scans for changes (new, changed, deleted), |
5 | 5 | * displays them in pretty way with diffs and finally executes the actions the user choices. |
6 | 6 | * |
7 | | - * @ingroup Extensions |
8 | | - * |
| 7 | + * @file |
9 | 8 | * @author Niklas Laxström |
10 | 9 | * @author Siebrand Mazeland |
11 | 10 | * @copyright Copyright © 2009-2010, Niklas Laxström, Siebrand Mazeland |
12 | 11 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
13 | 12 | */ |
14 | 13 | |
| 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 | + */ |
15 | 18 | class MessageWebImporter { |
16 | 19 | protected $title; |
17 | 20 | protected $user; |
18 | 21 | protected $group; |
19 | 22 | protected $code; |
20 | 23 | |
21 | | - protected $processingTime = 60; // Seconds |
| 24 | + /** |
| 25 | + * Maximum processing time in seconds. |
| 26 | + */ |
| 27 | + protected $processingTime = 60; |
22 | 28 | |
23 | 29 | public function __construct( Title $title = null, $group = null, $code = 'en' ) { |
24 | 30 | $this->setTitle( $title ); |
— | — | @@ -278,16 +284,15 @@ |
279 | 285 | /** |
280 | 286 | * Perform an action on a given group/key/code |
281 | 287 | * |
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 |
289 | 295 | * @param $editFlags Integer bitfield: see Article::doEdit |
290 | | - * |
291 | | - * @return String: action result |
| 296 | + * @return \string Action result |
292 | 297 | */ |
293 | 298 | public static function doAction( $action, $group, $key, $code, $message, $comment = '', $user = null, $editFlags = 0 ) { |
294 | 299 | $title = self::makeTranslationTitle( $group, $key, $code ); |
— | — | @@ -413,9 +418,10 @@ |
414 | 419 | /** |
415 | 420 | * Given a group, message key and language code, creates a title for the |
416 | 421 | * translation page. |
| 422 | + * |
417 | 423 | * @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 |
420 | 426 | * @return Title |
421 | 427 | */ |
422 | 428 | public static function makeTranslationTitle( $group, $key, $code ) { |
— | — | @@ -425,13 +431,12 @@ |
426 | 432 | } |
427 | 433 | |
428 | 434 | /** |
429 | | - * Make section elements |
| 435 | + * Make section elements. |
430 | 436 | * |
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 |
436 | 441 | */ |
437 | 442 | public static function makeSectionElement( $legend, $type, $content ) { |
438 | 443 | $containerParams = array( 'class' => "mw-tpt-sp-section mw-tpt-sp-section-type-{$type}" ); |
— | — | @@ -449,8 +454,7 @@ |
450 | 455 | * Prepends translation with fuzzy tag and ensures there is only one of them. |
451 | 456 | * |
452 | 457 | * @param $message String: message content |
453 | | - * |
454 | | - * @return $message prefixed with TRANSLATE_FUZZY tag |
| 458 | + * @return $message \string Message prefixed with TRANSLATE_FUZZY tag |
455 | 459 | */ |
456 | 460 | public static function makeTextFuzzy( $message ) { |
457 | 461 | $message = str_replace( TRANSLATE_FUZZY, '', $message ); |
Index: trunk/extensions/Translate/utils/Html.php |
— | — | @@ -1,5 +1,14 @@ |
2 | 2 | <?php |
3 | 3 | /** |
| 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 | +/** |
4 | 13 | * HTML builder class which wraps around Html::rawElement(). |
5 | 14 | * Most of the functions are dual purpose. With no value (or null value) they |
6 | 15 | * return the current value of asked property. If the value is not null, it |
— | — | @@ -8,7 +17,6 @@ |
9 | 18 | * <code>$tag = new HtmlTag( 'div' ); $div = $div->content( 'foo' )->style( 'color', 'red' );</code> |
10 | 19 | * Note: relies on implicit toString conversion (PHP >= 5.2) |
11 | 20 | */ |
12 | | - |
13 | 21 | class HtmlTag { |
14 | 22 | public $tag = 'div'; |
15 | 23 | public $content = ''; |
— | — | @@ -20,9 +28,10 @@ |
21 | 29 | /** |
22 | 30 | * Constructs a html tag. See the notes about handling contentless tags in |
23 | 31 | * 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. |
27 | 36 | */ |
28 | 37 | public function __construct( $tag = null, $content = null, $params = null ) { |
29 | 38 | $this->tag( $tag ); |
— | — | @@ -32,8 +41,9 @@ |
33 | 42 | |
34 | 43 | /** |
35 | 44 | * 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; |
38 | 48 | */ |
39 | 49 | public function tag( $value = null ) { |
40 | 50 | if ( $value === null ) { |
— | — | @@ -47,8 +57,9 @@ |
48 | 58 | |
49 | 59 | /** |
50 | 60 | * 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. |
53 | 64 | */ |
54 | 65 | public function content( $value = null ) { |
55 | 66 | if ( $value === null ) { |
— | — | @@ -66,8 +77,9 @@ |
67 | 78 | |
68 | 79 | /** |
69 | 80 | * 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. |
72 | 84 | */ |
73 | 85 | public function params( $value = null ) { |
74 | 86 | if ( $value === null ) { |
— | — | @@ -81,9 +93,10 @@ |
82 | 94 | |
83 | 95 | /** |
84 | 96 | * 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. |
88 | 101 | */ |
89 | 102 | public function param( $name, $value = null ) { |
90 | 103 | $name = (string) $this->assert( 'is_string', $name ); |
— | — | @@ -104,9 +117,10 @@ |
105 | 118 | /** |
106 | 119 | * Sets or unsets one CSS style parameter. Chain-accessor. These will be |
107 | 120 | * 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. |
111 | 125 | */ |
112 | 126 | public function style( $name, $value = null ) { |
113 | 127 | $name = (string) $this->assert( 'is_string', $name ); |
— | — | @@ -132,9 +146,10 @@ |
133 | 147 | } |
134 | 148 | |
135 | 149 | /** |
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 |
137 | 151 | * implicit string conversion. |
138 | | - * @return string html |
| 152 | + * |
| 153 | + * @return \string HTML |
139 | 154 | */ |
140 | 155 | public function html() { |
141 | 156 | // Collapse styles |
— | — | @@ -154,7 +169,8 @@ |
155 | 170 | |
156 | 171 | /** |
157 | 172 | * Wrapper for html method, for implicit conversion to string. |
158 | | - * @return string html |
| 173 | + * |
| 174 | + * @return \string html |
159 | 175 | */ |
160 | 176 | public function __toString() { |
161 | 177 | return $this->html(); |
— | — | @@ -162,7 +178,8 @@ |
163 | 179 | |
164 | 180 | /** |
165 | 181 | * Constructs the value for style parameter. |
166 | | - * @return string The value for style parameter. |
| 182 | + * |
| 183 | + * @return \string The value for style parameter. |
167 | 184 | */ |
168 | 185 | public function collapseStyles() { |
169 | 186 | $style = ''; |
— | — | @@ -185,10 +202,11 @@ |
186 | 203 | |
187 | 204 | /** |
188 | 205 | * 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. |
193 | 211 | */ |
194 | 212 | protected function assert( $function, $value, $result = true ) { |
195 | 213 | if ( $function === 'is_string' ) { |
Index: trunk/extensions/Translate/utils/Font.php |
— | — | @@ -1,11 +1,18 @@ |
2 | 2 | <?php |
3 | 3 | /** |
| 4 | + * Contains class with wrapper around font-config. |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @author Niklas Laxström, 2008 |
| 8 | + * @license Public Domain |
| 9 | + */ |
| 10 | + |
| 11 | +/** |
4 | 12 | * Wrapper around font-config to get useful ttf font given a language code. |
5 | 13 | * Uses wfShellExec, wfEscapeShellArg and wfDebugLog from MediaWiki. |
6 | | - * @author Niklas Laxström, 2008 |
7 | | - * @license PD |
| 14 | + * |
| 15 | + * @todo Needs documentation. |
8 | 16 | */ |
9 | | - |
10 | 17 | class FCFontFinder { |
11 | 18 | public static function find( $code ) { |
12 | 19 | if ( ini_get( 'open_basedir' ) ) { |
Index: trunk/extensions/Translate/utils/StringMatcher.php |
— | — | @@ -1,5 +1,15 @@ |
2 | 2 | <?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 | + */ |
3 | 10 | |
| 11 | +/** |
| 12 | + * @todo Needs documentation. |
| 13 | + */ |
4 | 14 | interface StringMangler { |
5 | 15 | public static function EmptyMatcher(); |
6 | 16 | public function setConf( $configuration ); |
— | — | @@ -10,6 +20,9 @@ |
11 | 21 | public function unMangle( $data ); |
12 | 22 | } |
13 | 23 | |
| 24 | +/** |
| 25 | + * @todo Needs documentation. |
| 26 | + */ |
14 | 27 | class StringMatcher implements StringMangler { |
15 | 28 | protected $sPrefix = ''; |
16 | 29 | protected $aExact = array(); |
Index: trunk/extensions/Translate/utils/MessageIndexRebuilder.php |
— | — | @@ -1,17 +1,19 @@ |
2 | 2 | <?php |
3 | 3 | /** |
| 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 | +/** |
4 | 13 | * Creates a database of keys in all groups, so that namespace and key can be |
5 | 14 | * used to get the group they belong to. This is used as a fallback when |
6 | 15 | * loadgroup parameter is not provided in the request, which happens if someone |
7 | 16 | * 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 |
14 | 17 | */ |
15 | | - |
16 | 18 | class MessageIndexRebuilder { |
17 | 19 | public static function execute() { |
18 | 20 | $groups = MessageGroups::singleton()->getGroups(); |
Index: trunk/extensions/Translate/utils/TranslationMemoryUpdater.php |
— | — | @@ -1,8 +1,16 @@ |
2 | 2 | <?php |
3 | 3 | /** |
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 | + */ |
6 | 11 | |
| 12 | +/** |
| 13 | + * Class for updating the Translation Memory runtime. |
| 14 | + */ |
7 | 15 | class TranslationMemoryUpdater { |
8 | 16 | public static function update( $article, $user, $text, $summary, $minor, $_, $_, $flags, $revision ) { |
9 | 17 | global $wgContLang; |
— | — | @@ -70,7 +78,7 @@ |
71 | 79 | |
72 | 80 | // Purge old translations for this message |
73 | 81 | $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 |
75 | 83 | $dbw->replace( '`targets`', null, $insert, __METHOD__ ); |
76 | 84 | wfDebugLog( 'tmserver', "Inserted new tm-translation for $ns_text:$key/$code" ); |
77 | 85 | |
Index: trunk/extensions/Translate/utils/TranslationStats.php |
— | — | @@ -1,15 +1,17 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Class which offers functionality for statistics reporting. |
| 4 | + * Contains class which offers functionality for statistics reporting. |
5 | 5 | * |
6 | | - * @ingroup Extensions |
7 | | - * |
| 6 | + * @file |
8 | 7 | * @author Niklas Laxström |
9 | 8 | * @author Siebrand Mazeland |
10 | 9 | * @copyright Copyright © 2010, Niklas Laxström, Siebrand Mazeland |
11 | 10 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
12 | 11 | */ |
13 | 12 | |
| 13 | +/** |
| 14 | + * Contains methods that provide statistics for message groups. |
| 15 | + */ |
14 | 16 | class TranslationStats { |
15 | 17 | /** |
16 | 18 | * Returns translated percentage for message group in given |
Index: trunk/extensions/Translate/utils/ResourceLoader.php |
— | — | @@ -1,5 +1,15 @@ |
2 | 2 | <?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 | + */ |
3 | 10 | |
| 11 | +/** |
| 12 | + * @todo Needs documentation. |
| 13 | + */ |
4 | 14 | class ResourceLoader { |
5 | 15 | public static function loadVariableFromPHPFile( $_filename, $_variable ) { |
6 | 16 | if ( !file_exists( $_filename ) ) { |
Index: trunk/extensions/Translate/SpecialTranslations.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Contains logic for special page Special:Translations |
| 4 | + * Contains logic for special page Special:Translations. |
5 | 5 | * |
6 | 6 | * @file |
7 | 7 | * @author Siebrand Mazeland |
Index: trunk/extensions/Translate/ffs/Wiki.php |
— | — | @@ -155,7 +155,7 @@ |
156 | 156 | * not be exported. |
157 | 157 | * |
158 | 158 | * @param $messages MessageCollection Reference of MessageArray. |
159 | | - * @return Array of key-translation pairs. |
| 159 | + * @return Array of key-translation pairs. |
160 | 160 | */ |
161 | 161 | public function makeExportArray( MessageCollection $messages ) { |
162 | 162 | // We copy only relevant translations to this new array |
Index: trunk/extensions/Translate/TranslatePage.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Contains logic for special page Special:Translate |
| 4 | + * Contains logic for special page Special:Translate. |
5 | 5 | * |
6 | 6 | * @file |
7 | 7 | * @author Niklas Laxström |
Index: trunk/extensions/Translate/scripts/export.php |
— | — | @@ -3,8 +3,7 @@ |
4 | 4 | * Script to export translations of one message group to file(s). |
5 | 5 | * |
6 | 6 | * @author Niklas Laxstrom |
7 | | - * |
8 | | - * @copyright Copyright © 2008, Niklas Laxström |
| 7 | + * @copyright Copyright © 2008-2010, Niklas Laxström |
9 | 8 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
10 | 9 | * @file |
11 | 10 | */ |
Index: trunk/extensions/Translate/scripts/messageDust.php |
— | — | @@ -1,14 +1,17 @@ |
2 | 2 | <?php |
| 3 | +/** |
| 4 | + * This scripts finds messages that are invalid or unused. |
| 5 | + * |
| 6 | + * @file |
| 7 | + */ |
3 | 8 | |
4 | | -/* This scripts finds messages that are invalid or unused */ |
5 | | - |
6 | 9 | require( dirname( __FILE__ ) . '/cli.inc' ); |
7 | 10 | |
8 | 11 | $dbr = wfGetDB( DB_SLAVE ); |
9 | 12 | $rows = $dbr->select( array( 'page' ), |
10 | 13 | array( 'page_title', 'page_namespace' ), |
11 | 14 | array( |
12 | | - 'page_namespace' => $wgTranslateMessageNamespaces, |
| 15 | + 'page_namespace' => $wgTranslateMessageNamespaces, |
13 | 16 | ), |
14 | 17 | __METHOD__ |
15 | 18 | ); |
— | — | @@ -27,6 +30,7 @@ |
28 | 31 | |
29 | 32 | $mg = TranslateUtils::messageKeyToGroup( $row->page_namespace, $key ); |
30 | 33 | $ns = $wgContLang->getNsText( $row->page_namespace ); |
| 34 | + |
31 | 35 | if ( is_null( $mg ) ) { |
32 | 36 | $keys["$ns:$key"][] = $code; |
33 | 37 | $owner = 'xx-unknown'; |
— | — | @@ -51,6 +55,7 @@ |
52 | 56 | |
53 | 57 | if ( count( $invalid ) ) { |
54 | 58 | echo "==Invalid language codes==\n" . implode( ', ', array_keys( $invalid ) ) . "\n"; |
| 59 | + |
55 | 60 | foreach ( $invalid as $key => $pages ) { |
56 | 61 | echo "# $key: " . implode( ', ', $pages ) . "\n"; |
57 | 62 | } |
— | — | @@ -58,6 +63,7 @@ |
59 | 64 | |
60 | 65 | if ( count( $owners ) ) { |
61 | 66 | echo "\n==Messages claimed==\n"; |
| 67 | + |
62 | 68 | foreach ( $owners as $o => $count ) { |
63 | 69 | echo "# $o: $count\n"; |
64 | 70 | } |
— | — | @@ -65,6 +71,7 @@ |
66 | 72 | |
67 | 73 | if ( count( $keys ) ) { |
68 | 74 | echo "\n==Unclaimed messages==\n"; |
| 75 | + |
69 | 76 | foreach ( $keys as $page => $langs ) { |
70 | 77 | echo "* $page: " . implode( ', ', $langs ) . "\n"; |
71 | 78 | } |
Index: trunk/extensions/Translate/scripts/fuzzy.php |
— | — | @@ -3,12 +3,9 @@ |
4 | 4 | * Command line script to mark translations fuzzy (similar to gettext fuzzy). |
5 | 5 | * |
6 | 6 | * @file |
7 | | - * @ingroup Extensions |
8 | | - * |
9 | 7 | * @author Niklas Laxström |
10 | 8 | * @copyright Copyright © 2007-2009, Niklas Laxström |
11 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
12 | | - * @file |
13 | 10 | */ |
14 | 11 | |
15 | 12 | require( dirname( __FILE__ ) . '/cli.inc' ); |
— | — | @@ -57,6 +54,9 @@ |
58 | 55 | |
59 | 56 | $bot->execute(); |
60 | 57 | |
| 58 | +/** |
| 59 | + * @todo Needs documentation. |
| 60 | + */ |
61 | 61 | class FuzzyBot { |
62 | 62 | private $titles = array(); |
63 | 63 | private $allclear = false; |
Index: trunk/extensions/Translate/scripts/cli.inc |
— | — | @@ -4,8 +4,7 @@ |
5 | 5 | * translate extension. |
6 | 6 | * |
7 | 7 | * @author Niklas Laxstrom |
8 | | - * |
9 | | - * @copyright Copyright © 2008, Niklas Laxström |
| 8 | + * @copyright Copyright © 2008-2010, Niklas Laxström |
10 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
11 | 10 | * @file |
12 | 11 | */ |
— | — | @@ -57,6 +56,9 @@ |
58 | 57 | |
59 | 58 | register_shutdown_function('STDOUT', false); |
60 | 59 | |
| 60 | +/** |
| 61 | + * @todo Needs documentation. |
| 62 | + */ |
61 | 63 | class Cli { |
62 | 64 | public static function parseLanguageCodes( /* string */ $codes ) { |
63 | 65 | $langs = array_map( 'trim', explode( ',', $codes ) ); |
Index: trunk/extensions/Translate/scripts/createCheckIndex.php |
— | — | @@ -3,8 +3,7 @@ |
4 | 4 | * Creates serialised database of messages that need checking for problems. |
5 | 5 | * |
6 | 6 | * @author Niklas Laxstrom |
7 | | - * |
8 | | - * @copyright Copyright © 2008, Niklas Laxström |
| 7 | + * @copyright Copyright © 2008-2010, Niklas Laxström |
9 | 8 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
10 | 9 | * @file |
11 | 10 | */ |
Index: trunk/extensions/Translate/scripts/magic-export-2.php |
— | — | @@ -3,7 +3,6 @@ |
4 | 4 | * Script to export special page aliases and magic words of extensions. |
5 | 5 | * |
6 | 6 | * @author Robert Leverington <robert@rhl.me.uk> |
7 | | - * |
8 | 7 | * @copyright Copyright © 2010 Robert Leverington |
9 | 8 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
10 | 9 | * @file |
— | — | @@ -55,7 +54,9 @@ |
56 | 55 | $handles = array(); |
57 | 56 | $keys = array(); error_reporting( E_ALL | E_STRICT ); |
58 | 57 | foreach ( $groups as $group ) { |
59 | | - if ( !$group instanceof ExtensionMessageGroup ) continue; |
| 58 | + if ( !$group instanceof ExtensionMessageGroup ) { |
| 59 | + continue; |
| 60 | + } |
60 | 61 | |
61 | 62 | if ( $type === 'special' ) { |
62 | 63 | $filename = $group->getAliasFile(); |
— | — | @@ -63,13 +64,20 @@ |
64 | 65 | $filename = $group->getMagicFile(); |
65 | 66 | } |
66 | 67 | |
67 | | - if ( $filename === null ) continue; |
| 68 | + if ( $filename === null ) { |
| 69 | + continue; |
| 70 | + } |
68 | 71 | |
69 | 72 | $file = "$wgTranslateExtensionDirectory/$filename"; |
70 | | - if ( !file_exists( $file ) ) continue; |
| 73 | + if ( !file_exists( $file ) ) { |
| 74 | + continue; |
| 75 | + } |
71 | 76 | |
72 | 77 | include( $file ); |
73 | | - if ( !isset( $aliases ) ) continue; |
| 78 | + if ( !isset( $aliases ) ) { |
| 79 | + continue; |
| 80 | + } |
| 81 | + |
74 | 82 | $keys[$group->getId()] = array_keys( $aliases['en'] ); |
75 | 83 | unset( $aliases ); |
76 | 84 | |
— | — | @@ -97,6 +105,7 @@ |
98 | 106 | } else { |
99 | 107 | STDOUT( "Processing $l..." ); |
100 | 108 | } |
| 109 | + |
101 | 110 | $article = new Article( $title ); |
102 | 111 | $data = $article->getContent(); |
103 | 112 | |
— | — | @@ -106,7 +115,9 @@ |
107 | 116 | array_shift( $segments ); |
108 | 117 | unset( $segments[count( $segments ) -1] ); |
109 | 118 | unset( $segments[count( $segments ) -1] ); |
| 119 | + |
110 | 120 | $messages = array(); |
| 121 | + |
111 | 122 | foreach ( $segments as $segment ) { |
112 | 123 | $parts = explode( '=', $segment ); |
113 | 124 | $key = trim( array_shift( $parts ) ); |
— | — | @@ -119,10 +130,12 @@ |
120 | 131 | STDOUT( "\t{$group}... " ); |
121 | 132 | $thismessages = $messages; // TODO: Reduce. |
122 | 133 | $out = "\$aliases['{$group} '] = array(\n"; |
| 134 | + |
123 | 135 | foreach ( $thismessages as $key => $translations ) { |
124 | 136 | $translations = implode( "', '", $translations ); |
125 | 137 | $out .= "\t'$key' => array( '$translations' ),\n"; |
126 | 138 | } |
| 139 | + |
127 | 140 | $out .= ");\n\n"; |
128 | 141 | fwrite( $handle, $out ); |
129 | 142 | } |
Index: trunk/extensions/Translate/scripts/magic-export.php |
— | — | @@ -3,7 +3,6 @@ |
4 | 4 | * Script to export special page aliases of extensions. |
5 | 5 | * |
6 | 6 | * @author Niklas Laxstrom |
7 | | - * |
8 | 7 | * @copyright Copyright © 2008-2009, Niklas Laxström |
9 | 8 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
10 | 9 | * @file |
— | — | @@ -73,9 +72,7 @@ |
74 | 73 | STDOUT( "Processing {$group->getLabel()}... ", $group->getId() ); |
75 | 74 | |
76 | 75 | $input = file_get_contents( $file ) . "\n"; |
77 | | - |
78 | 76 | $headerEnd = strpos( $input, "\n);\n" ); |
79 | | - |
80 | 77 | $output = substr( $input, 0, $headerEnd + 3 ) . "\n\n"; |
81 | 78 | |
82 | 79 | foreach ( $langs as $l ) { |
Index: trunk/extensions/Translate/scripts/createMessageIndex.php |
— | — | @@ -6,7 +6,6 @@ |
7 | 7 | * reaches a messages from somewhere else than Special:Translate. |
8 | 8 | * |
9 | 9 | * @author Niklas Laxstrom |
10 | | - * |
11 | 10 | * @copyright Copyright © 2008-2009, Niklas Laxström |
12 | 11 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
13 | 12 | * @file |
Index: trunk/extensions/Translate/scripts/pagetranslation-test-parser.php |
— | — | @@ -17,6 +17,9 @@ |
18 | 18 | } |
19 | 19 | require_once( "$IP/maintenance/Maintenance.php" ); |
20 | 20 | |
| 21 | +/** |
| 22 | + * @todo Needs documentation. |
| 23 | + */ |
21 | 24 | class PageTranslationParserTester extends Maintenance { |
22 | 25 | public function __construct() { |
23 | 26 | parent::__construct(); |
Index: trunk/extensions/Translate/scripts/sync-group.php |
— | — | @@ -129,6 +129,9 @@ |
130 | 130 | unset( $group ); |
131 | 131 | } |
132 | 132 | |
| 133 | +/** |
| 134 | + * @todo Needs documentation. |
| 135 | + */ |
133 | 136 | class ChangeSyncer { |
134 | 137 | public $group; |
135 | 138 | public $norc = false; |
Index: trunk/extensions/Translate/scripts/groupStatistics.php |
— | — | @@ -4,13 +4,14 @@ |
5 | 5 | * |
6 | 6 | * @author Niklas Laxstrom |
7 | 7 | * @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 |
11 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
12 | 10 | * @file |
13 | 11 | */ |
14 | 12 | |
| 13 | +/** |
| 14 | + * @todo Needs documentation. |
| 15 | + */ |
15 | 16 | $mostSpokenLanguages = array( |
16 | 17 | // 'language code' => array( position, speakers in millions, continent ), |
17 | 18 | // Source: http://stats.wikimedia.org/EN/Sitemap.htm |
— | — | @@ -70,6 +71,9 @@ |
71 | 72 | 'ku-latn' => array( 50, 26, 'asia' ), |
72 | 73 | ); |
73 | 74 | |
| 75 | +/** |
| 76 | + * @todo Needs documentation. |
| 77 | + */ |
74 | 78 | $localisedWeights = array( |
75 | 79 | 'wikimedia' => array( |
76 | 80 | 'core-0-mostused' => 40, |
— | — | @@ -158,6 +162,9 @@ |
159 | 163 | $optionsWithArgs = array( 'groups', 'output', 'skiplanguages', 'legenddetail', 'legendsummary' ); |
160 | 164 | require( dirname( __FILE__ ) . '/cli.inc' ); |
161 | 165 | |
| 166 | +/** |
| 167 | + * @todo Needs documentation. |
| 168 | + */ |
162 | 169 | class TranslateStatsOutput extends wikiStatsOutput { |
163 | 170 | function heading() { |
164 | 171 | 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 @@ |
31 | 31 | exit( 1 ); |
32 | 32 | } |
33 | 33 | |
34 | | -/** Process command line parameters |
| 34 | +/** |
| 35 | + * Process command line parameters |
35 | 36 | */ |
36 | 37 | if ( isset( $options['help'] ) ) { |
37 | 38 | showUsage(); |
— | — | @@ -73,12 +74,14 @@ |
74 | 75 | return array( $key, $code ); |
75 | 76 | } |
76 | 77 | |
77 | | -/** Select set of edits to report on |
| 78 | +/** |
| 79 | + * Select set of edits to report on |
78 | 80 | */ |
79 | 81 | $rows = TranslateUtils::translationChanges( $hours, $bots, $namespaces ); |
80 | 82 | |
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. |
83 | 86 | */ |
84 | 87 | $codes = array(); |
85 | 88 | foreach ( $rows as $_ ) { |
— | — | @@ -96,7 +99,8 @@ |
97 | 100 | $codes[$code]++; |
98 | 101 | } |
99 | 102 | |
100 | | -/** Sort counts and report descending up to $top rows. |
| 103 | +/** |
| 104 | + * Sort counts and report descending up to $top rows. |
101 | 105 | */ |
102 | 106 | arsort( $codes ); |
103 | 107 | $i = 0; |
Index: trunk/extensions/Translate/scripts/pagetranslation-check-database.php |
— | — | @@ -17,6 +17,9 @@ |
18 | 18 | } |
19 | 19 | require_once( "$IP/maintenance/Maintenance.php" ); |
20 | 20 | |
| 21 | +/** |
| 22 | + * @todo Needs documentation. |
| 23 | + */ |
21 | 24 | class PTCheckDB extends Maintenance { |
22 | 25 | public function __construct() { |
23 | 26 | parent::__construct(); |
— | — | @@ -31,17 +34,18 @@ |
32 | 35 | $dbw = wfGetDB( DB_MASTER ); |
33 | 36 | if ( $this->getOption( 'fix' ) ) { |
34 | 37 | $this->output( "Performing the following fixes:\n" ); |
| 38 | + |
35 | 39 | foreach ( $fixes as $name => $data ) { |
36 | 40 | $this->output( "$name: $data[0]...", $name ); |
37 | 41 | $dbw->delete( $data[1], '*', $data[2], __METHOD__ ); |
38 | 42 | } |
39 | 43 | } else { |
40 | 44 | $this->output( "Use --fix to perform following fixes:\n" ); |
| 45 | + |
41 | 46 | foreach ( $fixes as $name => $data ) { |
42 | 47 | $sql = $dbw->selectSQLtext( $data[1], '*', $data[2] ); |
43 | 48 | $sql = preg_replace( '~^SELECT~', 'DELETE', $sql ); |
44 | 49 | $this->output( "$name: $data[0] - $sql\n" ); |
45 | | - |
46 | 50 | } |
47 | 51 | } |
48 | 52 | } |
— | — | @@ -51,8 +55,10 @@ |
52 | 56 | |
53 | 57 | $dbr = wfGetDB( DB_SLAVE ); |
54 | 58 | $pages = $dbr->select( 'translate_sections', 'trs_page', null, __METHOD__, array( 'GROUP BY' => 'trs_page' ) ); |
| 59 | + |
55 | 60 | $this->output( "Found {$pages->numRows()} pages in the section table\n" ); |
56 | 61 | $this->output( "Checking that they match a valid translatable page...\n\n" ); |
| 62 | + |
57 | 63 | foreach ( $pages as $row ) { |
58 | 64 | $id = $row->trs_page; |
59 | 65 | $sections = $dbr->select( 'translate_sections', 'trs_key', array( 'trs_page' => $id ), __METHOD__ ); |
— | — | @@ -87,6 +93,7 @@ |
88 | 94 | |
89 | 95 | $this->output( "\n" ); |
90 | 96 | } |
| 97 | + |
91 | 98 | return $fixes; |
92 | 99 | } |
93 | 100 | |
— | — | @@ -97,11 +104,16 @@ |
98 | 105 | |
99 | 106 | $result = $dbr->select( 'revtag_type', '*', null, __METHOD__ ); |
100 | 107 | $idToTag = array(); |
101 | | - foreach ( $result as $_ ) $idToTag[$_->rtt_id] = $_->rtt_name; |
| 108 | + |
| 109 | + foreach ( $result as $_ ) { |
| 110 | + $idToTag[$_->rtt_id] = $_->rtt_name; |
| 111 | + } |
| 112 | + |
102 | 113 | $tagToId = array_flip( $idToTag ); |
103 | 114 | |
104 | 115 | $pages = $dbr->select( 'revtag', 'rt_page', null, __METHOD__, array( 'GROUP BY' => 'rt_page' ) ); |
105 | 116 | $this->output( "Checking that tags match a valid page...\n\n" ); |
| 117 | + |
106 | 118 | foreach ( $pages as $row ) { |
107 | 119 | $id = $row->rt_page; |
108 | 120 | $title = Title::newFromID( $id ); |
— | — | @@ -145,12 +157,14 @@ |
146 | 158 | } |
147 | 159 | |
148 | 160 | $this->output( "Checked {$result->numRows()} tags in the revtag table\n\n\n" ); |
| 161 | + |
149 | 162 | return $fixes; |
150 | 163 | } |
151 | 164 | |
152 | 165 | protected function idToName( $id ) { |
153 | 166 | $title = Title::newFromID( $id ); |
154 | 167 | $name = $title ? $title->getPrefixedText() : "#$id"; |
| 168 | + |
155 | 169 | if ( !$title ) { |
156 | 170 | $name .= $this->findDeletedPage( $id ); |
157 | 171 | } |
— | — | @@ -160,6 +174,7 @@ |
161 | 175 | |
162 | 176 | protected function getSectionNames( $result ) { |
163 | 177 | $names = array(); |
| 178 | + |
164 | 179 | foreach ( $result as $section ) { |
165 | 180 | $names[] = $section->trs_key; |
166 | 181 | } |
— | — | @@ -171,19 +186,24 @@ |
172 | 187 | $dbr = wfGetDB( DB_SLAVE ); |
173 | 188 | $page = $dbr->selectRow( 'archive', array( 'ar_namespace', 'ar_title' ), |
174 | 189 | array( 'ar_page_id' => $id ), __METHOD__ ); |
| 190 | + |
175 | 191 | if ( $page ) { |
176 | 192 | $title = Title::makeTitleSafe( $page->ar_namespace, $page->ar_title ); |
177 | 193 | if ( $title ) { |
178 | 194 | return $title->getPrefixedText(); |
179 | 195 | } |
180 | 196 | } |
| 197 | + |
181 | 198 | return false; |
182 | 199 | } |
183 | 200 | |
184 | 201 | protected function checkTransrevRevision( $revId ) { |
185 | 202 | static $cache = array(); |
186 | | - if ( isset( $cache[$revId] ) ) return $cache[$revId]; |
187 | 203 | |
| 204 | + if ( isset( $cache[$revId] ) ) { |
| 205 | + return $cache[$revId]; |
| 206 | + } |
| 207 | + |
188 | 208 | $revision = Revision::newFromId( $revId ); |
189 | 209 | if ( !$revision ) { |
190 | 210 | $cache[$revId] = 'no such revision'; |
Index: trunk/extensions/Translate/scripts/poimport.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Imports po files exported from Special:Translate back. |
| 4 | + * Imports gettext files exported from Special:Translate back. |
5 | 5 | * |
6 | 6 | * @author Niklas Laxström |
7 | 7 | * @copyright Copyright © 2007-2008 Niklas Laxström |
Index: trunk/extensions/Translate/scripts/mwcore-export.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Script to export special core feature of MediaWiki |
| 4 | + * Script to export special core features of MediaWiki. |
5 | 5 | * |
6 | 6 | * @author Niklas Laxstrom |
7 | 7 | * |
— | — | @@ -57,6 +57,7 @@ |
58 | 58 | |
59 | 59 | foreach ( $langs as $l ) { |
60 | 60 | $o = null; |
| 61 | + |
61 | 62 | switch ( $options['type'] ) { |
62 | 63 | case 'special': |
63 | 64 | $o = new SpecialPageAliasesCM( $l ); |
Index: trunk/extensions/Translate/MessageChecks.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | * } |
28 | 28 | * } |
29 | 29 | * @endcode |
30 | | - * |
| 30 | + * |
31 | 31 | * Warnings are of format: <pre> |
32 | 32 | * $warnings[$key][] = array( |
33 | 33 | * array( 'printf', $subcheck, $key, $code ), # check idenfitication |
Index: trunk/extensions/Translate/RcFilter.php |
— | — | @@ -1,15 +1,18 @@ |
2 | 2 | <?php |
3 | 3 | /** |
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. |
6 | 6 | * |
7 | 7 | * @file |
8 | 8 | * @author Niklas Laxström |
9 | | - * |
10 | 9 | * @copyright Copyright © 2010, Niklas Laxström |
11 | 10 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
12 | 11 | */ |
13 | 12 | |
| 13 | +/** |
| 14 | + * Adds a new filter to Special:RecentChanges which makes it possible to filter |
| 15 | + * translations away or show them only. |
| 16 | + */ |
14 | 17 | class TranslateRcFilter { |
15 | 18 | /** |
16 | 19 | * Default action for the filter: ('', 'only', 'filter', 'site') |
— | — | @@ -21,7 +24,7 @@ |
22 | 25 | * documentation of the function parameters. |
23 | 26 | * |
24 | 27 | * Appends SQL filter conditions into $conds. |
25 | | - * @return Boolean true |
| 28 | + * @return \bool true |
26 | 29 | */ |
27 | 30 | public static function translationFilter( &$conds, &$tables, &$join_conds, $opts ) { |
28 | 31 | global $wgRequest, $wgTranslateMessageNamespaces; |
— | — | @@ -57,7 +60,7 @@ |
58 | 61 | * documentation of the function parameters. |
59 | 62 | * |
60 | 63 | * Adds a HTMl selector into $items |
61 | | - * @return Boolean true |
| 64 | + * @return \bool true |
62 | 65 | */ |
63 | 66 | public static function translationFilterForm( &$items, $opts ) { |
64 | 67 | $opts->consumeValue( 'translations' ); |
Index: trunk/extensions/Translate/SpecialTranslationStats.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Contains logic for special page Special:TranslationStats |
| 4 | + * Contains logic for special page Special:TranslationStats. |
5 | 5 | * |
6 | 6 | * @file |
7 | 7 | * @author Niklas Laxström |
Index: trunk/extensions/Translate/FFS.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | public function getWritePath(); |
34 | 34 | |
35 | 35 | /** |
36 | | - * Will parse messages, authors, and any custom data from the file |
| 36 | + * Will parse messages, authors, and any custom data from the file |
37 | 37 | * and return it in associative array with keys like \c AUTHORS and |
38 | 38 | * \c MESSAGES. |
39 | 39 | * @param $code \string Languge code. |
Index: trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php |
— | — | @@ -1,15 +1,20 @@ |
2 | 2 | <?php |
3 | 3 | /** |
| 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 | +/** |
4 | 13 | * Overrides Special:Movepage to to allow renaming a page translation page and |
5 | 14 | * all related translations and derivative pages. |
6 | 15 | * |
7 | 16 | * @ingroup SpecialPage |
8 | 17 | * @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 |
12 | 18 | */ |
13 | | - |
14 | 19 | class SpecialPageTranslationMovePage extends UnlistedSpecialPage { |
15 | 20 | // Basif form parameters both as text and as titles |
16 | 21 | protected $newText, $newTitle, $oldText, $oldTitle; |
— | — | @@ -289,7 +294,9 @@ |
290 | 295 | |
291 | 296 | protected function printChangeLine( $base, $old, $target, $enabled = true ) { |
292 | 297 | global $wgOut; |
| 298 | + |
293 | 299 | $to = $this->newPageTitle( $base, $old, $target ); |
| 300 | + |
294 | 301 | if ( $enabled ) { |
295 | 302 | $wgOut->addWikiText( '* ' . $old->getPrefixedText() . ' → ' . $to ); |
296 | 303 | } else { |
— | — | @@ -319,7 +326,10 @@ |
320 | 327 | if ( $this->moveSubpages ) { |
321 | 328 | $subpages = $this->getSubpages(); |
322 | 329 | foreach ( $subpages as $old ) { |
323 | | - if ( TranslatablePage::isTranslationPage( $old ) ) continue; |
| 330 | + if ( TranslatablePage::isTranslationPage( $old ) ) { |
| 331 | + continue; |
| 332 | + } |
| 333 | + |
324 | 334 | $to = $this->newPageTitle( $base, $old, $target ); |
325 | 335 | $jobs[$old->getPrefixedText()] = MoveJob::newJob( $old, $to, $base, $this->user ); |
326 | 336 | } |
— | — | @@ -341,6 +351,7 @@ |
342 | 352 | |
343 | 353 | $newTpage = TranslatablePage::newFromTitle( $this->newTitle ); |
344 | 354 | $newTpage->addReadyTag( $this->newTitle->getLatestRevId( GAID_FOR_UPDATE ) ); |
| 355 | + |
345 | 356 | if ( $newTpage->getMarkedTag() === $oldLatest ) { |
346 | 357 | $newTpage->addMarkedTag( $this->newTitle->getLatestRevId( GAID_FOR_UPDATE ) ); |
347 | 358 | } |
— | — | @@ -409,8 +420,12 @@ |
410 | 421 | if ( $this->moveSubpages ) { |
411 | 422 | $subpages = $this->getSubpages(); |
412 | 423 | foreach ( $subpages as $old ) { |
413 | | - if ( TranslatablePage::isTranslationPage( $old ) ) continue; |
| 424 | + if ( TranslatablePage::isTranslationPage( $old ) ) { |
| 425 | + continue; |
| 426 | + } |
| 427 | + |
414 | 428 | $new = $this->newPageTitle( $base, $old, $target ); |
| 429 | + |
415 | 430 | if ( !$new ) { |
416 | 431 | $blockers[] = array( 'pt-movepage-block-subpage-invalid', $old->getPrefixedText() ); |
417 | 432 | } elseif ( $new->exists() ) { |
— | — | @@ -435,6 +450,7 @@ |
436 | 451 | */ |
437 | 452 | protected function newPageTitle( $base, Title $old, Title $target ) { |
438 | 453 | $search = preg_quote( $base, '~' ); |
| 454 | + |
439 | 455 | if ( $old->getNamespace() == NS_TRANSLATIONS ) { |
440 | 456 | $new = $old->getText(); |
441 | 457 | $new = preg_replace( "~^$search~", $target->getPrefixedText(), $new, 1 ); |
— | — | @@ -482,5 +498,4 @@ |
483 | 499 | protected function getSubpages() { |
484 | 500 | return $this->page->getTitle()->getSubpages(); |
485 | 501 | } |
486 | | - |
487 | 502 | } |
Index: trunk/extensions/Translate/tag/MoveJob.php |
— | — | @@ -1,14 +1,18 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Job for moving translation pages. |
| 4 | + * Contains class with job for moving translation pages. |
5 | 5 | * |
6 | | - * @ingroup Extensions |
7 | | - * |
| 6 | + * @file |
8 | 7 | * @author Niklas Laxström |
9 | 8 | * @copyright Copyright © 2008-2010, Niklas Laxström |
10 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
11 | 10 | */ |
12 | 11 | |
| 12 | +/** |
| 13 | + * Contains class with job for moving translation pages. |
| 14 | + * |
| 15 | + * @ingroup PageTranslation |
| 16 | + */ |
13 | 17 | class MoveJob extends Job { |
14 | 18 | public static function newJob( Title $source, Title $target, $base, /*User*/ $performer ) { |
15 | 19 | global $wgTranslateFuzzyBotName; |
— | — | @@ -182,6 +186,4 @@ |
183 | 187 | } |
184 | 188 | $wgUser->clearInstanceCache(); |
185 | 189 | } |
186 | | - |
187 | | - |
188 | 190 | } |
Index: trunk/extensions/Translate/tag/TPSection.php |
— | — | @@ -2,11 +2,16 @@ |
3 | 3 | /** |
4 | 4 | * This class represents one section of a translatable page. |
5 | 5 | * |
| 6 | + * @file |
6 | 7 | * @author Niklas Laxström |
7 | | - * @copyright Copyright © 2009 Niklas Laxström |
| 8 | + * @copyright Copyright © 2009-2010 Niklas Laxström |
8 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
9 | 10 | */ |
10 | 11 | |
| 12 | +/** |
| 13 | + * @todo Needs documentation. |
| 14 | + * @ingroup PageTranslation |
| 15 | + */ |
11 | 16 | class TPSection { |
12 | 17 | public $id, $name, $text, $type; |
13 | 18 | |
Index: trunk/extensions/Translate/tag/TranslatablePage.php |
— | — | @@ -1,6 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | 4 | * Translatable page model. |
| 5 | + |
5 | 6 | * @defgroup PageTranslation Page Translation |
6 | 7 | * @file |
7 | 8 | * @author Niklas Laxström |
— | — | @@ -295,6 +296,7 @@ |
296 | 297 | * |
297 | 298 | * May throw a TPException if there is error with existing section |
298 | 299 | * markers. |
| 300 | + * |
299 | 301 | * @param $content string Content of one section |
300 | 302 | * @return TPSection |
301 | 303 | */ |
— | — | @@ -421,7 +423,6 @@ |
422 | 424 | } |
423 | 425 | } |
424 | 426 | |
425 | | - |
426 | 427 | public function getTranslationUrl( $code = false ) { |
427 | 428 | $translate = SpecialPage::getTitleFor( 'Translate' ); |
428 | 429 | $params = array( |
Index: trunk/extensions/Translate/tag/RenderJob.php |
— | — | @@ -9,6 +9,10 @@ |
10 | 10 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
11 | 11 | */ |
12 | 12 | |
| 13 | +/** |
| 14 | + * @todo Needs documentation. |
| 15 | + * @ingroup PageTranslation |
| 16 | + */ |
13 | 17 | class RenderJob extends Job { |
14 | 18 | public static function newJob( Title $target ) { |
15 | 19 | global $wgTranslateFuzzyBotName; |
— | — | @@ -52,7 +56,7 @@ |
53 | 57 | |
54 | 58 | $article = new Article( $title ); |
55 | 59 | |
56 | | - // TODO: fuzzybot hack |
| 60 | + // @todo Fuzzybot hack |
57 | 61 | PageTranslationHooks::$allowTargetEdit = true; |
58 | 62 | |
59 | 63 | // User hack |
Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -1,4 +1,13 @@ |
2 | 2 | <?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 | + */ |
3 | 12 | |
4 | 13 | /** |
5 | 14 | * A special page for marking revisions of pages for translation. |
— | — | @@ -9,10 +18,6 @@ |
10 | 19 | * |
11 | 20 | * @ingroup SpecialPage |
12 | 21 | * @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 |
17 | 22 | */ |
18 | 23 | class SpecialPageTranslation extends SpecialPage { |
19 | 24 | function __construct() { |
Index: trunk/extensions/Translate/tag/TPParse.php |
— | — | @@ -3,11 +3,16 @@ |
4 | 4 | * This class represents the results of parsed source page, that is, the |
5 | 5 | * extracted sections and a template. |
6 | 6 | * |
| 7 | + * @file |
7 | 8 | * @author Niklas Laxström |
8 | 9 | * @copyright Copyright © 2009-2010 Niklas Laxström |
9 | 10 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
10 | 11 | */ |
11 | 12 | |
| 13 | +/** |
| 14 | + * @todo Needs documentation. |
| 15 | + * @ingroup PageTranslation |
| 16 | + */ |
12 | 17 | class TPParse { |
13 | 18 | protected $title = null; |
14 | 19 | |
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php |
— | — | @@ -1,5 +1,19 @@ |
2 | 2 | <?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 | + */ |
3 | 11 | |
| 12 | +/** |
| 13 | + * Hooks for page translation. |
| 14 | + * |
| 15 | + * @todo Methods need documentation. |
| 16 | + * @ingroup PageTranslation |
| 17 | + */ |
4 | 18 | class PageTranslationHooks { |
5 | 19 | // Uuugly hack |
6 | 20 | static $allowTargetEdit = false; |
— | — | @@ -564,7 +578,4 @@ |
565 | 579 | |
566 | 580 | return true; |
567 | 581 | } |
568 | | - |
569 | | - |
570 | | - |
571 | 582 | } |
Index: trunk/extensions/Translate/SpecialTranslationChanges.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Contains logic for special page Special:TranslationChanges |
| 4 | + * Contains logic for special page Special:TranslationChanges. |
5 | 5 | * |
6 | 6 | * @file |
7 | 7 | * @author Niklas Laxström |
Index: trunk/extensions/Translate/Doxyfile |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | GENERATE_TESTLIST = YES |
41 | 41 | GENERATE_BUGLIST = YES |
42 | 42 | GENERATE_DEPRECATEDLIST= YES |
43 | | -ENABLED_SECTIONS = |
| 43 | +ENABLED_SECTIONS = |
44 | 44 | MAX_INITIALIZER_LINES = 30 |
45 | 45 | SHOW_USED_FILES = YES |
46 | 46 | SHOW_DIRECTORIES = NO |
— | — | @@ -56,18 +56,18 @@ |
57 | 57 | #--------------------------------------------------------------------------- |
58 | 58 | # configuration options related to the input files |
59 | 59 | #--------------------------------------------------------------------------- |
60 | | -INPUT = |
| 60 | +INPUT = |
61 | 61 | FILE_PATTERNS = *.php |
62 | 62 | RECURSIVE = YES |
63 | 63 | EXCLUDE = spyc |
64 | 64 | EXCLUDE_SYMLINKS = YES |
65 | 65 | EXCLUDE_PATTERNS = *.i18n.php .svn {{EXCLUDE}} |
66 | | -EXAMPLE_PATH = |
| 66 | +EXAMPLE_PATH = |
67 | 67 | EXAMPLE_PATTERNS = * |
68 | 68 | EXAMPLE_RECURSIVE = NO |
69 | | -IMAGE_PATH = |
70 | | -INPUT_FILTER = |
71 | | -FILTER_PATTERNS = |
| 69 | +IMAGE_PATH = |
| 70 | +INPUT_FILTER = |
| 71 | +FILTER_PATTERNS = |
72 | 72 | FILTER_SOURCE_FILES = NO |
73 | 73 | #--------------------------------------------------------------------------- |
74 | 74 | # configuration options related to source browsing |
— | — | @@ -84,20 +84,20 @@ |
85 | 85 | #--------------------------------------------------------------------------- |
86 | 86 | ALPHABETICAL_INDEX = NO |
87 | 87 | COLS_IN_ALPHA_INDEX = 5 |
88 | | -IGNORE_PREFIX = |
| 88 | +IGNORE_PREFIX = |
89 | 89 | #--------------------------------------------------------------------------- |
90 | 90 | # configuration options related to the HTML output |
91 | 91 | #--------------------------------------------------------------------------- |
92 | 92 | GENERATE_HTML = YES |
93 | 93 | HTML_OUTPUT = html |
94 | 94 | HTML_FILE_EXTENSION = .html |
95 | | -HTML_HEADER = |
96 | | -HTML_FOOTER = |
97 | | -HTML_STYLESHEET = |
| 95 | +HTML_HEADER = |
| 96 | +HTML_FOOTER = |
| 97 | +HTML_STYLESHEET = |
98 | 98 | HTML_ALIGN_MEMBERS = YES |
99 | 99 | GENERATE_HTMLHELP = NO |
100 | | -CHM_FILE = |
101 | | -HHC_LOCATION = |
| 100 | +CHM_FILE = |
| 101 | +HHC_LOCATION = |
102 | 102 | GENERATE_CHI = NO |
103 | 103 | BINARY_TOC = NO |
104 | 104 | TOC_EXPAND = YES |
— | — | @@ -114,8 +114,8 @@ |
115 | 115 | MAKEINDEX_CMD_NAME = makeindex |
116 | 116 | COMPACT_LATEX = NO |
117 | 117 | PAPER_TYPE = a4wide |
118 | | -EXTRA_PACKAGES = |
119 | | -LATEX_HEADER = |
| 118 | +EXTRA_PACKAGES = |
| 119 | +LATEX_HEADER = |
120 | 120 | PDF_HYPERLINKS = YES |
121 | 121 | USE_PDFLATEX = YES |
122 | 122 | LATEX_BATCHMODE = NO |
— | — | @@ -127,8 +127,8 @@ |
128 | 128 | RTF_OUTPUT = rtf |
129 | 129 | COMPACT_RTF = NO |
130 | 130 | RTF_HYPERLINKS = NO |
131 | | -RTF_STYLESHEET_FILE = |
132 | | -RTF_EXTENSIONS_FILE = |
| 131 | +RTF_STYLESHEET_FILE = |
| 132 | +RTF_EXTENSIONS_FILE = |
133 | 133 | #--------------------------------------------------------------------------- |
134 | 134 | # configuration options related to the man page output |
135 | 135 | #--------------------------------------------------------------------------- |
— | — | @@ -141,8 +141,8 @@ |
142 | 142 | #--------------------------------------------------------------------------- |
143 | 143 | GENERATE_XML = NO |
144 | 144 | XML_OUTPUT = xml |
145 | | -XML_SCHEMA = |
146 | | -XML_DTD = |
| 145 | +XML_SCHEMA = |
| 146 | +XML_DTD = |
147 | 147 | XML_PROGRAMLISTING = YES |
148 | 148 | #--------------------------------------------------------------------------- |
149 | 149 | # configuration options for the AutoGen Definitions output |
— | — | @@ -154,29 +154,29 @@ |
155 | 155 | GENERATE_PERLMOD = NO |
156 | 156 | PERLMOD_LATEX = NO |
157 | 157 | PERLMOD_PRETTY = YES |
158 | | -PERLMOD_MAKEVAR_PREFIX = |
| 158 | +PERLMOD_MAKEVAR_PREFIX = |
159 | 159 | #--------------------------------------------------------------------------- |
160 | | -# Configuration options related to the preprocessor |
| 160 | +# Configuration options related to the preprocessor |
161 | 161 | #--------------------------------------------------------------------------- |
162 | 162 | ENABLE_PREPROCESSING = YES |
163 | 163 | MACRO_EXPANSION = NO |
164 | 164 | EXPAND_ONLY_PREDEF = NO |
165 | 165 | 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 = |
170 | 170 | SKIP_FUNCTION_MACROS = YES |
171 | 171 | #--------------------------------------------------------------------------- |
172 | | -# Configuration::additions related to external references |
| 172 | +# Configuration::additions related to external references |
173 | 173 | #--------------------------------------------------------------------------- |
174 | | -TAGFILES = |
175 | | -GENERATE_TAGFILE = |
| 174 | +TAGFILES = |
| 175 | +GENERATE_TAGFILE = |
176 | 176 | ALLEXTERNALS = NO |
177 | 177 | EXTERNAL_GROUPS = YES |
178 | 178 | PERL_PATH = /usr/bin/perl |
179 | 179 | #--------------------------------------------------------------------------- |
180 | | -# Configuration options related to the dot tool |
| 180 | +# Configuration options related to the dot tool |
181 | 181 | #--------------------------------------------------------------------------- |
182 | 182 | CLASS_DIAGRAMS = NO |
183 | 183 | HIDE_UNDOC_RELATIONS = YES |
— | — | @@ -192,15 +192,15 @@ |
193 | 193 | GRAPHICAL_HIERARCHY = YES |
194 | 194 | DIRECTORY_GRAPH = YES |
195 | 195 | DOT_IMAGE_FORMAT = png |
196 | | -DOT_PATH = |
197 | | -DOTFILE_DIRS = |
| 196 | +DOT_PATH = |
| 197 | +DOTFILE_DIRS = |
198 | 198 | MAX_DOT_GRAPH_DEPTH = 1000 |
199 | 199 | DOT_TRANSPARENT = NO |
200 | 200 | DOT_MULTI_TARGETS = NO |
201 | 201 | GENERATE_LEGEND = YES |
202 | 202 | DOT_CLEANUP = YES |
203 | 203 | #--------------------------------------------------------------------------- |
204 | | -# Configuration::additions related to the search engine |
| 204 | +# Configuration::additions related to the search engine |
205 | 205 | #--------------------------------------------------------------------------- |
206 | 206 | SEARCHENGINE = NO |
207 | 207 | |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -592,7 +592,7 @@ |
593 | 593 | */ |
594 | 594 | $field = array( 'rtt_name' => $tag ); |
595 | 595 | $ret = $dbw->selectField( 'revtag_type', 'rtt_name', $field, __METHOD__ ); |
596 | | - |
| 596 | + |
597 | 597 | if ( $ret !== $tag ) { |
598 | 598 | $dbw->insert( 'revtag_type', $field, __METHOD__ ); |
599 | 599 | } |