diff options
-rw-r--r-- | modules/ECMCreateQmFromPoFiles.cmake | 7 | ||||
-rw-r--r-- | modules/ECMQmLoader.cpp.in | 3 |
2 files changed, 3 insertions, 7 deletions
diff --git a/modules/ECMCreateQmFromPoFiles.cmake b/modules/ECMCreateQmFromPoFiles.cmake index b383311a..f24090b7 100644 --- a/modules/ECMCreateQmFromPoFiles.cmake +++ b/modules/ECMCreateQmFromPoFiles.cmake @@ -57,11 +57,8 @@ function(_ecm_qm_create_target po_dir pot_name data_install_dir data_install_sub file(GLOB po_files "${po_dir}/*.po") foreach (it ${po_files}) - # PO files are foo-en_GB.po not foo_en_GB.po like Qt expects. Get a - # proper filename. - get_filename_component(it ${it} ABSOLUTE) - get_filename_component(file_with_dash ${it} NAME_WE) - string(REPLACE "-" "_" filename_base "${file_with_dash}") + get_filename_component(filename_base ${it} ABSOLUTE) + get_filename_component(filename_base ${it} NAME_WE) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set(tsfile ${CMAKE_CURRENT_BINARY_DIR}/${filename_base}.ts) diff --git a/modules/ECMQmLoader.cpp.in b/modules/ECMQmLoader.cpp.in index 92c0d07a..4fd9c116 100644 --- a/modules/ECMQmLoader.cpp.in +++ b/modules/ECMQmLoader.cpp.in @@ -13,10 +13,9 @@ static QTranslator *createTranslator() QString installSubDir = QStringLiteral("@data_install_sub_dir@"); QString qmName = QStringLiteral("@qm_name@"); - QString lang = QLocale::system().name(); QString dir = QStandardPaths::locate(QStandardPaths::GenericDataLocation, installSubDir, QStandardPaths::LocateDirectory); QTranslator *translator = new QTranslator(QCoreApplication::instance()); - translator->load(qmName + QStringLiteral("_") + lang, dir); + translator->load(QLocale::system(), qmName, QStringLiteral("-") /* prefix */, dir); return translator; } |