Spanish translation added

This commit is contained in:
codestation
2013-08-29 14:49:29 -04:30
parent 153695903a
commit acbdf57b1a
6 changed files with 289 additions and 3 deletions

View File

@@ -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