diff --git a/src/app/services/internationalisation.service.ts b/src/app/services/internationalisation.service.ts index 1d9438227e462c2e4683ab326e75dc7604c36c37..4b8f545f65dd4ebcdf9b9e7592c50920df7b95db 100644 --- a/src/app/services/internationalisation.service.ts +++ b/src/app/services/internationalisation.service.ts @@ -60,6 +60,11 @@ export class I18nService extends Observable implements Observer { * @param code ISO 639-1 language code */ public async setLanguage(code: string) { + /** excluded calculators */ + const childCalculatorType: CalculatorType[] = [ + CalculatorType.Section, CalculatorType.Structure, CalculatorType.CloisonAval, CalculatorType.YAXN + ]; + // ensure 2-letter language code code = code.substring(0, 2); // is language supported ? @@ -75,7 +80,7 @@ export class I18nService extends Observable implements Observer { const promisesList: Promise<any>[] = []; for (const ct in CalculatorType) { const calcType = Number(ct); - if (!isNaN(calcType)) { + if (!isNaN(calcType) && !childCalculatorType.includes(calcType)) { promisesList.push(this.loadLocalisation(calcType).catch((err) => { /* silent fail */ })); } } @@ -118,7 +123,7 @@ export class I18nService extends Observable implements Observer { } } else { return new Promise((resolve, reject) => { - resolve(); // does nothing but complies with Promise expectation + resolve(undefined); // does nothing but complies with Promise expectation }); } }