Wednesday, August 27, 2014

Using a US layout keyboard to type in PT-BR (Portuguese Brazil) in Xubuntu

Since Xubuntu 14, when using the US layout with dead keys, pressing acute accent (') and then c results in ć instead of the expected ç when writing in PT-BR. There are two solutions for this:
1. Use alt-gr + , (which is inconvenient)
2. Do the workaround below

I can't remember who originally wrote this, I believe it was someone in the Ubuntu bug tracker.

"1) Editing the files:

for 64 bits:
sudo gedit /usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache
sudo gedit /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache

for 32 bits:
sudo gedit /usr/lib/i386-linux-gnu/gtk-2.0/2.10.0/immodules.cache

changing the line

"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa"

to

"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa:en"

2) replacing "ć" to "ç" and "Ć" to "Ç" on /usr/share/X11/locale/en_US.UTF-8/Compose

sudo cp /usr/share/X11/locale/en_US.UTF-8/Compose /usr/share/X11/locale/en_US.UTF-8/Compose.bak
sed 's/ć/ç/g' < /usr/share/X11/locale/en_US.UTF-8/Compose | sed 's/Ć/Ç/g' > Compose
sudo mv Compose /usr/share/X11/locale/en_US.UTF-8/Compose

3) add two lines on /etc/environment

GTK_IM_MODULE=cedilla
QT_IM_MODULE=cedilla

4)restart your computer"

No comments:

Post a Comment