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

Add Angular 7 support #29

Open
daniel-bikemap opened this issue Apr 11, 2019 · 4 comments
Open

Add Angular 7 support #29

daniel-bikemap opened this issue Apr 11, 2019 · 4 comments

Comments

@daniel-bikemap
Copy link

With Angular 7, I get the following warnings:

npm i @biesbjerg/ngx-translate-po-http-loader --save
npm WARN @biesbjerg/ngx-translate-po-http-loader@3.1.0 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @biesbjerg/ngx-translate-po-http-loader@3.1.0 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @biesbjerg/ngx-translate-po-http-loader@3.1.0 requires a peer of @ngx-translate/core@^10.0.0 but none is installed. You must install peer dependencies yourself.

I am using Angular 7 with ngx-translate/core 11.x and ngx-translate/http-loader 4.x.

@LizanLycan
Copy link

LizanLycan commented Apr 26, 2019

ERROR in ./node_modules/@biesbjerg/ngx-translate-po-http-loader/node_modules/gettext-parser/lib/poparser.js
Module not found: Error: Can't resolve 'stream' in '...\node_modules\@biesbjerg\ngx-translate-po-http-loader\node_modules\gettext-parser\lib'

It is strange because it was with the only package that did not work (there were 2 more with the same error), I added the following configuration to tsconfig.json and for the others it worked:

{
  ...
  "compilerOptions": {
    ...
    "paths": {
      "stream": ["../node_modules/readable-stream/readable.js"]
    }
  }
}

Try installing directly npm install stream and compile. But during the deployment in the browser comes out another error. Despite this, try the solution seen in the PR requested for update with angle 6, but unfortunately it did not work either (see thread #26 )

@Mohl
Copy link

Mohl commented Apr 26, 2019

I habe to admit, I abbandoned the idea of using ngx-translate with the po-loader since I could not work around this problem. Since it seems that @biesbjerg has abandoned this project I went ahead and used angular-l10n instead. I had to jump through a few hoops but got it up & running, even working with the ngx-translate-extractor, which wasn't built for angular-l10n at all. It doesn't with the full angular-l10n featureset, but good enough to extract .po files. I convert these .po files on the fly with a small server-side python script, but working with .mo files should work as well. I hope @biesbjerg will find the time someday to maintain this project again.

@LizanLycan
Copy link

@Mohl @daniel-bikemap meanwhile can go trying the solution provided in #22 (#22 (comment)), so far, I compiled as much as I ran in the browser!

@Tohnmeister
Copy link

Tohnmeister commented Sep 20, 2019

ERROR in ./node_modules/@biesbjerg/ngx-translate-po-http-loader/node_modules/gettext-parser/lib/poparser.js
Module not found: Error: Can't resolve 'stream' in '...\node_modules\@biesbjerg\ngx-translate-po-http-loader\node_modules\gettext-parser\lib'

It is strange because it was with the only package that did not work (there were 2 more with the same error), I added the following configuration to tsconfig.json and for the others it worked:

{
  ...
  "compilerOptions": {
    ...
    "paths": {
      "stream": ["../node_modules/readable-stream/readable.js"]
    }
  }
}

Try installing directly npm install stream and compile. But during the deployment in the browser comes out another error. Despite this, try the solution seen in the PR requested for update with angle 6, but unfortunately it did not work either (see thread #26 )

You should probably change

"stream": ["../node_modules/readable-stream/readable.js"]

to

"stream": ["./node_modules/readable-stream/readable.js"]

That worked for me.

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

4 participants