lephyrus / ngx-translate-messageformat-compiler

Advanced pluralization (and more) for ngx-translate, using standard ICU syntax which is compiled with the help of messageformat.js.
MIT License
93 stars 30 forks source link

Angular 8 support #46

Closed jlandsmann closed 5 years ago

robiXxu commented 5 years ago

Yes please! npm WARN ngx-translate-messageformat-compiler@4.4.0 requires a peer of @angular/core@^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.

SemVC7 commented 5 years ago

I can confirm that Angular8 does not seem to be supported yet.

I get the following error: Can't resolve 'messageformat' in .........\node_modules\ngx-translate-messageformat-compiler\fesm2015'

FirstLikeComment commented 5 years ago

Hi, I have the same problem here, what's the fix?

Carniatto commented 5 years ago

I have the same problem when running Ivy as @SemVC7

  Error: Can't resolve all parameters for TranslateMessageFormatCompiler: (?).
    at getUndecoratedInjectableFactory (vendor.js:64488)
    at injectableDefOrInjectorDefFactory (vendor.js:64472)
    at providerToFactory (vendor.js:64573)
    at providerToRecord (vendor.js:64518)
    at R3Injector.processProvider (vendor.js:64379)
    at vendor.js:64344
    at vendor.js:64604
    at Array.forEach (<anonymous>)
    at deepForEach (vendor.js:64600)
    at R3Injector.processInjectorType (vendor.js:64340)
KirillFedorov commented 5 years ago

me too... please fix it.

hpawe01 commented 5 years ago

@SemVC7 @FirstLikeComment @Carniatto @KirillFedorov did you installed the messageformat package as described in the README? I did not and it worked until Angular v8. Than I got the same error.

But with npm i --save messageformat (as described in the README) it now works (for me).

KirillFedorov commented 5 years ago

I have messageformat in package.json, but doesn't work :-(

"messageformat": "^2.3.0" "ngx-translate-messageformat-compiler": "^4.4.0"

KirillFedorov commented 5 years ago

with TranslateMessageFormatDebugCompiler is working... what difference?

KirillFedorov commented 5 years ago

@lephyrus can you help with problem?

lephyrus commented 5 years ago

@KirillFedorov We need a much better problem description to be able to help. Also, this is not about general Angular 8 compatibility, which is working for many (including me). Even the Example App at the top of the README is using Angular 8.

This issue is currently closed, which is another reason you're not getting help. Please open a new issue with a more meaningful title. Does the problem only occur when turning on Ivy? Only when doing a prod (AOT) build? If it has worked before, what did you change? Please list the steps to reproduce the problem. Ideally, add a link to StackBlitz or a small repo where people can see the problem and try to help you.

KirillFedorov commented 5 years ago

Thanks, i`ll open new issue and try to create demo app to reproduce the problem.

longman96 commented 4 years ago

Hopefully this ends up helping people. I have managed to get this working with angular 8 and ivy enabled using the following:

export function TranslateMessageFormatCompilerFactory() { return new TranslateMessageFormatCompiler(); }

TranslateModule.forRoot({ loader: { provide: TranslateLoader, useFactory: (createTranslateLoader), deps: [HttpClient] }, compiler: { provide: TranslateCompiler, useFactory: (TranslateMessageFormatCompilerFactory) } })

Might not be the best or correct fix but it works for me