Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can we see the whole list of named language values?

I notice that we can set the language for a form by using Xml:lang="en-US". I want to see the named of other languages but not sure where those can be accessed from C#.

Please help.

Edit I prefer to know an enum type which list the value set. Is there one available? Or we have to create that ourselves?

Since it seems to be no available enum type for this, here is my own-created one.

like image 300
Nam G VU Avatar asked Nov 19 '10 08:11

Nam G VU


People also ask

How many languages are used in ISO?

There are 58 languages in ISO 639-2 which are considered, for the purposes of the standard, to be "macrolanguages" in ISO 639-3.

What is language name?

A language name uses essentially the same formatting as a locale name. For example, the language name for the English (Belize) locale is "en-BZ". Each language name corresponds to a language identifier.

What is the code of the language?

A language code is a code that assigns letters or numbers as identifiers or classifiers for languages. These codes may be used to organize library collections or presentations of data, to choose the correct localizations and translations in computing, and as a shorthand designation for longer forms of language names.


3 Answers

For .NET cultures belonging to a specific country and region:

CultureInfo.GetCultures(CultureTypes.SpecificCultures);

To access all the .NET cultures (standard or not), use:

CultureInfo.GetCultures(CultureTypes.AllCultures);
like image 153
Matthew Flaschen Avatar answered Oct 05 '22 23:10

Matthew Flaschen


To get all valid culture infos:

CultureInfo[] cultureInfos = CultureInfo.GetCultures(CultureTypes.AllCultures);

Maybe you need this:

string xmlCulture = "en-US";
bool isSupported = CultureInfo.GetCultures(CultureTypes.AllCultures).Any(c => c.Name.Equals(xmlCulture));
like image 27
Cheng Chen Avatar answered Oct 05 '22 22:10

Cheng Chen


If you want to see a list of the other culture you can find it here.

like image 33
bAN Avatar answered Oct 05 '22 23:10

bAN