@@ -26,7 +26,7 @@ |
||
| 26 | 26 | { |
| 27 | 27 | $info = XliffProprietaryDetect::getInfo($originalXliffPath); |
| 28 | 28 | |
| 29 | - if ($info[ 'proprietary_short_name' ] !== 'trados') { |
|
| 29 | + if ($info['proprietary_short_name'] !== 'trados') { |
|
| 30 | 30 | return new XliffSAXTranslationReplacer($originalXliffPath, $info['version'], $data, $transUnits, $targetLang, $outputFilePath, $setSourceInTarget, $logger, $callback); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -7,5 +7,5 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * List of allowed Xliff tags |
| 9 | 9 | */ |
| 10 | - public static $tags = [ 'g', 'x', 'bx', 'ex', 'bpt', 'ept', 'ph', 'pc', 'ec', 'sc', 'it', 'mrk' ]; |
|
| 10 | + public static $tags = ['g', 'x', 'bx', 'ex', 'bpt', 'ept', 'ph', 'pc', 'ec', 'sc', 'it', 'mrk']; |
|
| 11 | 11 | } |
| 12 | 12 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | public static function flatArray(array $input = [], $separator_elements = ', ', $separator = ': ') |
| 13 | 13 | { |
| 14 | 14 | return implode($separator_elements, array_map( |
| 15 | - function ($v, $k, $s) { |
|
| 15 | + function($v, $k, $s) { |
|
| 16 | 16 | return sprintf("%s{$s}\"%s\"", $k, $v); |
| 17 | 17 | }, |
| 18 | 18 | $input, |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | { |
| 29 | 29 | preg_match('|<xliff.*?\sversion\s?=\s?["\'](.*?)["\']|si', substr($xliffContent, 0, 1000), $versionMatches); |
| 30 | 30 | |
| 31 | - if (empty($versionMatches) ) { |
|
| 31 | + if (empty($versionMatches)) { |
|
| 32 | 32 | throw new NotValidFileException('This is not a valid xliff file'); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -13,12 +13,12 @@ |
||
| 13 | 13 | { |
| 14 | 14 | $fileType = []; |
| 15 | 15 | |
| 16 | - if (isset($tmp[ 0 ])) { |
|
| 17 | - if (stripos($tmp[ 0 ], 'globalsight') !== false) { |
|
| 18 | - $fileType[ 'proprietary' ] = true; |
|
| 19 | - $fileType[ 'proprietary_name' ] = 'GlobalSight Download File'; |
|
| 20 | - $fileType[ 'proprietary_short_name' ] = 'globalsight'; |
|
| 21 | - $fileType[ 'converter_version' ] = 'legacy'; |
|
| 16 | + if (isset($tmp[0])) { |
|
| 17 | + if (stripos($tmp[0], 'globalsight') !== false) { |
|
| 18 | + $fileType['proprietary'] = true; |
|
| 19 | + $fileType['proprietary_name'] = 'GlobalSight Download File'; |
|
| 20 | + $fileType['proprietary_short_name'] = 'globalsight'; |
|
| 21 | + $fileType['converter_version'] = 'legacy'; |
|
| 22 | 22 | |
| 23 | 23 | return $fileType; |
| 24 | 24 | } |
@@ -13,17 +13,17 @@ |
||
| 13 | 13 | { |
| 14 | 14 | $fileType = []; |
| 15 | 15 | |
| 16 | - if (isset($tmp[ 0 ])) { |
|
| 17 | - preg_match('#tool-id\s*=\s*"matecat-converter(\s+([^"]+))?"#i', $tmp[ 0 ], $matches); |
|
| 16 | + if (isset($tmp[0])) { |
|
| 17 | + preg_match('#tool-id\s*=\s*"matecat-converter(\s+([^"]+))?"#i', $tmp[0], $matches); |
|
| 18 | 18 | if (!empty($matches)) { |
| 19 | - $fileType[ 'proprietary' ] = false; |
|
| 20 | - $fileType[ 'proprietary_name' ] = 'MateCAT Converter'; |
|
| 21 | - $fileType[ 'proprietary_short_name' ] = 'matecat_converter'; |
|
| 22 | - if (isset($matches[ 2 ])) { |
|
| 23 | - $fileType[ 'converter_version' ] = $matches[ 2 ]; |
|
| 19 | + $fileType['proprietary'] = false; |
|
| 20 | + $fileType['proprietary_name'] = 'MateCAT Converter'; |
|
| 21 | + $fileType['proprietary_short_name'] = 'matecat_converter'; |
|
| 22 | + if (isset($matches[2])) { |
|
| 23 | + $fileType['converter_version'] = $matches[2]; |
|
| 24 | 24 | } else { |
| 25 | 25 | // First converter release didn't specify version |
| 26 | - $fileType[ 'converter_version' ] = '1.0'; |
|
| 26 | + $fileType['converter_version'] = '1.0'; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | return $fileType; |
@@ -8,13 +8,13 @@ |
||
| 8 | 8 | { |
| 9 | 9 | $fileType = []; |
| 10 | 10 | |
| 11 | - if (isset($tmp[ 0 ])) { |
|
| 12 | - if (stripos($tmp[ 0 ], 'sdl:version') !== false) { |
|
| 11 | + if (isset($tmp[0])) { |
|
| 12 | + if (stripos($tmp[0], 'sdl:version') !== false) { |
|
| 13 | 13 | //little trick, we consider not proprietary Sdlxliff files because we can handle them |
| 14 | - $fileType[ 'proprietary' ] = false; |
|
| 15 | - $fileType[ 'proprietary_name' ] = 'SDL Studio '; |
|
| 16 | - $fileType[ 'proprietary_short_name' ] = 'trados'; |
|
| 17 | - $fileType[ 'converter_version' ] = 'legacy'; |
|
| 14 | + $fileType['proprietary'] = false; |
|
| 15 | + $fileType['proprietary_name'] = 'SDL Studio '; |
|
| 16 | + $fileType['proprietary_short_name'] = 'trados'; |
|
| 17 | + $fileType['converter_version'] = 'legacy'; |
|
| 18 | 18 | |
| 19 | 19 | return $fileType; |
| 20 | 20 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | self::STATUS_REBUTTED |
| 54 | 54 | ]; |
| 55 | 55 | |
| 56 | - public static function isReviewedStatus( $status ) { |
|
| 57 | - return in_array( $status, TranslationStatus::$REVISION_STATUSES ); |
|
| 56 | + public static function isReviewedStatus($status) { |
|
| 57 | + return in_array($status, TranslationStatus::$REVISION_STATUSES); |
|
| 58 | 58 | } |
| 59 | 59 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | $fileType = []; |
| 15 | 15 | |
| 16 | - if (isset($tmp[ 0 ])) { |
|
| 16 | + if (isset($tmp[0])) { |
|
| 17 | 17 | preg_match('|<xliff.*?\sversion\s?=\s?["\'](.*?)["\']|si', substr($tmp[0], 0, 1000), $versionMatches); |
| 18 | 18 | preg_match('|<xliff.*?\sxmlns\s?=\s?["\']urn:oasis:names:tc:xliff:document:(.*?)["\']|si', substr($tmp[0], 0, 1000), $xmlnsMatches); |
| 19 | 19 | |
@@ -22,10 +22,10 @@ discard block |
||
| 22 | 22 | $xmlns = $xmlnsMatches[1]; |
| 23 | 23 | |
| 24 | 24 | if ($version === $xmlns && $version >= 2) { |
| 25 | - $fileType[ 'proprietary' ] = false; |
|
| 26 | - $fileType[ 'proprietary_name' ] = 'Xliff v'.$version.' File'; |
|
| 27 | - $fileType[ 'proprietary_short_name' ] = 'xliff_v2'; |
|
| 28 | - $fileType[ 'converter_version' ] = '2.0'; |
|
| 25 | + $fileType['proprietary'] = false; |
|
| 26 | + $fileType['proprietary_name'] = 'Xliff v' . $version . ' File'; |
|
| 27 | + $fileType['proprietary_short_name'] = 'xliff_v2'; |
|
| 28 | + $fileType['converter_version'] = '2.0'; |
|
| 29 | 29 | |
| 30 | 30 | return $fileType; |
| 31 | 31 | } |