Skip to content

xi18n doesn't emit messages.xlf with Ivy enabled #14225

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

Closed
cexbrayat opened this issue Apr 21, 2019 · 7 comments · Fixed by #14771
Closed

xi18n doesn't emit messages.xlf with Ivy enabled #14225

cexbrayat opened this issue Apr 21, 2019 · 7 comments · Fixed by #14771
Assignees
Labels
freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@cexbrayat
Copy link
Member

cexbrayat commented Apr 21, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [x] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

The issue is only present with Ivy enabled

Description

Running ng xi18n does not emit messages.xlf if the app uses Ivy.

🔬 Minimal Reproduction

ng new xi18n --defaults --enable-ivy
cd xi18n
# add i18n attribute on the h1 tag in app.component.html
ng xi18n

🔥 Exception or Error

No error can be seen, the command runs OK:


Hash: d2b856c9dffb86f8809b
Time: 16592ms
Built at: 21/04/2019 15:44:26
           Asset      Size         Chunks                    Chunk Names
         main.js  2.19 MiB           main  [emitted]  [big]  main
polyfills-es5.js   361 KiB  polyfills-es5  [emitted]  [big]  polyfills-es5
    polyfills.js   151 KiB      polyfills  [emitted]         polyfills
Entrypoint main [big] = main.js
Entrypoint polyfills-es5 [big] = polyfills-es5.js
Entrypoint polyfills = polyfills.js
chunk {main} main.js (main) 1.81 MiB [entry] [rendered]
chunk {polyfills} polyfills.js (polyfills) 146 KiB [entry] [rendered]
chunk {polyfills-es5} polyfills-es5.js (polyfills-es5) 193 KiB [entry] [rendered]

But not file is emitted.

If you switch enableIvy to false, then the command emits messages.xlf again.

🌍 Your Environment


Angular CLI: 8.0.0-beta.16
Node: 11.11.0
OS: darwin x64
Angular: 8.0.0-beta.13
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.0-beta.16
@angular-devkit/build-angular     0.800.0-beta.16
@angular-devkit/build-optimizer   0.800.0-beta.16
@angular-devkit/build-webpack     0.800.0-beta.16
@angular-devkit/core              8.0.0-beta.16
@angular-devkit/schematics        8.0.0-beta.16
@angular/@types                   
@angular/cli                      8.0.0-beta.16
@angular/events                   
@angular/rxjs                     
@angular/tslib                    
@angular/typescript               
@ngtools/webpack                  8.0.0-beta.16
@schematics/angular               8.0.0-beta.16
@schematics/update                0.800.0-beta.16
rxjs                              6.4.0
typescript                        3.4.4
webpack                           4.30.0
@cexbrayat
Copy link
Member Author

cc @ocombe as you may have an idea?

@deebloo
Copy link
Contributor

deebloo commented Apr 21, 2019

@cexbrayat I don't think xi18n works with ivy yet

@ocombe
Copy link
Contributor

ocombe commented Apr 21, 2019

@AndrewKushnir you told me the other day that it was supposed to work with ivy right now, can you take a look at it please?

@ngbot ngbot bot added this to the needsTriage milestone Apr 22, 2019
@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity3: broken labels Apr 22, 2019
@AndrewKushnir
Copy link

@ocombe sorry for the delay in answering. Ivy uses different code to process i18n-related attributes/blocks. The code of existing extraction/merging tools (based on View Engine) is not affected by Ivy changes, so these tools should continue to run without any changes.
It looks like the flag that enables Ivy somehow interfere with running xi18n command and additional investigation is needed to see how to ignore this flag (to keep using VE's logic to extract i18n messages) while running xi18n command.

@ocombe
Copy link
Contributor

ocombe commented Apr 29, 2019

I added a ticket on Jira to track this

@pacocom
Copy link

pacocom commented May 29, 2019

xi18n doesn't emit messages.xlf with Ivy enabled (same problem with)

{
  "name": "ivyapp",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "start:es": "ng serve --configuration=es",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "i18n": "ng xi18n --outputPath=locale"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~8.0.0",
    "@angular/common": "~8.0.0",
    "@angular/compiler": "~8.0.0",
    "@angular/core": "~8.0.0",
    "@angular/forms": "~8.0.0",
    "@angular/platform-browser": "~8.0.0",
    "@angular/platform-browser-dynamic": "~8.0.0",
    "@angular/router": "~8.0.0",
    "rxjs": "~6.4.0",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.800.0",
    "@angular/cli": "~8.0.0",
    "@angular/compiler-cli": "~8.0.0",
    "@angular/language-service": "~8.0.0",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "angular-http-server": "^1.9.0",
    "codelyzer": "^5.0.0",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.4.3",
    "webpack-bundle-analyzer": "^3.3.2"
  }
}

@ngbot ngbot bot modified the milestones: needsTriage, Backlog Jun 13, 2019
mgechev pushed a commit that referenced this issue Jun 14, 2019
…18n in Ivy

i18n is not yet implemented in Ivy, we should emit a warning stating this and exit gracefully.

This also swaps the readTsConfig logic to use `@angular/compiler-cli` instead of `typescript`. This is needed because when parsing the tsconfig, typescript is not aware of `angularCompilerOptions` and will not merged them if they are at un upper level tsconfig file when using `extends`.

Closes #14225
mgechev pushed a commit that referenced this issue Jun 15, 2019
…18n in Ivy

i18n is not yet implemented in Ivy, we should emit a warning stating this and exit gracefully.

This also swaps the readTsConfig logic to use `@angular/compiler-cli` instead of `typescript`. This is needed because when parsing the tsconfig, typescript is not aware of `angularCompilerOptions` and will not merged them if they are at un upper level tsconfig file when using `extends`.

Closes #14225
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants