Commit c7131e3a authored by Max-Wilhelm Bruker's avatar Max-Wilhelm Bruker
Browse files

Windows client: translation path fix

parent 37129955
......@@ -160,12 +160,6 @@ SET(cockatrice_HEADERS
if (UNIX)
set_source_files_properties(src/main.cpp PROPERTIES COMPILE_FLAGS -DTRANSLATION_PATH=\\"${CMAKE_INSTALL_PREFIX}/share/cockatrice/translations\\")
endif (UNIX)
if (WIN32)
set_source_files_properties(src/main.cpp PROPERTIES COMPILE_FLAGS -DTRANSLATION_PATH=\\"translations\\")
endif (WIN32)
if (APPLE)
set_source_files_properties(src/main.cpp PROPERTIES COMPILE_FLAGS -DTRANSLATION_PATH=\\"../../../translations\\")
endif (APPLE)
set(cockatrice_RESOURCES cockatrice.qrc)
set(cockatrice_TS
......
......@@ -69,8 +69,6 @@ void installNewTranslator()
qtTranslator->load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
qApp->installTranslator(qtTranslator);
if (!translationPath.startsWith("/"))
translationPath.prepend(qApp->applicationDirPath() + "/");
translator->load(translationPrefix + "_" + lang, translationPath);
qApp->installTranslator(translator);
}
......@@ -99,6 +97,17 @@ int main(int argc, char *argv[])
QCoreApplication::setOrganizationDomain("cockatrice.de");
QCoreApplication::setApplicationName("Cockatrice");
if (translationPath.isEmpty()) {
#ifdef Q_OS_MAC
QDir translationsDir = baseDir;
translationsDir.cd("translations");
translationPath = translationsDir.absolutePath();
#endif
#ifdef Q_OS_WIN
translationPath = app.applicationDirPath() + "/translations";
#endif
}
rng = new RNG_SFMT;
settingsCache = new SettingsCache;
db = new CardDatabase;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment