jsverse / transloco

🚀 😍 The internationalization (i18n) library for Angular

Home Page:https://jsverse.github.io/transloco/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug(tranloco): provideTranslocoTranspiler does not work with FunctionalTranspiler

ghostlytalamaur opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Which Transloco package(s) are the source of the bug?

Transloco

Is this a regression?

Yes

Current behavior

When you provide FunctionalTranspiler using provideTranslocoTranspiler(FunctionalTranspiler) error is raised. It happens because this.injector in FunctionalTranspiler actually is not an injector, but TranslocoConfig object due to deps field in provideTranslocoTranspiler function.
I suggest:

  1. provideTranslocoTranspiler should not use deps array;
  2. DefaultTranspiler and FunctionalTranspiler should use inject
  3. FunctionalTranspiler should use correct config. Right now config is not passed to base DefaultTranspiller class.

Expected behavior

provideTranslocoTranspiler should work as expected with DefaultTranspiler and FunctionalTranspiler

Please provide a link to a minimal reproduction of the bug, if you won't provide a link the issue won't be handled.

https://stackblitz.com/edit/stackblitz-starters-1ehzbq?file=src%2Fmain.ts

Transloco Config

No response

Please provide the environment you discovered this bug in

Transloco: 6.0.0

Browser

No response

Additional context

No response

I would like to make a pull request for this bug

No