mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
autodetect system language on MacOS
This commit is contained in:
parent
31a9f91961
commit
2da87deead
1 changed files with 13 additions and 16 deletions
|
@ -32,22 +32,6 @@ endif()
|
|||
# -----------------------------------------------------------------------------
|
||||
add_executable(qbt_app)
|
||||
|
||||
# Generate lproj folders for the translations
|
||||
foreach(TS_FILE IN LISTS QBT_TS_FILES)
|
||||
string(FIND "${TS_FILE}" "_" POS)
|
||||
math(EXPR START "${POS} + 1")
|
||||
string(SUBSTRING "${TS_FILE}" ${START} -1 LPROJ_FOLDER)
|
||||
string(REPLACE ".ts" ".lproj" LPROJ_FOLDER "${LPROJ_FOLDER}")
|
||||
# @ is not valid as a language code for a lproj folder on MacOS
|
||||
string(REPLACE "@" "-" LPROJ_FOLDER "${LPROJ_FOLDER}")
|
||||
add_custom_command(
|
||||
TARGET qbt_app
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
"$<TARGET_FILE_DIR:qbt_app>/../Resources/${LPROJ_FOLDER}"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
target_sources(qbt_app PRIVATE
|
||||
# headers
|
||||
application.h
|
||||
|
@ -102,6 +86,19 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|||
PROPERTIES
|
||||
MACOSX_PACKAGE_LOCATION Resources
|
||||
)
|
||||
# Generate lproj folders for the translations
|
||||
foreach(TS_FILE IN LISTS QBT_TS_FILES)
|
||||
string(FIND "${TS_FILE}" "_" POS)
|
||||
math(EXPR START "${POS} + 1")
|
||||
string(SUBSTRING "${TS_FILE}" ${START} -1 LPROJ_FOLDER)
|
||||
string(REPLACE ".ts" ".lproj" LPROJ_FOLDER "${LPROJ_FOLDER}")
|
||||
# @ is not valid as a language code for a lproj folder on MacOS
|
||||
string(REPLACE "@" "-" LPROJ_FOLDER "${LPROJ_FOLDER}")
|
||||
add_custom_command( TARGET qbt_app POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
"$<TARGET_FILE_DIR:qbt_app>/../Resources/${LPROJ_FOLDER}"
|
||||
)
|
||||
endforeach()
|
||||
# provide variables for substitution in dist/mac/Info.plist
|
||||
get_target_property(EXECUTABLE_NAME qbt_app OUTPUT_NAME)
|
||||
# This variable name should be changed once qmake is no longer used. Refer to the discussion in PR #14813
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue