aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/ChangeLog5
-rw-r--r--common/i18n.h3
-rw-r--r--common/simple-gettext.c9
3 files changed, 17 insertions, 0 deletions
diff --git a/common/ChangeLog b/common/ChangeLog
index ab4bec0a4..b458bdd5c 100644
--- a/common/ChangeLog
+++ b/common/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-25 Werner Koch <[email protected]>
+
+ * i18n.h (ngettext): New.
+ * simple-gettext.c (ngettext): New.
+
2007-04-20 Werner Koch <[email protected]>
* miscellaneous.c (my_gcry_logger, my_gcry_outofcore_handler):
diff --git a/common/i18n.h b/common/i18n.h
index 6881a8a61..56c00abf6 100644
--- a/common/i18n.h
+++ b/common/i18n.h
@@ -17,6 +17,8 @@
#ifdef USE_SIMPLE_GETTEXT
int set_gettext_file( const char *filename );
const char *gettext( const char *msgid );
+ const char *ngettext(const char *msgid1, const char *msgid2,
+ unsigned long int n);
# define _(a) gettext (a)
# define N_(a) (a)
#else
@@ -34,6 +36,7 @@
# else
# define _(a) (a)
# define N_(a) (a)
+# define ngettext(a,b,c) ((c)==1? (a):(b))
# endif
#endif /*!USE_SIMPLE_GETTEXT*/
diff --git a/common/simple-gettext.c b/common/simple-gettext.c
index 56a305fd8..6661b2d12 100644
--- a/common/simple-gettext.c
+++ b/common/simple-gettext.c
@@ -419,6 +419,15 @@ gettext( const char *msgid )
return msgid;
}
+
+const char *
+ngettext (const char *msgid1, const char *msgid2, unsigned long int n)
+{
+ /* We use the simple Germanic plural rule. */
+ return gettext (n==1? msgid1 : msgid2);
+}
+
+
#if 0
unsigned int cp1, cp2;