daniel-sc / xliff-simple-merge

Merges XLIFF 1.2/2.0 files. Usable for Angular i18n automation.
MIT License
16 stars 7 forks source link

Prevent replacement of apostrophes with html character entities #4

Closed vglaeser closed 2 years ago

vglaeser commented 2 years ago

Currently, apostrophes ( ' ) in xliff-files in <source> or <target> tags will be replaced by &apos; when running xliff-simple-merge. Is there a way to prevent this behaviour? Thanks in advance

daniel-sc commented 2 years ago

Hi @vglaeser

Currently this behavior cannot be changed.

I think that converting ' to &apos; leads to conform XML (which Xliff is base upon). At least in the spec for XLIFF 1.0 this is explicitly mentioned. To my knowledge this is well handled by the angular translations merge step in the build.

So I'd suggest that this is not really a problem - but please convince me otherwise and I'll look for a solution :)

vglaeser commented 2 years ago

Hi @daniel-sc , thank you for your fast response. Indeed, it seems to be part of the specification, althouth it doesn't seem to be required to be replaced, at least ng extract-i18n doesn't replace ' by &apos. In our case we are sending the generated xliff-files to our customer who redirects changed entries to a translator. In order to avoid problems with our customer's change-detection it would be nice if we could disable the replacement but if necessary we could also use a script in order to replace characters in xliff-files.

daniel-sc commented 2 years ago

Hi @vglaeser, I understand - please try v0.7.0 with the new configuration --no-replace-apostrophe :)

vglaeser commented 2 years ago

Thank you, this is working like a charm