dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pnet-developers] RFC: GNU gettext support for C#


From: Bruno Haible
Subject: Re: [Pnet-developers] RFC: GNU gettext support for C#
Date: Tue, 6 Jan 2004 15:45:21 +0100
User-agent: KMail/1.5

Rhys Weatherley wrote:
> What I normally do (in assemblies other than "mscorlib" which
> is a special case) is define a class called "S", which takes care of
> loading the string resources and defining the "_" method.  Then the idiom
> is:
>
>     Console.WriteLine(S._("Completed"));

That's also a good approach. I'll mention it in the documentation.

> You could define such an "S" class in your C# gettext library, and use
> "Assembly.GetCallingAssembly()" to figure out which assembly to fetch
> gettext resources for.

Then the developer would still have to add a "using GNU.Gettext;" statement
in each of his source files. To avoid this, it's better if he defines the
class 'S' in a package of his own.

Thanks for the feedback.

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]