pspp-dev
[Top][All Lists]
Advanced

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

Re: [PATCH] q2c: Eliminate many translations for generated .c files.


From: Ben Pfaff
Subject: Re: [PATCH] q2c: Eliminate many translations for generated .c files.
Date: Sat, 09 Apr 2011 17:01:22 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

John Darrington <address@hidden> writes:

> On Sat, Mar 19, 2011 at 05:45:50PM -0700, Ben Pfaff wrote:
>      Most of the %s directives used in msg() format strings that q2c
>      generates don't have to be substituted at q2c translation time.  By
>      translating them later, we can eliminate a lot of the work that
>      translators need to do for q2c-generated fiels.
>      ---
>      This seems correct to me but I'd like to have another set of eyes
>      look it over before I push it.
>
> I don't think this is going to work. We would need to add all the generated .c
> files to the potfile manifest.  That will cause problems because some of the
> strings therein have already been translated.  Even if we can solve that 
> issue,
> it'll been that the potfile will depend on files generated at build time which
> is not a good idea.  It'll also mean that the potfile comments will get 
> bloated
> with references to every generated .c
>
> Instead, I suggest we solve this problem as follows:
>
> 1. Create a new function within q2c.c similar to
>
>   static void dump_msg (int severity, const char *msg, ...);  
>
> 2. We can then call this function within q2c.c like this:
>
>       dump_msg (SE, N_("`(' expected after %s specifier of %s subcommand."), 
> s->specname, sbc->name);
>
>    and it will generate the following code:
>
>         msg (SE, gettext ("`(' expected after %s specifier of %s 
> subcommand."), "the-specname", "the-name");
>
> 3.  We will also have to add q2c.c to the list of translatable files.
>
> Does this make sense?

It is definitely an improvement on the status quo.  I think it
will work.  I'll give it a shot when I have time.
-- 
Ben Pfaff 
http://benpfaff.org



reply via email to

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