]> git.deb.at Git - pkg/abook.git/commitdiff
Added gettext.c
authorCedric Duval <cedricduval@free.fr>
Fri, 23 Sep 2005 21:34:39 +0000 (21:34 +0000)
committerCedric Duval <cedricduval@free.fr>
Fri, 23 Sep 2005 21:34:39 +0000 (21:34 +0000)
(needed for sgettext() support)

gettext.c [new file with mode: 0644]

diff --git a/gettext.c b/gettext.c
new file mode 100644 (file)
index 0000000..949e843
--- /dev/null
+++ b/gettext.c
@@ -0,0 +1,19 @@
+#ifdef HAVE_CONFIG_H
+#      include "config.h"
+#endif
+
+#ifdef ENABLE_NLS
+#include <string.h>
+#include "gettext.h"
+
+char *
+sgettext(const char *msgid)
+{
+       char *msgval = gettext(msgid);
+
+       if(msgval == msgid)
+               msgval = strrchr(msgid, '|') + 1;
+
+       return msgval;
+}
+#endif