How can i find the language for a given locale?
Example: input: en_US output: English
Using the .NET libraries? I tried the CultureInfo class, but i can't find something usefull.
Thanks!
A Locale object represents a specific geographical, political, or cultural region. An operation that requires a Locale to perform its task is called locale-sensitive and uses the Locale to tailor information for the user.
The locale setting defines the language of your user interface and the display formats for information like time, date, and currency.
When the Java virtual machine starts running on a computer, it creates an object called the default locale. This object affects the format of strings created from data. Depending on the default locale, a program creates different strings for the same number.
You need to use en-US not en_US with code like:
System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo("en-US");
string name = culture.DisplayName;
output: English (United States)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With