René's URL Explorer Experiment


Title: extract-i18n with HTML entities and interpolation · Issue #41034 · angular/angular · GitHub

Open Graph Title: extract-i18n with HTML entities and interpolation · Issue #41034 · angular/angular

X Title: extract-i18n with HTML entities and interpolation · Issue #41034 · angular/angular

Description: 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint extract-i18n run config help version doc Is this a regression? Yes, I also tested this with the old extraction tool ("@angular/cli": "~9.1.15") and i...

Open Graph Description: 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint extract-i18n run config help version doc Is this a regression? Yes, I also tested this with the old extractio...

X Description: 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint extract-i18n run config help version doc Is this a regression? Yes, I also tested this with the old extractio...

Opengraph URL: https://github.com/angular/angular/issues/41034

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"extract-i18n with HTML entities and interpolation","articleBody":"\u003c!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅\r\n\r\nOh hi there! 😄\r\n\r\nTo expedite issue processing please search open and closed issues before submitting a new one.\r\nExisting issues often contain information about workarounds, resolution, or progress updates.\r\n\r\n🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->\r\n\r\n\r\n# 🐞 Bug report\r\n\r\n### Command (mark with an `x`)\r\n\u003c!-- Can you pin-point the command or commands that are effected by this bug? -->\r\n\u003c!-- ✍️edit: -->\r\n\r\n- [ ] new\r\n- [ ] build\r\n- [ ] serve\r\n- [ ] test\r\n- [ ] e2e\r\n- [ ] generate\r\n- [ ] add\r\n- [ ] update\r\n- [ ] lint\r\n- [x] extract-i18n\r\n- [ ] run\r\n- [ ] config\r\n- [ ] help\r\n- [ ] version\r\n- [ ] doc\r\n\r\n\r\n### Is this a regression?\r\n\r\nYes, I also tested this with the old extraction tool (`\"@angular/cli\": \"~9.1.15\"`) and it works correctly with `ng xi18n`.\r\n\r\n\r\n### Description\r\n\r\nPlacing an [HTML entity](https://dev.w3.org/html5/html-author/charref) (e.g. ` `) inside a translated text which also contains interpolated variables\r\n(`\u003cdiv i18n> Interpolation: {{ variable }}\u003c/div>`)\r\nresults in an incorrect value of the `equiv-text` attribute inside the extracted message's `INTERPOLATION` tag\r\n(`\u003cx id=\"INTERPOLATION_1\" equiv-text=\"ion: {{ v\"/>`).\r\nSeems like the value is shifted by the difference in amount of characters taken up by the HTML entity and it's actual representation.\r\n\r\nThis is a minor and rather unimportant issue since it does not affect the actual interpolation or translation. From what I understand this `equiv-text` attribute has an informative role for translators.\r\n\r\n## 🔬 Minimal Reproduction\r\n\u003c!--\r\nSimple steps to reproduce this bug.\r\n\r\nPlease include: commands run (including args), packages added, related code changes.\r\n\r\nIf reproduction steps are not enough for reproduction of your issue, please create a minimal GitHub repository with the reproduction of the issue. \r\nA good way to make a minimal reproduction is to create a new app via `ng new repro-app` and add the minimum possible code to show the problem. \r\nShare the link to the repo below along with step-by-step instructions to reproduce the problem, as well as expected and actual behavior.\r\n\r\nIssues that don't have enough info and can't be reproduced will be closed.\r\n\r\nYou can read more about issue submission guidelines here: https://github.com/angular/angular-cli/blob/master/CONTRIBUTING.md#-submitting-an-issue\r\n-->\r\n[https://github.com/pKrupaJunior/extract-i18n-issue](https://github.com/pKrupaJunior/extract-i18n-issue)\r\n\r\n1. Create project:\r\n  ```shell\r\n  ng new extract-i18n-issue -s -t --minimal -g -S --style css --create-application false\r\n  ```\r\n2. Create sample application:\r\n  ```shell\r\n  ng g application demo -s -t --minimal --style css -S --routing false\r\n  ```\r\n3. Add localization support:\r\n  ```shell\r\n  ng add @angular/localize\r\n  ```\r\n4. Add an HTML template containing `i18n` attribute on a tag with **interpolated variables** and **HTML entities**:\r\n  ```html\r\n  \u003cdiv i18n>Interpolation: {{ one }} Interpolation: {{ two }}\u003c/div>\r\n  ```\r\n5. Run `extract-i18n`:\r\n  ```shell\r\n  ng extract-i18n --output-path projects/demo/src/i18n\r\n  ```\r\n\r\n## 🔥 Result\r\nThe generated `messages.xlf` file contains this:\r\n```xml\r\n\u003ctrans-unit id=\"4906579891802234912\" datatype=\"html\">\r\n  \u003csource>Interpolation: \u003cx id=\"INTERPOLATION\" equiv-text=\"{{ one }}\"/> Interpolation: \u003cx id=\"INTERPOLATION_1\" equiv-text=\"ion: {{ t\"/>\u003c/source>\r\n  ...\r\n\u003c/trans-unit>\r\n```\r\nThe second `equiv-text` attribute value is incorrect: `\u003cx id=\"INTERPOLATION_1\" equiv-text=\"ion: {{ t\"/>`.\r\nWhile it should be: `\u003cx id=\"INTERPOLATION_1\" equiv-text=\"{{ two }}\"/>`.\r\n\r\n\r\n## 🌍 Your Environment\r\n\u003cpre>\u003ccode>Angular CLI: 11.1.4\r\nNode: 12.13.0\r\nOS: win32 x64\r\n\r\nAngular: 11.1.2\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... localize, platform-browser, platform-browser-dynamic, router\r\nIvy Workspace: Yes\r\n\r\nPackage                         Version\r\n---------------------------------------------------------\r\n@angular-devkit/architect       0.1101.4\r\n@angular-devkit/build-angular   0.1101.4\r\n@angular-devkit/core            11.1.4\r\n@angular-devkit/schematics      11.1.4\r\n@angular/cli                    11.1.4\r\n@schematics/angular             11.1.4\r\n@schematics/update              0.1101.4\r\nrxjs                            6.6.6\r\ntypescript                      4.1.5\r\n\u003c/code>\u003c/pre>\r\n","author":{"url":"https://github.com/pKrupaJunior","@type":"Person","name":"pKrupaJunior"},"datePublished":"2021-02-27T22:40:37Z","url":"https://github.com/angular/angular/issues/41034"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4701bf7f-3324-383d-7b1b-00e0c94b4632
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB70E:14ECB:2342F52:2CC8D4E:6B0180AC
html-safe-nonce782f548b8ec4d95ae12324fcb8f672b82f147ad3fd420ab9de811dfc7d7c2d56
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzBFOjE0RUNCOjIzNDJGNTI6MkNDOEQ0RTo2QjAxODBBQyIsInZpc2l0b3JfaWQiOiI5MjYxMjg2NTc0Mzk3NTIzNjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac88afdef6fe8bfa80dc6b7968c644d60ec761e933f270ecb4b5d08a77359b3fa7
hovercard-subject-tagissue:818278418
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/41034/issue_layout
twitter:imagehttps://opengraph.githubassets.com/338c0862fc87c851e77666e621ab0feac609d223bc3ae0be954bc5f1819f1269/angular/angular/issues/41034
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/338c0862fc87c851e77666e621ab0feac609d223bc3ae0be954bc5f1819f1269/angular/angular/issues/41034
og:image:alt🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint extract-i18n run config help version doc Is this a regression? Yes, I also tested this with the old extractio...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepKrupaJunior
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/41034#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F41034
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F41034
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/41034
Reloadhttps://github.com/angular/angular/issues/41034
Reloadhttps://github.com/angular/angular/issues/41034
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/41034
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/41034
extract-i18n with HTML entities and interpolationhttps://github.com/angular/angular/issues/41034#top
https://github.com/petebacondarwin
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
area: i18nIssues related to localization and internationalizationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20i18n%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/pKrupaJunior
pKrupaJuniorhttps://github.com/pKrupaJunior
on Feb 27, 2021https://github.com/angular/angular/issues/41034#issue-818278418
HTML entityhttps://dev.w3.org/html5/html-author/charref
https://github.com/pKrupaJunior/extract-i18n-issuehttps://github.com/pKrupaJunior/extract-i18n-issue
Nexthttps://github.com/angular/angular/issues/41034?timeline_page=1
alan-agius4https://github.com/alan-agius4
angular/angular-clihttps://github.com/angular/angular-cli
on Feb 28, 2021https://github.com/angular/angular/issues/41034#event-4386395128
alan-agius4https://github.com/alan-agius4
area: i18nIssues related to localization and internationalizationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20i18n%22
on Feb 28, 2021https://github.com/angular/angular/issues/41034#event-4386395424
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Feb 28, 2021https://github.com/angular/angular/issues/41034#event-4386395434
petebacondarwinhttps://github.com/petebacondarwin
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
on Mar 1, 2021https://github.com/angular/angular/issues/41034#event-4388755268
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
Backloghttps://github.com/angular/angular/milestone/82
on Mar 1, 2021https://github.com/angular/angular/issues/41034#event-4388755321
petebacondarwinhttps://github.com/petebacondarwin
on Mar 2, 2021https://github.com/angular/angular/issues/41034#event-4398114266
https://github.com/petebacondarwin
petebacondarwinhttps://github.com/petebacondarwin
on May 4, 2021https://github.com/angular/angular/issues/41034#issuecomment-832171982
https://github.com/petebacondarwin
petebacondarwinhttps://github.com/petebacondarwin
on May 4, 2021https://github.com/angular/angular/issues/41034#issuecomment-832182024
petebacondarwinhttps://github.com/petebacondarwin
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
on Jun 9, 2021https://github.com/angular/angular/issues/41034#event-4865754410
atscotthttps://github.com/atscott
on Aug 2, 2021https://github.com/angular/angular/issues/41034#event-5100202742
fix(compiler): include leading whitespace in source-spans of i18n mes…https://github.com/angular/angular/commit/11ef03b36f71eea4ec7b3782f86a38a3d8f316da
https://docs.github.com/articles/closing-issues-via-commit-messages
11ef03bhttps://github.com/angular/angular/commit/11ef03b36f71eea4ec7b3782f86a38a3d8f316da
fix(compiler): include leading whitespace in source-spans of i18n mes…https://github.com/angular/angular/commit/82ca69d6da9f915f3d26904827ea59f3a661c655
https://docs.github.com/articles/closing-issues-via-commit-messages
82ca69dhttps://github.com/angular/angular/commit/82ca69d6da9f915f3d26904827ea59f3a661c655
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 2, 2021https://github.com/angular/angular/issues/41034#issuecomment-911843987
automatic conversation locking policyhttps://github.com/angular/angular/blob/8f24bc9443b3872fe095d9f7f77b308a361a13b4/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 2, 2021https://github.com/angular/angular/issues/41034#event-5248606193
jessicajaniukhttps://github.com/jessicajaniuk
on Sep 16, 2021https://github.com/angular/angular/issues/41034#event-5314319364
fix(compiler): include leading whitespace in source-spans of i18n mes…https://github.com/angular/angular/commit/feba4d27191089301ae1926952403107ae2bb75d
https://docs.github.com/articles/closing-issues-via-commit-messages
feba4d2https://github.com/angular/angular/commit/feba4d27191089301ae1926952403107ae2bb75d
fix(compiler): include leading whitespace in source-spans of i18n mes…https://github.com/angular/angular/commit/9c8a1f8a71be9b8380afbdc61ee7ee60f24488b4
https://docs.github.com/articles/closing-issues-via-commit-messages
9c8a1f8https://github.com/angular/angular/commit/9c8a1f8a71be9b8380afbdc61ee7ee60f24488b4
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/41034
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/41034
petebacondarwinhttps://github.com/petebacondarwin
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
area: i18nIssues related to localization and internationalizationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20i18n%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.