Title: extract-i18n produces incorrect "equiv-text" attributes of interpolation elements · Issue #56845 · angular/angular · GitHub
Open Graph Title: extract-i18n produces incorrect "equiv-text" attributes of interpolation elements · Issue #56845 · angular/angular
X Title: extract-i18n produces incorrect "equiv-text" attributes of interpolation elements · Issue #56845 · angular/angular
Description: Command extract-i18n Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description In the XLF file generated by extract-i18n, there are so...
Open Graph Description: Command extract-i18n Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description In the XLF file...
X Description: Command extract-i18n Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description In the XLF file...
Opengraph URL: https://github.com/angular/angular/issues/56845
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"extract-i18n produces incorrect \"equiv-text\" attributes of interpolation elements","articleBody":"### Command\n\nextract-i18n\n\n### Is this a regression?\n\n- [ ] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n_No response_\n\n### Description\n\nIn the XLF file generated by extract-i18n, there are sometimes incorrect values inside the \"equiv-text\" attributes of the interpolation elements. In these cases, \"equiv-text\" does contain parts of the surrounding text (sometimes including other HTML elements). It seems that the issue occurs when the interpolation element is located directly at the beginning of the translation unit (so a linebreak inside the HTML element fixes the output, see example below).\n\n### Minimal Reproduction\n\n**This example leads to the expected output:**\r\n\r\nHTML template:\r\n```\r\n\u003cdiv i18n=\"@@project.download.progressInfo.database\"\u003e\r\n {{getRoundedProgress(databaseProgressPercent)}}% finished...\r\n\u003c/div\u003e\r\n\u003cdiv\u003eSomething else\u003c/div\u003e\r\n```\r\n\r\nXLF generated by extract-i18n (using builder @angular-devkit/build-angular:extract-i18n):\r\n```\r\n\u003ctrans-unit id=\"project.download.progressInfo.database\" datatype=\"html\"\u003e\r\n \u003csource\u003e \u003cx id=\"INTERPOLATION\" equiv-text=\"{{getRoundedProgress(databaseProgressPercent)}}\"/\u003e% finished... \u003c/source\u003e\r\n \u003ccontext-group purpose=\"location\"\u003e\r\n \u003ccontext context-type=\"sourcefile\"\u003esrc/app/components/project/download-project-progress-modal.html\u003c/context\u003e\r\n \u003ccontext context-type=\"linenumber\"\u003e12,14\u003c/context\u003e\r\n \u003c/context-group\u003e\r\n\u003c/trans-unit\u003e\r\n```\r\n\r\n**This example produces incorrect content in \"equiv-text\":**\r\n\r\nHTML template:\r\n```\r\n\u003cdiv i18n=\"@@project.download.progressInfo.database\"\u003e{{getRoundedProgress(databaseProgressPercent)}}% finished...\u003c/div\u003e\r\n\u003cdiv\u003eSomething else\u003c/div\u003e\r\n```\r\n\r\n\r\nXLF generated by extract-i18n (using builder @angular-devkit/build-angular:extract-i18n):\r\n```\r\n\u003ctrans-unit id=\"project.download.progressInfo.database\" datatype=\"html\"\u003e\r\n \u003csource\u003e\u003cx id=\"INTERPOLATION\" equiv-text=\"% finished...\u0026lt;/div\u0026gt;\r\n \u0026lt;div\u0026gt;Something else\u0026lt;/div\u0026gt;\"/\u003e% finished...\u003c/source\u003e\r\n \u003ccontext-group purpose=\"location\"\u003e\r\n \u003ccontext context-type=\"sourcefile\"\u003esrc/app/components/project/download-project-progress-modal.html\u003c/context\u003e\r\n \u003ccontext context-type=\"linenumber\"\u003e12\u003c/context\u003e\r\n \u003c/context-group\u003e\r\n\u003c/trans-unit\u003e\r\n```\n\n### Exception or Error\n\n_No response_\n\n### Your Environment\n\n```text\nAngular CLI: 18.0.6\r\nNode: 20.14.0\r\nPackage Manager: npm 10.7.0\r\nOS: darwin arm64\r\n\r\nAngular: 18.0.5\r\n... animations, cdk, common, compiler, compiler-cli, core, forms\r\n... localize, platform-browser, platform-browser-dynamic, router\r\n\r\nPackage Version\r\n---------------------------------------------------------\r\n@angular-devkit/architect 0.1800.6\r\n@angular-devkit/build-angular 18.0.6\r\n@angular-devkit/core 18.0.6\r\n@angular-devkit/schematics 18.0.6\r\n@angular/cli 18.0.6\r\n@schematics/angular 18.0.6\r\nrxjs 6.5.5\r\ntypescript 5.4.5\r\nzone.js 0.14.7\n```\n\n\n### Anything else relevant?\n\n_No response_","author":{"url":"https://github.com/tkleinke","@type":"Person","name":"tkleinke"},"datePublished":"2024-07-04T09:14:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/56845/angular/issues/56845"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9e234b2f-a51f-dcbd-d874-e3acbf0fd2a3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB9C:1BBE0B:5724E88:7130E2D:69753E00 |
| html-safe-nonce | ce8385d5c650a39014d2c21277c58ec5b3f8a38fcba62378d3acd10e5769cfb1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjlDOjFCQkUwQjo1NzI0RTg4OjcxMzBFMkQ6Njk3NTNFMDAiLCJ2aXNpdG9yX2lkIjoiNDk1NTM1MTY1NTIwMTk3OTkwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 26620a0a4557e266f52504a781c97498b8cc5505f7491e57225d115fdc0e1537 |
| hovercard-subject-tag | issue:2390469316 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/56845/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f8e7588e6b9ec4dc52ff8eaa8085f3858d5ac5f288c77552a2f24d8df4b8e432/angular/angular/issues/56845 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f8e7588e6b9ec4dc52ff8eaa8085f3858d5ac5f288c77552a2f24d8df4b8e432/angular/angular/issues/56845 |
| og:image:alt | Command extract-i18n Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description In the XLF file... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tkleinke |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width