31 preg_match_all(
',# Author: ([^\n]+)\n,', $data, $matches );
32 $authors = $matches[1];
34 preg_match_all(
',<!ENTITY[ ]+([^ ]+)\s+"([^"]+)"[^>]*>,', $data, $matches );
35 list( , $keys, $messages ) = $matches;
36 $messages = array_combine(
39 static function ( $message ) {
40 return html_entity_decode( $message, ENT_QUOTES );
46 $messages = $this->group->getMangler()->mangleArray( $messages );
49 'AUTHORS' => $authors,
50 'MESSAGES' => $messages,
58 $header .= $this->doHeader( $collection );
59 $header .= $this->doAuthors( $collection );
63 $mangler = $this->group->getMangler();
66 foreach ( $collection as $key => $m ) {
67 $key = $mangler->unmangle( $key );
68 $trans = $m->translation();
69 $trans = str_replace( TRANSLATE_FUZZY,
'', $trans );
71 if ( $trans ===
'' ) {
75 $trans = str_replace(
'"',
'"', $trans );
76 $output .=
"<!ENTITY $key \"$trans\">\n";
80 return $header . $output;