fix search and login

This commit is contained in:
Mario Romano
2016-05-19 18:41:40 +01:00
parent c74f9e9fe6
commit 40d8cff331
4 changed files with 91 additions and 107 deletions

View File

@@ -78,7 +78,6 @@ export class AlfrescoLoginComponent {
'required': 'LOGIN.MESSAGES.PASSWORD-REQUIRED'
}
};
this.translationInit(translate);
this.form.valueChanges.subscribe(data => this.onValueChanged(data));
@@ -156,19 +155,4 @@ export class AlfrescoLoginComponent {
return true;
}
}
/**
* Initial configuration for Multi language
* @param translate
*/
translationInit(translate: TranslateService) {
this.translate = translate;
let userLang = navigator.language.split('-')[0]; // use navigator lang if available
userLang = /(fr|en)/gi.test(userLang) ? userLang : 'en';
this.translate.setDefaultLang(userLang);
this.translate.currentLoader.addComponentList('node_modules/ng2-alfresco-login');
this.translate.getTranslation(userLang);
this.translate.use(userLang);
}
}