]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include: [nls.h] define a macro for handling plurals with ngettext()
authorBenno Schulenberg <bensberg@justemail.net>
Sat, 30 Jul 2011 17:20:58 +0000 (19:20 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 2 Aug 2011 12:13:44 +0000 (14:13 +0200)
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
include/nls.h

index 00f2e37a745a344b6f8b293706ae7daf155a5782..9a9311bdcc94b3681c572c771639e2db0a2c2abd 100644 (file)
@@ -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