You are not logged in.

#1 2012-04-16 08:54:36

instant
Member
Registered: 2011-02-12
Posts: 17

language in Qt applications

Ok, this has been bothering me for an eternity now: The localization for some Qt applications seems completely broken.

My main OS language is set to english. But as I want to have stuff like the time, currency, keyboard layout, measurement and so on in european, metric or whatever format, I naturally set my locales to the according values.

But for some reason, Qt seems to thing that my LC_NUMERIC corresponds to the language I want to use for f*'s sake. Am I missing something really obvious? I can't find anything useful by googling, so you guys are my last hope.

Even more strangely, the language depends on wether I start the application via a gnome shell icon or via command-line.

I would enormously appreciate any hints or help you guys can provide. Here's what locale spits out (settings are written in my .bashrc):

LANG=C
LC_CTYPE=en_US.utf8
LC_NUMERIC=fr_CH.utf8
LC_TIME=en_DK.utf8
LC_COLLATE=C
LC_MONETARY=fr_LU.utf8@euro
LC_MESSAGES=en_GB.utf8
LC_PAPER=fr_CH.utf8
LC_NAME=fr_CH.utf8
LC_ADDRESS=fr_CH.utf8
LC_TELEPHONE=fr_CH.utf8
LC_MEASUREMENT=fr_CH.utf8
LC_IDENTIFICATION=fr_CH.utf8
LC_ALL=

In gnome-shell my language is set to British English but under Formats, the region is set to Germany.

Starting via command-line, smplayer or minitube etc are in french, starting via gnome they are in german.

Offline

#2 2012-04-16 09:21:43

ludwis
Member
Registered: 2011-01-17
Posts: 29

Re: language in Qt applications

Post the output of

locale

and

locale -a

command. Also, have you tried setting these settings system-wide?

Last edited by ludwis (2012-04-16 09:29:21)

Offline

#3 2012-04-16 12:39:15

instant
Member
Registered: 2011-02-12
Posts: 17

Re: language in Qt applications

locale is the one above. locale -a is

C
POSIX
de_DE.utf8@euro
de_LU.utf8@euro
en_DK.utf8
en_GB.utf8
en_US.utf8
fr_CH.utf8
fr_LU.utf8@euro

And nah, no system-wide settings, everything is C there, so it shouldn't be a problem.

Offline

#4 2012-04-16 13:57:46

ludwis
Member
Registered: 2011-01-17
Posts: 29

Re: language in Qt applications

It's a long shot, but from what you write I assume you are running gnome, and using gdm to manage session. If so, then have a look at this piece of code:

# Overwrite $LANG from /etc/profile (and friends) with the one picked in the
# greeter
if [ -n "$GDM_LANG" ]; then
  LANG="$GDM_LANG"
  export LANG
fi

It is taken from /etc/gdm/Xsession file. If you are indeed using gdm, then it can be the source of your problems.  You can try to comment it out or use xdm instead.

Offline

#5 2012-04-17 08:41:30

instant
Member
Registered: 2011-02-12
Posts: 17

Re: language in Qt applications

Thanks for the suggestion. I just tried that and it didn't make a difference. The problem is that my language is set to english while the faulty apps are either in german or in french. So it's a complete mess.

It really seems to me that LC_NUMERIC decides the interface language which is so utterly bollocks that I can't even get my head around it...

any further suggestions would be dearly appreciated

Offline

#6 2012-04-17 10:09:29

ludwis
Member
Registered: 2011-01-17
Posts: 29

Re: language in Qt applications

Have you tried running these apps from a different de/wm? It would help us narrow the cause of the problem. I'm still uncertain wheather it's a problem with qt itself or with gnome. I used to run gnome 2 and 3 with two language setup, and never experienced such problems. Maybe you could force qt apps to use a certain locales setup. From what I remember there is a file .kde4/share/config/kdeglobals in home dir where you can set language settings. You must use google, because I don't remember how to setup it.

Offline

#7 2012-04-18 07:29:25

instant
Member
Registered: 2011-02-12
Posts: 17

Re: language in Qt applications

Yes, same thing happens in Openbox, although it just switches to french, not both. Setting anything in "systemsettings" (the KDE control panel) doesn't help, so I'm pretty sure it's a qt thing, especially since the more mature KDE apps don't suffer from it.

Thanks anyway for your effort.

PS: I'm an idiot, since I could've made the explanation simpler from the start: if I start an app like this: "LC_NUMERIC=en.US smplayer", everything is fine. So what the hell?

PPS: And I finally found that bug report again: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=600213

Last edited by instant (2012-04-18 07:36:02)

Offline

#8 2012-04-18 10:41:38

ludwis
Member
Registered: 2011-01-17
Posts: 29

Re: language in Qt applications

I'd like to reproduce this bug on my machine. What apps are we talking about? As I understand it, you have problems with specific apps only, right?

Offline

#9 2012-04-19 00:16:32

instant
Member
Registered: 2011-02-12
Posts: 17

Re: language in Qt applications

Yes. smplayer, qjackctl and minitube come to mind. Rkward is fine, krename and akregator as well. Some are more of a mess like qsynth, the messages are broken while the menu is in english. I once watched minitube change the interface language during runtime.

I don't use a lot of other qt apps, I hope this helps somewhat.

Offline

#10 2012-04-19 12:40:31

ludwis
Member
Registered: 2011-01-17
Posts: 29

Re: language in Qt applications

I reproduced this behaviour. Please try putting your settings into .profile file instead of .bashrc. That solved it for me smile

Offline

#11 2012-04-19 13:40:36

instant
Member
Registered: 2011-02-12
Posts: 17

Re: language in Qt applications

I really appreciate your effort, thanks.

Setting my locales in .profile didn't change anything for me.

Offline

#12 2012-04-19 15:22:12

ludwis
Member
Registered: 2011-01-17
Posts: 29

Re: language in Qt applications

There is another file, called .dmrc. You can give it a shot. And I also found this bug report. I think what they write there is logical and can be of use to you.

Offline

Board footer

Powered by FluxBB