summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2007-05-04 11:22:18 +0200
committerWerner Koch <wk@gnupg.org>2007-05-04 11:22:18 +0200
commit3c351d0232d39e8496bd6a06abf0640896352aea (patch)
treeafafa3eea6f93b7e78ec302749d097c3448a371f /common
parent* packet.h, mainproc.c (reset_literals_seen): New function to reset (diff)
downloadgnupg2-3c351d0232d39e8496bd6a06abf0640896352aea.tar.xz
gnupg2-3c351d0232d39e8496bd6a06abf0640896352aea.zip
UTF-8 Fixes
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 <wk@g10code.com>
+
+ * i18n.h (ngettext): New.
+ * simple-gettext.c (ngettext): New.
+
2007-04-20 Werner Koch <wk@g10code.com>
* 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;