summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/opengl/main.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2022-07-29 11:38:56 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2022-08-10 23:21:55 +0200
commitb779b8062cdeef5f2ac33c9164b5846780cfd495 (patch)
tree0e3c9cb5790a5aa1fcc7a84ea0f052bd5bf5088b /tests/benchmarks/opengl/main.cpp
parentc4fabe37b9a97a189b02de4e72d040009892ad08 (diff)
QTranslator: generalize a UNIX-only path
QTranslator builds a list of "candidate" names in order to find out the translation file to load. Part of the name comes from the UI languages, as determined by the QLocale object passed to load() (via QLocale::uiLanguages()). On UNIX this list of languages is processed by adding a lowercase version of each language. In other words, if the list is something like: {"en-Latn-US", "en-US", "en"} then it is changed to contain: {"en-Latn-US", "en-latn-us", "en-US", "en-us", "en"} (The last element is not needlessly duplicated, since it's already fully lowercase.) I am not sure why this is done only on UNIX: the commit introducing this behavior predates public history. If I have to take a guess, it's done because the language is then used to assemble a file name that QTranslator tries to open. On UNIX file names are case sensitive, so if the translation file is called "translations_en_us.qm" it would fail to load under a "en-US" locale (the "-" -> "_" processing is done later). But what about Windows? In principle, turning the names in lowercase is not necessary as Windows' filesystem is case insensitive; a translation file called "translations_en_us.qm" will still be loaded if opened as "translations_en_US.qm"... ... *except* if the file is in the resource system! In that case, filesystem access is still case sensitive, and will fail to load the translation file (which instead would load just fine on UNIX). Plug this silly cross-platform difference by also lowercasing on Windows. Change-Id: I2573721e33d9da08f60a5bb56e35e4553cbe4efe Pick-to: 5.15 6.2 6.3 6.4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'tests/benchmarks/opengl/main.cpp')
0 files changed, 0 insertions, 0 deletions