Index: trunk/extensions/Translate/ffs/Simple.php |
— | — | @@ -8,6 +8,9 @@ |
9 | 9 | * @file |
10 | 10 | */ |
11 | 11 | |
| 12 | +/** |
| 13 | + * @todo Needs documentation. |
| 14 | + */ |
12 | 15 | class SimpleFormatReader { |
13 | 16 | const SEPARATOR = '----'; |
14 | 17 | const AUTHORPREFIX = 'Author: '; |
— | — | @@ -94,6 +97,9 @@ |
95 | 98 | } |
96 | 99 | } |
97 | 100 | |
| 101 | +/** |
| 102 | + * @todo Needs documentation. |
| 103 | + */ |
98 | 104 | class SimpleFormatWriter { |
99 | 105 | const SEPARATOR = '----'; |
100 | 106 | const AUTHORPREFIX = 'Author: '; |
— | — | @@ -147,6 +153,7 @@ |
148 | 154 | |
149 | 155 | wfMkdirParents( dirname( $target ) ); |
150 | 156 | $handle = fopen( $target, 'wt' ); |
| 157 | + |
151 | 158 | if ( $handle === false ) { |
152 | 159 | throw new MWException( "Unable to open target for writing" ); |
153 | 160 | } |
— | — | @@ -229,11 +236,14 @@ |
230 | 237 | |
231 | 238 | protected function formatAuthors( $prefix, $code ) { |
232 | 239 | // Check if there is any authors at all |
233 | | - if ( empty( $this->authors[$code] ) ) return ''; |
| 240 | + if ( empty( $this->authors[$code] ) ) { |
| 241 | + return ''; |
| 242 | + } |
234 | 243 | |
235 | 244 | $groupId = $this->group->getId(); |
236 | 245 | $authors = $this->authors[$code]; |
237 | 246 | $authors = $this->filterAuthors( $authors, $code, $groupId ); |
| 247 | + |
238 | 248 | if ( empty( $authors ) ) { |
239 | 249 | return ''; |
240 | 250 | } |
— | — | @@ -256,6 +266,7 @@ |
257 | 267 | |
258 | 268 | protected function exportMessages( $handle, MessageCollection $collection ) { |
259 | 269 | $mangler = $this->group->getMangler(); |
| 270 | + |
260 | 271 | foreach ( $collection as $item ) { |
261 | 272 | $key = $mangler->unMangle( $item->key() ); |
262 | 273 | $value = str_replace( TRANSLATE_FUZZY, '', $item->translation() ); |
Index: trunk/extensions/Translate/ffs/WikiExtension.php |
— | — | @@ -2,12 +2,15 @@ |
3 | 3 | /** |
4 | 4 | * Multiple language wiki file format handler. |
5 | 5 | * |
| 6 | + * @file |
6 | 7 | * @author Niklas Laxström |
7 | 8 | * @copyright Copyright © 2008, Niklas Laxström |
8 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
9 | | - * @file |
10 | 10 | */ |
11 | 11 | |
| 12 | +/** |
| 13 | + * @todo Needs documentation and conversion to new style message group. |
| 14 | + */ |
12 | 15 | class WikiExtensionFormatReader extends WikiFormatReader { |
13 | 16 | public function parseSections( $var ) { |
14 | 17 | if ( $this->filename === false ) { |
— | — | @@ -77,6 +80,9 @@ |
78 | 81 | } |
79 | 82 | } |
80 | 83 | |
| 84 | +/** |
| 85 | + * @todo Needs documentation and conversion to new style message group. |
| 86 | + */ |
81 | 87 | class WikiExtensionFormatWriter extends WikiFormatWriter { |
82 | 88 | // Inherit |
83 | 89 | protected $authors; |
Index: trunk/extensions/Translate/ffs/Wiki.php |
— | — | @@ -8,6 +8,9 @@ |
9 | 9 | * @file |
10 | 10 | */ |
11 | 11 | |
| 12 | +/** |
| 13 | + * @todo Needs documentation. |
| 14 | + */ |
12 | 15 | class WikiFormatReader extends SimpleFormatReader { |
13 | 16 | // Set by creater |
14 | 17 | public $variableName = 'messages'; |
— | — | @@ -71,6 +74,9 @@ |
72 | 75 | |
73 | 76 | } |
74 | 77 | |
| 78 | +/** |
| 79 | + * @todo Needs documentation. |
| 80 | + */ |
75 | 81 | class WikiFormatWriter extends SimpleFormatWriter { |
76 | 82 | public $commaToArray = false; |
77 | 83 | |
— | — | @@ -155,6 +161,7 @@ |
156 | 162 | // We copy only relevant translations to this new array |
157 | 163 | $new = array(); |
158 | 164 | $mangler = $this->group->getMangler(); |
| 165 | + |
159 | 166 | foreach ( $messages as $key => $m ) { |
160 | 167 | $key = $mangler->unMangle( $key ); |
161 | 168 | # Remove fuzzy markings before export |
Index: trunk/extensions/Translate/ffs/Xliff.php |
— | — | @@ -12,6 +12,8 @@ |
13 | 13 | /** |
14 | 14 | * This writer creates standard compliant XLIFF documents. Currently it only |
15 | 15 | * writes little more than what is mandatory. |
| 16 | + * |
| 17 | + * @deprecated Old style writer. |
16 | 18 | */ |
17 | 19 | class XliffFormatWriter extends SimpleFormatWriter { |
18 | 20 | // Re-implemented |