Closed zewa666 closed 9 years ago
hey that is very strange , this is the BasePage that i am using , every page extends from this one. they don't have to do anything else to make it work:
export class BasePage{
static inject = [Element,EventAggregator,I18N];
constructor(element,ea,i18n){
this.element = element;
this.ea = ea;
this.i18n = i18n;
this.ea.subscribe('i18n:locale:changed', payload=>{
this.updateTranslations();
});
}
attached(){
this.updateTranslations();
}
updateTranslations(){
this.i18n.updateTranslations(this.element.querySelector("router-view")||this.element);
}
}
Ok we really need to find a way to make VMs more extendable as you already mentioned.
@Aaike The initial translation does not seem to happen when using Attribute based translations. A current workaround is to manually switch the locale inside attached to force reevaluation of the translation process like so: