I would like to include an "all languages" dropdown box in an ASP.NET 2.0 website (the objective is make statistics on user languages to set up translation priorities). A very unreliable way of doing this would be to list myself all the languages that I know,
but I guess that there are more standard ways of achieving such effect.
Does anyone know how to include an "all languages" dropdown box?
' Displays several properties of the neutral cultures.
Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME")
Dim ci As CultureInfo
For Each ci In CultureInfo.GetCultures(CultureTypes.NeutralCultures)
Console.Write("{0,-7}", ci.Name)
Console.Write(" {0,-3}", ci.TwoLetterISOLanguageName)
Console.Write(" {0,-3}", ci.ThreeLetterISOLanguageName)
Console.Write(" {0,-3}", ci.ThreeLetterWindowsLanguageName)
Console.Write(" {0,-40}", ci.DisplayName)
Console.WriteLine(" {0,-40}", ci.EnglishName)
Next ci
i use the Languages collection of the Browser object to see what our visitors have set in their browser.
The first culture code in their list is their perferred language with any subsequent entries representing acceptable but less preferred alternates (in descending order of preference).
In this way our users do not need to do anything but set their browsers language, and our site will automatically flip to the first language in their list that we have translations for. In addition to keeping track of which language we rendered the page
in, we also keep track of the first language in their list in cases where we didnt have transaltions for it. This allows us to prioritize the translations.
So assuming we support en, it, es, pt
and a person visits out site with their browser configured for
fr
pl
we would find no matching language in their list and we would serve en
we would log that fr was their preferred language choice.
later on, we could count how many people preferred fr and perhaps make arrangements to get the necessary French translations.
Member
13 Points
173 Posts
All languages dropdown box ?
Feb 06, 2006 03:53 AM|Joannes Vermorel|LINK
Does anyone know how to include an "all languages" dropdown box?
Thanks in advance,
Joannes
Contributor
5053 Points
2450 Posts
Re: All languages dropdown box ?
Feb 07, 2006 05:33 PM|Motley|LINK
' Displays several properties of the neutral cultures.
Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME")
Dim ci As CultureInfo
For Each ci In CultureInfo.GetCultures(CultureTypes.NeutralCultures)
Console.Write("{0,-7}", ci.Name)
Console.Write(" {0,-3}", ci.TwoLetterISOLanguageName)
Console.Write(" {0,-3}", ci.ThreeLetterISOLanguageName)
Console.Write(" {0,-3}", ci.ThreeLetterWindowsLanguageName)
Console.Write(" {0,-40}", ci.DisplayName)
Console.WriteLine(" {0,-40}", ci.EnglishName)
Next ci
Member
13 Points
173 Posts
Re: All languages dropdown box ?
Feb 08, 2006 03:38 AM|Joannes Vermorel|LINK
Joannes
All-Star
159965 Points
13198 Posts
ASPInsiders
Moderator
Re: All languages dropdown box ?
Feb 12, 2006 05:59 PM|mbanavige|LINK
i use the Languages collection of the Browser object to see what our visitors have set in their browser.
The first culture code in their list is their perferred language with any subsequent entries representing acceptable but less preferred alternates (in descending order of preference).
In this way our users do not need to do anything but set their browsers language, and our site will automatically flip to the first language in their list that we have translations for. In addition to keeping track of which language we rendered the page in, we also keep track of the first language in their list in cases where we didnt have transaltions for it. This allows us to prioritize the translations.
So assuming we support en, it, es, pt
and a person visits out site with their browser configured for
fr
pl
we would find no matching language in their list and we would serve en
we would log that fr was their preferred language choice.
later on, we could count how many people preferred fr and perhaps make arrangements to get the necessary French translations.