question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

xi18n extraction should be based on code referenced/entrypoints

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Angular CLI: 1.5.0
Node: 8.7.0
OS: darwin x64
Angular: 5.0.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.0
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.1
typescript: 2.4.2
webpack: 3.8.1

Repro steps.

Use monorepos pattern for having multiple apps and libs and then extract strings for each app. They all contain references to all strings whether used or not.

Command: https://github.com/intellix/nx-cli/blob/master/package.json#L13

References to strings in other apps: https://github.com/intellix/nx-cli/blob/master/apps/red/src/locale/messages.xlf#L26

References to lazy module that’s not used/referenced by that app: https://github.com/intellix/nx-cli/blob/master/apps/red/src/locale/messages.xlf#L77

Desired functionality.

I’d like extraction (and pretty much everything through ngc) to only be based on context of the app and it’s entrypoints (static or lazy). In the example repository, the Red app doesn’t reference or have a loadChildren reference to LazierModule but still gets strings extracted for it and all the other apps.

We’ve got feature modules defined as libs and a couple of apps that include some of them. The product owners of apps are confused why they’re translating strings for features they don’t have and for other apps

Mention any other details that might be useful.

Schematics: https://nrwl.io/nx/ Repository: https://github.com/intellix/nx-cli

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
filipesilvacommented, Oct 8, 2019

I think this is a non-issue now that CLI uses a workspace file and can have several distinct applications, each of them with its own tsconfig files. Let me know if that’s not the case.

1reaction
ocombecommented, Nov 15, 2017

Nice, fyi you can extend another tsconfig file instead of copy pasting everything in each file. If you only need to change the exclude, it’s easier to have a generic app config file, extend it and just change that

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng extract-i18n - Angular
Option Description Default Value ‑‑format Output format for the generated file. xlf ‑‑out‑file Name of the file to output. ‑‑output‑path Path where output will be placed....
Read more >
Angular CLI - ng xi18n Command - Tutorialspoint
ng xi18n command extracts i18n messages from source code. Arguments. The argument for ng xi18n command is as follows −. Sr.No. Argument &...
Read more >
ng xi18n: exclude code in node_modules when extracting ...
Is there a way to not have stuff from node_modules included in the extracted strings? Like some exclude option which can be configured...
Read more >
Angular i18n: internationalization & localization with examples
Angular I18n uses the built-in module for internationalization. Learn how to set up I18n, ... The source code can be found at GitHub....
Read more >
How To Use Internationalization (i18n) in Angular | DigitalOcean
In this tutorial, you will learn to use the built-in i18n functionality in an Angular ... Step 2 — Using xi18n to Extract...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found