use russian tr if current language is russian
[colorflood] / colorflood / src / main.cpp
1 /*
2   Copyright 2010 Serge Ziryukin <ftrvxmtrx@gmail.com>
3
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU General Public License as published by
6   the Free Software Foundation; version 2 of the License.
7
8   This program is distributed in the hope that it will be useful,
9   but WITHOUT ANY WARRANTY; without even the implied warranty of
10   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11   GNU General Public License for more details.
12 */
13
14 #include <QApplication>
15 #include <QLocale>
16 #include <QTranslator>
17 #include "window.hpp"
18
19 /*
20 =================
21 main
22 =================
23 */
24 int main (int argc, char **argv)
25 {
26     QApplication app(argc, argv);
27
28     QCoreApplication::setOrganizationName("ftrvxmtrx");
29     QCoreApplication::setApplicationName("Color Flood");
30
31     QTranslator translator;
32
33     if (QLocale::Russian == QLocale::system().language())
34         translator.load(":/colorflood.qm");
35
36     app.installTranslator(&translator);
37
38     Window window;
39     window.show();
40
41     return app.exec();
42 }