[Mono-list] Multi-langual Assemblies
Giuseppe Greco
giuseppe.greco@agamura.com
Sat, 23 Aug 2003 18:47:24 +0200
On Sat, 2003-08-23 at 18:29, Gonzalo Paniagua Javier wrote:
Gonzalo,
Thank you very much! it works, and now I've understood how
it works...
Bye,
Gius_.
> El sáb, 23-08-2003 a las 15:29, Giuseppe Greco escribió:
> > Hi all,
> >
> > I've statically linked resources in different languages to
> > my assembly (myApp.en-US.resx, myApp.de-DE.resx, etc.).
> >
> > The question is, how can I get my error messages in another
> > language than English?
> >
> > For test purposes, I've just tried to put the following
> > lines at the beginning of my app:
> >
> > Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE");
> > Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
>
> Setting CurrentUICulture is enough.
>
> >
> > Despite that, I always get the error message in English. English
> > resources have been linked like this:
> >
> > -res:en-US/myApp.en-US.resources,myApp.resources
>
> You gotta add German resources like:
>
> -res:de-DE/myapp.de-DE.resources,myApp.de-DE.resources
>
> Then:
>
> ResourceManager rm = new ResourceManager ("myApp",
> Assembly.GetExecutingAssebly ());
>
> Console.WriteLine (rm.GetString ("id_of_the_string"));
>
>
> The id_of_the_string shoule be that way if you use MS resource format,
> but you can use .po and other formats that allow using spaces
> (monoresgen.exe).
>
> -Gonzalo
>
>
> _______________________________________________
> Mono-list maillist - Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
--
----------------------------------------
Giuseppe Greco
::agamura::
phone: +41 (0)91 604 67 65
mobile: +41 (0)76 390 60 32
email: giuseppe.greco@agamura.com
web: www.agamura.com
----------------------------------------