diff main.cpp @ 155:edab92f3ea0b

* Add translation support -- useful for proper plural handling even in English
author Chris Cannam
date Thu, 02 Dec 2010 21:13:53 +0000
parents 644bd31e8301
children b6dd1ee0e486
line wrap: on
line diff
--- a/main.cpp	Thu Dec 02 18:04:21 2010 +0000
+++ b/main.cpp	Thu Dec 02 21:13:53 2010 +0000
@@ -20,6 +20,7 @@
 #include "debug.h"
 
 #include <QApplication>
+#include <QTranslator>
 #include <QDir>
 
 int main(int argc, char *argv[])
@@ -35,6 +36,13 @@
     installSignalHandlers();
 
     QApplication app(argc, argv);
+
+    QTranslator translator;
+    QString language = QLocale::system().name();
+    QString trname = QString("easyhg_%1").arg(language);
+    translator.load(trname, ":");
+    app.installTranslator(&translator);
+
     QStringList args = app.arguments();
     MainWindow mainWin;
     mainWin.show();