]> git.ipfire.org Git - thirdparty/libvirt.git/commit
maint: improve i18n on non-Linux
authorEric Blake <eblake@redhat.com>
Tue, 16 Nov 2010 19:01:37 +0000 (12:01 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 17 Nov 2010 17:12:57 +0000 (10:12 -0700)
commit981d2cdab41edf2f4b7f6e1164336b85a02708cc
tree086164df4793e19504fb54a59f8a2fc81fb7da2b
parent0d5f54bb2158528c603d34b29e0faab9ca23a93b
maint: improve i18n on non-Linux

Per the gettext developer:
http://lists.gnu.org/archive/html/bug-gnu-utils/2010-10/msg00019.html
http://lists.gnu.org/archive/html/bug-gnu-utils/2010-10/msg00021.html

gettext() doesn't work correctly on all platforms unless you have
called setlocale().  Furthermore, gnulib's gettext.h has provisions
for setting up a default locale, which is the preferred method for
libraries to use gettext without having to call textdomain() and
override the main program's default domain (virInitialize already
calls bindtextdomain(), but this is insufficient without the
setlocale() added in this patch; and a redundant bindtextdomain()
in this patch doesn't hurt, but serves as a good example for other
packages that need to bind a second translation domain).

This patch is needed to silence a new gnulib 'make syntax-check'
rule in the next patch.

* daemon/libvirtd.c (main): Setup locale and gettext.
* src/lxc/lxc_controller.c (main): Likewise.
* src/security/virt-aa-helper.c (main): Likewise.
* src/storage/parthelper.c (main): Likewise.
* tools/virsh.c (main): Fix exit status.
* src/internal.h (DEFAULT_TEXT_DOMAIN): Define, for gettext.h.
(_): Simplify definition accordingly.
* po/POTFILES.in: Add src/storage/parthelper.c.
daemon/libvirtd.c
po/POTFILES.in
src/internal.h
src/lxc/lxc_controller.c
src/security/virt-aa-helper.c
src/storage/parthelper.c
tools/virsh.c