Title: Include context/context-group tags in i18n extraction tooling · Issue #37202 · angular/angular · GitHub
Open Graph Title: Include context/context-group tags in i18n extraction tooling · Issue #37202 · angular/angular
X Title: Include context/context-group tags in i18n extraction tooling · Issue #37202 · angular/angular
Description: 🚀 feature request It would be useful for the still in-development i18n extraction tooling to include support for context and context-group tags in the generated XLIFF files when this functionality is released. Relevant Package @angular/l...
Open Graph Description: 🚀 feature request It would be useful for the still in-development i18n extraction tooling to include support for context and context-group tags in the generated XLIFF files when this functionality ...
X Description: 🚀 feature request It would be useful for the still in-development i18n extraction tooling to include support for context and context-group tags in the generated XLIFF files when this functionality ...
Opengraph URL: https://github.com/angular/angular/issues/37202
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Include context/context-group tags in i18n extraction tooling","articleBody":"# 🚀 feature request\r\nIt would be useful for the still in-development i18n extraction tooling to include support for `context` and `context-group` tags in the generated XLIFF files when this functionality is released.\r\n\r\n### Relevant Package\r\n@angular/localize\r\n\r\n### Description\r\nThis is in anticipation of functionality that is currently in-flight (#32912 ). I looked through that PR, open issues, and other i18n-related PRs but couldn't find any mention of this. It would be really useful for the i18n extraction tooling, whenever it is released, to include support for including the `context` and `context-group` tags as defined in the [XLIFF 1.2 Specs](http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#context-group). This would make it easier to see where strings are used in source, at a glance.\r\n\r\n### Describe the solution you'd like\r\nInclude `context` and `context-group` tag information in generated XLIFF files when i18n extraction support is released. An example of what this might look like in a generated XLIFF file's `trans-unit` block:\r\n```\r\n \u003ctrans-unit id=\"0aaa61f16a4e7f7d6a1bfc6d513fb99ceec77f17\" datatype=\"html\">\r\n \u003csource>String 1\u003c/source>\r\n \u003ctarget>String 1 translation\u003c/target>\r\n \u003ccontext-group purpose=\"location\">\r\n \u003ccontext context-type=\"sourcefile\">src/app/components/examplecomponent/example.component.ts\u003c/context>\r\n \u003ccontext context-type=\"linenumber\">25\u003c/context>\r\n \u003c/context-group>\r\n \u003ccontext-group purpose=\"location\">\r\n \u003ccontext context-type=\"sourcefile\">src/app/components/examplecomponent/example.component.html\u003c/context>\r\n \u003ccontext context-type=\"linenumber\">7\u003c/context>\r\n \u003c/context-group>\r\n \u003c/trans-unit>\r\n```\r\n\r\n### Describe alternatives you've considered\r\nTwo alternatives would make it a little easier to back-track from string to source but have shortcomings:\r\n- \u003cb>Option 1:\u003c/b> Use custom ids for all localized strings, and use some convention to ensure that every id is unique. The downside to this approach is that in cases where the same string needs to be used multiple times, your XLIFF file has separate entries for each instance of the string, making the XLIFF file a bit of a mess with duplicate entries.\r\n- \u003cb>Option 2:\u003c/b> Use a custom id for all unique strings. So, every time we needed the string 'String 1', we'd specify custom id 'string1'. The issue here of course is that if someone changes the actual string used in one of those cases without changing the custom id, per the i18n documentation: *\"If you use the same id for two different text messages, only the first one is extracted, and its translation is used in place of both original text messages\"*.","author":{"url":"https://github.com/scotia673","@type":"Person","name":"scotia673"},"datePublished":"2020-05-19T17:41:39Z","url":"https://github.com/angular/angular/issues/37202"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:30d60ae2-7c9a-df9d-ed27-ffb147dfd947 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E87E:395430:B9901F:F6B2B4:6B00EFF0 |
| html-safe-nonce | 50140000bf60a93ff378da1c2022f2852bca1fe981b02a6292cf6f2ac752637a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODdFOjM5NTQzMDpCOTkwMUY6RjZCMkI0OjZCMDBFRkYwIiwidmlzaXRvcl9pZCI6Ijg3NzQ2Mzc4NjI3Njg0MDY1MTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 33663fc33e718ca57ad9c670ae4246283b04c18f307109b6e549165fe31112f6 |
| hovercard-subject-tag | issue:621165870 |
| 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/37202/issue_layout |
| twitter:image | https://opengraph.githubassets.com/00d85a26acc2aca2c25b5d801d15f9ec88919bed2d04333199a1eec4eb3de376/angular/angular/issues/37202 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/00d85a26acc2aca2c25b5d801d15f9ec88919bed2d04333199a1eec4eb3de376/angular/angular/issues/37202 |
| og:image:alt | 🚀 feature request It would be useful for the still in-development i18n extraction tooling to include support for context and context-group tags in the generated XLIFF files when this functionality ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | scotia673 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width