From 7dfee3ffc5129307217eb949698c5088a4561642 Mon Sep 17 00:00:00 2001 From: Mike FABIAN Date: Mon, 4 Jun 2012 09:50:07 +0200 Subject: 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 --- src/corelib/tools/qlocale_unix.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/corelib/tools/qlocale_unix.cpp') 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()); case LocaleChanged: Q_ASSERT(false); - case LanguageId: - return lc_messages.language(); default: break; } -- cgit v1.2.3