actually load the translation
This commit is contained in:
@ -50,7 +50,7 @@ add_definitions(${QT_DEFINITIONS})
|
||||
# for config.h
|
||||
include_directories("${PROJECT_BINARY_DIR}/src")
|
||||
|
||||
file(GLOB qjoypad_TRANS_SOURCES translations/qjoypad_*.ts)
|
||||
file(GLOB qjoypad_TRANS_SOURCES translations/qjoypad*.ts)
|
||||
|
||||
if(UPDATE_TRANSLATIONS)
|
||||
file(GLOB_RECURSE qjoypad_TRANS_FILES *.cpp *.h)
|
||||
@ -63,6 +63,7 @@ add_subdirectory(icons)
|
||||
add_subdirectory(src)
|
||||
|
||||
add_custom_target(translations_target DEPENDS ${qjoypad_TRANS})
|
||||
add_dependencies(qjoypad translations_target)
|
||||
|
||||
install(PROGRAMS qjoypad.desktop DESTINATION "share/applications")
|
||||
install(FILES ${qjoypad_TRANS} DESTINATION "share/qjoypad/translations")
|
||||
|
@ -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/");
|
||||
|
@ -146,7 +146,7 @@
|
||||
<message>
|
||||
<location filename="../src/button_edit.cpp" line="26"/>
|
||||
<source>&Rapid Fire</source>
|
||||
<translation type="unfinished">Schnellfeue&r</translation>
|
||||
<translation type="unfinished">&Schnellfeuer</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
Reference in New Issue
Block a user