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): ensure extracted messages are serialized in a consistent order #40192

Conversation

petebacondarwin
Copy link
Member

@petebacondarwin petebacondarwin commented Dec 18, 2020

The CLI integration can provide code files in a non-deterministic
order, which led to the extracted translation files having
messages in a non-consistent order between extractions.

This commit fixes this by ensuring that serialized messages
are ordered by their location.

Fixes #39262

@petebacondarwin petebacondarwin added 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 labels Dec 18, 2020
@ngbot ngbot bot added this to the Backlog milestone Dec 18, 2020
@google-cla google-cla bot added the cla: yes label Dec 18, 2020
@petebacondarwin
Copy link
Member Author

@AndrewKushnir / @clydin - this will change the ordering of extracted messages in serialized files. But I think that since the order was non-determinate via the CLI integration previously, then this is arguably not a breaking change. WDYT?

@petebacondarwin petebacondarwin force-pushed the i18n-sort-extracted-messages branch 2 times, most recently from 20d4d19 to d81d8e5 Compare December 19, 2020 15:28
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.

Thanks for the fix @petebacondarwin 👍 Just left a few minor comments.

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.

Thanks for updates @petebacondarwin 👍

this will change the ordering of extracted messages in serialized files. But I think that since the order was non-determinate via the CLI integration previously, then this is arguably not a breaking change. WDYT?

Given that the order was not consistent before, I think this should not be a breaking change. One potentially breaking aspect is that we now use first duplicate message in JSON translation file (vs the last one), but since Ivy i18n extraction pipeline is not the default one and JSON format was not documented yet, I'd not consider this change as breaking.

@petebacondarwin petebacondarwin added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 23, 2020
…nt order

The CLI integration can provide code files in a non-deterministic
order, which led to the extracted translation files having
messages in a non-consistent order between extractions.

This commit fixes this by ensuring that serialized messages
are ordered by their location.

Fixes angular#39262
@petebacondarwin petebacondarwin added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Jan 5, 2021
@petebacondarwin petebacondarwin deleted the i18n-sort-extracted-messages branch January 14, 2021 09:08
@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 Feb 14, 2021
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: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make i18n extractor execution idempotent
3 participants