Multilanguage App: How to get system language setting?

Multilanguage App: How to get system language setting?

Hi, what API calls can be used to read out the system language when you develop an App that should support different languages? Do I need an in-app selection for the language or can I use anything from the Windows API, registry or from the AppUp SDK to find out in which language the application should run? Best regards, Andreas
www.adrastea.com
5 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

Imports System.Globalization

Dim cultInfo As CultureInfo

For Each cultInfo In CultureInfo.GetCultures(CultureTypes.SpecificCultures)

there are quite a few properties - you might prefer cultInfo.TwoLetterISOLanguageName, but there are also 3-character codes, names,
calendars, date and number formats, keyboards ...

Next cultInfo

Hello Andreas,

which programming language you're using?

I use .NET and here it is very easy to determinate the current user language.

If you use something like C++, you can use a Windows API function, of course. Something like that e. g.:
http://msdn.microsoft.com/en-us/library/dd318136%28VS.85%29.aspx

But anyway, it's always a good idea to additionally let the user change the language inside the program if the detected language was wrong for whatever reason.

Best regards
Andreas

I'm use GetUserDefaultLCID to get the locale identifier for the user default locale

LCID GetUserDefaultLCID(void)

http://msdn.microsoft.com/en-us/library/dd318135(v=vs.85).aspx

You can do that via localization. Use difference resources for different locale and load file as per locale. You can get locale via system setting in .Net

Sachin

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui