Inhaltsverzeichnis
Multilingualisation (M17N) oder native Sprachunterstützung (die Anpassung eines Software-Produkts zur Unterstützung mehrerer Sprachen) wird in zwei Schritten durchgeführt:
Internationalisierung (I18N): eine Software so einrichten, dass sie grundsätzlich verschiedene Gebietsschemata (Locales) unterstützt.
Lokalisierung (L10N): eine Software für die Unterstützung eines bestimmten Gebietsschemas anpassen.
![]() |
Tipp |
---|---|
There are 17, 18, or 10 letters between "m" and "n", "i" and "n", or "l" and "n" in multilingualization, internationalization, and localization which correspond to M17N, I18N, and L10N. See Introduction to i18n for details. |
The behavior of programs supporting internationalization are configured by
the environment variable "$LANG
" to support
localization. Actual support of locale dependent features by the
libc
library requires to install
locales
or locales-all
packages. The
locales
package requires to be initialized properly.
If neither locales
or locales-all
package are installed, support of locale features are lost and system uses
US English messages and handles data as ASCII. This behavior is the same way as
"$LANG
" is set by "LANG=
",
"LANG=C
", or "LANG=POSIX
".
The modern software such as GNOME and KDE are multilingualized. They are
internationalized by making them handle UTF-8
data and localized by providing their translated messages through the
gettext
(1) infrastructure. Translated messages may be
provided as separate localization packages.
The current Debian desktop GUI system normally sets the locale under GUI
environment as "LANG=xx_YY.UTF-8
". Here,
"xx
" is ISO 639
language codes and "YY
" is ISO 3166 country codes. These values
are set by the desktop configuration GUI dialogue and change the program
behavior. See Abschnitt 1.5.2, „Die "$LANG
"-Variable“
The simplest representation of the text data is ASCII which is sufficient for English and uses less than 127 characters (representable with 7 bits).
Sogar reiner Text in Englisch kann nicht-ASCII-Zeichen enthalten, so sind z.B. die leicht geschweiften rechten und linken Anführungszeichen in ASCII nicht enthalten:
“double quoted text” is not "double quoted ASCII" ‘single quoted text’ is not 'single quoted ASCII'
In order to support more characters, many character sets and encoding systems have been used to support many languages (see Tabelle 11.2, „Liste von Werten für die Zeichenkodierung und deren Verwendung“).
Unicode character set can represent practically all characters known to human with 21 bit code point range (i.e., 0 to 10FFFF in hexadecimal notation).
Text encoding system UTF-8 fits Unicode code points into a sensible 8 bit data stream mostly compatible with the ASCII data processing system. This makes UTF-8 the modern preferred choice. UTF stands for Unicode Transformation Format. When ASCII plain text data is converted to UTF-8 one, it has exactly the same content and size as the original ASCII one. So you loose nothing by deploying UTF-8 locale.
Under UTF-8 locale with the compatible
application program, you can display and edit any foreign language text data
as long as required fonts and input methods are installed and enabled. For
example under "LANG=fr_FR.UTF-8
" locale,
gedit
(1) (text editor for the GNOME Desktop) can display
and edit Chinese character text data while presenting menus in French.
![]() |
Tipp |
---|---|
Both the new standard " |
![]() |
Anmerkung |
---|---|
Einige Programme verbrauchen mehr Speicher, wenn sie I18N unterstützen. Das kommt daher, weil sie für die Unicode-Unterstützung intern UTF-32(UCS4) verwenden (zwecks Geschwindigkeitsoptimierung; dabei werden 4 Bytes für jedes ASCII-Zeichen genutzt, unabhängig vom gewählten Gebietsschema). Nochmals: Sie verlieren nichts, wenn Sie ein UTF-8-Gebietsschema einsetzen. |
In order for the system to access a particular locale, the locale data must be compiled from the locale database.
The locales
package does not come with pre-compiled locale data. You need
to configure it as:
# dpkg-reconfigure locales
This process involves 2 steps.
Select all required locale data to be compiled into the binary form. (Please make sure to include at least one UTF-8 locale)
Set the system wide default locale value by creating
"/etc/default/locale
" for use by PAM (see Abschnitt 4.5, „PAM und NSS“).
The system wide default locale value set in
"/etc/default/locale
" may be overridden by the GUI
configuration for GUI applications.
![]() |
Anmerkung |
---|---|
Actual traditional encoding system can be identified by
" |
The locales-all
package comes with all locale data
pre-compiled but doesn't creating "/etc/default/locale
".
Für den Datenaustausch über verschiedene Plattformen hinweg (Näheres in
Abschnitt 10.1.7, „Wechseldatenträger“) müssen Sie unter Umständen beim
Einbinden einiger Dateisysteme bestimmte Kodierungen vorwählen. Zum Beispiel
wird beim Einbinden eines vfat-Dateisystems durch
mount
(8) die CP437-Kodierung
genutzt, wenn nichts anderes angegeben ist. Sie müssen eine explizite
mount-Option angeben, wenn UTF-8 oder CP932 als Kodierung für die Dateinamen genutzt werden
soll.
![]() |
Anmerkung |
---|---|
Wenn ein während des Betrieb eingesteckter USB-Stick in einer modernen Arbeitsplatzumgebung wie GNOME automatisch eingebunden wird, können Sie solche mount-Optionen möglicherweise durch einen Rechtsklick auf das Icon auf der Arbeitsfläche vorwählen. Klicken Sie auf die Lasche "Laufwerk", klappen Sie per Mausklick die Liste der "Einstellungen" auf und geben Sie dann "utf8" bei den "Mount-Optionen:" ein. Wenn der USB-Stick das nächste Mal eingesteckt wird, ist das Einbinden mit UTF-8 aktiviert. |
![]() |
Anmerkung |
---|---|
Beim Hochrüsten eines Systems oder wenn Sie Laufwerke von älteren nicht-UTF-8-Systemen verwenden, könnten Dateinamen mit nicht-ASCII-Zeichen in historischen und überholten Kodierungen wie ISO-8859-1 oder eucJP kodiert sein. Bitte suchen Sie die Hilfe von Textkonvertierungswerkzeugen, um diese in UTF-8 zu konvertieren. Details hierzu finden Sie in Abschnitt 11.1, „Werkzeuge für Textkonvertierung“. |
Samba verwendet für neuere Clients (Windows NT,
200x, XP und später) standardmäßig Unicode, aber bei älteren für DOS und
Windows 9x/Me wird per Voreinstellung CP850
eingesetzt. Dieser Standard für ältere Clients kann mittels "dos
charset
" in der Datei "/etc/samba/smb.conf
"
geändert werden, CP932 zum Beispiel für
Japanisch.
Für viele Textmeldungen und Dokumente, die im Debian-System angezeigt werden, wie z.B. Fehlermeldungen, Standard-Programmausgaben, Menüs und Handbuchseiten, existieren Übersetzungen. Die GNU-gettext(1)-Werkzeuge werden für die meisten Übersetzungsaktivitäten als Backend-Programme im Hintergrund verwendet.
aptitude
(8) bietet unter "Tasks" → "Lokalisierung" eine
ausführliche Liste nützlicher Binärpakete, die lokalisierte Meldungen für
Anwendungen und übersetzte Dokumentation enthalten.
So können Sie übersetzte Handbuchseiten (manpages) in Deutsch erhalten,
indem Sie das manpages-de
-Paket installieren. Um z.B. die
deutsche Handbuchseite für programmname aus
"/usr/share/man/de/
" zu lesen (falls für dieses Programm
eine übersetzte Handbuchseite existiert), führen Sie folgendes aus:
LANG=it_IT.UTF-8 man programname
GNU gettext can accommodate priority list of translation languages with
$LANGUAGE
environment variable. For example:
$ export LANGUAGE="pt:pt_BR:es:it:fr"
For more, see info gettext
and read the section "The
LANGUAGE variable".
Durch die Sprachauswahl im Gebietsschema wird die Sortierreihenfolge von
Zeichen mit sort
(1) beeinflußt. In den Gebietsschemata
für Spanisch und Englisch beispielsweise wird unterschiedlich sortiert.
Das Gebietsschema wirkt sich auch auf das Datumsformat von
ls
(1) aus. Die Ausgaben des Datumsformats von
"LANG=C ls -l
" und "LANG=en_US.UTF-8
"
z.B. sind unterschiedlich (Näheres in Abschnitt 9.3.4, „Angepasste Anzeige von Datum und Zeit“).
Die Zahlen-Interpunktion unterscheidet sich ebenfalls abhängig vom
Gebietsschema. Zum Beispiel wird ein-tausend-eins-komma-eins im englischen
Gebietsschema "1,000.1
" geschrieben, im deutschen
hingegen "1.000,1
". Sie können den Unterschied in einem
Tabellenkalkulationsprogramm sehen.
Each detail feature of "$LANG
" environment variable may
be overridden by setting "$LC_*
" variables. These
environment variables can be overridden again by setting
"$LC_ALL
" variable. See locale
(7)
manpage for the details. Unless you have strong reason to create
complicated configuration, please stay away from them and use only
"$LANG
" variable set to one of the UTF-8 locales.
Das Debian-System kann mittels der
keyboard-configuration
- und
console-setup
-Pakete so konfiguriert werden, dass es mit
vielen internationalen Tastaturkonfigurationen funktioniert:
# dpkg-reconfigure keyboard-configuration # dpkg-reconfigure console-setup
For the Linux console and the X Window system, this updates configuration
parameters in "/etc/default/keyboard
" and
"/etc/default/console-setup
". This also configures the
Linux console font. Many non-ASCII characters including accented characters
used by many European languages can be made available with dead key, AltGr key,
and compose key.
For GNOME on Wayland desktop system, Abschnitt 8.2.1, „The keyboard input for Linux console and X Window“ can't support
non-English European languages. IBus was made
to support not only Asian languages but also European languages. The
package dependency of GNOME Desktop Environment recommends
"ibus
" via "gnome-shell
". The code of
"ibus
" has been updated to integrate
setxkbmap
and XKB option functionalities. You need to
configure ibus
from "GNOME Settings" or "GNOME Tweaks"
for the multilingualized keyboard input.
![]() |
Anmerkung |
---|---|
If ibus is active, your classic X keyboard configuration by the
|
Since GNOME Desktop Environment recommends "ibus
" via
"gnome-shell
", "ibus
" is the good
choice for input method.
Mehrsprachige Eingaben für Anwendungen werden wie hier dargestellt verarbeitet:
Keyboard Application | ^ | | +-> Linux kernel -> Input method (ibus) -> Gtk, Qt, X, Wayland +-- Engine--+
The list of IBus and its engine packages are the following.
Tabelle 8.1. List of IBus and its engine packages
Paket | Popcon | Größe | unterstütztes Gebietsschema |
---|---|---|---|
ibus | V:82, I:99 | 1584 | Eingabemethoden-Rahmenwerk, das dbus verwendet |
ibus-mozc | V:1, I:2 | 1006 | Japanisch |
ibus-anthy | V:1, I:1 | 8790 | " |
ibus-kkc | V:0, I:0 | 214 | " |
ibus-skk | V:0, I:0 | 244 | " |
ibus-pinyin | V:0, I:1 | 1434 | Chinesisch (für zh_CN) |
ibus-chewing | V:0, I:0 | 415 | " (für zh_TW) |
ibus-hangul | V:0, I:1 | 288 | Koreanisch |
ibus-table | V:0, I:1 | 1809 | Tabellen-Engine für IBus |
ibus-table-thai | I:0 | 47 | Thailändisch |
ibus-unikey | V:0, I:0 | 318 | Vietnamesisch |
ibus-m17n | V:0, I:1 | 187 | Multilingual: Indisch, Arabisch und andere |
![]() |
Anmerkung |
---|---|
For Chinese, " |
I find the Japanese input method started under English environment
("en_US.UTF-8
") very useful. Here is how I did this with
IBus for GNOME on Wayland:
Install the Japanese input tool package ibus-mozc
(or
ibus-anthy
) with its recommended packages such as
im-config
.
Select "Settings" → "Keyboard" → "Input Sources" → click
"+
" in "Input Sources" → "Japanese" → "Japanese mozc (or
anthy)" and click "Add" if it hasn't been activated.
You may chose as many input sources.
Melden Sie sich am Benutzerkonto neu an.
Setup each input source by right clicking the GUI toolbar icon.
Wählen Sie zwischen den installierten Eingabequellen mittels SUPERTASTE+LEERTASTE (die SUPERTASTE ist normalerweise die Windows-Taste).
![]() |
Tipp |
---|---|
If you wish to have access to alphabet only keyboard environment with the
physical Japanese keyboard on which shift- |
The GUI menu entry for im-config
(8) is "Input method".
Alternatively, execute "im-config
" from user's shell.
im-config
(8) verhält sich unterschiedlich abhängig davon,
ob es von root ausgeführt wurde oder nicht.
im-config
(8) aktiviert standardmäßig ohne weiteres
Agieren des Benutzers die beste Eingabemethode auf dem System.
Linux console can only display limited characters. (You need to use special
terminal program such as jfbterm
(1) to display
non-European languages on the non-GUI console.)
GUI environment (Kapitel 7, GUI System) can display any characters in the UTF-8 as long as required fonts are installed and enabled. (The encoding of the original font data is taken care and transparent to the user.)
Bei Verwendung des ostasiatischen Gebietsschemas können die Zeichnung der Box sowie griechische und kyrillische Schriftzeichen breiter als beabsichtigt dargestellt werden, was zu einer ungleichmäßigen, schlecht ausgerichteten Terminalausgabe führt (näheres unter Unicode Standard Annex #11).
Sie können dies Problem jedoch umgehen:
gnome-terminal
: Preferences → Profiles →
Profile name → Compatibility → Ambiguous-wide
characters → Narrow
ncurses
: Setzen einer Umgebungsvariablen mit
export NCURSES_NO_UTF8_ACS=0
.