r71381 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71380‎ | r71381 | r71382 >
Date:22:10, 20 August 2010
Author:siebrand
Status:deferred
Tags:
Comment:
Documentation update.
Modified paths:
  • /trunk/extensions/Translate/ffs/Simple.php (modified) (history)
  • /trunk/extensions/Translate/ffs/Wiki.php (modified) (history)
  • /trunk/extensions/Translate/ffs/WikiExtension.php (modified) (history)
  • /trunk/extensions/Translate/ffs/Xliff.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/ffs/Simple.php
@@ -8,6 +8,9 @@
99 * @file
1010 */
1111
 12+/**
 13+ * @todo Needs documentation.
 14+ */
1215 class SimpleFormatReader {
1316 const SEPARATOR = '----';
1417 const AUTHORPREFIX = 'Author: ';
@@ -94,6 +97,9 @@
9598 }
9699 }
97100
 101+/**
 102+ * @todo Needs documentation.
 103+ */
98104 class SimpleFormatWriter {
99105 const SEPARATOR = '----';
100106 const AUTHORPREFIX = 'Author: ';
@@ -147,6 +153,7 @@
148154
149155 wfMkdirParents( dirname( $target ) );
150156 $handle = fopen( $target, 'wt' );
 157+
151158 if ( $handle === false ) {
152159 throw new MWException( "Unable to open target for writing" );
153160 }
@@ -229,11 +236,14 @@
230237
231238 protected function formatAuthors( $prefix, $code ) {
232239 // Check if there is any authors at all
233 - if ( empty( $this->authors[$code] ) ) return '';
 240+ if ( empty( $this->authors[$code] ) ) {
 241+ return '';
 242+ }
234243
235244 $groupId = $this->group->getId();
236245 $authors = $this->authors[$code];
237246 $authors = $this->filterAuthors( $authors, $code, $groupId );
 247+
238248 if ( empty( $authors ) ) {
239249 return '';
240250 }
@@ -256,6 +266,7 @@
257267
258268 protected function exportMessages( $handle, MessageCollection $collection ) {
259269 $mangler = $this->group->getMangler();
 270+
260271 foreach ( $collection as $item ) {
261272 $key = $mangler->unMangle( $item->key() );
262273 $value = str_replace( TRANSLATE_FUZZY, '', $item->translation() );
Index: trunk/extensions/Translate/ffs/WikiExtension.php
@@ -2,12 +2,15 @@
33 /**
44 * Multiple language wiki file format handler.
55 *
 6+ * @file
67 * @author Niklas Laxström
78 * @copyright Copyright © 2008, Niklas Laxström
89 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
9 - * @file
1010 */
1111
 12+/**
 13+ * @todo Needs documentation and conversion to new style message group.
 14+ */
1215 class WikiExtensionFormatReader extends WikiFormatReader {
1316 public function parseSections( $var ) {
1417 if ( $this->filename === false ) {
@@ -77,6 +80,9 @@
7881 }
7982 }
8083
 84+/**
 85+ * @todo Needs documentation and conversion to new style message group.
 86+ */
8187 class WikiExtensionFormatWriter extends WikiFormatWriter {
8288 // Inherit
8389 protected $authors;
Index: trunk/extensions/Translate/ffs/Wiki.php
@@ -8,6 +8,9 @@
99 * @file
1010 */
1111
 12+/**
 13+ * @todo Needs documentation.
 14+ */
1215 class WikiFormatReader extends SimpleFormatReader {
1316 // Set by creater
1417 public $variableName = 'messages';
@@ -71,6 +74,9 @@
7275
7376 }
7477
 78+/**
 79+ * @todo Needs documentation.
 80+ */
7581 class WikiFormatWriter extends SimpleFormatWriter {
7682 public $commaToArray = false;
7783
@@ -155,6 +161,7 @@
156162 // We copy only relevant translations to this new array
157163 $new = array();
158164 $mangler = $this->group->getMangler();
 165+
159166 foreach ( $messages as $key => $m ) {
160167 $key = $mangler->unMangle( $key );
161168 # Remove fuzzy markings before export
Index: trunk/extensions/Translate/ffs/Xliff.php
@@ -12,6 +12,8 @@
1313 /**
1414 * This writer creates standard compliant XLIFF documents. Currently it only
1515 * writes little more than what is mandatory.
 16+ *
 17+ * @deprecated Old style writer.
1618 */
1719 class XliffFormatWriter extends SimpleFormatWriter {
1820 // Re-implemented

Status & tagging log