]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
locale-util: fix _() definition
authorDmitry V. Levin <ldv@strace.io>
Tue, 18 Jul 2023 08:00:00 +0000 (08:00 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 19 Jul 2023 12:02:04 +0000 (14:02 +0200)
The previous definition was not quite appropriate for the library code
because it relied on the message domain set by textdomain() invocation
which is not necessarily the same message domain defined in
GETTEXT_PACKAGE macro.

The only code that uses _() so far is located in pam_systemd_home.c.

Fixes: 20f56fddcd5 ("Add gettext support")
src/basic/locale-util.h

index 8990cb6a75a4a25e01e30066797ef6df65bc736c..ae2797cd2dcc0764543aebeb51322ecf61e90096 100644 (file)
@@ -33,7 +33,7 @@ int get_locales(char ***l);
 bool locale_is_valid(const char *name);
 int locale_is_installed(const char *name);
 
-#define _(String) gettext(String)
+#define _(String) dgettext(GETTEXT_PACKAGE, String)
 #define N_(String) String
 void init_gettext(void);