48 preg_match_all(
'/^; Author: (.*)$/m', $data, $matches, PREG_SET_ORDER );
49 foreach ( $matches as $match ) {
50 $authors[] = $match[1];
54 $data = preg_replace(
'/^\s*;.*$/m',
'', $data );
56 $data = preg_replace(
'/(^.+?=\s*)([^\'"].+)$/m',
'\1"\2"', $data );
58 $messages = parse_ini_string( $data );
59 if ( is_array( $messages ) ) {
60 $messages = $this->group->getMangler()->mangleArray( $messages );
66 'MESSAGES' => $messages,
67 'AUTHORS' => $authors,
73 $mangler = $this->group->getMangler();
76 foreach ( $collection as $key => $m ) {
77 $value = $m->translation();
78 if ( $value ===
null ) {
84 if ( $m->hasTag(
'fuzzy' ) ) {
85 $value = str_replace( TRANSLATE_FUZZY,
'', $value );
86 $comment =
"; Fuzzy\n";
89 $key = $mangler->unmangle( $key );
90 $output .=
"$comment$key = $value\n";
94 if ( $output ===
'' ) {
100 $header =
"; Exported from $wgSitename\n";
104 foreach ( $authors as $author ) {
105 $header .=
"; Author: $author\n";
108 $header .=
'[' . $collection->
getLanguage() .
"]\n";
110 return $header . $output;