From e7d5803f07c11882685e2a65b5638fd385804d22 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 27 Jul 2010 15:50:43 -0500 Subject: Use the plural features of gettext Gettext has this whole 'Plural-Form' thing that until now we haven't taken advantage of. Given that not all languages have the same plural form rules as English, take advantage of it by defining a new _n() macro which will normally define to ngettext(), and adjust a few messages as an example of how to use. There are surely other places where we do singular/plural logic without me having noticed, so further patches are welcome to fix those up too. Signed-off-by: Dan McGee --- src/pacman/util.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/pacman/util.h') diff --git a/src/pacman/util.h b/src/pacman/util.h index bbf43827..d85ba7b6 100644 --- a/src/pacman/util.h +++ b/src/pacman/util.h @@ -30,8 +30,10 @@ #include /* here so it doesn't need to be included elsewhere */ /* define _() as shortcut for gettext() */ #define _(str) gettext(str) +#define _n(str1, str2, ct) ngettext(str1, str2, ct) #else #define _(str) str +#define _n(str1, str2, ct) (ct == 1 ? str1 : str2) #endif /* update speed for the fill_progress based functions */ -- cgit v1.2.3-70-g09d2