r49188 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49187‎ | r49188 | r49189 >
Date:22:12, 4 April 2009
Author:siebrand
Status:deferred
Tags:
Comment:
* Add experimental support for NOCC
* Update README
Modified paths:
  • /trunk/extensions/Translate/MessageChecks.php (modified) (history)
  • /trunk/extensions/Translate/README (modified) (history)
  • /trunk/extensions/Translate/SpecialTranslationChanges.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/_autoload.php (modified) (history)
  • /trunk/extensions/Translate/groups/Nocc.php (added) (history)

Diff [purge]

Index: trunk/extensions/Translate/SpecialTranslationChanges.php
@@ -80,6 +80,7 @@
8181 case 'core': $class = 'mediawiki'; break;
8282 case 'out-freecol': $class = 'freecol'; break;
8383 case 'out-mantis': $class = 'mantis'; break;
 84+ case 'out-nocc': $class = 'nocc'; break;
8485 case 'out-voctrain': $class = 'voctrain'; break;
8586 case 'out-zabbix': $class = 'zabbix'; break;
8687 default: $class = 'extension'; break;
Index: trunk/extensions/Translate/groups/Nocc.php
@@ -0,0 +1,69 @@
 2+<?php
 3+/**
 4+ * Support NOCC: http://nocc.sourceforge.net.
 5+ *
 6+ * @addtogroup Extensions
 7+ *
 8+ * @author Siebrand Mazeland
 9+ * @copyright Copyright � 2009, Siebrand Mazeland
 10+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 11+ */
 12+
 13+class NoccMessageGroup extends MessageGroup {
 14+ protected $label = 'NOCC (webmail client)';
 15+ protected $id = 'out-nocc';
 16+ protected $type = 'nocc';
 17+
 18+ protected $fileDir = '__BUG__';
 19+
 20+ public function getPath() { return $this->fileDir; }
 21+ public function setPath( $value ) { $this->fileDir = $value; }
 22+
 23+ protected $codeMap = array(
 24+ 'fa' => 'farsi',
 25+ 'sr-el' => 'sr',
 26+ 'ko' => 'kr',
 27+ 'zh-hans' => 'zh-gb',
 28+ 'zh-hant' => 'zh-tw',
 29+ );
 30+
 31+/* protected $optional = array(
 32+ 'key',
 33+ ); */
 34+
 35+ public $header = '<?php
 36+/**
 37+ * Language configuration file for NOCC
 38+ *
 39+ * Copyright 2001 Nicolas Chalanset <nicocha@free.fr>
 40+ * Copyright 2001 Olivier Cahagne <cahagn_o@epita.fr>
 41+ *
 42+ * This file is part of NOCC. NOCC is free software under the terms of the
 43+ * GNU General Public License. You should have received a copy of the license
 44+ * along with NOCC. If not, see <http://www.gnu.org/licenses/>.
 45+ *
 46+ * @package NOCC
 47+ * @subpackage Translations
 48+ * @license http://www.gnu.org/licenses/ GNU General Public License
 49+ * @version SVN: $Id$
 50+ */';
 51+
 52+ public function getMessageFile( $code ) {
 53+ if ( isset( $this->codeMap[$code] ) ) {
 54+ $code = $this->codeMap[$code];
 55+ }
 56+ return "$code.php";
 57+ }
 58+
 59+ protected function getFileLocation( $code ) {
 60+ return $this->fileDir . '/' . $this->getMessageFile( $code );
 61+ }
 62+
 63+ public function getReader( $code ) {
 64+ return new PhpVariablesFormatReader( $this->getFileLocation( $code ) );
 65+ }
 66+
 67+ public function getWriter() {
 68+ return new PhpVariablesFormatWriter( $this );
 69+ }
 70+}
Property changes on: trunk/extensions/Translate/groups/Nocc.php
___________________________________________________________________
Added: svn:eol-style
171 + native
Added: svn:keywords
272 + Id
Index: trunk/extensions/Translate/Translate.php
@@ -11,7 +11,7 @@
1212 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1313 */
1414
15 -define( 'TRANSLATE_VERSION', '11:2009-03-27' );
 15+define( 'TRANSLATE_VERSION', '11:2009-04-04:2' );
1616
1717 $wgExtensionCredits['specialpage'][] = array(
1818 'name' => 'Translate',
Index: trunk/extensions/Translate/MessageChecks.php
@@ -32,6 +32,11 @@
3333 'checkPrintfExtraVars',
3434 'checkBalance',
3535 ),
 36+ 'nocc' => array(
 37+ 'checkPrintfMissingVars',
 38+ 'checkPrintfExtraVars',
 39+ 'checkBalance',
 40+ ),
3641 'voctrain' => array(
3742 'checkI18nSprintMissingVars',
3843 'checkI18nSprintExtraVars',
Index: trunk/extensions/Translate/_autoload.php
@@ -71,6 +71,7 @@
7272 $wgAutoloadClasses['CommonistMessageGroup'] = $dir . 'groups/Commonist.php';
7373 $wgAutoloadClasses['FreeColMessageGroup'] = $dir . 'groups/FreeCol.php';
7474 $wgAutoloadClasses['MantisMessageGroup'] = $dir . 'groups/Mantis.php';
 75+$wgAutoloadClasses['NoccMessageGroup'] = $dir . 'groups/Nocc.php';
7576
7677 # tag
7778 $wgAutoloadClasses['TranslateTag'] = $dir . 'tag/Tag.php';
Index: trunk/extensions/Translate/README
@@ -33,6 +33,9 @@
3434 </code>
3535
3636 == Changes in version 11 ==
 37+* 2009-04-04:2 Experimental support added for NOCC
 38+* 2009-04-04:1 PhpVariables Mantis header inconsistency fixed
 39+* 2009-03-29 Table header on Special:LanguageStats suppressed when all translations are complete
3740
3841 == Changes in version 10 ==
3942 * 2009-03-24 Also 2 decimals for fuzzy in Special:LanguageStats

Status & tagging log