Skip to content

Commit

Permalink
Relates #311: MacOS: create Resources/<lang>.lproj directory
Browse files Browse the repository at this point in the history
This should persuade the OS to switch the Finder Menu
to the current language.
At least for me it does not work.

Keep it for reference. It does not hurt either.
  • Loading branch information
chris2511 committed Aug 22, 2024
1 parent 8851b57 commit c880eb8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lang/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

set(S "${PROJECT_SOURCE_DIR}/lang")
set(D "${PROJECT_BINARY_DIR}")
set(D "${PROJECT_BINARY_DIR}/lang")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${D})

list(APPEND XCA_QT_LANGUAGES de fr ja pl ru tr es it sk bg)
list(APPEND XCA_LANGUAGES id hr nl pt_BR zh_CN fa ${XCA_QT_LANGUAGES})
Expand All @@ -18,6 +19,10 @@ foreach(lang ${XCA_LANGUAGES})
endif()
string(APPEND LANG_COMPS " </Component>\n")
list(APPEND LANG_ALLCOMPS ${LANG_COMPS})
execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${D}/${lang}.keep)
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${D}/${lang}.keep)
set_source_files_properties(${D}/${lang}.keep PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources/${lang}.lproj")
endforeach()

string(APPEND WIX_LANG_CONTENT
Expand All @@ -29,7 +34,6 @@ WixFile(${D}/language.wxs ${WIX_LANG_CONTENT})
if (${QT_VERSION} VERSION_LESS 6.0.0 )
qt5_add_translation(QM_FILES ${TS_FILES} OPTIONS -silent)
message(STATUS "Updating translations from source with 'lupdate' only supprted with QT6")
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${QM_FILES})
else()
get_target_property(LIBSRC xcalib SOURCES)
get_target_property(XCASRC xca SOURCES)
Expand All @@ -40,7 +44,7 @@ else()
)
add_custom_target(trans DEPENDS xca_lupdate "${D}/xca.pot")
endif()
list(APPEND APP_RESOURCES ${QM_FILES})
list(APPEND APP_RESOURCES ${QM_FILES} ${LANG_DIRS})
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${QM_FILES})

if (UNIX AND NOT APPLE)
Expand Down

0 comments on commit c880eb8

Please sign in to comment.