Mercurial > hg > easyhg
comparison 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 |
comparison
equal
deleted
inserted
replaced
154:6bcb4a4d6521 | 155:edab92f3ea0b |
---|---|
18 #include "mainwindow.h" | 18 #include "mainwindow.h" |
19 #include "common.h" | 19 #include "common.h" |
20 #include "debug.h" | 20 #include "debug.h" |
21 | 21 |
22 #include <QApplication> | 22 #include <QApplication> |
23 #include <QTranslator> | |
23 #include <QDir> | 24 #include <QDir> |
24 | 25 |
25 int main(int argc, char *argv[]) | 26 int main(int argc, char *argv[]) |
26 { | 27 { |
27 QApplication::setOrganizationName("easymercurial"); | 28 QApplication::setOrganizationName("easymercurial"); |
33 loseControllingTerminal(); | 34 loseControllingTerminal(); |
34 | 35 |
35 installSignalHandlers(); | 36 installSignalHandlers(); |
36 | 37 |
37 QApplication app(argc, argv); | 38 QApplication app(argc, argv); |
39 | |
40 QTranslator translator; | |
41 QString language = QLocale::system().name(); | |
42 QString trname = QString("easyhg_%1").arg(language); | |
43 translator.load(trname, ":"); | |
44 app.installTranslator(&translator); | |
45 | |
38 QStringList args = app.arguments(); | 46 QStringList args = app.arguments(); |
39 MainWindow mainWin; | 47 MainWindow mainWin; |
40 mainWin.show(); | 48 mainWin.show(); |
41 | 49 |
42 if (args.size() == 2) { | 50 if (args.size() == 2) { |