angular: [IVY] i18n not working yet?

I was trying out IVY on our medium sized corporate project - I finally managed to get the site compiled, but noticed none of the i18n translations were injected into the generated code.

Is i18n not supposed to work with IVY yet? Just curious

There are no error messages other than weird stuff like

WARNING in /Users/lrj/project/ivy2/src/app/modules/iticket-business/views/edit-profile/index.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

But the site seems to be working - just not with the translations inserted. I make heavy use of paths in tsconfig.json, - is this not supposed to be supported in IVY?

Is this a regression?

Don’t know

🌍 Your Environment

Angular Version:


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 9.0.0-next.0
Node: 12.2.0
OS: darwin x64
Angular: 9.0.0-next.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.0-next.0
@angular-devkit/build-angular     0.900.0-next.0
@angular-devkit/build-optimizer   0.900.0-next.0
@angular-devkit/build-webpack     0.900.0-next.0
@angular-devkit/core              9.0.0-next.0
@angular-devkit/schematics        9.0.0-next.0
@angular/cdk                      8.1.2
@angular/cli                      9.0.0-next.0
@angular/material                 8.1.2
@angular/pwa                      0.900.0-next.0
@ngtools/webpack                  9.0.0-next.0
@schematics/angular               9.0.0-next.0
@schematics/update                0.900.0-next.0
rxjs                              6.5.2
typescript                        3.5.2

Anything else relevant? I’m sorry if this is a dumb question but I just wanted to check if the i18n="@@my-id" was supposed to be working with IVY.

I make heavy use of paths in tsconfig.json, - is this not supposed to be supported in IVY?

Tsconfig:


{
  "compileOnSave": false,
  "angularCompilerOptions": {
    "enableIvy": true
  },
  "compilerOptions": {
    "baseUrl": "./src",
    "importHelpers": true,
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    //"module": "es2015",
    "module": "esnext",
    "moduleResolution": "node",
    "noImplicitAny": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "skipLibCheck": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ],
    "paths": {
      "@store/*": ["app/store/*", "app/store"],
      "@store": ["app/store/*", "app/store"],
      "@modules/*": ["app/modules/*", "app/modules"],
      "@modules": ["app/modules/*", "app/modules"],
      "@main/*": ["app/main/*", "app/main"],
      "@models/*": ["app/models/*", "app/models"],
      "@models": ["app/models/*", "app/models"],
      "@main": ["app/main/*", "app/main"],
      "@environment": ["environments/environment"],
      "@lib/*": ["app/lib/*", "app/lib"],
      "@lib": ["app/lib/*", "app/lib"],
      "@iticket-business/*": [ "app/modules/iticket-business/*", "app/modules/iticket-business"]
    }
  }
}

@ocombe

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (10 by maintainers)

Most upvoted comments

We are working on i18n in ivy.

We already have some pieces merged into master but it is not functional yet. There are a few more pieces to go and the plan is to have it all working by v9.0.0 release.

Please bear with us.

Or just append tsconfig.json with an exclude section: “exclude”: [ “src/app/modules/iticket-business/views/edit-profile/index.ts” ]

Try this:

  • create a new file named “tsconfig.app.json” with next content:

{ “extends”: “./tsconfig.json”, “compilerOptions”: { “outDir”: “./out-tsc/app”, “types”: [] }, “files”: [ “src/main.ts”, “src/polyfills.ts” ], “include”: [ “src//*.ts" ], “exclude”: [ “src/test.ts”, "src//*.spec.ts” ] }

  • save to the same directory as the “tsconfig.json” file;

  • edit angular.json and replace “tsConfig”: “tsconfig.json” with “tsConfig”: “tsconfig.app.json”,

Hope this helps…