Loaded translation files correctly on MacOSX
This commit is contained in:
parent
7feb45b4ec
commit
bfee209b7a
2 changed files with 11 additions and 1 deletions
|
@ -108,7 +108,7 @@ IF (UPDATE_TRANSLATIONS)
|
|||
ELSE (UPDATE_TRANSLATIONS)
|
||||
IF (APPLE)
|
||||
SET_SOURCE_FILES_PROPERTIES(${telldus-gui_TS} PROPERTIES
|
||||
OUTPUT_LOCATION ${CMAKE_BINARY_DIR}
|
||||
OUTPUT_LOCATION ${CMAKE_BINARY_DIR}/TelldusCenter.app/Contents/Resources
|
||||
)
|
||||
ELSEIF (UNIX)
|
||||
SET_SOURCE_FILES_PROPERTIES(${telldus-gui_TS} PROPERTIES
|
||||
|
|
|
@ -1,13 +1,23 @@
|
|||
#include "telldusgui.h"
|
||||
#include <QTranslator>
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
|
||||
#include "devicewidget.h"
|
||||
|
||||
QWidget* WINAPI tdDeviceWidget( QWidget *parent ) {
|
||||
QTranslator *translator = new QTranslator(parent);
|
||||
#ifdef Q_OS_MAC
|
||||
QDir resDir = QDir(qApp->applicationDirPath());
|
||||
if (resDir.dirName() == "MacOS") {
|
||||
resDir.cdUp();
|
||||
resDir.cd("resources");
|
||||
}
|
||||
translator->load("TelldusGui_" + QLocale::system().name(), resDir.absolutePath());
|
||||
#else
|
||||
translator->load("TelldusGui_" + QLocale::system().name());
|
||||
#endif
|
||||
qApp->installTranslator(translator);
|
||||
return new DeviceWidget(parent);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue