jsverse / transloco

🚀 😍 The internationalization (i18n) library for Angular
https://jsverse.github.io/transloco/
MIT License
2.04k stars 197 forks source link

Transloco language change overwrites translolo-locale #462

Open Ketec opened 3 years ago

Ketec commented 3 years ago

If the locale is set using this.translocoLocaleService.setLocale(locale) (or default) it is overwritten the moment this.translocoService.setActiveLang(lang); is called.

Because of the https://github.com/ngneat/transloco/blob/master/projects/ngneat/transloco-locale/src/lib/transloco-locale.service.ts translocoService.langChanges$ subscription.

There is no property or config to disable this behaviour.toLocale() method is private so it cannot be overridden to not overwrite locale.

Language and locale can be configured separately (people often want to use their own local region formats but prefer English as the UI language).

shaharkazaz commented 3 years ago

Do you want to create a PR?

Ketec commented 3 years ago

If i find some time to check out and correctly add the config + tests and documentation in the correct place.

Ketec commented 3 years ago

@shaharkazaz Can the PR be checked and verified?