/// <summary> /// Get the text specified by the given language. /// </summary> /// <param name="Language">The internationalized (I18N) language.</param> /// <returns>The internationalized (I18N) text or String.Empty</returns> public String this[LanguageCode Language] { get { if (I18NTexts.TryGetValue(Language, out String Text)) { return(Text); } return(String.Empty); } set { I18NTexts[Language] = value; } }
/// <summary> /// Create a new internationalized (I18N) multi-language string /// based on the given language and string. /// </summary> /// <param name="Language">The internationalized (I18N) language.</param> /// <param name="Text">The internationalized (I18N) text.</param> public static I18NText Create(LanguageCode Language, String Text) => new I18NText(Language, Text);
/// <summary> /// Checks if the given language representation exists. /// </summary> /// <param name="Language">The internationalized (I18N) language.</param> public Boolean has(LanguageCode Language) => I18NTexts.ContainsKey(Language);
/// <summary> /// Create a new internationalized (I18N) multi-language string /// based on the given language and string. /// </summary> /// <param name="Language">The internationalized (I18N) language.</param> /// <param name="Text">The internationalized (I18N) text.</param> public I18NText(LanguageCode Language, String Text) : this() { I18NTexts.Add(Language, Text); }