All pastes #431211 Raw Edit

gvy

public text v1 · immutable
·published 2007-04-09 14:44 UTC
rendered paste body
+#include <QLibraryInfo>
+#include <QTranslator>
+#include <QLocale>


+// load up standard Qt4 localization; thanks zerg@ and wrar@
+// for advice (mike@altlinux on 20070302); see also
+// http://doc.trolltech.com/4.2/qtranslator.html
+#ifndef WIN32
+       QTranslator translator;
+       translator.load(QLibraryInfo::location(QLibraryInfo::TranslationsPath) + "/qt_"+QLocale::system().name());
+       a.installTranslator(&translator);
+#endif