Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot extract i18n from library since angular 18 #29120

Closed
1 task
magioloro opened this issue Dec 12, 2024 · 2 comments
Closed
1 task

Cannot extract i18n from library since angular 18 #29120

magioloro opened this issue Dec 12, 2024 · 2 comments

Comments

@magioloro
Copy link

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

17

Description

I have a multi-project workspace with 2 applications and 1 library, which uses all i18n. In angular 17 I could simply execute ng extract-i18n and all translations from all applications and the library were extracted in one single file.

After updating to version 18 and executing ng extract-i18n the following message appears:

Error: Cannot determine project for command.
This is a multi-project workspace and more than one project supports this command. Run "ng extract-i18n [project]" to execute the command for a specific project or change the current working directory to a project directory.
Available projects are:

  • application1
  • application2

So I have to extract the translations from each single application and the library isn't supported anymore?

Minimal Reproduction

ng extract-i18n

Exception or Error


Your Environment

Angular CLI: 18.2.12
Node: 18.20.2
Package Manager: yarn 3.6.1
OS: win32 x64

Angular: 18.2.13
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1802.12
@angular-devkit/build-angular      18.2.12
@angular-devkit/core               18.2.12
@angular-devkit/schematics         18.2.12
@angular/cdk                       18.2.14
@angular/cli                       18.2.12
@angular/material                  18.2.14
@angular/material-moment-adapter   18.2.14
@schematics/angular                18.2.12
ng-packagr                         18.2.1
rxjs                               7.8.1
typescript                         5.4.5
zone.js                            0.15.0

Anything else relevant?

No response

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Dec 12, 2024

I18n extraction from multiple projects at once, and from libraries were never supported.

I am not entirely sure how this worked in your case, but maybe you were using a non official builder or TypeScript path mappings?

See: #17140

@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2024
@magioloro
Copy link
Author

magioloro commented Dec 12, 2024

I18n extraction from multiple projects at once, and from libraries were never supported.

I am not entirely sure how this worked in your case, but maybe you were using a non official builder or TypeScript path mappings?

See: #17140

Yes, i use a path mapping

"paths": {
      "@libs": [
        "./dist/libs"
      ]
}

But no I follow the tip in #17140 and added "extract-i18n" in the architects section of my lib. But I get the following message by now:

Tried to extract from libs with 'projectType' library, which is not supported. The 'extract-i18n' builder can only extract from applications.

So translating libraries isn't supported at all, although it is allegedly supported? https://v18.angular.dev/cli/extract-i18n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants