daniel-sc / ng-extract-i18n-merge

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

Provide an option to disable ng-extract-i18n-merge's use of HTML Character Entities like " #76

Closed FrostKiwi closed 10 months ago

FrostKiwi commented 1 year ago

Is your feature request related to a problem? Please describe. ng-extract-i18n-merge handles certain characters as HTML Character Entities. Most prominent here is ng-extract-i18n-merge inserting " for ". The translation platform we use, Weblate, uses the characters directly. So it inserts ". There is no need to use HTML Character Entities in Angular and Weblate replaces " with " automatically. This leads to an annoying back and forth, which fills up commit diffs.

See screenshot below.

Describe the solution you'd like A switch in angular.json to disable ng-extract-i18n-merge's use of HTML Character Entities for "builder": "ng-extract-i18n-merge:ng-extract-i18n-merge" would be nice.

Additional context Also in the screen shot is seen ng-extract-i18n-merge misunderstanding <source> changes and resetting the translation to "new". This issue is unrelated to this one and reported in: https://github.com/daniel-sc/ng-extract-i18n-merge/issues/75

Screenshots image

Version (please complete the following information):

daniel-sc commented 1 year ago

@FrostKiwi this is essentially the behavior of Angulars extract-i18n, which generally makes sense - see #7.

This library could only convert quoted entities back - but this seems brittle, as angular probably does not expect unquoted special chars in the translation files..

I'd suggest, this is rather a bug / feature request for Weblate, that it should keep quoted characters and do no conversion!?

daniel-sc commented 10 months ago

please comment/reopen if there is further input!