From 6d81c25627612d06fc13cf23bd0990e5cb8498ae Mon Sep 17 00:00:00 2001 From: Mauro Cassani Date: Thu, 13 May 2021 17:44:04 +0200 Subject: [PATCH] translation replacement + handling of `` and `` tags (#2014) * Handling xliff files with no nodes (Xliff parser v1.0.58) * Updated to Xliff-parser 1.0.60 (/ correct handling) Co-authored-by: Mauro Cassani --- composer.lock | 38 ++++----- .../Filters/PlaceHoldXliffTags.php | 4 + nodejs/package-lock.json | 80 +++++++++---------- 3 files changed, 63 insertions(+), 59 deletions(-) diff --git a/composer.lock b/composer.lock index e884e4e881..0006d289f3 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.179.2", + "version": "3.181.1", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "7d3490e35878d0884905fa0c1ab43ecf178c8d9b" + "reference": "0829df420170e4994767860290a69487a18555f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/7d3490e35878d0884905fa0c1ab43ecf178c8d9b", - "reference": "7d3490e35878d0884905fa0c1ab43ecf178c8d9b", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/0829df420170e4994767860290a69487a18555f7", + "reference": "0829df420170e4994767860290a69487a18555f7", "shasum": "" }, "require": { @@ -92,9 +92,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.179.2" + "source": "https://github.com/aws/aws-sdk-php/tree/3.181.1" }, - "time": "2021-04-30T19:46:52+00:00" + "time": "2021-05-12T18:13:31+00:00" }, { "name": "defuse/php-encryption", @@ -756,16 +756,16 @@ }, { "name": "matecat/xliff-parser", - "version": "v1.0.57", + "version": "v1.0.60", "source": { "type": "git", "url": "https://github.com/matecat/xliff-parser.git", - "reference": "233a9960c909e37aaac2cb9dc3ca21535398f94a" + "reference": "29d67be859bd4294a763a901d4c26fe8cc64339a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matecat/xliff-parser/zipball/233a9960c909e37aaac2cb9dc3ca21535398f94a", - "reference": "233a9960c909e37aaac2cb9dc3ca21535398f94a", + "url": "https://api.github.com/repos/matecat/xliff-parser/zipball/29d67be859bd4294a763a901d4c26fe8cc64339a", + "reference": "29d67be859bd4294a763a901d4c26fe8cc64339a", "shasum": "" }, "require": { @@ -801,9 +801,9 @@ ], "support": { "issues": "https://github.com/matecat/xliff-parser/issues", - "source": "https://github.com/matecat/xliff-parser/tree/v1.0.57" + "source": "https://github.com/matecat/xliff-parser/tree/v1.0.60" }, - "time": "2021-05-02T19:56:34+00:00" + "time": "2021-05-13T08:54:03+00:00" }, { "name": "monolog/monolog", @@ -1479,16 +1479,16 @@ }, { "name": "psr/log", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { @@ -1512,7 +1512,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -1523,9 +1523,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.3" + "source": "https://github.com/php-fig/log/tree/1.1.4" }, - "time": "2020-03-23T09:12:05+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { "name": "ralouphie/getallheaders", diff --git a/lib/Utils/SubFiltering/Filters/PlaceHoldXliffTags.php b/lib/Utils/SubFiltering/Filters/PlaceHoldXliffTags.php index d504eb66f0..5cdd1d6238 100644 --- a/lib/Utils/SubFiltering/Filters/PlaceHoldXliffTags.php +++ b/lib/Utils/SubFiltering/Filters/PlaceHoldXliffTags.php @@ -37,6 +37,10 @@ public function transform( $segment ) { $segment = preg_replace( '|<(/ept)>|si', Constants::LTPLACEHOLDER . "$1" . Constants::GTPLACEHOLDER, $segment ); $segment = preg_replace( '|<(ph .*?)>|si', Constants::LTPLACEHOLDER . "$1" . Constants::GTPLACEHOLDER, $segment ); $segment = preg_replace( '|<(/ph)>|si', Constants::LTPLACEHOLDER . "$1" . Constants::GTPLACEHOLDER, $segment ); + $segment = preg_replace( '|<(ec .*?)>|si', Constants::LTPLACEHOLDER . "$1" . Constants::GTPLACEHOLDER, $segment ); + $segment = preg_replace( '|<(/ec)>|si', Constants::LTPLACEHOLDER . "$1" . Constants::GTPLACEHOLDER, $segment ); + $segment = preg_replace( '|<(sc .*?)>|si', Constants::LTPLACEHOLDER . "$1" . Constants::GTPLACEHOLDER, $segment ); + $segment = preg_replace( '|<(/sc)>|si', Constants::LTPLACEHOLDER . "$1" . Constants::GTPLACEHOLDER, $segment ); $segment = preg_replace( '|<(pc .*?)>|si', Constants::LTPLACEHOLDER . "$1" . Constants::GTPLACEHOLDER, $segment ); $segment = preg_replace( '|<(/pc)>|si', Constants::LTPLACEHOLDER . "$1" . Constants::GTPLACEHOLDER, $segment ); $segment = preg_replace( '|<(it .*?)>|si', Constants::LTPLACEHOLDER . "$1" . Constants::GTPLACEHOLDER, $segment ); diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index efc4efac39..43ae313bae 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -9,9 +9,9 @@ "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz", "integrity": "sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==", "requires": { - "colorspace": "1.1.x", - "enabled": "2.0.x", - "kuler": "^2.0.0" + "colorspace": "1.1.2", + "enabled": "2.0.0", + "kuler": "2.0.0" } }, "async": { @@ -24,8 +24,8 @@ "resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz", "integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==", "requires": { - "color-convert": "^1.9.1", - "color-string": "^1.5.2" + "color-convert": "1.9.3", + "color-string": "1.5.5" } }, "color-convert": { @@ -46,8 +46,8 @@ "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.5.tgz", "integrity": "sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg==", "requires": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" + "color-name": "1.1.3", + "simple-swizzle": "0.2.2" } }, "colors": { @@ -60,8 +60,8 @@ "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.2.tgz", "integrity": "sha512-vt+OoIP2d76xLhjwbBaucYlNSpPsrJWPlBTtwCpQKIu6/CSMutyzX93O/Do0qzpH3YoHEes8YEFXyZ797rEhzQ==", "requires": { - "color": "3.0.x", - "text-hex": "1.0.x" + "color": "3.0.0", + "text-hex": "1.0.0" } }, "core-util-is": { @@ -124,11 +124,11 @@ "resolved": "https://registry.npmjs.org/logform/-/logform-2.2.0.tgz", "integrity": "sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg==", "requires": { - "colors": "^1.2.1", - "fast-safe-stringify": "^2.0.4", - "fecha": "^4.2.0", - "ms": "^2.1.1", - "triple-beam": "^1.3.0" + "colors": "1.4.0", + "fast-safe-stringify": "2.0.7", + "fecha": "4.2.1", + "ms": "2.1.3", + "triple-beam": "1.3.0" } }, "ms": { @@ -146,7 +146,7 @@ "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", "requires": { - "fn.name": "1.x.x" + "fn.name": "1.1.0" } }, "process-nextick-args": { @@ -164,9 +164,9 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "inherits": "2.0.4", + "string_decoder": "1.3.0", + "util-deprecate": "1.0.2" } }, "safe-buffer": { @@ -179,7 +179,7 @@ "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", "requires": { - "is-arrayish": "^0.3.1" + "is-arrayish": "0.3.2" } }, "sse-channel": { @@ -197,7 +197,7 @@ "resolved": "https://registry.npmjs.org/stompit/-/stompit-1.0.0.tgz", "integrity": "sha512-He+ZV41LyCs4WNpMT9WFAuhQ6cUNhzfa+PsRlf7qxGIfMhDCUncnD9V7Cwvo8tzvpnwVyRB2BDG3R7I2Gbv4Ww==", "requires": { - "qs": "~6.9.1" + "qs": "6.9.6" } }, "string_decoder": { @@ -205,7 +205,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "requires": { - "safe-buffer": "~5.2.0" + "safe-buffer": "5.2.1" } }, "text-hex": { @@ -233,15 +233,15 @@ "resolved": "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz", "integrity": "sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw==", "requires": { - "@dabh/diagnostics": "^2.0.2", - "async": "^3.1.0", - "is-stream": "^2.0.0", - "logform": "^2.2.0", - "one-time": "^1.0.0", - "readable-stream": "^3.4.0", - "stack-trace": "0.0.x", - "triple-beam": "^1.3.0", - "winston-transport": "^4.4.0" + "@dabh/diagnostics": "2.0.2", + "async": "3.2.0", + "is-stream": "2.0.0", + "logform": "2.2.0", + "one-time": "1.0.0", + "readable-stream": "3.6.0", + "stack-trace": "0.0.10", + "triple-beam": "1.3.0", + "winston-transport": "4.4.0" } }, "winston-transport": { @@ -249,8 +249,8 @@ "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.4.0.tgz", "integrity": "sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw==", "requires": { - "readable-stream": "^2.3.7", - "triple-beam": "^1.2.0" + "readable-stream": "2.3.7", + "triple-beam": "1.3.0" }, "dependencies": { "readable-stream": { @@ -258,13 +258,13 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "core-util-is": "1.0.2", + "inherits": "2.0.4", + "isarray": "1.0.0", + "process-nextick-args": "2.0.1", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" } }, "safe-buffer": { @@ -277,7 +277,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "5.1.2" } } }