Ben Pfaff <[email protected]> writes: > John Darrington <[email protected]> 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.
I came up with a strategy I like even better. I'll post a series to implement it soon. -- Ben Pfaff http://benpfaff.org _______________________________________________ pspp-dev mailing list [email protected] https://lists.gnu.org/mailman/listinfo/pspp-dev
