Example #1
0
        /// <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;
            }
        }
Example #2
0
        /// <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);
Example #3
0
        /// <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);
Example #4
0
 /// <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);
 }