Qt:Mac: Add CFBundleLocalizations tag

This commit is contained in:
TellowKrinkle 2023-07-15 15:59:23 -05:00 committed by Connor McLaughlin
parent 1d63779b7d
commit 22682e4150
2 changed files with 17 additions and 0 deletions

View File

@ -205,6 +205,18 @@ if(WIN32)
qt_add_lrelease(pcsx2-qt TS_FILES ${TS_FILES})
elseif(APPLE)
qt_add_lrelease(pcsx2-qt TS_FILES ${TS_FILES} QM_FILES_OUTPUT_VARIABLE QM_FILES)
set(PCSX2_MACOS_LOCALIZATIONS)
foreach (TS_FILE IN LISTS TS_FILES)
get_filename_component(TS_FILE_NAME ${TS_FILE} NAME)
set(regex "^pcsx2-qt_([a-zA-Z0-9\\-]+)\\.ts$")
if (TS_FILE_NAME MATCHES ${regex})
string(REGEX REPLACE ${regex} "\\1" language ${TS_FILE_NAME})
string(REPLACE "-" "_" language ${language})
set(PCSX2_MACOS_LOCALIZATIONS "${PCSX2_MACOS_LOCALIZATIONS}\n\t\t<string>${language}</string>")
else()
message(WARNING "Unrecognized ts file ${TS_FILE_NAME}")
endif()
endforeach()
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/)

View File

@ -41,5 +41,10 @@
<true/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleLocalizations</key>
<array>${PCSX2_MACOS_LOCALIZATIONS}
</array>
</dict>
</plist>