/// <summary> /// Translates a string to the specified language. /// </summary> /// <param name="language">The language to be translated to.</param> /// <returns> /// Returns a to the specified language translated string. /// </returns> public string Translate(KerykeionCmsLanguage language) { if (language == KerykeionCmsLanguage.NL) { return(Dutch); } if (language == KerykeionCmsLanguage.FR) { return(French); } if (language == KerykeionCmsLanguage.DE) { return(German); } return(English); }
/// <summary> /// Gets a list of languages which are currently not chosen. /// </summary> /// <param name="chosenLanguage">The current chosen language.</param> /// <returns> /// A list of languages to choose from except the one that's already chosen. /// </returns> public List <PickedLanguageDto> NotChosenCmsLanguages(KerykeionCmsLanguage chosenLanguage) { return(chosenLanguage switch { KerykeionCmsLanguage.NL => new List <PickedLanguageDto> { new PickedLanguageDto { ShortLanguage = "EN", LongLanguage = "English" }, new PickedLanguageDto { ShortLanguage = "FR", LongLanguage = "Français" }, new PickedLanguageDto { ShortLanguage = "DE", LongLanguage = "Deutsch" } }, KerykeionCmsLanguage.EN => new List <PickedLanguageDto> { new PickedLanguageDto { ShortLanguage = "NL", LongLanguage = "Nederlands" }, new PickedLanguageDto { ShortLanguage = "FR", LongLanguage = "Français" }, new PickedLanguageDto { ShortLanguage = "DE", LongLanguage = "Deutsch" } }, KerykeionCmsLanguage.DE => new List <PickedLanguageDto> { new PickedLanguageDto { ShortLanguage = "EN", LongLanguage = "English" }, new PickedLanguageDto { ShortLanguage = "FR", LongLanguage = "Français" }, new PickedLanguageDto { ShortLanguage = "NL", LongLanguage = "Nederlands" } }, KerykeionCmsLanguage.FR => new List <PickedLanguageDto> { new PickedLanguageDto { ShortLanguage = "EN", LongLanguage = "English" }, new PickedLanguageDto { ShortLanguage = "NL", LongLanguage = "Nederlands" }, new PickedLanguageDto { ShortLanguage = "DE", LongLanguage = "Deutsch" } }, _ => new List <PickedLanguageDto> { new PickedLanguageDto { ShortLanguage = "NL", LongLanguage = "Nederlands" }, new PickedLanguageDto { ShortLanguage = "FR", LongLanguage = "Français" }, new PickedLanguageDto { ShortLanguage = "DE", LongLanguage = "Deutsch" } }, });