Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(localize): enable whitespace preservation marker in XLIFF files #38737

Conversation

petebacondarwin
Copy link
Member

@petebacondarwin petebacondarwin commented Sep 7, 2020

Whitespace can be relevant in extracted XLIFF translation files.
Some i18n tools - e.g. CAT tool (OmegaT) - will reformat
the file to collapse whitespace if there is no indication to tell it
not to.

This commit adds the ability to specify "format options" that are passed
to the translation file serializer. The XLIFF 1.2 and 2.0 seralizers have
been updated to accept {"xml:space":"preserve"} format option which will
by added to the <file> element in the serialized translation file during
extraction.

Fixes #38679

@petebacondarwin petebacondarwin added type: bug/fix action: review The PR is still awaiting reviews from at least one requested reviewer area: i18n target: patch This PR is targeted for the next patch release engine: ivy labels Sep 7, 2020
@ngbot ngbot bot modified the milestone: needsTriage Sep 7, 2020
@pullapprove pullapprove bot requested a review from IgorMinar September 7, 2020 21:04
@petebacondarwin petebacondarwin changed the title fix(localize): declare preserve whitespace in XLIFF files fix(localize): enable whitespace preservation marker in XLIFF files Sep 8, 2020
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @petebacondarwin 👍

(just left a couple minor comments)

@AndrewKushnir AndrewKushnir added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 8, 2020
@petebacondarwin petebacondarwin requested review from josephperrott and gkalpak and removed request for IgorMinar September 8, 2020 20:16
@petebacondarwin petebacondarwin added action: merge The PR is ready for merge by the caretaker action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Sep 8, 2020
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@petebacondarwin petebacondarwin removed the request for review from gkalpak September 8, 2020 20:32
@petebacondarwin petebacondarwin removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 8, 2020
@petebacondarwin
Copy link
Member Author

Failure is due to size change on master.

Whitespace can be relevant in extracted XLIFF translation files.
Some i18n tools - e.g. CAT tool (OmegaT) - will reformat
the file to collapse whitespace if there is no indication to tell it
not to.

This commit adds the ability to specify "format options" that are passed
to the translation file serializer. The XLIFF 1.2 and 2.0 seralizers have
been updated to accept `{"xml:space":"preserve"}` format option which will
by added to the `<file>` element in the serialized translation file during
extraction.

Fixes angular#38679
@atscott atscott closed this in 4360eed Sep 8, 2020
atscott pushed a commit that referenced this pull request Sep 8, 2020
…38737)

Whitespace can be relevant in extracted XLIFF translation files.
Some i18n tools - e.g. CAT tool (OmegaT) - will reformat
the file to collapse whitespace if there is no indication to tell it
not to.

This commit adds the ability to specify "format options" that are passed
to the translation file serializer. The XLIFF 1.2 and 2.0 seralizers have
been updated to accept `{"xml:space":"preserve"}` format option which will
by added to the `<file>` element in the serialized translation file during
extraction.

Fixes #38679

PR Close #38737
@petebacondarwin petebacondarwin deleted the i18n-xml-preserve-whitespace branch September 9, 2020 07:19
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: i18n cla: yes target: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Space preservation attribute not added to XLF file
4 participants