transloco icon indicating copy to clipboard operation
transloco copied to clipboard

Bug(translation API): it failed to get sub scope with `selectTranslation()`

Open NevenLiang opened this issue 3 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

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

Transloco

Is this a regression?

Yes

Current behavior

I have a subfolders under the path of /assests/i18n. In the demo, the path is /assets/i18n/admin-page/sub-page. I want to get the translation in component with selectTranslation(), but it doesn't work. selectTranslate() and selectTranslateObject() work.

In my understanding, we should use selectTranslateObject() when we want to get a part of the translation, and use selectTranslation for the whole translation file.

Expected behavior

selectTranslation() should work for this use case.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/ngneat-transloco-arpvtq?file=src/app/home/home.component.ts

Transloco Config

No response

Please provide the environment you discovered this bug in

Browser

No response

Additional context

Check app/home/home.component.ts, and see the logs in console.

I would like to make a pull request for this bug

No

NevenLiang avatar Nov 29 '21 16:11 NevenLiang