Language settings from LANG enviroment variable (bug #6136)
[urpo] / src / main.cpp
1 #include <QtGui/QApplication>
2 #include <QTranslator>
3 #include "urpomainwindow.h"
4 #include <QString>
5 #include <cstdlib>
6
7 /*! @mainpage Urpo - Unix Remote Printing Operation
8
9
10   @author Arto Hyvättinen
11   @version 0.9
12   @date 2010-06
13
14   Urpo prints to remote computer via cups and ssh. Urpo is designed for Maemo.
15
16   Urpo uses Qt library. It it translated into Finnish.
17
18   */
19
20
21
22 int main(int argc, char *argv[])
23 {
24     QApplication a(argc, argv);
25
26     QTranslator appTranslator;
27     // using LANG enviroment variable instead of QLocale because of Qt on Maemo problem
28     // bug #6136
29     QString language = std::getenv("LANG");
30     appTranslator.load("urpo_" + language.toLower() ,":/");
31     a.installTranslator(&appTranslator);
32
33     UrpoMainWindow w;
34 #if defined(Q_WS_S60)
35     w.showMaximized();
36 #else
37     w.show();
38 #endif
39
40     return a.exec();
41 }