diff --git a/pcsx2-qt/CMakeLists.txt b/pcsx2-qt/CMakeLists.txt index 17b8dcc9a8..d6adbe4d44 100644 --- a/pcsx2-qt/CMakeLists.txt +++ b/pcsx2-qt/CMakeLists.txt @@ -204,8 +204,11 @@ if(WIN32) set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_SOURCE_DIR}/bin/translations") qt_add_lrelease(pcsx2-qt TS_FILES ${TS_FILES}) elseif(APPLE) - # Hopefully macdeployqt will pick these up. - qt_add_lrelease(pcsx2-qt TS_FILES ${TS_FILES}) + qt_add_lrelease(pcsx2-qt TS_FILES ${TS_FILES} QM_FILES_OUTPUT_VARIABLE QM_FILES) + foreach (QM_FILE IN LISTS QM_FILES) + target_sources(pcsx2-qt PRIVATE ${QM_FILE}) + set_source_files_properties(${QM_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/translations/) + endforeach() else() # TODO: Copy base translations. qt_add_lrelease(pcsx2-qt TS_FILES ${TS_FILES} QM_FILES_OUTPUT_VARIABLE QM_FILES) diff --git a/pcsx2-qt/Translations.cpp b/pcsx2-qt/Translations.cpp index 3fd92f2ae0..b291150dd1 100644 --- a/pcsx2-qt/Translations.cpp +++ b/pcsx2-qt/Translations.cpp @@ -72,7 +72,11 @@ void QtHost::InstallTranslator() QString::fromStdString(Host::GetBaseStringSettingValue("UI", "Language", GetDefaultLanguage())); // Install the base qt translation first. +#ifdef __APPLE__ + const QString base_dir = QStringLiteral("%1/../Resources/translations").arg(qApp->applicationDirPath()); +#else const QString base_dir = QStringLiteral("%1/translations").arg(qApp->applicationDirPath()); +#endif QString base_path = QStringLiteral("%1/qt_%2.qm").arg(base_dir).arg(language); bool has_base_ts = QFile::exists(base_path); if (!has_base_ts)