From: Benno Schulenberg Date: Sat, 30 Jul 2011 17:20:58 +0000 (+0200) Subject: include: [nls.h] define a macro for handling plurals with ngettext() X-Git-Tag: v2.20-rc2~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27cc25474f733460a22031bdfa3d147bf6c3906b;p=thirdparty%2Futil-linux.git include: [nls.h] define a macro for handling plurals with ngettext() Signed-off-by: Benno Schulenberg --- 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