summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtTranslator.h')
-rw-r--r--Swift/QtUI/QtTranslator.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Swift/QtUI/QtTranslator.h b/Swift/QtUI/QtTranslator.h
index fdafaf0..a2129f0 100644
--- a/Swift/QtUI/QtTranslator.h
+++ b/Swift/QtUI/QtTranslator.h
@@ -16,6 +16,10 @@ class QtTranslator : public Swift::Translator {
}
virtual std::string translate(const std::string& text, const std::string& context) {
+#if QT_VERSION >= 0x050000
+ return std::string(QCoreApplication::translate(context.c_str(), text.c_str(), 0).toUtf8());
+#else
return std::string(QCoreApplication::translate(context.c_str(), text.c_str(), 0, QCoreApplication::UnicodeUTF8).toUtf8());
+#endif
}
};