summaryrefslogtreecommitdiffstats
path: root/gettextfromc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gettextfromc.cpp')
-rw-r--r--gettextfromc.cpp19
1 files changed, 19 insertions, 0 deletions
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 <QCoreApplication>
+#include <QString>
+#include <gettextfromc.h>
+
+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);
+}