Search:  
Gentoo Wiki

TIP_Speak_Your_Language

Image:Gentoo_tux.png

Base Install

  1. What is Gentoo?
  2. About
  3. Preparation
  4. Partitioning
  5. Configuring
  6. Stage Progression
  7. Kernel
  8. Bootloader
  9. Test
  10. Converting from or to a non-Gentoo distribution
  11. Troubleshooting
  12. Maintaining

Configuration

Base Extras

Server

Desktop

Other Articles

edit


Contents

Console

You need to edit two files, /etc/conf.d/keymaps and /etc/conf.d/consolefont.

KEYMAP configures your keyboard, CONSOLEFONT makes sure local chars are displayed correctly.

Language /etc/conf.d/keymaps /etc/conf.d/consolefont Notes
Belgian KEYMAP="be-latin1" CONSOLEFONT="lat9w-16"
Brazilian Portuguese KEYMAP="br-abnt2" CONSOLEFONT="lat9w-16"
Canadian French KEYMAP="cf" CONSOLEFONT="default8x16", or

CONSOLETRANSLATION="8859-1_to_uni"

Czech KEYMAP="cz" CONSOLEFONT="lat2-16"
Danish KEYMAP="dk-latin1" CONSOLEFONT="lat0-16"
Finnish KEYMAP="fi-latin1" CONSOLEFONT="lat0-16"
French KEYMAP="fr-latin9" CONSOLEFONT="lat0-16"
German KEYMAP="de-latin1" CONSOLEFONT="lat0-16", or CONSOLEFONT="lat9w-16" (please be aware of a possible problem with ncurses on certain systems).
Greek KEYMAP="-u gr" CONSOLEFONT="iso07u-16" CONSOLETRANSLATION="8859-7_to_uni" and DUMPKEYS_CHARSET="iso-8859-7". Configuration is for UTF-8
Hebrew KEYMAP="il", "il-heb", or "il-phonetic"

DUMPKEYS_CHARSET="iso-8859-8"

CONSOLEFONT="iso08.08"

CONSOLETRANSLATION="8859-8_to_uni"

Hungarian KEYMAP="hu101", or "hu" CONSOLEFONT="lat2-16"

CONSOLETRANSLATION="8859-2_to_uni"

Icelandic KEYMAP="is-latin1" CONSOLEFONT="cp850-8x16"

CONSOLETRANSLATION="8859-1_to_uni"

Italian KEYMAP="it" CONSOLEFONT="default8x16"

CONSOLETRANSLATION="8859-15_to_uni"

Norwegian KEYMAP="no-latin1"note CONSOLEFONT="lat9w-16"
Polish KEYMAP="pl", or

KEYMAP="pl2" (former uses left-alt to insert special chars)

CONSOLEFONT="lat2-16"

CONSOLETRANSLATION="8859-2_to_uni"

If you want to have polish characters in manpages edit /etc/man.conf, and replace "-Tascii" with "-Tlatin1"
Portuguese KEYMAP="pt-latin1" CONSOLEFONT="lat0-16"
Romanian KEYMAP="ro_win" CONSOLEFONT="lat2-16"
Slovak KEYMAP="sk-qwertz" CONSOLEFONT="lat2-16"
Slovenian KEYMAP="slovene" CONSOLEFONT="lat2-16"
Spanish Si tienes un teclado con distribución latinoamericana he encontrado que ésta combinación funciona muy bien: KEYMAP="la-latin1". Para español de Castilla: KEYMAP="es euro2" CONSOLEFONT="lat0-16"
Swedish KEYMAP="sv-latin1" CONSOLEFONT="lat9-16" Many sites recommend lat0-16 as the Swedish consolefont. lat0-16 can display å, ä, and ö but can't display Å, Ä and Ö. lat9-16 displays all six.
Turkish KEYMAP="trq" CONSOLEFONT="iso09.16"
United Kingdom/British KEYMAP="uk" CONSOLEFONT="default8x16"

Issues

Norwegian keymap error

The Norwegian key setup file 'no-latin1.map' has an error. The 'DEL'-key is in fact a 'Backspace'.

FIX: Unpack no-latin1.map.gz:

 gunzip /usr/share/keymaps/i386/qwerty/no-latin1.map.gz

Insert a '#' in front of the line 'plain keycode 111 = Delete # "Remove" originally, weird...':

 nano -w /usr/share/keymaps/i386/qwerty/no-latin1.map

Gzip the file:

 gzip /usr/share/keymaps/i386/qwerty/no-latin1.map

Tips

A handy trick to switch between multiple keymaps on the fly, is to create aliases in a shell configuration file (such as ~/.bashrc if you use Bash).

File: ~/.bashrc
alias hu='loadkeys /usr/share/keymaps/i386/qwerty/hu101'
alias en='loadkeys /usr/share/keymaps/i386/qwerty/us'

You can then simply switch between your layouts by entering hu or en at the command prompt.

KDE

In /etc/make.conf use LINGUAS to choose what translations of KDE you want installed, then emerge kde-i18n.

echo LINGUAS=\"nb nn sv da pl pt_BR de es it tr\" >>/etc/make.conf
emerge kde-i18n

Turkish

Don't forget to select Konsole->Encoding->Turkish on KDE.

Hungarian

 Konsole: Settings->Encoding->"iso 8859-2"

For text editors where applicable, this encoding is to be set as a file open/save encoding (kwrite: Settings->Configure Editor...->Open/Save->Encoding).

For the ' ő ', ' ű ' characters in some graphical apps (eg. kwrite) to appear properly, an appropriate font selection is adequate (eg. Courier). Other fonts may result in rectangles to appear.

Tip! A good keyboard layout switching tool is Kxkb: emerge kxkb
Note: A fully satisfactory solution though is a complete migration to a Unicode/UTF-8 system.

X

To get the keyboard map in X11, edit /etc/X11/xorg.conf (you shouldn't be using /etc/X11/XF86Config unless you're still with XFree[1]). Find:

 Section "InputDevice"
   Identifier  "Keyboard0"

And add the relevant option from the table below to that section.

Language Lines to add
Belgian
  Option  "XkbLayout"     "be"
Brazilian
  Option  "XkbLayout"     "br-abnt2"
Canadian
  # As of Xorg version 7.0.0.  This setup replaces the old ca_enhanced and ca(fr).
  #Option  "XkbLayout"     "ca"    # For English
  #Option  "XkbVariant"    "fr"    # For French.
  Option  "XkbVariant"    "multi" # For the multilang variant
  # If your é key is the one left the main shift bar, the following may help
  # ensure that it is entered in one key-stroke.
  #Option "XkbModel" "pc105"
Czech
   Option "XkbLayout"     "cz"
  #Option "XkbLayout"     "cz_qwerty" # for QWERTY setting
Danish
  Option  "XkbLayout"     "dk"
French
  Option  "XkbLayout"     "fr"
German
  Option  "XkbLayout"     "de"
Greek
  Option  "XkbLayout"     "el"
Hebrew
  Option  "XkbLayout"     "he"
Hindi
(see also)
  Option  "XkbLayout"     "hi"
Hungarian
  Option   "XkbLayout"    "hu"
Icelandic
  Option  "XkbLayout"     "is"
Italian
  Option   "XkbLayout"    "it"
Japanese
(see also)
  Option   "XkbLayout"    "jp"
Norwegian
  Option   "XkbLayout"    "no"
Polish
  Option  "XkbLayout"     "pl"
Portuguese
  Option  "XkbLayout"     "pt"
Romanian
   Option "XkbLayout"     "ro"
Slovak
   Option "XkbLayout"     "sk"
Slovenian
   Option "XkbLayout"     "si"
Spanish
  Option  "XkbLayout"     "es" -> para teclado en español
  Option  "XkbLayout"     "la" -> para teclado latinoamericano
  Option  "XkbLayout"     "latam" -> para teclado latinoamericano con Xorg > 6.8.2
                                     (ahora "la" se usa para el idoma Lao )
Swedish
  Option  "XkbLayout"     "se"
Warning: The "se" layout is know for it's bugs, "fi" layout gives you the same features without the bugs.
Swiss
  Option  "XkbLayout"     "ch"
  # Choose either of the two:
  Option  "XkbVariant"     "de" # German
  Option  "XkbVariant"     "fr" # French
Turkish
  Option  "XkbLayout"     "tr"
United Kingdom/British
  Option  "XkbLayout"     "gb"
US international
  Option  "XkbLayout"     "us_intl"
Note: For me (brasilian, pt-br) the keyboard actually just worked fine with the Section "InputDevice" this way:
 Option      "XkbLayout" "br"
 Option      "XkbModel"  "abnt2" 


It worked much better to me than

 Option  "XkbLayout"     "br-abnt2"

did. With this option set Xorg did not recognized the "windows-key" (Mod4) of my keyboard and because of that I couldn't get my keyboard shortcuts on fluxbox.

Profiles

There are many nuances that depend on local standards so setting the locale to the appropriate value, you can access these easily. To see the current locale settings, run

locale

A description of some of these can (as you already know from reading the locale man page) be found in Section 8.2 of the IEEE Std 1003.1-2001.

Most users will only want to set the LANG variable. The LC_* variables can be used to tune application behaviour. LC_ALL shouldn't be set except for testing purposes.

An example of a tuned setup would be:

LANG=is_IS.utf8         # Icelandic default for everything
LC_MESSAGES=en_GB.utf8  # Messages are in British English
LC_PAPER=en_CA.utf8     # Canadian paper sizes are used.

Edit or create /etc/env.d/02locale and set the relevant variables there. After changing it, run

env-update && source /etc/profile
Language Lines to add
Belgian
 # To have the programs in english, but keeping the locale and font encoding belgian:
 LANG="fr_BE@euro"
 # or:
 # LANG="nl_BE@euro"
Brazilian
 LANG="pt_BR"
Canadian French
 LANG="fr_CA"
Catalan
 LANG="ca_ES@euro"
Czech
 LANG="cs_CZ"
Danish
 LANG="da_DK"
German
 LANG="de_DE@euro"
Greek
 LANG="el_GR.UTF-8"
 LC_ALL="el_GR.UTF-8"
Hebrew
 LANG="he_IL"
Hindi
 LANG="hi"
Hungarian
 LANG="hu_HU"
Icelandic
 LANG="is_IS"
Italian
 LANG="it_IT@euro"
French
 LANG="fr_FR@euro"
Norwegian
 # Bokmål:
 LANG="nb_NO;no_NO"
 # Nynorsk:
 LANG="nn_NO;no_NO"

Note: Most applications (including Gnome) don't seem to accept multiple languages (replacing it with C), so you might want to chop off the ";no_NO" part. This will make older applications (that doesn't know about nb and nn) use the C locale, though. Either way you lose. How nice.

Polish
 LANG="pl_PL"
Portuguese
 LANG="pt_PT@euro"
Romanian
 LANG="ro_RO"
Slovak
 LANG="sk_SK"
Slovenian
 LANG="sl_SI"
Spanish
 LANG="es_ES@euro"
Swedish
 LANG="sv_SE"
Turkish
 LANG="tr_TR"

This makes programs, if translated, speak your language (and display dates in the correct format, etc.).

Dictionary

Norwegian, Swedish, Danish, Icelandic, Dutch, Portuguese and Hebrew, German, Spanish, Hungarian, Polish, Dutch spelling dictionaries are in Portage:

emerge aspell-no aspell-sv ispell-sv aspell-da ispell-da
emerge aspell-is aspell-nl aspell-pl ispell-pl aspell-pt
emerge ispell-pt aspell-de aspell-es aspell-he aspell-cs

You probably also want to install English (aspell-en), German (aspell-de) and French (aspell-fr). There isn't an aspell-tr package for Turkish, but there is dev-java/zemberek library for Turkish spellcheck.

OpenOffice.org

OpenOffice.org uses the LINGUAS variable to detect which Language you want to install. Set this in /etc/make.conf. The first one that is supported is used.

For a list of LINGUAS settings available for your version of Open Office.org, run

emerge -pv openoffice

For information about which LINGUAS entry a language uses, see LocaleCatalog.pm for a large list of locales.

Additionally you can also install localized helpcontent. For this to work, download the correct helpcontent for your language from an OpenOffice.org-mirror (directory /contrib/helpcontent/ e.g. ) and put it in your /usr/portage/distfiles, the ebuild will use it automatically during the build.

Choose your language dictionary from myspell:

$ emerge -s myspell 
(quicker search with eix: $eix -sS myspell)

Install the dictionary of choice: eg myspell-en

$  sudo emerge -va app-dicts/myspell-en

Then select which dictionary you are using:

  emerge eselect-oodict
  eselect oodict show

to get:

$ OpenOffice.org configured dictionaries
 [1]   myspell
   Configured language codes from /usr/share/myspell:
     en

Open OpenOffice.org and write something to check the spellcheck.

XML config file

This file can be very useful for any program that configure locales.

File: /etc/locale.xml
<?xml version="1.0"?>
<!--
Distributed under the terms of the GNU General Public License v2
Jonas Melian <jonasmg@mail.berlios.de> 2005
-->
<!DOCTYPE locale[
	<!ELEMENT locale (country)+>
	<!ELEMENT country (name,time_zone+,language+,lang+,encoding,keymap+,xkeymap+)>
	<!ELEMENT name (#PCDATA)>
	<!ELEMENT time_zone (#PCDATA)>
	<!ELEMENT language (#PCDATA)>
	<!ELEMENT lang (#PCDATA)>
	<!ELEMENT encoding (#PCDATA)>
	<!ELEMENT keymap (#PCDATA)>
	<!ELEMENT xkeymap (#PCDATA)>
	
	<!ATTLIST country domain CDATA #REQUIRED>
	<!ATTLIST encoding type (latin1|latin2) "latin1">
]>

<locale>
	<country domain="BE">
		<name>Belgium</name>
		<time_zone>Europe/Brussels</time_zone>
		<language>Dutch</language>
		<language>French</language>
		<language>German</language>
		<lang>nl_BE</lang>
		<lang>fr_BE</lang>
		<lang>de_BE</lang>
		<encoding type="latin1"/>
		<keymap>be-latin1</keymap>
		<xkeymap>be</xkeymap>
	</country>
	<country domain="BR">
		<name>Brazil</name>
		<time_zone>Brazil/</time_zone>
		<language>Brazilian</language>
		<lang>pt_BR</lang>
		<encoding type="latin1"/>
		<keymap>br-latin1-abnt2</keymap>
		<keymap>br-latin1-us</keymap>
		<xkeymap>br</xkeymap>
	</country>
	<country domain="CA">
		<name>Canada</name>
		<time_zone>Canada/</time_zone>
		<language>Canadian French</language>
		<lang>fr_CA</lang>
		<encoding type="latin1"/>
		<keymap>cf</keymap>
		<xkeymap>ca_enhanced</xkeymap>
	</country>
	<country domain="CZ">
		<name>Czech Republic</name>
		<time_zone>Europe/Prague</time_zone>
		<language>Czech</language>
		<lang>cs_CZ</lang>
		<encoding type="latin2"/>
		<keymap>cz-lat2</keymap>
		<xkeymap>cz</xkeymap>
		<xkeymap>cz_qwerty</xkeymap>
	</country>
	<country domain="DE">
		<name>Germany</name>
		<time_zone>Europe/Berlin</time_zone>
		<language>German</language>
		<lang>de_DE</lang>
		<encoding type="latin1"/>
		<keymap>de-latin1</keymap>
		<xkeymap>de</xkeymap>
	</country>
	<country domain="DK">
		<name>Denmark</name>
		<time_zone>Europe/Copenhagen</time_zone>
		<language>Danish</language>
		<lang>da_DK</lang>
		<encoding type="latin1"/>
		<keymap>dk-latin1</keymap>
		<xkeymap>dk</xkeymap>
	</country>
	<country domain="ES">
		<name>Spain</name>
		<time_zone>Europe/Madrid</time_zone>
		<time_zone>Atlantic/Canary</time_zone>
		<language>Spanish</language>
		<language>Catalan</language>
		<lang>es_ES</lang>
		<lang>ca_ES</lang>
		<encoding type="latin1"/>
		<keymap>es euro2</keymap>
		<xkeymap>es</xkeymap>
	</country>
	<country domain="FI">
		<name>Finland</name>
		<time_zone>Europe/Helsinki</time_zone>
		<language>Finnish</language>
		<lang>fi_FI</lang>
		<encoding type="latin1"/>
		<keymap>fi-latin9</keymap>
		<xkeymap>fi</xkeymap>
	</country>
	<country domain="FR">
		<name>France</name>
		<time_zone>Europe/Paris</time_zone>
		<language>French</language>
		<lang>fr_FR</lang>
		<encoding type="latin1"/>
		<keymap>fr-latin9</keymap>
		<xkeymap>fr</xkeymap>
	</country>
	<country domain="HU">
		<name>Hungary</name>
		<time_zone>Europe/Budapest</time_zone>
		<language>Hungarian</language>
		<lang>hu_HU</lang>
		<encoding type="latin2"/>
		<keymap>hu</keymap>
		<xkeymap>hu</xkeymap>
		<xkeymap>hu_qwerty</xkeymap>
	</country>
	<country domain="IS">
		<name>Iceland</name>
		<time_zone>Iceland</time_zone>
		<language>Icelandic</language>
		<lang>is_IS</lang>
		<encoding type="latin1"/>
		<keymap>is-latin1</keymap>
		<xkeymap>is</xkeymap>
	</country>
	<country domain="IT">
		<name>Italy</name>
		<time_zone>Europe/Rome</time_zone>
		<language>Italian</language>
		<lang>it_IT</lang>
		<encoding type="latin1"/>
		<keymap>it2</keymap>
		<xkeymap>it</xkeymap>
	</country>
	<country domain="MX">
		<name>Mexico</name>
		<time_zone>Mexico/</time_zone>
		<language>Spanish</language>
		<lang>es_MX</lang>
		<encoding type="latin1"/>
		<keymap>la-latin1</keymap>
		<xkeymap>la</xkeymap>
	</country>
	<country domain="NO">
		<name>Norway</name>
		<time_zone>Europe/Oslo</time_zone>
		<language>Norwegian</language>
		<lang>no_NO</lang>
		<encoding type="latin1"/>
		<keymap>no-latin1</keymap>
		<xkeymap>no</xkeymap>
	</country>
	<country domain="PL">
		<name>Poland</name>
		<time_zone>Europe/Warsaw</time_zone>
		<language>Polish</language>
		<lang>pl_PL</lang>
		<encoding type="latin2"/>
		<keymap>pl</keymap>
		<xkeymap>pl</xkeymap>
		<xkeymap>pl2</xkeymap>
	</country>
	<country domain="PT">
		<name>Portugal</name>
		<time_zone>Europe/Lisbon</time_zone>
		<language>Portuguese</language>
		<lang>pt_PT</lang>
		<encoding type="latin1"/>
		<keymap>pt-latin9</keymap>
		<xkeymap>pt</xkeymap>
	</country>
	<country domain="RO">
		<name>Romania</name>
		<time_zone>Europe/Bucharest</time_zone>
		<language>Romanian</language>
		<lang>ro_RO</lang>
		<encoding type="latin2"/>
		<keymap>ro-latin2</keymap>
		<xkeymap>ro</xkeymap>
	</country>
	<country domain="SE">
		<name>Sweden</name>
		<time_zone>Europe/Stockholm</time_zone>
		<language>Swedish</language>
		<lang>sv_SE</lang>
		<encoding type="latin1"/>
		<keymap>sv-latin1</keymap>
		<xkeymap>se</xkeymap>
	</country>
	<country domain="SK">
		<name>Slovak Republic</name>
		<time_zone>Europe/Bratislava</time_zone>
		<language>Slovak</language>
		<lang>sk_SK</lang>
		<encoding type="latin1"/>
		<keymap>sk-qwertz</keymap>
		<keymap>sk-qwerty</keymap>
		<xkeymap>sk</xkeymap>
		<xkeymap>sk_qwerty</xkeymap>
	</country>
	<country domain="TR">
		<name>Turkiye</name>
		<time_zone>Europe/Istanbul</time_zone>
		<language>Turkish</language>
		<lang>tr_TR</lang>
		<encoding type="latin5"/>
		<keymap>tr</keymap>
		<xkeymap>trq</xkeymap>
	</country>
	<country domain="UK">
		<name>United Kingdom</name>
		<time_zone>Europe/London</time_zone>
		<language>British English</language>
		<lang>en_GB</lang>
		<encoding type="latin1"/>
		<keymap>uk</keymap>
		<xkeymap>gb</xkeymap>
	</country>
	<country domain="US">
		<name>United States</name>
		<time_zone>America/</time_zone>
		<language>American English</language>
		<lang>en_US</lang>
		<encoding type="latin1"/>
		<keymap>us-acentos</keymap>
		<xkeymap>en_US</xkeymap>
	</country>

</locale>

See also

How to Compose Accented Characters in X using Compose - This is useful if one wants to write in a locale other than that for which the keyboard was designed. (broken)


Last modified: Tue, 07 Oct 2008 02:08:00 +0000 Hits: 72,354