From 12af2572e2feea075e2b624705a6eea368976198 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sun, 31 May 2020 14:41:59 +0100 Subject: [PATCH] Avoid duplicate resources and ensure generic Qt UI l10n loaded --- CMakeLists.txt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b95c09f54..bf37768a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1094,7 +1094,7 @@ add_custom_target (ctags COMMAND ${CTAGS} -o ${CMAKE_SOURCE_DIR}/tags -R ${sourc add_custom_target (etags COMMAND ${ETAGS} -o ${CMAKE_SOURCE_DIR}/TAGS -R ${sources}) -# Qt i18n +# Qt i18n - always include the country generic if any regional variant is included set (LANGUAGES en # English (we need this to stop # translation loaders loading the @@ -1108,13 +1108,11 @@ set (LANGUAGES zh_HK # Chinese per Hong Kong ) foreach (lang_ ${LANGUAGES}) - file (TO_NATIVE_PATH translations/wsjtx_${lang_}.ts ts_) - list (APPEND TS_FILES ${ts_}) - set (qt_translations_ "${QT_TRANSLATIONS_DIR}/qtbase_${lang_}.qm") - if (NOT EXISTS "${qt_translations_}") - string (REGEX REPLACE "([a-z][a-z])_[A-Z][A-Z]" "\\1" lang_ ${lang_}) - set (qt_translations_ "${QT_TRANSLATIONS_DIR}/qtbase_${lang_}.qm") + file (TO_NATIVE_PATH ${CMAKE_SOURCE_DIR}/translations/wsjtx_${lang_}.ts ts_) + if (EXISTS "${ts_}") + list (APPEND TS_FILES ${ts_}) endif () + set (qt_translations_ "${QT_TRANSLATIONS_DIR}/qtbase_${lang_}.qm") if (EXISTS "${qt_translations_}") add_custom_command ( OUTPUT "${CMAKE_BINARY_DIR}/qt_${lang_}.qm"