public override string ToString()
        {
            List <string> cultures     = SupportedCultures?.Select(selector: s => s.EnglishName).ToList() ?? new List <string>();
            string        culturesText = cultures.Any()
                ? $" - ({ string.Join(separator: ", ", values: cultures)})"
                : " - No specific Culture";

            return($"{Name}{culturesText}");
        }
예제 #2
0
 /// <summary>
 /// 获得支持多语言集合
 /// </summary>
 /// <returns></returns>
 public IList <CultureInfo> GetSupportedCultures()
 {
     // 用户设置时使用用户设置,未设置时使用内置中英文文化
     _cultures ??= new Lazy <List <CultureInfo> >(() => SupportedCultures?.Select(name => new CultureInfo(name)).ToList() ?? JsonLocalizationOptions.SupportedCultures);
     return(_cultures.Value);
 }
예제 #3
0
 /// <summary>
 /// Returns the CultureInfo collection for the system's supported cultures
 /// </summary>
 public IEnumerable <CultureInfo> GetSupportedCultures()
 {
     return(SupportedCultures.Select(key => new CultureInfo(key)).ToList());
 }