]*>,', $data, $matches ); list( , $keys, $messages ) = $matches; $messages = array_combine( $keys, array_map( function ( $message ) { return html_entity_decode( $message, ENT_QUOTES ); }, $messages ) ); $messages = $this->group->getMangler()->mangleArray( $messages ); return [ 'AUTHORS' => $authors, 'MESSAGES' => $messages, ]; } protected function writeReal( MessageCollection $collection ) { $collection->loadTranslations(); $header = "\n"; $output = ''; $mangler = $this->group->getMangler(); /** @var TMessage $m */ foreach ( $collection as $key => $m ) { $key = $mangler->unmangle( $key ); $trans = $m->translation(); $trans = str_replace( TRANSLATE_FUZZY, '', $trans ); if ( $trans === '' ) { continue; } $trans = str_replace( '"', '"', $trans ); $output .= "\n"; } if ( $output ) { return $header . $output; } return false; } protected function doHeader( MessageCollection $collection ) { global $wgSitename; $code = $collection->code; $name = TranslateUtils::getLanguageName( $code ); $native = TranslateUtils::getLanguageName( $code, $code ); $output = "# Messages for $name ($native)\n"; $output .= "# Exported from $wgSitename\n\n"; return $output; } protected function doAuthors( MessageCollection $collection ) { $output = ''; $authors = $collection->getAuthors(); $authors = $this->filterAuthors( $authors, $collection->code ); foreach ( $authors as $author ) { $output .= "# Author: $author\n"; } return $output; } }