Title: ng xi18n isn't extracting localized messages when using $localize inside component ts files · Issue #16375 · angular/angular-cli · GitHub
Open Graph Title: ng xi18n isn't extracting localized messages when using $localize inside component ts files · Issue #16375 · angular/angular-cli
X Title: ng xi18n isn't extracting localized messages when using $localize inside component ts files · Issue #16375 · angular/angular-cli
Description: 🐞 Bug report / 🚀Feature request Command (mark with an x) new build serve test e2e generate add update lint xi18n run config help version doc Description ng xi18n isn't extracting localized messages when using $localize inside component t...
Open Graph Description: 🐞 Bug report / 🚀Feature request Command (mark with an x) new build serve test e2e generate add update lint xi18n run config help version doc Description ng xi18n isn't extracting localized messages...
X Description: 🐞 Bug report / 🚀Feature request Command (mark with an x) new build serve test e2e generate add update lint xi18n run config help version doc Description ng xi18n isn't extracting localized mess...
Opengraph URL: https://github.com/angular/angular-cli/issues/16375
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ng xi18n isn't extracting localized messages when using $localize inside component ts files","articleBody":"# 🐞 Bug report / 🚀Feature request\r\n\r\n### Command (mark with an `x`)\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] xi18n\r\n- [ ] run\r\n- [ ] config\r\n- [ ] help\r\n- [ ] version\r\n- [ ] doc\r\n\r\n### Description\r\n\r\n``ng xi18n`` isn't extracting localized messages when using ``$localize`` inside component ts files.\r\n\r\n\r\n## 🔬 Minimal Reproduction\r\n1. Create a Angular v9 Ivy enabled application.\r\n2. Add `@angular/localize` (`ng add @angular/localize`)\r\n3. Add a localized message in a component HTML template using `i18n` attribute (`\u003ch2 i18n=\"@@works\">This works\u003c/h2>`). \r\n4. Add a localized message in a component ts file using `$localize` (```this.message = $localize`:@@anId:a basic message`;```)\r\n5. Execute ``ng xi18n``. \r\n6. Only the HTML template messages are being extracted.\r\n\r\nManually adding the non extracted translations and building the application works as expected but running ``ng xi18n`` again will erase them.\r\n\r\nI've created a minimal GitHub repository with the reproduction of the issue : [ivy-xi18n-issue](https://github.com/josuerios/ivy-xi18n-issue)\r\n\r\n## 🌍 Your Environment\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 9.0.0-rc.5\r\nNode: 10.17.0\r\nOS: darwin x64\r\n\r\nAngular: 9.0.0-rc.5\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... language-service, localize, platform-browser\r\n... platform-browser-dynamic, router\r\nIvy Workspace: Yes\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.900.0-rc.5\r\n@angular-devkit/build-angular 0.900.0-rc.5\r\n@angular-devkit/build-optimizer 0.900.0-rc.5\r\n@angular-devkit/build-webpack 0.900.0-rc.5\r\n@angular-devkit/core 9.0.0-rc.5\r\n@angular-devkit/schematics 9.0.0-rc.5\r\n@ngtools/webpack 9.0.0-rc.5\r\n@schematics/angular 9.0.0-rc.5\r\n@schematics/update 0.900.0-rc.5\r\nrxjs 6.5.3\r\ntypescript 3.6.4\r\nwebpack 4.41.2\r\n\r\n\u003c/code>\u003c/pre>\r\n","author":{"url":"https://github.com/josuerios","@type":"Person","name":"josuerios"},"datePublished":"2019-12-06T17:29:01Z","url":"https://github.com/angular/angular-cli/issues/16375"}
| 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:ea768ba4-48f0-5a69-b8b2-ace0fd8fcd8e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ADCE:1148D3:90DB5A:BAC364:6B00EE94 |
| html-safe-nonce | 701715eb5c84647141344f4fdf77089ffaa437540c262dc3bb2efacff4b5cbb4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRENFOjExNDhEMzo5MERCNUE6QkFDMzY0OjZCMDBFRTk0IiwidmlzaXRvcl9pZCI6Ijg3NDA5NzI4OTAxNzIyNDg1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b0b942a9c35180ae628a5af2aec29e705395459fc3ea5416342b182b2fd20ee7 |
| hovercard-subject-tag | issue:534163975 |
| 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-cli/16375/issue_layout |
| twitter:image | https://opengraph.githubassets.com/539ebe36a8125cc31ea526405260a1cf821bbb3bfc4ceb5fc10766e07e3dc70c/angular/angular-cli/issues/16375 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/539ebe36a8125cc31ea526405260a1cf821bbb3bfc4ceb5fc10766e07e3dc70c/angular/angular-cli/issues/16375 |
| og:image:alt | 🐞 Bug report / 🚀Feature request Command (mark with an x) new build serve test e2e generate add update lint xi18n run config help version doc Description ng xi18n isn't extracting localized messages... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | josuerios |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| 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