From 14cb56ddac3c08a553f84fd4a4ae945b44e61170 Mon Sep 17 00:00:00 2001 From: Nenderus Date: Sun, 8 Sep 2024 11:22:17 +0300 Subject: [PATCH] Install translations in PACKAGE MODE --- pcsx2-qt/Translations.cpp | 6 +++++- pcsx2/CMakeLists.txt | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pcsx2-qt/Translations.cpp b/pcsx2-qt/Translations.cpp index d8f1ca691ebd35..60c64e6bd5d892 100644 --- a/pcsx2-qt/Translations.cpp +++ b/pcsx2-qt/Translations.cpp @@ -121,7 +121,11 @@ void QtHost::InstallTranslator(QWidget* dialog_parent) #ifdef __APPLE__ const QString base_dir = QStringLiteral("%1/../Resources/translations").arg(qApp->applicationDirPath()); #else - const QString base_dir = QStringLiteral("%1/translations").arg(qApp->applicationDirPath()); + #ifdef PCSX2_APP_DATADIR + const QString base_dir = QStringLiteral("%1/%2/translations").arg(qApp->applicationDirPath()).arg(PCSX2_APP_DATADIR); + #else + const QString base_dir = QStringLiteral("%1/translations").arg(qApp->applicationDirPath()); + #endif #endif // Qt base uses underscores instead of hyphens. diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index be628e2be7fe73..0a229bd80ea0b6 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -1289,6 +1289,7 @@ function(setup_main_executable target) if (PACKAGE_MODE) install(TARGETS pcsx2-qt DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/resources DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/PCSX2) + install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/translations DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/PCSX2) else() install(TARGETS pcsx2-qt DESTINATION ${CMAKE_SOURCE_DIR}/bin) endif()