28 preg_match_all(
',# Author: ([^\n]+)\n,', $data, $matches );
29 $authors = $matches[1];
31 preg_match_all(
',<!ENTITY[ ]+([^ ]+)\s+"([^"]+)"[^>]*>,', $data, $matches );
32 list( , $keys, $messages ) = $matches;
33 $messages = array_combine(
36 static function ( $message ) {
37 return html_entity_decode( $message, ENT_QUOTES );
43 $messages = $this->group->getMangler()->mangleArray( $messages );
46 'AUTHORS' => $authors,
47 'MESSAGES' => $messages,
55 $header .= $this->doHeader( $collection );
56 $header .= $this->doAuthors( $collection );
60 $mangler = $this->group->getMangler();
63 foreach ( $collection as $key => $m ) {
64 $key = $mangler->unmangle( $key );
65 $trans = $m->translation();
66 $trans = str_replace( TRANSLATE_FUZZY,
'', $trans );
68 if ( $trans ===
'' ) {
72 $trans = str_replace(
'"',
'"', $trans );
73 $output .=
"<!ENTITY $key \"$trans\">\n";
77 return $header . $output;