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

3

6

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.

Pion answered 19/11, 2010 at 8:24 Comment(3)
Perhaps this page might be useful? msdn.microsoft.com/en-us/library/…Defamation
Actually these aren't languages but they're called 'cultures'.Jacquettajacquette
@Gerrie: en-US is a "culture" or "locale": it defines both a language ("en") and a region ("US").Berkow
C
2

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

Checkmate answered 19/11, 2010 at 8:29 Comment(0)
A
9

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);
Ambroseambrosi answered 19/11, 2010 at 8:29 Comment(0)
A
4

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));
Astrix answered 19/11, 2010 at 8:36 Comment(0)
C
2

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

Checkmate answered 19/11, 2010 at 8:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.