Ubuntu

QT incorrectly determines the default locale from the LC_* variables

Reported by Captain Chaos on 2012-01-19
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Qt
Fix Released
Undecided
Unassigned
qt4-x11 (Ubuntu)
Undecided
Unassigned

Bug Description

QT 4.7, included in Ubuntu Oneiric Ocelot, incorrectly determines the default locale, causing QT-based programs to use the wrong language for the user interface, among other things.

There is already a bug report for this in QT: https://bugreports.qt.nokia.com/browse/QTBUG-1313. According to that report the bug has been fixed in version 4.8. Is it possible to either upgrade QT to 4.8, or backport that fix?

The problem appears to be that QT incorrectly uses the LC_NUMERIC variable to determine the default locale (when it should only determine the number format to use), and ignores the LANG variable. My locale settings are as follows:

LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE=nl_NL.UTF-8
LC_NUMERIC=nl_NL.UTF-8
LC_TIME=nl_NL.UTF-8
LC_COLLATE=nl_NL.UTF-8
LC_MONETARY=nl_NL.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=nl_NL.UTF-8
LC_NAME=nl_NL.UTF-8
LC_ADDRESS=nl_NL.UTF-8
LC_TELEPHONE=nl_NL.UTF-8
LC_MEASUREMENT=nl_NL.UTF-8
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

And yet QT based programs (in contrast with all other programs on my computer) use Dutch for the user interface, when they should be using English as indicated by the LANG variable. Setting LC_ALL causes them to use English, but that is not an acceptable solution since LC_ALL overrides all the other LC_* variables.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: libqtcore4 4:4.7.4-0ubuntu8
ProcVersionSignature: Ubuntu 3.0.0-14.23-generic 3.0.9
Uname: Linux 3.0.0-14-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Thu Jan 19 16:50:29 2012
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
SourcePackage: qt4-x11
UpgradeStatus: Upgraded to oneiric on 2011-11-23 (57 days ago)

Captain Chaos (launchpad-chaos) wrote :
Captain Chaos (launchpad-chaos) wrote :

Fixed in version 4.8.0

Changed in qt:
status: New → Fix Released
description: updated
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qt4-x11 (Ubuntu):
status: New → Confirmed
wvengen (wvengen) wrote :

Still a problem for me in Ubuntu Raring (13.04). E.g. with qtconfig-qt4 (4:4.8.4+dfsg-0ubuntu9) using libqtcore4 (4:4.8.4+dfsg-0ubuntu9):
  $ LC_NUMERIC=C qtconfig-qt4 # shows English UI
  $ LC_NUMERIC=pl qtconfig-qt4 # shows Polish UI

Some applications work correctly; Lyx, for example, does language selection based on $LANGUAGE.

tags: added: raring
Alexandre BELLONI (abelloni) wrote :

Got the same issue in 13.10

Alexandre BELLONI (abelloni) wrote :

I had a closer look, this has been finally fixed in 4.8.5. Do you mind backporting https://qt.gitorious.org/qt/qt/commit/e5205aa247 ?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers