Title: [i18n] enable control over translation message ID · Issue #12941 · angular/angular · GitHub
Open Graph Title: [i18n] enable control over translation message ID · Issue #12941 · angular/angular
X Title: [i18n] enable control over translation message ID · Issue #12941 · angular/angular
Description: I'm submitting a ... (check one with "x") [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/an...
Open Graph Description: I'm submitting a ... (check one with "x") [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request...
X Description: I'm submitting a ... (check one with "x") [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not su...
Opengraph URL: https://github.com/angular/angular/issues/12941
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[i18n] enable control over translation message ID ","articleBody":"**I'm submitting a ...** (check one with \"x\")\r\n```\r\n [ ] bug report =\u003e search github for a similar issue or PR before submitting\r\n [x] feature request\r\n [ ] support request =\u003e Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n```\r\n\r\n**Current behavior**\r\nCurrently the traduction ID is created by hashing the node content and the traduction \"meaning\" value. e.g: : \r\n\r\nfor this html fragment : \r\n```html\r\n\u003cp i18n=\"vehicule|personal vehicule\"\u003ethe car\u003c/p\u003e\r\n```\r\nthe traduction ID will be a hash of `the car[vehicule]`\r\n\r\nFixing any typo in the html tag content (*in this example removing the two spaces between \"the\" and \"car\"*) will create a new ID for translation. So I will have to change the ID for each XLIFF | XTB files despite the fact that I don't know the ID because it's a hash.\r\n\r\n**Expected behavior**\r\nIt would be very useful to have an option to disable the message ID generation to only use the \"meaning\" value as the translation ID.\r\n\r\nFor example, we can have an option in the ng-xi18n script to disable hashing : \r\n```bash\r\n./node_modules/.bin/ng-xi18n --i18nFormat=xlf --meaningAsId\r\n```\r\nAnd add a new provider in the app : \r\n```js \r\nplatformBrowserDynamic().bootstrapModule(AppModule, {[\r\n {provide : TRANSLATIONS, useValue : translationFile},\r\n {provide : TRANSLATIONS_FORMAT, useValue : 'xlf'},\r\n {provide : LOCALE_ID, useValue : 'fr'},\r\n {provide : MESSAGE_ID, useValue : 'meaning'}\r\n]});\r\n```\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\nThis feature will avoid the fact that each minimal changes in the \"original content\" (without affecting the meaning of a word or sentence) will produce a crash of the app because the message ID changes for the `HTML_parser`. In other words, if the developper adds a meaning in the i18n attribute, he must have the choice to change the translation (by changing its ID) or not.\r\n\r\nCurrently, it's impossible to change something in the original content without fixing the ID for every translation files.\r\n\r\n* **Angular version:** 2.1.0\r\n\r\n* **Browser:** all\r\n \r\n* **Language:** TypeScript 2.0.2\r\n\r\n* **Node (for AoT issues):** `node --version` = 4.4.1\r\n","author":{"url":"https://github.com/maxime-allex","@type":"Person","name":"maxime-allex"},"datePublished":"2016-11-17T14:30:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/12941/angular/issues/12941"}
| 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:f38cfee6-f6b6-3811-d97b-fb3a98f1e0eb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9286:2A7CC:2780BEB:34A9428:69742166 |
| html-safe-nonce | 3e9d29bbee16cfeda518546f79901b6356f9d73f48d4b2ad0795359e0fc98b39 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Mjg2OjJBN0NDOjI3ODBCRUI6MzRBOTQyODo2OTc0MjE2NiIsInZpc2l0b3JfaWQiOiIzNjM1MTIxNTY2NjMzMjUwMzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5535a3b40f103df91637f0e244a68f2efab7108bb561174683360c32febf3985 |
| hovercard-subject-tag | issue:190062557 |
| 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/12941/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0497a33d137c29841026dbd3af7b1c95f34930241f2c0f118580457a0b8383ac/angular/angular/issues/12941 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0497a33d137c29841026dbd3af7b1c95f34930241f2c0f118580457a0b8383ac/angular/angular/issues/12941 |
| og:image:alt | I'm submitting a ... (check one with "x") [ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | maxime-allex |
| hostname | github.com |
| expected-hostname | github.com |
| None | 447dc9917c3d68d647a01abfdefe55ec7ee1785922136c1d8395dbb3ab6d57b9 |
| 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 | 8dad7bdfecbe3eaa97ac4e632d6b47e2b23e81d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width