Skip to content

fix(localize): render placeholder types in extracted XLIFF files (BACKPORT to 10.2.x) #39459

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

Conversation

petebacondarwin
Copy link
Contributor

@petebacondarwin petebacondarwin commented Oct 27, 2020

This is a backport of #39398 - to patch (10.2.x).

The previous ViewEngine extraction tooling added `ctype` and `type`
attributes to XLIFF 1.2 and 2.0 translation files, respectively.

This commit adds this to the new $localize based extraction tooling.
Since the new extraction tooling works from the compiled output rather
than having direct access to the template content, the placeholder types
must be inferred from the name of the placeholder.  This is considered
reasonable, since it already does this to compute opening and closing
tag placeholders.

Fixes angular#38791
@google-cla google-cla bot added the cla: yes label Oct 27, 2020
@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 area: i18n Issues related to localization and internationalization target: patch This PR is targeted for the next patch release labels Oct 27, 2020
@ngbot ngbot bot modified the milestone: needsTriage Oct 27, 2020
alxhub pushed a commit that referenced this pull request Oct 27, 2020
)

The previous ViewEngine extraction tooling added `ctype` and `type`
attributes to XLIFF 1.2 and 2.0 translation files, respectively.

This commit adds this to the new $localize based extraction tooling.
Since the new extraction tooling works from the compiled output rather
than having direct access to the template content, the placeholder types
must be inferred from the name of the placeholder.  This is considered
reasonable, since it already does this to compute opening and closing
tag placeholders.

Fixes #38791

PR Close #39459
@AndrewKushnir AndrewKushnir removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 28, 2020
@alxhub
Copy link
Member

alxhub commented Oct 28, 2020

(merged yesterday)

@alxhub alxhub closed this Oct 28, 2020
@petebacondarwin petebacondarwin deleted the i18n-extract-fmt-types-issue-38791-patch branch November 5, 2020 11:10
@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 Dec 6, 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 Issues related to localization and internationalization cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants