From 27cc25474f733460a22031bdfa3d147bf6c3906b Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 30 Jul 2011 19:20:58 +0200 Subject: [PATCH] include: [nls.h] define a macro for handling plurals with ngettext() Signed-off-by: Benno Schulenberg --- include/nls.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/nls.h b/include/nls.h index 00f2e37a74..9a9311bdcc 100644 --- a/include/nls.h +++ b/include/nls.h @@ -22,6 +22,7 @@ int main(int argc, char *argv[]); # else # define N_(String) (String) # endif +# define P_(Singular, Plural, n) ngettext (Singular, Plural, n) #else # undef bindtextdomain # define bindtextdomain(Domain, Directory) /* empty */ @@ -29,6 +30,7 @@ int main(int argc, char *argv[]); # define textdomain(Domain) /* empty */ # define _(Text) (Text) # define N_(Text) (Text) +# define P_(Singular, Plural, n) ((n) == 1 ? (Singular) : (Plural)) #endif #ifdef HAVE_LANGINFO_H -- 2.47.3