From 7dd74af305b4150324e25554eb5c0a916be169af Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Tue, 21 Apr 2020 09:46:35 +0200 Subject: [PATCH] refactor: simplify use of translatedPropertyNames --- src/translator.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/translator.ts b/src/translator.ts index 07b9996e..2e86e9f2 100644 --- a/src/translator.ts +++ b/src/translator.ts @@ -218,15 +218,15 @@ export class SCThingTranslator { * All the values will be set to the known translations of the property/key name * @example * const translatedMetaDish = translator.translatedPropertyNames(SCThingType.CourseOfStudies); - * @param thing The thing whose property names will be translated + * @param type The type whose property names will be translated * @param language The language all property names will be translated to * @returns An object with the properties of the SCThingType where the values are the known property tranlations */ - public translatedPropertyNames(thing: T, + public translatedPropertyNames(type: SCThingType, language?: keyof SCTranslations): T | undefined { const targetLanguage = (typeof language !== 'undefined') ? language : this.language; - return this.getAllMetaFieldTranslations(thing.type, targetLanguage) as T; + return this.getAllMetaFieldTranslations(type, targetLanguage) as T; } /**