Programmatic way to get all the available languages (in satellite assemblies)

You can programatically list the cultures available in your application // Pass the class name of your resources as a parameter e.g. MyResources for MyResources.resx ResourceManager rm = new ResourceManager(typeof(MyResources)); CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures); foreach (CultureInfo culture in cultures) { try { ResourceSet rs = rm.GetResourceSet(culture, true, false); // or ResourceSet rs = rm.GetResourceSet(new CultureInfo(culture.TwoLetterISOLanguageName), … Read more

Alternatives to gettext?

First of all I think gettext is one of the best at this point. You may take a look on Boost.Locale that may provide a better API and use gettext‘s dictionary model: http://cppcms.sourceforge.net/boost_locale/docs/ (not official part of Boost, still beta). Edit: If you don’t like gettext… These are translation technologies: OASIS XLIFF GNU gettext po/mo … Read more

How can I determine a user’s locale within the browser?

The proper way is to look at the HTTP Accept-Language header sent to the server. This contains the ordered, weighted list of languages the user has configured their browser to prefer. Unfortunately this header is not available for reading inside JavaScript; all you get is navigator.language, which tells you what localised version of the web … Read more