I'm Brazilian but when I installed Debian on my machine I set the language to English (US). I prefer to keep my menus and error messages in English because they are more googable (and the translations aren't always the best...). Anyway, this had the unfortunate consequence of making it annoying to write text in Portuguese because in the en_US
locale (with a "US international with dead keys" keyboard layout) typing '+c results in a Ć
instead of the Ç
that I want. Is there a way to make my "typing locale" be PT_BR while still keeping all my menus in English and the US keyboard layout with dead keys?

- 829,060

- 5,747
- 4
- 39
- 54
2 Answers
The way to change the dead keys without changing the keyboard layout is to set the LC_CTYPE
environment variable to pt_BR.utf8
. I did this by adding the following line to my .profile
.
export LC_CTYPE='pt_BR.utf8'
There are also other LC_
variables that you can set if you want. The locale
command shows a list of them, this page describes what they do and locale -a
says what locales are currently available in the system.
That said, in order for this to work, both the en_US.utf8
and pt_BR.utf8
locales need to be installed in the system. To make sure this is the case, run
sudo dpkg-reconfigure locales
In the first screen, it will ask what locales you want to generate for the system (so select both en_US.utf8
and pt_BR.utf8
) and in the second screen it asks what should be the default system language (choose English).

- 5,747
- 4
- 39
- 54
You can do it:
dpkg-reconfigure locales

- 10,850
-
What does this command do? I don't want to change everything, just how my keyboard input is treated... – hugomg Dec 24 '14 at 00:40
-
You can copy/paste from here, It reconfigure locales package, when you reconfiure it, you can add or remove other locales and "set your default locale", you need to set default locale. – PersianGulf Dec 24 '14 at 00:44
-
but if I change my default locale to pt_BR its also going to make all my menus appear in Portuguese isn't it? I don't want that. – hugomg Dec 24 '14 at 01:13
-
No, when you change your locale change everything, But you can have keyboard layout and some other.... – PersianGulf Dec 24 '14 at 01:15
LC_CTYPE
doesn't affect the keyboard layout. – Gilles 'SO- stop being evil' Dec 24 '14 at 20:03locale
, everything is set to english except LC_CTYPE – hugomg Dec 24 '14 at 20:30LANG
andLANGUAGE
is not necessary and has the nasty side effect of settingLC_COLLATE
. Just setLC_CTYPE
topt_BR.utf8
in~/.profile
or~/.pam_environment
. – Gilles 'SO- stop being evil' Dec 24 '14 at 20:38en_US.utf8
- should they have beenC
instead? (Is this what choosing "none" as the language in dpkg-reconfigure does? Does this make my menus appear in english?) – hugomg Dec 24 '14 at 20:47C
), and setLC_CTYPE
(theutf8
part is the most important; the part ofLC_CTYPE
before the.
only affects a few programs, one of which is the input method you're using where it affects dead keys). – Gilles 'SO- stop being evil' Dec 24 '14 at 20:52