Fix translation handling.

Use "i18n" instead of "translations" as subdirectory.
Expect "i18n" being a directory.
This commit is contained in:
Christian Hohnstaedt 2021-05-20 20:45:35 +02:00 committed by Christian Hohnstädt
parent e066619a08
commit f5f6b57df4
2 changed files with 8 additions and 2 deletions

View File

@ -69,6 +69,9 @@ lang/xca_hr.ts lang/xca_pt_BR.ts
lang/xca_it.ts lang/xca_ru.ts
)
qt5_add_translation(QM_FILES ${TS_FILES})
set_source_files_properties(${TS_FILES}
PROPERTIES MACOSX_PACKAGE_LOCATION Resources/i18n
)
add_custom_target(translations DEPENDS ${QM_FILES})
add_dependencies(${CMAKE_PROJECT_NAME} translations)
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${QM_FILES})
@ -179,9 +182,12 @@ if (WIN32)
endif (WIN32)
if (UNIX AND NOT APPLE)
install(FILES ${QM_FILES} ${TEXT_FILES} ${XCA_TEMPLATES}
install(FILES ${TEXT_FILES} ${XCA_TEMPLATES}
DESTINATION ${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}
)
install(FILES ${QM_FILES}
DESTINATION ${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}/i18n
)
install(FILES misc/xca.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
)

View File

@ -271,7 +271,7 @@ const QString getUserSettingsDir()
const QString getI18nDir()
{
return QStandardPaths::locate(QStandardPaths::DataLocation,
"translations");
"i18n", QStandardPaths::LocateDirectory);
}
void migrateOldPaths()