[Mono-list] Resource System Proposal

A Rafael D Teixeira rafaelteixeirabr@hotmail.com
Thu, 15 Nov 2001 10:23:43 -0200


I think Serge is right. It demands tools to help generate standard code but 
tag-based is safer, because my experience is that strings don´t stabilize 
fast enough, they change a lot during development, so you´d keep postponing 
the translation work to the very end of the project.

I would go with a preprocessing tool, but with a little twist: two forms for 
the 'macro':

1) _("Hello Mañana")
with a single argument, what would generate something like

on source:

   Environment.GetResourceString("TAG_Hello_Mañana")
or
   class SR {
     public static string Hello_Mañana {
       get { Environment.GetResourceString("TAG_Hello_Mañana")} ...}

on resource:

   TAG_Hello_Mañana "Hello Mañana"


2) _("Hello \n\n crazy \n\n \u0222 World!!!","Hello_Crazy_World")
with two arguments generating:

on source:

   Environment.GetResourceString("TAG_Hello_Crazy_World")
or
   class SR {
     public static string Hello_Crazy_World {
       get { Environment.GetResourceString("TAG_Hello_Crazy_World")} ...}

on resource:

   TAG_Hello_Crazy_World "Hello \n\n crazy \n\n \u0222 World!!!"


Rafael Teixeira
Brazilian Developer



>From: "Serge" <serge@wildwestsoftware.com>
>To: "Rhys Weatherley" <rweather@zip.com.au>, <mono-list@ximian.com>
>Subject: Re: [Mono-list] Resource System Proposal
>Date: Wed, 14 Nov 2001 14:59:07 +0200
>
>Personally, I think Tag-Based approach is better. Messages tend to be
>changed often, whereas tags are stable, and if you want to change (English)
>message with String-Based approach you have to change it twice, in the code
>and in the resource table. There are many reasons why changes in the
>messages may be introduced - to make it more user-friendly, or simply
>correct the spelling (for example, my English is far from ideal ;-)
>
>Introducing new keywords is extremely bad, from my point of view (basically
>for the same reasons stated by Guy Murphy above).
>To me it looks like sacrificing clarity for ease of typing.
>Consider that many people are going to use MS tools and particularly VS.NET
>to contribute to Mono.
>Also consider end-users. Those people who will use library code to
>understand how things work - many people use JDK sources this way. 
>Typically
>those people will have very different mindset from C-coders - try to talk
>about macro-wrapped gettext merits to Java purists. For example, many Java
>people I know have great dislike to anything with underscore symbol :)
>It's a different culture, that's it.
>
>That said, I think that using some macro processor or custom preprocessor
>tool to implement gettext approach is okay, as long as distributed sources
>are in clean standard C#.
>
>Cheers,
>Sergey
>
>
>----- Original Message -----
>From: "Rhys Weatherley" <rweather@zip.com.au>
>To: <developers@dotgnu.org>; <mono-list@ximian.com>
>Sent: Wednesday, November 14, 2001 9:31 AM
>Subject: [Mono-list] Resource System Proposal
>
>
> > The string resource handling in .NET is a bit of a pain to use,
> > and so I've come up with some alternatives that Mono and
> > Portable.NET could use instead.  The aim is to use the same
> > system for both projects, rather than inventing two mutually
> > incompatible versions.
> >
> > I've been discussing these ideas with Miguel de Icaza, and
> > I would like to get some wider feedback as to what other
> > people think.
> >
> > http://www.southern-storm.com.au/l10n.html
> >
> > Cheers,
> >
> > Rhys.
> >
> >
> >
> >
> > _______________________________________________
> > Mono-list maillist  -  Mono-list@ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
> >
>
>
>
>
>_______________________________________________
>Mono-list maillist  -  Mono-list@ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-list


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp