Index: trunk/extensions/Translate/groups/Wikiblame.php |
— | — | @@ -0,0 +1,47 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Support Wikiblame: http://wikipedia.ramselehof.de/wikiblame.php. |
| 5 | + * |
| 6 | + * @addtogroup Extensions |
| 7 | + * |
| 8 | + * @copyright Copyright © 2009, Siebrand Mazeland |
| 9 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 10 | + * |
| 11 | + */ |
| 12 | + |
| 13 | +class WikiblameMessageGroup extends MessageGroup { |
| 14 | + protected $label = 'Wikiblame'; |
| 15 | + protected $id = 'out-wikiblame'; |
| 16 | + protected $type = 'wikiblame'; |
| 17 | + |
| 18 | + protected $fileDir = '__BUG__'; |
| 19 | + |
| 20 | + public function getPath() { return $this->fileDir; } |
| 21 | + public function setPath( $value ) { $this->fileDir = $value; } |
| 22 | + |
| 23 | + protected $optional = array(); |
| 24 | + |
| 25 | + public $header = '<?php |
| 26 | +/** Wikiblame |
| 27 | + * |
| 28 | + */'; |
| 29 | + |
| 30 | + public function getMessageFile( $code ) { |
| 31 | + if ( isset( $this->codeMap[$code] ) ) { |
| 32 | + $code = $this->codeMap[$code]; |
| 33 | + } |
| 34 | + return "$code.php"; |
| 35 | + } |
| 36 | + |
| 37 | + protected function getFileLocation( $code ) { |
| 38 | + return $this->fileDir . '/' . $this->getMessageFile( $code ); |
| 39 | + } |
| 40 | + |
| 41 | + public function getReader( $code ) { |
| 42 | + return new PhpVariablesFormatReader( $this->getFileLocation( $code ) ); |
| 43 | + } |
| 44 | + |
| 45 | + public function getWriter() { |
| 46 | + return new PhpVariablesFormatWriter( $this ); |
| 47 | + } |
| 48 | +} |
Property changes on: trunk/extensions/Translate/groups/Wikiblame.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 49 | + native |
Name: svn:keywords |
2 | 50 | + Id |
Index: trunk/extensions/Translate/_autoload.php |
— | — | @@ -84,6 +84,7 @@ |
85 | 85 | $wgAutoloadClasses['MantisMessageGroup'] = $dir . 'groups/Mantis.php'; |
86 | 86 | $wgAutoloadClasses['NoccMessageGroup'] = $dir . 'groups/Nocc.php'; |
87 | 87 | $wgAutoloadClasses['OpenLayersMessageGroup'] = $dir . 'groups/OpenLayers.php'; |
| 88 | +$wgAutoloadClasses['WikiblameMessageGroup'] = $dir . 'groups/Wikiblame.php'; |
88 | 89 | |
89 | 90 | # complex messages |
90 | 91 | $wgAutoloadClasses['ComplexMessages'] = $dir . 'groups/ComplexMessages.php'; |