r45773 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45772‎ | r45773 | r45774 >
Date:17:18, 15 January 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* Support code for a new group
Modified paths:
  • /trunk/extensions/Translate/_autoload.php (modified) (history)
  • /trunk/extensions/Translate/groups/Commonist.php (added) (history)

Diff [purge]

Index: trunk/extensions/Translate/groups/Commonist.php
@@ -0,0 +1,42 @@
 2+<?php
 3+
 4+class CommonistMessageGroup extends MessageGroup {
 5+ protected $label = 'Commonist';
 6+ protected $id = 'out-commonist';
 7+ #protected $type = '';
 8+
 9+ protected $fileDir = '__BUG__';
 10+
 11+ public function getPath() { return $this->fileDir; }
 12+ public function setPath( $value ) { $this->fileDir = $value; }
 13+
 14+
 15+ protected $optional = array(
 16+ );
 17+
 18+ protected $ignored = array(
 19+ );
 20+
 21+ public function getMessageFile( $code ) {
 22+ if ( $code == 'en' ) {
 23+ return 'messages.properties';
 24+ } else {
 25+ if ( isset( $this->codeMap[$code] ) ) {
 26+ $code = $this->codeMap[$code];
 27+ }
 28+ return "messages_$code.properties";
 29+ }
 30+ }
 31+
 32+ protected function getFileLocation( $code ) {
 33+ return $this->fileDir . '/' . $this->getMessageFile( $code );
 34+ }
 35+
 36+ public function getReader( $code ) {
 37+ return new JavaFormatReader( $this->getFileLocation( $code ) );
 38+ }
 39+
 40+ public function getWriter() {
 41+ return new JavaFormatWriter( $this );
 42+ }
 43+}
Property changes on: trunk/extensions/Translate/groups/Commonist.php
___________________________________________________________________
Name: svn:eol-style
144 + native
Index: trunk/extensions/Translate/_autoload.php
@@ -68,6 +68,7 @@
6969
7070 # predefined groups
7171 $wgAutoloadClasses['PremadeMediawikiExtensionGroups'] = $dir . 'groups/MediaWikiExtensions.php';
 72+$wgAutoloadClasses['CommonistMessageGroup'] = $dir . 'groups/Commonist.php';
7273 $wgAutoloadClasses['FreeColMessageGroup'] = $dir . 'groups/FreeCol.php';
7374 $wgAutoloadClasses['MantisMessageGroup'] = $dir . 'groups/Mantis.php';
7475

Status & tagging log