On Sat, 2 Dec 2000, Angus Leeming wrote:
> On Friday 01 December 2000 00:01, Allan Rae wrote:
> > On 30 Nov 2000, Lars Gullik Bjønnes wrote:
> > > #: src/frontends/xforms/form_graphics.C:52
> > > #: src/frontends/xforms/form_graphics.C:67
> > > #, c-format
> > > msgid "% of Page"
> > > msgstr "% av siden"
> > >
> > > since this is not marked as
> > > // no-c-format
> > > it leads to errors in the .po file validations.
> >
> > Angus, I'm not sure you understood the implications of what Lars pointed
> > out. We need to modify src/frontends/xforms/forms/fixc.sed so that
> > strings marked for conversion by gettext have a line inserted in front of
> > them so that we see:
> > //no-c-format
> > fl_whatever(_("...%..."),...);
> >
> > in the code. Gettext thinks the % is a C printf format string.
> >
> > Allan. (ARRae)
>
> Which lines need changing?
>
> # For all lines containing "fl_" and a string _not_ containing |,
> # replace the string with _(string)
> /fl_/ s/".[^|]*"/_(&)/
>
> # For all lines containing "shortcut" and a string containing |,
> # replace the string with scex(_(string))
> /shortcut/ s/".*[|].*"/scex(_(&))/
>
>
> # For all lines containing "fl_add" and a string containing |, replace
> # the string with idex(_(string))
> /fl_add/ s/".*[|].*"/idex(_(&))/
>
> # For all lines containing "fl_add" and a string containing |, add the
> # shortcut command after the end of this line
> /fl_add/ s/idex(\(.*\)").*$/&\
> fl_set_button_shortcut(obj,scex(\1")),1);/
They are all affected because any of them could contain a '%' in the
name or even the shortcut part since the whole string is used in all cases
to ensure the shortcut isn't separated from the name.
Probably best to just add another rule that looks something like:
/_(".*[%].*")/i\
// no-c-format
which should put a comment on the line immediately before the gettext
call. I don't think this would break anything because IIRC all the
gettext strings are on the first line of the function they are called
within. Otherwise, we might be able to do something a little yuckier:
s,\(_(".*[%].*")\),/* no-c-format */ \1,
Allan. (ARRae)