Use the environment variable LANG to determine interface language.

Bug #304132 reported by Usplash Smooth
6
Affects Status Importance Assigned to Milestone
Phatch
Fix Released
Medium
Stani
Debian
Fix Released
Unknown

Bug Description

Here I use Ubuntu written in English, but I want most of my programs to behave with Brazillian Portuguese
characteristics, so I have set the LC_* variables appropriately.

But currently, Phatch is using the LC_CTYPE to determine the Phatch Actions language. And as such, everything
in Phatch Actions wrongly appears in Portuguese for me, while the rest of the interface is correctly in English.

My LC_* environment variable are as follows:

LANG="en_US.UTF-8"

LC_CTYPE="pt_BR.UTF8"
LC_COLLATE="pt_BR.UTF8"
LC_NUMERIC="pt_BR.UTF8"
LC_MONETARY="pt_BR.UTF8"
LC_PAPER="pt_BR.UTF8"
LC_NAME="pt_BR.UTF8"
LC_ADDRESS="pt_BR.UTF8"
LC_TELEPHONE="pt_BR.UTF8"
LC_MEASUREMENT="pt_BR.UTF8"

From 'man locale' and from the specification in:
http://opengroup.org/onlinepubs/007908799/xbd/envvar.html

LANG
    This variable determines the locale category for native language, local customs and coded character set in the absence of the LC_ALL and other LC_* (LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, LC_TIME) environment variables. This can be used by applications to determine the language to use for error messages and instructions, collating sequences, date formats, and so forth.

LC_ALL
    This variable determines the values for all locale categories. The value of the LC_ALL environment variable has precedence over any of the other environment variables starting with LC_ (LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, LC_TIME) and the LANG environment variable.

LC_CTYPE
    This variable determines the locale category for character handling functions, such as tolower(), toupper() and isalpha(). This environment variable determines the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters), the classification of characters (for example, alpha, digit, graph) and the behaviour of character classes. Additional semantics of this variable, if any, are implementation-dependent.

Phatch is using LC_CTYPE to determine the language to use fot Phatch Actions, and this is improper.
Please use the appropriate LC_ALL variable, with a fallback to the LANG variable, so that is conforms
to the standard and works as expected!

A screenshot is attached.

Phatch is the only program in my system that presents this behaviour.
Using Phatch version 0.1.5, in Ubuntu Intrepid 64-bit.
Thank you a lot.

Revision history for this message
Usplash Smooth (usplash-smooth-deactivatedaccount) wrote :
Revision history for this message
Stani (stani) wrote :

Thanks for reporting this bug. I'll tackle this bug on my next round of bug fixing. In the meantime, you can start Phatch with:

phatch -l en

When I've done the fix, I hope you are around to confirm my solution.

Changed in phatch:
assignee: nobody → stani
importance: Undecided → Low
Revision history for this message
Stani (stani) wrote :

In the meantime this bug got also reported on Debian. Pochu was so nice to inspect this bug and to provide a patch. Thanks! Usplash Smooth, can you apply this patch or test phatch with the latest version of bzr:
$ bzr branch lp:phatch
$ cd phatch
$ python phatch.py

Changed in phatch:
importance: Low → Medium
status: New → Fix Committed
Revision history for this message
Marcus Sundman (sundman) wrote :

Which version is the fix supposed to be in? At least the current version, 0.1.6-1, in jaunty still shows the same bug.

Revision history for this message
Stani (stani) wrote :

@Marcus:
https://bugs.launchpad.net/phatch/+bug/304132/comments/3

This version is not included in Jaunty, but will be in Jaunty+1. However it will become available in my PPA shortly after Jaunty is released.

Stani (stani)
Changed in phatch:
milestone: none → 0.2.1
status: Fix Committed → Fix Released
Changed in debian:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.