From 4d3e74a23676a33ffdc04a4a8b83c05f63b2693c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 6 Oct 2013 08:55:58 -0700 Subject: Trying to switch to Qt translation This compiles and looks about right, but it doesn't appear to work, yet. Signed-off-by: Dirk Hohndel --- gettextfromc.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 gettextfromc.cpp (limited to 'gettextfromc.cpp') diff --git a/gettextfromc.cpp b/gettextfromc.cpp new file mode 100644 index 000000000..4976d70f8 --- /dev/null +++ b/gettextfromc.cpp @@ -0,0 +1,19 @@ +#include +#include +#include + +char *gettextFromC::gettext(const char *text) +{ + return tr(text).toLocal8Bit().data(); +} + +gettextFromC* gettextFromC::instance() +{ + static gettextFromC *self = new gettextFromC(); + return self; +} + +extern "C" const char *gettext(const char *text) +{ + return gettextFromC::instance()->gettext(text); +} -- cgit v1.2.3-70-g09d2