Refresh translation with params after param value changes
See original GitHub issueHi, I’m trying to know if its possible to reload a certain translation which holds a parameter when the param value changes.
json
{
"HELLO": "hello {{value}}"
}
html
<button (click)="change()">{{ 'HELLO' | translate:param }}</button>
component
constructor(private translate: TranslateService) {
...
}
param = {value: 'world'};
change(){
this.param.value = 'earth';
//this.translate.use(this.translate.currentLang);
//this.translate.resetLang(this.translate.currentLang);
//this.translate.reloadLang(this.translate.currentLang);
}
I’ve tryed to force the translation to re-translate again when clicking the button by calling the methods from the translate service commented above but it didn’t work. Is this something possible to do? Thanks in advance, the library is great!
I’m Using library version 9 since this is from an Angular 5 project
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Is possible to reload component when url param changes in ...
I have route called 'partners' and when path is hitting 'partners/:slug' i'm listening for activatedRoute changes to update translated title.
Read more >Reloading Components when change in Route Params
These values will be calculated for the first load of the component and they won't change unless you reload the page. Why could...
Read more >How to change published parameter value after run time
I am running FME 2011. I would like to change the value of a published parameter during a translation (i.e. overide what was...
Read more >Connection refresh for queries with parameters not giving ...
If you click the card for the connector it should expand and you can change the parameter value, before clicking the refresh button....
Read more >Common Routing Tasks - Angular
The application name in the following example is routing-app . ... example uses a variable, name , and assigns it the value based...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@rmartin94 Did you find a solution? This is driving me crazy right now and it seems nobody is posting a good workaround
I could refresh the params, but I had to replace the whole object with a new object, instead of replacing each property in the old params object.