diff options
author | Mike FABIAN <maiku.fabian@gmail.com> | 2012-06-04 09:50:07 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-06 15:29:34 +0200 |
commit | 7dfee3ffc5129307217eb949698c5088a4561642 (patch) | |
tree | b4cb26749d134f910bee5e8ad27c2ca76b024bf1 /src/corelib/tools/qlocale_unix.cpp | |
parent | 66a0b8446dbd4d77e117353c9a55630249eccf7e (diff) |
Use LC_MESSAGES instead of LC_NUMERIC in QSystemLocale::fallbackLocale()
commit b9790a04eeba664ecdf9ace24911094a71b5f0bd
(https://codereview.qt-project.org/24304) introduced the problem that
the country gets initialized from LC_NUMERIC and the language from
LC_MESSAGES. For example, if LC_NUMERIC=ru_RU and LC_MESSAGE=fr_FR,
then QLocale::system().name() returns "fr_RU". It is not nice to mix
the values of two LC_ variables there. Therefore, revert this change
and use LC_MESSAGES instead of LC_NUMERIC in
QSystemLocale::fallbackLocale(). This was also suggested in the
changelog of b9790a04 and it looks like a better way to fix the
problem.
Change-Id: I8fa6fec2b33e9f1f5a31c4b288503a658dad6d30
Reviewed-by: Denis Dzyubenko
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/tools/qlocale_unix.cpp')
-rw-r--r-- | src/corelib/tools/qlocale_unix.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/corelib/tools/qlocale_unix.cpp b/src/corelib/tools/qlocale_unix.cpp index b4a560b718..3602319f67 100644 --- a/src/corelib/tools/qlocale_unix.cpp +++ b/src/corelib/tools/qlocale_unix.cpp @@ -114,7 +114,7 @@ QLocale QSystemLocale::fallbackLocale() const { QByteArray lang = qgetenv("LC_ALL"); if (lang.isEmpty()) - lang = qgetenv("LC_NUMERIC"); + lang = qgetenv("LC_MESSAGES"); if (lang.isEmpty()) lang = qgetenv("LANG"); return QLocale(QString::fromLatin1(lang)); @@ -242,8 +242,6 @@ QVariant QSystemLocale::query(QueryType type, QVariant in) const return lc_messages.createSeparatedList(in.value<QStringList>()); case LocaleChanged: Q_ASSERT(false); - case LanguageId: - return lc_messages.language(); default: break; } |