]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: fix NLS support
authorKarel Zak <kzak@redhat.com>
Tue, 25 Apr 2017 15:05:09 +0000 (17:05 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 25 Apr 2017 15:05:09 +0000 (17:05 +0200)
commit7095232d21232ca1ab307fbdd1a36471347f23c6
tree3ad718b1bcd33acdebfecd955b0fdcc9824e19c3
parentbe685b98c03b43c34d0f6e0447361f7d2dcdae9a
libfdisk: fix NLS support

The current libfdisk code uses gettext() to translate strings. It
means it follows the default text domain (as set by textdomain(3)
usually in the main program). This is useless for public shared
library.

We have call private bindtextdomain() and use dgettext() with private
domain name to be independent on the main program. For this purpose
include/nls.h supports UL_TEXTDOMAIN_EXPLICIT to use dgettext().

Note that libfdisk will continue to use util-linux.po, rather than
keep the texts in the separate file.

The nls.h has to be included only from fdiskP.h to be sure that
nls.h works as expected for the library.

Signed-off-by: Karel Zak <kzak@redhat.com>
include/nls.h
libfdisk/src/bsd.c
libfdisk/src/context.c
libfdisk/src/dos.c
libfdisk/src/fdiskP.h
libfdisk/src/gpt.c
libfdisk/src/parttype.c
libfdisk/src/sgi.c
libfdisk/src/sun.c