ngx-rocket / generator-ngx-rocket

:rocket: Extensible Angular 14+ enterprise-grade project generator
https://ngx-rocket.github.io/
MIT License
1.53k stars 217 forks source link

generating electron app breaks l10n #500

Closed felepp closed 5 years ago

felepp commented 5 years ago

I'm submitting a...

Current behavior

When selecting the electron option during ngx new the localization is not working out of the box, similar to issue https://github.com/ngx-rocket/generator-ngx-rocket/issues/165. Although the language selector changes the language in localStorage no strings are replaced. The app name is displayed as "APP_NAME". When generating a "Web app" only everything seems to work fine.

Expected behavior

Translatable strings should be replaced.

Minimal reproduction of the problem with instructions

ngx new with the options provided below.

Environment



ngX-Rocket: 7.0.2       
Node.js: v12.8.0        
Npm: 6.10.3
OS: win32 x64 10.0.18362

Generated project options:
{
  "generator-ngx-rocket": {
    "version": "7.0.2",
    "props": {
      "location": "path",
      "strict": false,
      "skipInstall": false,
      "skipQuickstart": false,
      "initGit": true,
      "appName": "ngx rocket test 3",
      "target": [
        "web",
        "electron"
      ],
      "pwa": false,
      "desktop": [
        "windows"
      ],
      "ui": "bootstrap",
      "auth": false,
      "lazy": false,
      "angulartics": false,
      "tools": [],
      "utility": [],
      "projectName": "ngx-rocket-test-3",
      "packageManager": "npm",
      "mobile": []
    }
  }
}

Angular CLI: 8.1.3
Node: 12.8.0
OS: win32 x64
Angular: 8.2.4
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.3
@angular-devkit/build-angular     0.801.3
@angular-devkit/build-optimizer   0.801.3
@angular-devkit/build-webpack     0.801.3
@angular-devkit/core              8.1.3
@angular-devkit/schematics        8.1.3
@angular/cli                      8.1.3
@ngtools/webpack                  8.1.3
@schematics/angular               8.1.3
@schematics/update                0.801.3
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.35.2

geyuqiu commented 5 years ago

Is there any progress on it?

sinedied commented 5 years ago

Will take a look, but I'm a bit overloaded for now. If you want to take a look a it we'll gladly accept a PR.

sinedied commented 5 years ago

On it, instead of netflix night, tonight will be bugfix night 😄

sinedied commented 5 years ago

Of found it, issue was same as #165 💀 Long story short:

I went for the quick fix this time, but it seems I need to add proper es6 module handling for Electron to the (long) list of things that needs to be improved with Electron.