]*>,', $data, $matches ); $keys = $matches[1]; $values = $matches[2]; $messages = []; $count = count( $matches[1] ); for ( $i = 0; $i < $count; $i++ ) { $messages[$keys[$i]] = str_replace( [ '"', '"', ''' ], [ '"', '"', "'" ], $values[$i] ); } $messages = $this->group->getMangler()->mangle( $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"; } return $output ? $header . $output : 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; } }