[libvirt] [PATCH] libvirtd: mark strings for translation, including --help output

Eric Blake eblake at redhat.com
Thu May 20 19:16:58 UTC 2010


On 05/20/2010 02:02 AM, Jim Meyering wrote:
> +++ b/daemon/libvirtd.c
> @@ -484,8 +484,8 @@ static int daemonForkIntoBackground(void) {
> 
>              if (ret == 1 && status != 0) {
>                  fprintf(stderr,
> -                        "error: %s. Check /var/log/messages or run without "
> -                        "--daemon for more info.\n",
> +                        _("error: %s. Check /var/log/messages or run without "
> +                          "--daemon for more info.\n"),

Should we also do a followup that passes argv[0] to this method, so that
the error message can start with the program name?

>                          virDaemonErrTypeToString(status));
>              }
>              _exit(ret == 1 && status == 0 ? 0 : 1);
> @@ -2963,7 +2963,7 @@ static void
>  usage (const char *argv0)
>  {
>      fprintf (stderr,
> -             "\n\
> +             _("\n\
>  Usage:\n\
>    %s [options]\n\

As is the case in usage()?

> +               (REMOTE_PID_FILE[0] != '\0'
> +                ? REMOTE_PID_FILE
> +                : "(disabled in ./configure)"));

Missed a string.  This should be _("(disabled in ./configure)").

>          default:
> -            fprintf (stderr, "libvirtd: internal error: unknown flag: %c\n",
> +            fprintf (stderr, _("libvirtd: internal error: unknown flag: %c\n"),

And here, should we be using %s/argv[0] instead of hard-coding the name
"libvirtd"?

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100520/9ce6b1e6/attachment-0001.sig>


More information about the libvir-list mailing list