I want to create a dropdown list with a list of spoken languages (English, Arabic, French, Spanish, etc.). Any idea where to get a full list? I will import the list into a database and then bind using a sql query ...
A:
I don't know about a canonical source (or whether it's even possible to generate one), but this Wikipedia article has a fairly long list, ordered by usage. The article has links to other lists (top 100, top 30, etc).
Michael Petrotta
2009-07-07 16:40:44
+3
A:
This will give you a list of string names of languages you can then assign to the ComboBox, or you can replace languageList.Add() with ComboBox.Items.Add().
public static List<string> GetCountryList()
{
List<string> languageList = new List<string>();
CultureInfo[] cultureList = CultureInfo.GetCultures(CultureTypes.AllCultures);
foreach (CultureInfo culture in cultureList)
{
languageList.Add(culture.DisplayName);
}
return languageList;
}
Or you can do the following:
CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
ComboBox b = new ComboBox();
b.DisplayMember = "DisplayName";
b.ValueMember = "LCID";
b.DataSource = cultures;
GenericTypeTea
2009-07-07 16:43:57