Spanish translation added
This commit is contained in:
14
main.cpp
14
main.cpp
@@ -22,7 +22,9 @@
|
||||
#endif
|
||||
|
||||
#include <QDebug>
|
||||
#include <QLocale>
|
||||
#include <QThread>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "singleapplication.h"
|
||||
#include "mainwidget.h"
|
||||
@@ -39,6 +41,16 @@ void noMessageOutput(QtMsgType type, const char *msg)
|
||||
Q_UNUSED(msg);
|
||||
}
|
||||
|
||||
void loadTranslation(QApplication &app)
|
||||
{
|
||||
QTranslator* translator = new QTranslator();
|
||||
QString locale = QLocale().system().name();
|
||||
qDebug() << "Current locale:" << locale;
|
||||
if(translator->load("qcma." + locale, ":/main/resources/translations")) {
|
||||
app.installTranslator(translator);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if(SingleApplication::sendMessage(QObject::tr("A instance of QCMA is already running"))) {
|
||||
@@ -47,6 +59,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
SingleApplication app(argc, argv);
|
||||
|
||||
loadTranslation(app);
|
||||
|
||||
#ifndef Q_OS_WIN32
|
||||
// FIXME: libmtp sends SIGPIPE if a socket write fails crashing the whole app
|
||||
// the proper fix is to libmtp to handle the cancel properly or ignoring
|
||||
|
Reference in New Issue
Block a user