50 preg_match_all(
'/^; Author: (.*)$/m', $data, $matches, PREG_SET_ORDER );
51 foreach ( $matches as $match ) {
52 $authors[] = $match[1];
56 $data = preg_replace(
'/^\s*;.*$/m',
'', $data );
58 $data = preg_replace(
'/(^.+?=\s*)([^\'"].+)$/m',
'\1"\2"', $data );
60 $messages = parse_ini_string( $data );
61 if ( is_array( $messages ) ) {
62 $messages = $this->group->getMangler()->mangleArray( $messages );
68 'MESSAGES' => $messages,
69 'AUTHORS' => $authors,
75 $mangler = $this->group->getMangler();
78 foreach ( $collection as $key => $m ) {
79 $value = $m->translation();
80 if ( $value ===
null ) {
86 if ( $m->hasTag(
'fuzzy' ) ) {
87 $value = str_replace( TRANSLATE_FUZZY,
'', $value );
88 $comment =
"; Fuzzy\n";
91 $key = $mangler->unmangle( $key );
92 $output .=
"$comment$key = $value\n";
96 if ( $output ===
'' ) {
102 $header =
"; Exported from $wgSitename\n";
105 $authors = $this->
filterAuthors( $authors, $collection->getLanguage() );
106 foreach ( $authors as $author ) {
107 $header .=
"; Author: $author\n";
110 $header .=
'[' . $collection->getLanguage() .
"]\n";
112 return $header . $output;