refactor: update to recent changes in translator

This commit is contained in:
Rainer Killinger
2021-01-13 16:47:22 +01:00
parent 456560026c
commit 3d4c476549
20 changed files with 706 additions and 330 deletions

View File

@@ -116,14 +116,14 @@ export class ContextMenuComponent {
getTranslatedPropertyName(property: string, onlyForType?: SCThingType): string {
return (this.translator
// tslint:disable-next-line:no-any
.translatedPropertyNames(onlyForType ? onlyForType : SCThingType.AcademicEvent) as any)[property];
.translatedPropertyNames(typeof onlyForType !== 'undefined' ? onlyForType : SCThingType.AcademicEvent) as any)[property];
}
/**
* Returns translated type of given SCThingType string
* Returns translated property value
*/
getTranslatedType(scThingType: string) {
return this.translator.translatedThingType(scThingType as SCThingType);
getTranslatedPropertyValue(onlyForType: SCThingType, field: string, key?: string): string | undefined {
return this.translator.translatedPropertyValue(onlyForType, field, key);
}
/**