CoreMostUsedMessageGroup.php

Go to the documentation of this file.
00001 <?php
00017 class CoreMostUsedMessageGroup extends CoreMessageGroup {
00018     protected $label = 'MediaWiki (most used)';
00019     protected $id = 'core-0-mostused';
00020     protected $meta = true;
00021     protected $list;
00022 
00023     protected $description = '{{int:translate-group-desc-mediawikimostused}}';
00024 
00025     public function export( MessageCollection $messages ) {
00026         return 'Not supported';
00027     }
00028 
00029     public function exportToFile( MessageCollection $messages, $authors ) {
00030         return 'Not supported';
00031     }
00032 
00033     public function setListFile( $file ) {
00034         $this->list = $file;
00035     }
00036 
00037     function getDefinitions() {
00038         $data = file_get_contents( $this->list );
00039         $data = str_replace( "\r", '', $data );
00040         $messages = explode( "\n", $data );
00041         $contents = parent::getDefinitions();
00042         $definitions = array();
00043 
00044         foreach ( $messages as $key ) {
00045             if ( isset( $contents[$key] ) ) {
00046                 $definitions[$key] = $contents[$key];
00047             }
00048         }
00049 
00050         return $definitions;
00051     }
00052 }
00053 
Generated on Tue Oct 29 00:00:24 2013 for MediaWiki Translate Extension by  doxygen 1.6.3