[Mono-dev] Mono.Unix.Catalog.Init where does it get the locale from?

Jonathan Pryor jonpryor at vt.edu
Thu Mar 13 13:48:29 EDT 2008


On Thu, 2008-03-13 at 19:16 +0200, Vladimir Dimitrov wrote:
> Thanks for the quick answer I tried your suggestion and set the variable
> using this code:
> 
>                     CultureInfo culture = new CultureInfo
> (config.Localization);
>                     Thread.CurrentThread.CurrentCulture = culture;
>                     Thread.CurrentThread.CurrentUICulture = culture;
>                     Environment.SetEnvironmentVariable ("LANG",
> config.Localization.Replace ("-", "_"));

What I've found is that setting LANG is not enough; in my own tests with
Catalog:

	LANG=es mono foo.exe

is ignored, but

	LANGUAGE=es mono foo.exe

works as desired (using the `es' message catalog).  I don't know why
this is the case.

Consequently, I would suggest setting the LANGUAGE environment variable
and see if that works; it did for my test app.

 - Jon




More information about the Mono-devel-list mailing list