Skip to content

Commit

Permalink
translation replacement + handling of <ec> and <sc> tags (#2014)
Browse files Browse the repository at this point in the history
* Handling xliff files with no <target> nodes (Xliff parser v1.0.58)

* Updated to Xliff-parser 1.0.60
(<ec>/<sc> correct handling)

Co-authored-by: Mauro Cassani <[email protected]>
  • Loading branch information
mauretto78 and Mauro Cassani authored May 13, 2021
1 parent b090a18 commit 6d81c25
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 59 deletions.
38 changes: 19 additions & 19 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/Utils/SubFiltering/Filters/PlaceHoldXliffTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
80 changes: 40 additions & 40 deletions nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6d81c25

Please sign in to comment.