67 $authors = self::extractAuthors( $data );
68 $data = self::extractMessagePart( $data );
69 $messages = (array)FormatJson::decode( $data,
true );
73 if ( isset( $messages[
'root'] ) ) {
74 $messages = $this->group->getMangler()->mangleArray( $messages[
'root'] );
76 $messages = $this->group->getMangler()->mangleArray( $messages );
80 'MESSAGES' => $messages,
81 'AUTHORS' => $authors,
82 'METADATA' => $metadata,
92 $mangler = $this->group->getMangler();
95 foreach ( $collection as $key => $m ) {
96 $value = $m->translation();
97 if ( $value ===
null ) {
101 if ( $m->hasTag(
'fuzzy' ) ) {
102 $value = str_replace( TRANSLATE_FUZZY,
'', $value );
105 $key = $mangler->unmangle( $key );
106 $messages[$key] = $value;
110 if ( !count( $messages ) ) {
113 $header = $this->header( $collection->code, $collection->
getAuthors() );
114 return $header . FormatJson::encode( $messages,
"\t", FormatJson::UTF8_OK ) .
");\n";