示例#1
0
        public static string GetLanguageName(string languageCode)
        {
            if (string.IsNullOrEmpty(languageCode))
            {
                throw new ArgumentException("Language code cannot be null or empty!");
            }
            if (Enumerable.Count <char>((IEnumerable <char>)languageCode) != 3)
            {
                throw new ArgumentException("Invalid ISO 639-2 language code!");
            }
            SubLang languageCodeInternal = Languages.FindLanguageByLanguageCodeInternal(languageCode);

            if (languageCodeInternal != null)
            {
                return(languageCodeInternal.Name);
            }
            return(Languages.DefaultLanguage.Name);
        }
示例#2
0
 public static bool IsSupportedLanguageCode(string languageCode)
 {
     return(Languages.FindLanguageByLanguageCodeInternal(languageCode) != null);
 }