From ddd33b850bb519174511a34eeda40af69a1f7144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Tue, 1 Apr 2014 15:14:10 +0200 Subject: Do not replace "-" with "_" in .po files This causes problem with .po files whose name contains "-". A nice side effect of this approach is we pass a QLocale to QTranslator, which means it will try to load translations for all "ui languages" [1] instead of just the one returned by QLocale::name(). [1]: http://doc-snapshot.qt-project.org/qt5-stable/qlocale.html#uiLanguages REVIEW: 117296 --- modules/ECMCreateQmFromPoFiles.cmake | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'modules/ECMCreateQmFromPoFiles.cmake') 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) -- cgit v1.2.1