e i18n: add plural support thanks to ngettext.

SVN revision: 73864
This commit is contained in:
Chidambar Zinnoury 2012-07-15 06:45:33 +00:00
parent 3e6aee7a61
commit 4d617a725b
3 changed files with 7 additions and 2 deletions

View File

@ -256,7 +256,7 @@ AM_GNU_GETTEXT_VERSION([0.17])
])
m4_ifdef([AM_GNU_GETTEXT], [
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT([external], [need-ngettext])
po_makefile_in=po/Makefile.in
have_po="yes"
],[

View File

@ -8,7 +8,8 @@ subdir = po
top_builddir = ..
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8 --foreign-user
XGETTEXT_OPTIONS = --keyword=_ --keyword=d_:1 --keyword=P_:1,2 \
--keyword=dP_:1,2 --keyword=N_ --from-code=UTF-8 --foreign-user
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding

View File

@ -5,9 +5,13 @@
#ifdef HAVE_GETTEXT
#define _(str) gettext(str)
#define d_(str, dom) dgettext(PACKAGE dom, str)
#define P_(str, str_p, n) ngettext(str, str_p, n)
#define dP_(str, str_p, n, dom) dngettext(PACKAGE dom, str, str_p, n)
#else
#define _(str) (str)
#define d_(str, dom) (str)
#define P_(str, str_p, n) (str_p)
#define dP_(str, str_p, n, dom) (str_p)
#endif
/* This macro is used to just mark string for translation, this is useful
* for string lists which are not dynamically allocated