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 |
1 | 44 | + native |
Index: trunk/extensions/Translate/_autoload.php |
— | — | @@ -68,6 +68,7 @@ |
69 | 69 | |
70 | 70 | # predefined groups |
71 | 71 | $wgAutoloadClasses['PremadeMediawikiExtensionGroups'] = $dir . 'groups/MediaWikiExtensions.php'; |
| 72 | +$wgAutoloadClasses['CommonistMessageGroup'] = $dir . 'groups/Commonist.php'; |
72 | 73 | $wgAutoloadClasses['FreeColMessageGroup'] = $dir . 'groups/FreeCol.php'; |
73 | 74 | $wgAutoloadClasses['MantisMessageGroup'] = $dir . 'groups/Mantis.php'; |
74 | 75 | |