Indice
Il supporto per le lingue native o M17N (Multilingualization) per un software applicativo è ottenuto in 2 passi.
L'internazionalizzazione (I18N): per rendere un software capace di gestire potenzialmente localizzazioni multiple.
Localizzazione (L10N): per fare gestire dal software una localizzazione specifica.
![]() |
Suggerimento |
---|---|
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 Sezione 1.5.2, «La variabile "$LANG
"»
The simplest representation of the text data is ASCII which is sufficient for English and uses less than 127 characters (representable with 7 bits).
Anche un testo in semplice inglese può contenere caratteri non ASCII; le virgolette singole ricurve destra e sinistra per esempio non sono disponibili in ASCII.
“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 Tabella 11.2, «Elenco dei valori delle codifiche e loro uso»).
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.
![]() |
Suggerimento |
---|---|
Both the new standard " |
![]() |
Nota |
---|---|
Alcuni programmi usano più memoria dopo l'inclusione del supporto per l'internazionalizzazione. Questo avviene perché il loro codice è programmato per usare internamente UTF-32(UCS4) per supportare Unicode al fine di ottimizzare la velocità e consumano 4 byte per ogni dato di carattere ASCII, indipendentemente dalla localizzazione selezionata. Ancora una volta usando la localizzazione UTF-8 non si perde nulla. |
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 Sezione 4.5, «PAM e NSS»).
The system wide default locale value set in
"/etc/default/locale
" may be overridden by the GUI
configuration for GUI applications.
![]() |
Nota |
---|---|
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
".
Per lo scambia di dati interpiattaforma (vedere Sezione 10.1.7, «Supporti di archiviazione removibili»), può essere necessario montare alcuni
file system con codifiche particolari. Per esempio,
mount
(8), se usato senza opzioni, assume che venga usata
la codifica CP437 per il file system vfat. È necessario fornire
esplicitamente opzioni di montaggio per usare nomi di file UTF-8 o CP932.
![]() |
Nota |
---|---|
Quando una chiavetta USB inseribile a caldo viene automaticamente montata in un ambiente desktop moderno come GNOME, si può fornire una informazione di montaggio di questo tipo cliccando con il tasto destro sull'icona del dispositivo sul desktop, cliccare sulla scheda "Drive", cliccare per espandere "Impostazioni" ed inserire "utf8" in "Opzioni di mount:". La prossima volta che questa chiavetta di memoria verrà montata, sarà abilitato il montaggio con UTF-8. |
![]() |
Nota |
---|---|
Se si sta facendo l'aggiornamento di un sistema o spostando dischi da un sistema non UTF-8, i nomi di file con caratteri non ASCII potranno essere codificati con codifiche usate una volta e ora deprecate, come ISO-8859-1 o eucJP. Cercare aiuto sugli strumenti di conversione dei testi per convrtirli in UTF-8. Vedere Sezione 11.1, «Strumenti di conversione di dati testuali». |
Samba usa in modo predefinito Unicode per i
client più moderni (Windows NT, 200x, XP), ma usa CP850 per client più vecchi (DOS e Windows
9x/Me). Questo comportamento predefinito per i client più vecchi può essere
modificato usando "dos charset
" nel file
"/etc/samba/smb.conf
", per esempio usando "CP932" per il giapponese.
Esistono le traduzioni di molti dei messaggi di testo e dei documenti che sono mostrati nel sistema Debian, come messaggi di errore, output standard dei programmi, menu e pagine di manuale. L'insieme di strumenti GNU gettext(1) è usato come strumento di backend per la maggior parte delle attività di traduzione.
aptitude
(8) fornisce in "Task" → "Localizzazione" un
ampio elenco di utili pacchetti binari che aggiungono alle applicazioni
messaggi localizzati e che forniscono documentazione nella versione
tradotta.
Per esempio, si possono ottenere i messaggi localizzati per le pagine man
installando il pacchetto
manpages-LINGUA
. Per leggere le
pagine man di nomeprogramma in italiano contenute in
"/usr/share/man/it/
", eseguire il comando seguente.
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".
La disposizione dell'ordinamento dei caratteri con
sort
(1) è influenzata dalla lingua scelta dalla
localizzazione. Le localizzazioni spagnola e inglese ordinano in modo
diverso.
Il formato della data mostrato da ls
(1) è influenzato
dalla localizzazione. Il formato della data di "LANG=C ls
-l
" è differente da quello con
"LANG=en_US.UTF-8
" (vedere Sezione 9.3.4, «Visualizzazione personalizzata di date e orari»).
I caratteri di punteggiatura usati per i numeri sono diversi nelle varie
localizzazioni. Per esempio, nella localizzazione inglese mille virgola uno
è rappresentato come "1,000.1
", mentre nella
localizzazione in italiano è mostrato come "1.000,1
". Si
può vedere questa differenza nei programmi per fogli di calcolo.
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.
Il sistema Debian può essere configurato per funzionare con molte
disposizioni di tastiera internazionali usando i pacchetti
keyboard-configuration
e
console-setup
.
# 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, Sezione 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.
![]() |
Nota |
---|---|
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.
L'input multilingua verso l'applicazione è elaborato così:
Keyboard Application | ^ | | +-> Linux kernel -> Input method (ibus) -> Gtk, Qt, X, Wayland +-- Engine--+
The list of IBus and its engine packages are the following.
Tabella 8.1. List of IBus and its engine packages
pacchetto | popcon | dimensione | localizzazioni supportate |
---|---|---|---|
ibus | V:125, I:167 | 1598 | infrastruttura per metodo di input che usa dbus |
ibus-mozc | V:1, I:3 | 1003 | giapponese |
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 | cinese (per zh_CN) |
ibus-chewing | V:0, I:0 | 415 | " " (per zh_TW) |
ibus-hangul | V:0, I:1 | 288 | coreano |
ibus-table | V:0, I:1 | 1984 | motore di tabelle per IBus |
ibus-table-thai | I:0 | 47 | thailandese |
ibus-unikey | V:0, I:0 | 318 | vietnamita |
ibus-m17n | V:0, I:1 | 187 | multilingue: indico, arabico e altri |
![]() |
Nota |
---|---|
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.
Rieseguire il login nell'account utente
Setup each input source by right clicking the GUI toolbar icon.
Passare da una all'altra delle fonti di input installate con SUPER-SPAZIO. (SUPER è solitamente il tasto Windows.)
![]() |
Suggerimento |
---|---|
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) si comporta in modo diverso a seconda se è
eseguito da root o no.
im-config
(8) abilita il miglior metodo di input sul
sistema come impostazione predefinita senza alcuna azione dell'utente.
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 (Capitolo 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.)
Nella localizzazione dell'Asia dell'est i caratteri di disegno di riquadri, i caratteri greci e cirillici possono essere visualizzati più larghi della larghezza desiderata e causare un output su terminale non allineato (vedere Unicode Standard Annex #11).
Questo problema può essere aggirato:
gnome-terminal
: Preferences → Profiles →
Profile name → Compatibility → Ambiguous-wide
characters → Narrow
ncurses
: impostare l'ambiente export
NCURSES_NO_UTF8_ACS=0
.