CultureInfo.GetCultures 的等价物是 .NET Core [英] What is the equivalent of CultureInfo.GetCultures is .NET Core
问题描述
直截了当的问题,CultureInfo.GetCultures
与 .NET Core 的等价物是什么?
Straight forward question really, What is the equivalent of CultureInfo.GetCultures
is .NET Core?
只是想找到一种方法来枚举可用的文化.
Just trying to find a way to enumerate available cultures.
只是为了澄清,这与 GetCultureInfo
不同,因为它只获取指定的文化,(即不枚举它)
Just to clarify, this isn't the same as GetCultureInfo
as that only gets a specified culture, (i.e. does not enumerate it)
推荐答案
在 .NET Core 中枚举所有支持的文化并没有一个好方法 <2.0.在 .NET Core 2.0 中,针对 windows 和 *nix 实现了对底层本地化系统的相应查询,使该 API 可用.
There isn't a good way to enumerate all supported cultures in .NET Core < 2.0. In .NET Core 2.0 the respective queries to the underlying localisation systems have been implemented for windows and *nix, making this API available.
这篇关于CultureInfo.GetCultures 的等价物是 .NET Core的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!