rsyncui/main.cpp

28 lines
765 B
C++
Raw Normal View History

2023-01-07 12:44:45 +01:00
#include "mainwindow.h"
2023-01-23 10:04:54 +01:00
2023-01-22 14:33:23 +01:00
#include <QTranslator>
2023-01-07 12:44:45 +01:00
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
2023-01-18 23:12:21 +01:00
QTranslator myappTranslator;
2023-01-22 14:33:23 +01:00
QCoreApplication::setOrganizationName("RsyncUI");
QCoreApplication::setApplicationName("RsyncUI");
// Initialization of localization
2023-01-18 23:12:21 +01:00
QLocale localeName = QLocale::system();
2023-02-12 19:11:06 +01:00
QString localeDir = "/usr/share/locale/" + localeName.name() + "/LC_MESSAGES/"; //RsyncUI_" + localeName.name() + ".qm";
QString localeFilename = QCoreApplication::applicationName() + "_" + localeName.name();
QLocale locale = QLocale();
if (myappTranslator.load(localeFilename, localeDir))
2023-01-18 23:12:21 +01:00
{
a.installTranslator(&myappTranslator);
}
2023-01-07 12:44:45 +01:00
MainWindow w;
w.show();
return a.exec();
}