You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kobayashi Noritada <no...@dolphin.c.u-tokyo.ac.jp> on 2007/03/24 16:12:24 UTC

[PATCH] Make gettext extract a msgid correctly (Re: [l10n] the msgid is not a valid C format string)

Hi again,

From: Kobayashi Noritada
Subject: [l10n] the msgid is not a valid C format string
Date: Sat, 24 Mar 2007 23:47:26 +0900 (JST)

> After the merge of the sparse-directories branch into trunk,
> a following warning appears with gettext:
> 
> nori1[23:12]%  LC_ALL=C make locale-gnu-po-update PO=ja
> cd /home/nori1/svnwc/subversion-trunk && XGETTEXT="/home/nori1/bin/xgettext" MSGMERGE="/home/nori1/bin/msgmerge" \
>   tools/po/po-update.sh ja
> Building subversion.pot...
> ./libsvn_repos/reporter.c:218: warning: Although being used in a format string position, the msgid is not a valid C format string. Reason: The string ends in the middle of a directive.
> Updating ja.po...
> ............................................................................................................................................................ done.
> ............................................................................................................................................................ done.
> 
> 
> ... which is due to code like this:
> 
>           return svn_error_createf(SVN_ERR_REPOS_BAD_REVISION_REPORT, NULL,
>                                    _("Invalid depth (%"
>                                      APR_UINT64_T_FMT
>                                      ") for path '%s'"),
>                                     num, (*pi)->path);
> 
> 
> ... and results in a ill-formatted msgid like this:
> 
> msgid "Invalid depth (%"
> 
> 
> Could you please work around it?
> (I'm sorry I cannot create a patch to fix it...)

Hmm..., I was too pessimistic.  Does a patch attached to this mail work well?

Thanks,

-nori


[[[
* subversion/libsvn_repos/reporter.c
  (read_path_info): Make gettext parse a C format string and extract
  a msgid correctly.
]]]

Re: [PATCH] Make gettext extract a msgid correctly

Posted by Kobayashi Noritada <no...@dolphin.c.u-tokyo.ac.jp>.
Hi,

From: plundblad@google.com
Subject: Re: [PATCH] Make gettext extract a msgid correctly
Date: Mon, 26 Mar 2007 14:00:57 +0200

> > [[[
> > Eliminate a warning from gettext and enable extracting correct msgids
> > for translators.
> > 
> ...
> 
> +1 to commit this patch.

Thank you for reviewing.  Committed at r24141.

Regards,

-nori

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Make gettext extract a msgid correctly

Posted by Peter Lundblad <pl...@google.com>.
Kobayashi Noritada writes:
> 
> [[[
> Eliminate a warning from gettext and enable extracting correct msgids
> for translators.
> 
...

+1 to commit this patch.

Thanks,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Make gettext extract a msgid correctly

Posted by Kobayashi Noritada <no...@dolphin.c.u-tokyo.ac.jp>.
Hi,

From: Kobayashi Noritada
Subject: [PATCH] Make gettext extract a msgid correctly (Re: [l10n] the msgid is not a valid C format string)
Date: Sun, 25 Mar 2007 01:12:24 +0900 (JST)

> > After the merge of the sparse-directories branch into trunk,
> > a following warning appears with gettext:
> > 
> > nori1[23:12]%  LC_ALL=C make locale-gnu-po-update PO=ja
> > cd /home/nori1/svnwc/subversion-trunk && XGETTEXT="/home/nori1/bin/xgettext" MSGMERGE="/home/nori1/bin/msgmerge" \
> >   tools/po/po-update.sh ja
> > Building subversion.pot...
> > ./libsvn_repos/reporter.c:218: warning: Although being used in a format string position, the msgid is not a valid C format string. Reason: The string ends in the middle of a directive.
> > Updating ja.po...
> > ............................................................................................................................................................ done.
> > ............................................................................................................................................................ done.
> > 
> > 
> > ... which is due to code like this:
> > 
> >           return svn_error_createf(SVN_ERR_REPOS_BAD_REVISION_REPORT, NULL,
> >                                    _("Invalid depth (%"
> >                                      APR_UINT64_T_FMT
> >                                      ") for path '%s'"),
> >                                     num, (*pi)->path);
> > 
> > 
> > ... and results in a ill-formatted msgid like this:
> > 
> > msgid "Invalid depth (%"

I've made my patch more compact, removed a garbage '""' which was
accidentally inserted, and made the log more descriptive.  Could you
please find it for translators?


[[[
Eliminate a warning from gettext and enable extracting correct msgids
for translators.

* subversion/libsvn_repos/reporter.c
  (read_path_info): Make a format string for a message extractable and
  translatable by separating its preprocessing-needing part off.
]]]


Thanks,

-nori