transloco icon indicating copy to clipboard operation
transloco copied to clipboard

Transloco language change overwrites translolo-locale

Open Ketec opened this issue 3 years ago • 3 comments

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).

Ketec avatar Jun 15 '21 09:06 Ketec

Do you want to create a PR?

shaharkazaz avatar Jul 01 '21 13:07 shaharkazaz

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

Ketec avatar Jul 01 '21 18:07 Ketec

@shaharkazaz Can the PR be checked and verified?

Ketec avatar Jul 15 '21 06:07 Ketec