[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Do not use gettextize and i18n round 2 Re: I18n: The gettext proposal

From: <kfogel_at_collab.net>
Date: 2004-03-30 19:44:11 CEST

Nicolás Lichtmaier <nick@reloco.com.ar> writes:
> Yes. This is the issue:
>
> You can't add a function call anywhere in the code. You can't add a
> function call in a static initializer, like:
>
> char *global_greetings[] = { _("Hello"), _("Hi"), NULL };
>
> This won't compile. The solution is to have a macro which does
> nothing: "N_":
>
> #define N_(x) (x)
>
> char *global_greetings[] = { N_("Hello"), N_("Hi"), NULL };
>
> This will be caught by xgettext and it will be put in the .pot file,
> but global_greeting will still have the English messages. We fix that
> by calling "gettext" on the string:
>
> for(p=global_greetings;p;p++)
> printf(gettext(global_greeting));
>
> We use "gettext" here so as not to trigger xgettext.
>
> That's it!

I'm still confused. There are two statements here:

> You can't add a function call anywhere in the code. You can't add
> a function call in a static initializer ...

How is the first statement true?

Regarding the second statement, does it matter for Subversion? We
have few such initializations, and those we do have may not need to be
translated. At worst, we might have to change some code. It doesn't
seem like a showstopper, anyway.

(I understand that you were just explaining things. My confusion is
really about the assertion that Subversion strings will have a
problem, which originated with Justin, I think, not you.)

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 30 20:55:58 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.