Index: trunk/extensions/Translate/FFS.php |
— | — | @@ -1074,7 +1074,11 @@ |
1075 | 1075 | $json = shell_exec( "python -c'import simplejson as json; execfile(\"$filename\"); print json.dumps(msg)'" ); |
1076 | 1076 | self::$data[$this->group->getId()] = json_decode( $json, true ); |
1077 | 1077 | } |
1078 | | - if ( !isset( self::$data[$this->group->getId()][$code] ) ) self::$data[$this->group->getId()][$code] = array(); |
| 1078 | + |
| 1079 | + if ( !isset( self::$data[$this->group->getId()][$code] ) ) { |
| 1080 | + self::$data[$this->group->getId()][$code] = array(); |
| 1081 | + } |
| 1082 | + |
1079 | 1083 | return array( 'MESSAGES' => self::$data[$this->group->getId()][$code] ); |
1080 | 1084 | } |
1081 | 1085 | |
— | — | @@ -1092,10 +1096,15 @@ |
1093 | 1097 | $collection->loadTranslations(); |
1094 | 1098 | $ok = false; |
1095 | 1099 | foreach ( $collection as $messages ) { |
1096 | | - if ( $messages->translation() != '' ) $ok = true; |
| 1100 | + if ( $messages->translation() != '' ) { |
| 1101 | + $ok = true; |
| 1102 | + } |
1097 | 1103 | } |
1098 | | - if ( !$ok ) return; |
1099 | 1104 | |
| 1105 | + if ( !$ok ) { |
| 1106 | + return; |
| 1107 | + } |
| 1108 | + |
1100 | 1109 | $authors = $this->doAuthors( $collection ); |
1101 | 1110 | if ( $authors != '' ) { |
1102 | 1111 | fwrite( $this->fw, "$authors" ); |
— | — | @@ -1121,11 +1130,15 @@ |
1122 | 1131 | $messages = array(); |
1123 | 1132 | |
1124 | 1133 | foreach ( $collection as $message ) { |
1125 | | - if ( $message->translation() == '' ) continue; |
| 1134 | + if ( $message->translation() == '' ) { |
| 1135 | + continue; |
| 1136 | + } |
| 1137 | + |
1126 | 1138 | $translation = str_replace( '\\', '\\\\', $message->translation() ); |
1127 | 1139 | $translation = str_replace( '\'', '\\\'', $translation ); |
1128 | 1140 | $translation = str_replace( "\n", '\n', $translation ); |
1129 | 1141 | $translation = str_replace( TRANSLATE_FUZZY, '', $translation ); |
| 1142 | + |
1130 | 1143 | $messages[$message->key()] = $translation; |
1131 | 1144 | } |
1132 | 1145 | |