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
Index: subversion/libsvn_repos/reporter.c
===================================================================
--- subversion/libsvn_repos/reporter.c (revision 24140)
+++ subversion/libsvn_repos/reporter.c (working copy)
@@ -215,10 +215,9 @@
default and should never be sent. */
default:
return svn_error_createf(SVN_ERR_REPOS_BAD_REVISION_REPORT, NULL,
- _("Invalid depth (%"
- APR_UINT64_T_FMT
- ") for path '%s'"),
- num, (*pi)->path);
+ _("Invalid depth (%s) for path '%s'"),
+ apr_psprintf(pool, "%" APR_UINT64_T_FMT,
+ num), (*pi)->path);
}
}
else
- application/pgp-signature attachment: stored
Received on Mon Mar 26 13:47:26 2007