コード例 #1
0
        /// <summary>
        /// Adds the language support
        /// </summary>
        /// <param name="language"><c>Language</c> object</param>
        public static void AddLanguageSupport(Language language)
        {
            checkLangCode(language.LangCode);

            if (string.IsNullOrEmpty(language.LanguageEnglish))
            {
                throw new LocalizationException(Consts.ExceptionMessageNullEnglishLang);
            }

            LanguageConfiguration.AddLanguageSupport(
                language.LangCode,
                language.LanguageEnglish,
                language.LanguageLocal
                );
        }
コード例 #2
0
 /// <summary>
 /// Gets supported languages list
 /// </summary>
 /// <returns>Supported languages list</returns>
 public static List <Language> GetSupportedLanguages()
 {
     return(LanguageConfiguration.GetSupportedLanguages());
 }
コード例 #3
0
 /// <summary>
 /// Gets the language by two-letter code.
 /// </summary>
 /// <returns>The language by code.</returns>
 /// <param name="langCode">Two-letter language code (ISO 639-1)</param>
 public static Language GetLanguageByCode(string langCode)
 {
     return(LanguageConfiguration.GetLanguageByCode(langCode));
 }
コード例 #4
0
 /// <summary>
 /// Checks if the language is supported
 /// </summary>
 /// <returns><c>true</c>, if the language is supported, <c>false</c> otherwise</returns>
 /// <param name="langCode">Two-letter language code (ISO 639-1)</param>
 public static bool CheckLanguageSupported(string langCode)
 {
     return(LanguageConfiguration.CheckLanguageSupported(langCode));
 }