Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TranslateService.stream premature translation #815

Closed
fjozsef opened this issue Mar 21, 2018 · 0 comments · Fixed by #960
Closed

TranslateService.stream premature translation #815

fjozsef opened this issue Mar 21, 2018 · 0 comments · Fixed by #960

Comments

@fjozsef
Copy link
Contributor

fjozsef commented Mar 21, 2018

I'm submitting a ... (check one with "x")

[x] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request

Current behavior
TranslateService.stream can miss language changes when there has not been subscribed to the Observable created of it.

Expected/desired behavior
TranslateService.stream shouldn't make the first translation when it is called. Only when someone is subscribing to its Observable.

Reproduction of the problem
http://plnkr.co/edit/iI7WDj9ht9xwHbLPNNrz
The french translation should be shown, but the english text is displayed.

Please tell us about your environment:
See in plunker.

Known workaround
Wrap the Observable created by stream with defer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant