diff --git a/locale/de-DE.values.json b/locale/de-DE.values.json index c8ec56629af88bbd90ed91eaa6f63269b90182f5..c0aa406b6c6672027c5015161dbabebbed36a296 100644 --- a/locale/de-DE.values.json +++ b/locale/de-DE.values.json @@ -4,5 +4,9 @@ "giftTypeAll": "beides", "giftTypeNothing": "nichts", "no": "nein", - "yes": "ja" -} \ No newline at end of file + "yes": "ja", + "wichtelEventPhaseEnded": "Postwichteln", + "wichtelEventPhaseRegistration": "Registrierung", + "wichtelEventPhaseWaiting": "Präwichteln", + "wichtelEventPhaseWichteln": "Wichteln" +} diff --git a/scripts/utility/localisation.ts b/scripts/utility/localisation.ts index a7eacd6d590fb692f9fac8a4d2f78197305b61d8..8c9dca8901087ceffdcee0dd9960d4affe3339e4 100644 --- a/scripts/utility/localisation.ts +++ b/scripts/utility/localisation.ts @@ -3,6 +3,7 @@ import * as fs from 'fs'; import Config from './config'; import GiftType from '../wichtelbot/types/giftType'; import TokenString from './tokenString'; +import WichtelEventPhase from './wichtelEvent'; export interface CommandInfo { @@ -95,6 +96,10 @@ interface Values giftTypeNothing: string; no: string; yes: string; + wichtelEventPhaseEnded: string, + wichtelEventPhaseRegistration: string, + wichtelEventPhaseWaiting: string, + wichtelEventPhaseWichteln: string, } export default abstract class Localisation @@ -148,27 +153,19 @@ export default abstract class Localisation public static translateGiftType (giftType: GiftType): string { - let result = ''; - switch (giftType) { case GiftType.Analogue: - result = Localisation._values.giftTypeAnalogue; - break; + return Localisation._values.giftTypeAnalogue; case GiftType.Digital: - result = Localisation._values.giftTypeDigital; - break; + return Localisation._values.giftTypeDigital; case GiftType.All: - result = Localisation._values.giftTypeAll; - break; + return Localisation._values.giftTypeAll; case GiftType.Nothing: - result = Localisation._values.giftTypeNothing; - break; + return Localisation._values.giftTypeNothing; default: throw TypeError('Invalid gift type to translate.'); } - - return result; } public static translateCountry (country: string): string @@ -180,4 +177,21 @@ export default abstract class Localisation return localisedCountry; } + + public static translateWichtelEventPhase (eventPhase: WichtelEventPhase): string + { + switch (eventPhase) + { + case WichtelEventPhase.Waiting: + return Localisation._values.wichtelEventPhaseWaiting; + case WichtelEventPhase.Registration: + return Localisation._values.wichtelEventPhaseRegistration; + case WichtelEventPhase.Wichteln: + return Localisation._values.wichtelEventPhaseWichteln; + case WichtelEventPhase.Ended: + return Localisation._values.wichtelEventPhaseEnded; + default: + throw TypeError('Invalid event phase to translate.'); + } + } }