目次
アプリケーションソフトの多言語化 (M17N) とかネイティブ言語サポートは2段階で行います。
国際化 (I18N): ソフトが複数のロケール (地域) を扱えるようにします。
地域化 (L10N): 特定のロケール (地域) を扱えるようにします。
![]() |
ヒント |
---|---|
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
".
GNOME や KDE 等の現代的なソフトは多言語化されています。UTF-8
データーを扱えるようにすることで国際化され、gettext
(1)
インフラで翻訳されたメッセージを提供することで地域化されています。翻訳されたメッセージは別の地域化パッケージとして供給されているかもしれません。
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 「"$LANG
" 変数」
テキストデータの最も単純な表現は ASCII で、英語には十分で 127 未満の文字 (7 ビットで表現可能) を使います。
プレーンな英語のテキストですら非 ASCII 文字を含んでいるかもしれません。例えば微妙に曲がった左右のクォテーションマークは ASCII 内では利用できません。
“double quoted text” is not "double quoted ASCII" ‘single quoted text’ is not 'single quoted ASCII'
より多くの文字をサポートするために、多くの言語をサポートする多数の文字集合とエンコーディング体系が使用されてきました (表11.2「符号化方式値とその使い方リスト」 を参照)。
ユニコード 文字セットは実質的に人類が知り得る全ての文字を21ビットのコードポイント範囲 (16進表記で 0 から 10FFFF まで) で表記できます。
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.
![]() |
ヒント |
---|---|
新標準の " |
![]() |
注記 |
---|---|
一部のプログラムは I18N をサポートした後でより多くのメモリーを消費するようになります。それらのプログラムは、実行速度最適化のために内部的に UTF-32 (UCS4) で Unicode のサポートをコードされていて、選ばれたロケールに無関係にそれぞれの ASCII 文字データー毎に4バイトを消費するからです。ここでも、UTF-8 ロケールを使ったからといって何も失うわけではありません。 |
システムが特定のロケールにアクセスできるように、ロケールデータをロケールデータベースからコンパイルする必要が有ります。
The locales
package does not come with pre-compiled locale data. You need
to configure it as:
# dpkg-reconfigure locales
このプロセスは2段階あります。
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 「PAM と NSS」).
The system wide default locale value set in
"/etc/default/locale
" may be overridden by the GUI
configuration for GUI applications.
![]() |
注記 |
---|---|
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
".
クロスプラットフォームのデーター交換 (「リムーバブルストレージデバイス」参照下さい)
のために、特定の符号化方式 (エンコーディング) でファイルシステムをマウントする必要があるかもしれません。例えば、vfat ファイルシステムに関して mount
(8)
はオプション無しの場合 CP437 とみなします。ファイル名に UTF-8 とか CP932
を使うためには明示的にマウントオプションを提供する必要があります。
![]() |
注記 |
---|---|
GNOME のような現代的なデスクトップ環境の下では、デスクトップアイコンを右クリックし "Drive" タブをクリックし "Setting" を開くようにクリックし "Mount options:" に"utf8" を入力すれば、ホットプラグできる USB メモリーを自動マウントする時のマウントオプションを設定できます。このメモリースティックを次にマウントする機会には UTF-8 でのマウントが有効です。 |
![]() |
注記 |
---|---|
もしシステムをアップグレードしたり旧式非 UTF-8 システムからディスクを移動したりする場合には、非 ASCII 文字のファイル名は ISO-8859-1 とか eucJP 等の今は非推奨の歴史的符号化方式で符号化をしているかもしれません。テキスト変換ツールの助力を得て、ファイル名を UTF-8 に変換します。「テキストデーター変換ツール」を参照下さい。 |
Samba は新規クライアント (Windows NT、200x、XP) には Unicode
を使いますが、旧式クライアント (DOS、Windows 9x/Me) には CP850
をデフォールトで使います。この旧式クライアントへのデフォールトは "/etc/samba/smb.conf
"
ファイル中の "dos charset
" を使って例えば日本語なら CP932 等と変更できます。
Debian システム中で表示されるエラーメッセージや標準のプログラムの出力やメニューやマニュアルページ等のテキストメッセージや文書の多くに翻訳があります。ほとんどの翻訳行為のバックエンドツールとして GNU gettext(1) コマンドツールチェインが使われています。
"Tasks" → "Localization" の下の aptitude
(8)
リストは地域化されたメッセージをアプリケーションに追加したり翻訳された文書を提供する有用なバイナリーパッケージの徹底的なリストを提供します。
例えば、manpages-LANG
パッケージをインストールするとマンページで地域化したメッセージに使えるようになります。programname
に関するイタリア語のマンページを "/usr/share/man/it/
" から読むには、次を実行します。
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".
sort
(1) のソート順はロケールの言語選択に影響されます。スペイン語と英語のロケールではソート順が違います。
ls
(1) の日付形式はロケールに影響されます。"LANG=C ls -l
"
と "LANG=en_US.UTF-8
" の日付形式は違います (「時間と日付のカスタム化表示」を参照)。
Number punctuation are different for locales. For example, in English
locale, one thousand point one is displayed as "1,000.1
"
while in German locale, it is displayed as "1.000,1
".
You may see this difference in spreadsheet program.
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.
Debian システムは keyboard-configuration
と
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, 「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.
![]() |
注記 |
---|---|
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.
アプリケーションへの多言語入力は次のように処理されます。
Keyboard Application | ^ | | +-> Linux kernel -> Input method (ibus) -> Gtk, Qt, X, Wayland +-- Engine--+
IBus とそのエンジンパッケージの一覧は以下の通りです。
表8.1 IBusとエンジンパッケージのリスト
パッケージ | ポプコン | サイズ | サポートされたロケール |
---|---|---|---|
ibus | V:161, I:204 | 1637 | dbus を用いるインプットメソッドのフレームワーク |
ibus-mozc | V:2, I:3 | 935 | 日本語 |
ibus-anthy | V:0, I:1 | 8825 | , , |
ibus-skk | V:0, I:0 | 243 | , , |
ibus-kkc | V:0, I:0 | 215 | , , |
ibus-libpinyin | V:0, I:2 | 2711 | 中国語 (zh_CN 用) |
ibus-chewing | V:0, I:0 | 422 | , , (zh_TW 用) |
ibus-libzhuyin | I:0 | 40987 | , , (zh_TW 用) |
ibus-rime | V:0, I:0 | 77 | , , (for zh_CN/zh_TW) |
ibus-cangjie | V:0, I:0 | 119 | , , (for zh_HK) |
ibus-hangul | V:0, I:2 | 285 | 韓国語 |
ibus-libthai | I:0 | 90 | タイ語 |
ibus-table-thai | I:0 | 56 | タイ語 |
ibus-unikey | V:0, I:0 | 318 | ベトナム語 |
ibus-keyman | V:0, I:0 | 129 | Multilingual: Keyman engine for over 2000 languages |
ibus-table | V:0, I:1 | 2118 | IBus 用のテーブルエンジン |
ibus-m17n | V:0, I:2 | 366 | 多言語: インド系言語、アラビア語、他 |
plasma-widgets-addons | V:34, I:82 | 1972 | additional widgets for Plasma 5 containing Keyboard Indicator |
![]() |
注記 |
---|---|
For Chinese, " |
日本語インプットメソッドを英語環境 ("en_US.UTF-8
") 下で起動すると非常に便利です。Wayland
環境下で IBus を使ってどう実現したかを以下に記します。
Install the Japanese input tool package ibus-mozc
(or
ibus-anthy
) with its recommended packages such as
im-config
.
有効になっていない場合は "Settings" → "Keyboard" → "Input Sources" → click
"+
" in "Input Sources" → "Japanese" → "Japanese mozc (or
anthy)" を選択し "Add" をクリックします。
You may chose as many input sources.
ユーザーアカウントに再ログインします。
Setup each input source by right clicking the GUI toolbar icon.
インプットソース間を、SUPER-SPACE を用いて切り替えます。(SUPER は通常 Windows キーです。)
![]() |
ヒント |
---|---|
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".
あるいは、ユーザのシェルから "im-config
" を実行します。
im-config
(8) は実行されるのが root からかどうかによって違った挙動をします。
im-config
(8)
はユーザーからのアクション無しにシステム上で最も好ましいインプットメソッドを有効にします。
Linux コンソールは限定された文字しか表示できません。(非 GUI コンソール上で非ヨーロッパ言語を表示するには
jfbterm
(1) のような特別なターミナルプログラムを使う必要があります。)
GUI environment (7章GUI システム) 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.)
東アジアのロケールでは、箱描画文字やギリシャ文字やキリル文字はあなたが望むよりも広い幅で表示されて、ターミナル出力が揃わなくなるかもしれません(Unicode標準附属書 #11 参照)。
この問題は回避可能です:
gnome-terminal
: Preferences → Profiles →
Profile name → Compatibility → Ambiguous-wide
characters → Narrow
ncurses
: 環境変数を export
NCURSES_NO_UTF8_ACS=0
と設定します。