actually load the translation
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
|
||||
#define QJOYPAD_ICON24 "@CMAKE_INSTALL_PREFIX@/share/icons/hicolor/24x24/apps/qjoypad.png"
|
||||
#define QJOYPAD_ICON64 "@CMAKE_INSTALL_PREFIX@/share/icons/hicolor/64x64/apps/qjoypad.png"
|
||||
#define QJOYPAD_L10N_DIR "@CMAKE_INSTALL_PREFIX@/share/qjoypad/translations/"
|
||||
|
||||
#cmakedefine WITH_LIBUDEV
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QPointer>
|
||||
#include <QFileInfo>
|
||||
#include <QTranslator>
|
||||
|
||||
//to load layouts
|
||||
#include "layout.h"
|
||||
@ -48,8 +49,16 @@ int main( int argc, char **argv )
|
||||
//create a new event loop. This will be captured by the QApplication
|
||||
//when it gets created
|
||||
QApplication app( argc, argv );
|
||||
QTranslator translator;
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
|
||||
if (translator.load(QLocale::system(), "qjoypad", "_", QJOYPAD_L10N_DIR)) {
|
||||
app.installTranslator(&translator);
|
||||
}
|
||||
else {
|
||||
debug_mesg("no translation for locale: %s\n", qPrintable(QLocale::system().name()));
|
||||
}
|
||||
|
||||
|
||||
//where QJoyPad saves its settings!
|
||||
const QString settingsDir(QDir::homePath() + "/.qjoypad3/");
|
||||
|
Reference in New Issue
Block a user