daniel-sc / ng-extract-i18n-merge

Extract and merge i18n xliff translation files for angular projects.
MIT License
170 stars 18 forks source link

collapseWhitespace and trim not applied to translationTargetFile resulting in target state reset #102

Closed mbey-mw closed 6 months ago

mbey-mw commented 6 months ago

Describe the bug Translation tool lokalize (v23.08.1) adds line break to source/target when ending with interpolation. This is the observable change when saving in lokalize:

-      <trans-unit id="AudioChannelNumber" datatype="html">
-        <source>Audio Channel <x equiv-text="{{c}}" id="INTERPOLATION"/></source>
+      <trans-unit datatype="html" id="AudioChannelNumber">
+        <source>Audio Channel <x equiv-text="{{c}}" id="INTERPOLATION"/>
+        </source>
        <target state="signed-off">Canal Audio <x equiv-text="{{c}}" id="INTERPOLATION"/></target>
      </trans-unit>

This results in a target state change from signed-off to new after a run of ng-extract-i18n-merge.

Expected behavior When using "collapseWhitespace": true and "trim": true it should not change the target state because the source is the same (after normalization).

Version (please complete the following information):