CMake: Set CFBundleDevelopmentRegion from QT_I18N_SOURCE_LANGUAGE

The value of QT_I18N_TRANSLATED_LANGUAGES is reflected in generated
Info.plist files. We should do the same for QT_I18N_SOURCE_LANGUAGE.

Pick-to: 6.7 6.8
Fixes: QTBUG-126790
Change-Id: Id9d680a183047942585e00f5d8cf1ac3c2352c9f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2024-07-01 11:45:44 +02:00
parent ae7a8c84b0
commit ea435bb127

View File

@ -628,19 +628,31 @@ function(_qt_internal_set_apple_localizations target)
COMMANDS "print CFBundleLocalizations"
OUTPUT_VARIABLE existing_localizations
)
if(existing_localizations)
return()
if(NOT existing_localizations)
list(TRANSFORM supported_languages PREPEND
"Add CFBundleLocalizations: string ")
_qt_internal_plist_buddy("${plist_file}"
COMMANDS
"Add CFBundleLocalizations array"
${supported_languages}
"Delete CFBundleAllowMixedLocalizations"
)
endif()
list(TRANSFORM supported_languages PREPEND
"Add CFBundleLocalizations: string ")
_qt_internal_plist_buddy("${plist_file}"
COMMANDS
"Add CFBundleLocalizations array"
${supported_languages}
"Delete CFBundleAllowMixedLocalizations"
)
if(NOT "${QT_I18N_SOURCE_LANGUAGE}" STREQUAL "")
_qt_internal_plist_buddy("${plist_file}"
COMMANDS "print CFBundleDevelopmentRegion"
OUTPUT_VARIABLE existing_dev_region
)
if(NOT existing_dev_region)
_qt_internal_plist_buddy("${plist_file}"
COMMANDS
"Add CFBundleDevelopmentRegion string"
"Set CFBundleDevelopmentRegion ${QT_I18N_SOURCE_LANGUAGE}"
)
endif()
endif()
endfunction()
function(_qt_internal_set_ios_simulator_arch target)