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}"); }
/// <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); }
/// <summary> /// Returns the CultureInfo collection for the system's supported cultures /// </summary> public IEnumerable <CultureInfo> GetSupportedCultures() { return(SupportedCultures.Select(key => new CultureInfo(key)).ToList()); }