From 36752ebb554be1b395ba0dfa8605fb575d70f4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Thu, 3 Sep 2009 18:42:52 +0200 Subject: Add small wrapper to C-gettext --- portato/gui/windows/gettext.pyx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 portato/gui/windows/gettext.pyx (limited to 'portato') diff --git a/portato/gui/windows/gettext.pyx b/portato/gui/windows/gettext.pyx new file mode 100644 index 0000000..c8174e8 --- /dev/null +++ b/portato/gui/windows/gettext.pyx @@ -0,0 +1,18 @@ +cdef extern from "langinfo.h": + char* nl_langinfo (int item) + cdef enum: + CODESET + +cdef extern from "libintl.h": + char * textdomain (char* domain) + char * bindtextdomain (char* domain, char* dir) + char * bind_textdomain_codeset (char* domain, char* codeset) + +def set_gtk_gettext (char* domain, char* dir): + textdomain(domain) + bindtextdomain(domain, dir) + + old_charset = nl_langinfo(CODESET) + bind_textdomain_codeset(domain, "UTF-8") + + return old_charset -- cgit v1.2.3