[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [Libvir] [PATCH 4/9] qemudReportError: mark for translation string args to this function
- From: Jim Meyering <jim meyering net>
- To: "Richard W.M. Jones" <rjones redhat com>
- Cc: Libvirt <libvir-list redhat com>
- Subject: Re: [Libvir] [PATCH 4/9] qemudReportError: mark for translation string args to this function
- Date: Fri, 28 Mar 2008 12:36:45 +0100
"Richard W.M. Jones" <rjones redhat com> wrote:
> On Fri, Mar 28, 2008 at 12:15:04PM +0100, Jim Meyering wrote:
>> But there's nothing we can do about the latter, and there *is* something
>> we can do about the former: precede with "%s". Of course, gettext tools
>> like msgmerge are careful to ensure that %-directives in translations
>> match those in the original, so it's not a problem, in general.
>
> Does msgmerge distinguish between ordinary strings and format strings,
> eg. puts (_("SQL lets you write LIKE '%string%'")); ?
Yes, though actually it's xgettext that does the checking,
and you tell it which functions take format strings and how.
Here's part of coreutils' bootstrap.conf:
# Additional xgettext options to use. Use "\\\newline" to break lines.
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
--from-code=UTF-8\\\
--flag=asprintf:2:c-format\\\
--flag=asnprintf:3:c-format\\\
--flag=error:3:c-format\\\
--flag=error_at_line:5:c-format\\\
--flag=vasprintf:2:c-format\\\
--flag=vasnprintf:3:c-format\\\
--flag=wrapf:1:c-format\\\
--flag=xasprintf:1:c-format\\\
--flag=xfprintf:2:c-format\\\
--flag=xprintf:1:c-format\\\
'
libvirt could use something similar.
This is yet another reason to try to avoid adding a
new error-printing function per subsystem.
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]