mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3384] Create automated tests for Version Component (#3631)
* fix version component restore and delete event * version manager actions * fix test * fix unit test * remove fdescribe * fix tslint * fix screenshot rewrite problem * remove fdescribe * multi instance try * remove fdescribe * try uncomment some test * error page * fix user preferences pagiantion * search page test include * fix type tslint e2e * restore code * default lang momentadapter * fix test * [ADF-3384] removed console log from test * [ADF-3384] adding some fixes for tests and code * [ADF-3384] fixed some test and code
This commit is contained in:
committed by
Eugenio Romano
parent
17074478e2
commit
a12662e7e2
@@ -56,7 +56,7 @@ export class TranslationService {
|
||||
}
|
||||
}
|
||||
|
||||
userPreference.locale$.subscribe( (locale) => {
|
||||
userPreference.locale$.subscribe((locale) => {
|
||||
this.userLang = locale;
|
||||
this.use(this.userLang);
|
||||
});
|
||||
@@ -70,22 +70,18 @@ export class TranslationService {
|
||||
addTranslationFolder(name: string = '', path: string = '') {
|
||||
if (!this.customLoader.providerRegistered(name)) {
|
||||
this.customLoader.registerProvider(name, path);
|
||||
if (this.userLang !== this.defaultLang) {
|
||||
this.translate.getTranslation(this.defaultLang).subscribe(() => {
|
||||
this.translate.getTranslation(this.userLang).subscribe(
|
||||
() => {
|
||||
this.translate.use(this.userLang);
|
||||
this.onTranslationChanged(this.userLang);
|
||||
}
|
||||
);
|
||||
});
|
||||
} else {
|
||||
this.translate.getTranslation(this.userLang).subscribe(
|
||||
() => {
|
||||
if (this.userLang) {
|
||||
this.translate.getTranslation(this.userLang).subscribe(() => {
|
||||
this.translate.use(this.userLang);
|
||||
this.onTranslationChanged(this.userLang);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.translate.getTranslation(this.defaultLang).subscribe(() => {
|
||||
this.translate.use(this.defaultLang);
|
||||
this.onTranslationChanged(this.defaultLang);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,7 +113,7 @@ export class TranslationService {
|
||||
* @param interpolateParams String(s) to be interpolated into the main message
|
||||
* @returns Translated text
|
||||
*/
|
||||
get(key: string|Array<string>, interpolateParams?: Object): Observable<string|any> {
|
||||
get(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> {
|
||||
return this.translate.get(key, interpolateParams);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user