-
Notifications
You must be signed in to change notification settings - Fork 59
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
Issue when changing language #47
Comments
I don't know why you are using OnPush change detection strategy, but it's normal that the pure pipes don't work if you use it, because the input parameter ( |
It seems odd to me because I use other pure pipe in my components with OnPush change detection strategy and I don't have any issue. |
I may have found a solution: because the input parameter is updated by a subscription, I can add the calling to the
But then you have to pass a new parameter to the
What do you think? |
I think it's a good idea. |
I made the commit that adds support for OnPush Change Detection strategy. You should remove the library from your npm modules, and follow the instructions in the README to build & install the library locally. Please, try it in your app, and let me know if it works fine, so I'll include this support in the next release. P.S. Just to explain: because the input parameter of the pure pipes changes when the http request is completed (ie after the event has been generated), |
ok. I will test your change monday morning. |
Understand that pure pipes don't work, because the input parameter (lang) is updated by an event when the http request is completed. How should I reflect the changes of the pure pipes using locale.setCurrentLocale();? |
@robisim74 Your change is working fine :-) |
@FabienDehopre Thanks for reporting. I'll update you when I'll release the new version |
@skyfremen You have to extend the |
any idea when you will release this change ? |
Tonight I'll release the new minor version. In a few days the new major version. Both will have this features. |
New minor version is out. |
@FabienDehopre I'm closing this issue. If you need, open a new issue. Greetings |
Hi, just a question: Would it be possible to get the same behaviour by using both the |
Hi @MaciejWierzchowski, did you try it? |
I have an application with many modules (some lazy-loaded) and a ton of components..
When the user change the language of the application using a menu, not all the translation are updated.
For the translations I use a mix of pipe and directive depending on where I need to put the texts.
All my components extend the Locale class as described in the documentation.
At first glance, it seems that the texts translated using the pipe are the only texts affected by the issue. And I think that the issue appears only on components with the OnPush change detection strategy.
So, for the moment, my work around for this issue is to force a reload of the whole application using
location.reload()
.Here is a link to a video showing the issue: https://drive.google.com/open?id=0B0duWwBStbRAemI1V1lPaXlkYTA
The text was updated successfully, but these errors were encountered: