From b4fb55db3939219e976d53c32b42bf28acaa41b1 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 30 Sep 2011 14:01:37 +0300 Subject: Symbian: Parse ts filenames case-insensitively for localize_deployment A lot of platform applications have all-lowercase translation files due to file naming policies. This makes no difference for runtime translation, so removed unnecessary case sensitivity when parsing ts filenames for localization deployment. Task-number: QT-5305 Reviewed-by: Sami Merila --- mkspecs/common/symbian/symbian.conf | 13 ++++---- mkspecs/features/symbian/localize_deployment.prf | 38 ++++++++++++------------ qmake/generators/symbian/symbiancommon.cpp | 1 + 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 61a6228..c50dc77 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -151,11 +151,11 @@ SYMBIAN_SUPPORTED_LANGUAGES = \ mr mo mn nb pl pt pa ro ru sr \ si sk sl so es sw sv tl ta te \ th bo ti tr tk uk ur vi cy zu \ - nn eu zh gl fa st en_US fr_BE \ - pt_BR en_CA fr_CA el_CY tr_CY \ - en_TW en_HK en_CN en_JP en_TH \ - sv_FI zh_HK es_419 en_ZA fr_CH \ - de_CH it_CH zh_TW + nn eu zh gl fa st en_us fr_be \ + pt_br en_ca fr_ca el_cy tr_cy \ + en_tw en_hk en_cn en_jp en_th \ + sv_fi zh_hk es_419 en_za fr_ch \ + de_ch it_ch zh_tw # These directories must match what configure uses for QT_INSTALL_PLUGINS and QT_INSTALL_IMPORTS QT_PLUGINS_BASE_DIR = /resource/qt$${QT_LIBINFIX}/plugins @@ -251,7 +251,8 @@ defineTest(matchSymbianLanguages) { # Cannot parse .ts file for language here, so detect it from filename. # Allow two and three character language and country codes. for(translation, TRANSLATIONS) { - language = $$replace(translation, "^(.*/)?[^/]+_(([^_]{2,3}_)?[^_]{2,3})\\.ts$", \\2) + low_translation = $$lower($$translation) + language = $$replace(low_translation, "^(.*/)?[^/]+_(([^_]{2,3}_)?[^_]{2,3})\\.ts$", \\2) !contains(HANDLED_LANGUAGES, $$language) { HANDLED_LANGUAGES += $$language # Make sure translation path is absolute or shadow builds will not work diff --git a/mkspecs/features/symbian/localize_deployment.prf b/mkspecs/features/symbian/localize_deployment.prf index 185c713..3e7f585 100644 --- a/mkspecs/features/symbian/localize_deployment.prf +++ b/mkspecs/features/symbian/localize_deployment.prf @@ -76,26 +76,26 @@ SYMBIAN_LANG.cy = 97 #Welsh SYMBIAN_LANG.zu = 98 #Zulu # Regional dialects -SYMBIAN_LANG.en_US = 10 #American English -SYMBIAN_LANG.fr_BE = 21 #Belgian French -SYMBIAN_LANG.pt_BR = 76 #Brazilian Portuguese -SYMBIAN_LANG.en_CA = 46 #Canadian English -SYMBIAN_LANG.fr_CA = 51 #Canadian French -SYMBIAN_LANG.el_CY = 55 #Cyprus Greek -SYMBIAN_LANG.tr_CY = 91 #Cyprus Turkish -SYMBIAN_LANG.en_TW = 157 #English as appropriate for use in Taiwan -SYMBIAN_LANG.en_HK = 158 #English as appropriate for use in Hong Kong -SYMBIAN_LANG.en_CN = 159 #English as appropriate for use in the Peoples Republic of China -SYMBIAN_LANG.en_JP = 160 #English as appropriate for use in Japan -SYMBIAN_LANG.en_TH = 161 #English as appropriate for use in Thailand -SYMBIAN_LANG.sv_FI = 85 #Finland Swedish -SYMBIAN_LANG.zh_HK = 30 #HongKong Chinese +SYMBIAN_LANG.en_us = 10 #American English +SYMBIAN_LANG.fr_be = 21 #Belgian French +SYMBIAN_LANG.pt_br = 76 #Brazilian Portuguese +SYMBIAN_LANG.en_ca = 46 #Canadian English +SYMBIAN_LANG.fr_ca = 51 #Canadian French +SYMBIAN_LANG.el_cy = 55 #Cyprus Greek +SYMBIAN_LANG.tr_cy = 91 #Cyprus Turkish +SYMBIAN_LANG.en_tw = 157 #English as appropriate for use in Taiwan +SYMBIAN_LANG.en_hk = 158 #English as appropriate for use in Hong Kong +SYMBIAN_LANG.en_cn = 159 #English as appropriate for use in the Peoples Republic of China +SYMBIAN_LANG.en_jp = 160 #English as appropriate for use in Japan +SYMBIAN_LANG.en_th = 161 #English as appropriate for use in Thailand +SYMBIAN_LANG.sv_fi = 85 #Finland Swedish +SYMBIAN_LANG.zh_hk = 30 #HongKong Chinese SYMBIAN_LANG.es_419 = 83 #Latin American Spanish -SYMBIAN_LANG.en_ZA = 48 #South African English -SYMBIAN_LANG.fr_CH = 11 #Swiss French -SYMBIAN_LANG.de_CH = 12 #Swiss German -SYMBIAN_LANG.it_CH = 61 #Swiss Italian -SYMBIAN_LANG.zh_TW = 29 #Taiwan Chinese +SYMBIAN_LANG.en_za = 48 #South African English +SYMBIAN_LANG.fr_ch = 11 #Swiss French +SYMBIAN_LANG.de_ch = 12 #Swiss German +SYMBIAN_LANG.it_ch = 61 #Swiss Italian +SYMBIAN_LANG.zh_tw = 29 #Taiwan Chinese isEmpty(SYMBIAN_MATCHED_LANGUAGES) { matchSymbianLanguages() diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index 2c4373a..8db82d6 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -850,6 +850,7 @@ void SymbianCommonGenerator::parseTsFiles(SymbianLocalizationList *symbianLocali foreach (QString file, symbianTsFiles) { QRegExp matcher(matchStr); + matcher.setCaseSensitivity(Qt::CaseInsensitive); if (matcher.exactMatch(file) && parseTsContent(file, &loc)) break; } -- cgit v0.12