White space only fix. Translators can ignore.

Approved by: gjb (mentor)
This commit is contained in:
Dru Lavigne 2013-01-24 14:57:42 +00:00
parent 8e56b37c56
commit e304d13401
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=40734

View file

@ -33,9 +33,9 @@
contributors located all over the world. This chapter discusses contributors located all over the world. This chapter discusses
the internationalization and localization features of FreeBSD the internationalization and localization features of FreeBSD
that allow non-English speaking users to get real work done. that allow non-English speaking users to get real work done.
There are many aspects of the i18n implementation in both the system There are many aspects of the i18n implementation in both the
and application levels, so where applicable we refer the reader system and application levels, so where applicable we refer
to more specific sources of documentation.</para> the reader to more specific sources of documentation.</para>
<para>After reading this chapter, you will know:</para> <para>After reading this chapter, you will know:</para>
<itemizedlist> <itemizedlist>
@ -45,8 +45,8 @@
shell.</para></listitem> shell.</para></listitem>
<listitem><para>How to configure your console for non-English <listitem><para>How to configure your console for non-English
languages.</para></listitem> languages.</para></listitem>
<listitem><para>How to use X Window System effectively with different <listitem><para>How to use X Window System effectively with
languages.</para></listitem> different languages.</para></listitem>
<listitem><para>Where to find more information about writing <listitem><para>Where to find more information about writing
i18n-compliant applications.</para></listitem> i18n-compliant applications.</para></listitem>
</itemizedlist> </itemizedlist>
@ -64,48 +64,51 @@
<sect2> <sect2>
<title>What Is I18N/L10N?</title> <title>What Is I18N/L10N?</title>
<indexterm> <indexterm>
<primary>internationalization</primary> <primary>internationalization</primary>
<see>localization</see> <see>localization</see>
</indexterm> </indexterm>
<indexterm><primary>localization</primary></indexterm> <indexterm><primary>localization</primary></indexterm>
<para>Developers shortened internationalization into the term I18N, <para>Developers shortened internationalization into the term
counting the number of letters between the first and the last I18N, counting the number of letters between the first and
letters of internationalization. L10N uses the same naming the last letters of internationalization. L10N uses the
scheme, coming from <quote>localization</quote>. Combined same naming scheme, coming from <quote>localization</quote>.
together, I18N/L10N methods, protocols, and applications allow Combined together, I18N/L10N methods, protocols, and
users to use languages of their choice.</para> applications allow users to use languages of their
choice.</para>
<para>I18N applications are programmed using I18N kits under <para>I18N applications are programmed using I18N kits under
libraries. It allows for developers to write a simple file and libraries. It allows for developers to write a simple file
translate displayed menus and texts to each language. We strongly and translate displayed menus and texts to each language.
encourage programmers to follow this convention.</para> We strongly encourage programmers to follow this
convention.</para>
</sect2> </sect2>
<sect2> <sect2>
<title>Why Should I Use I18N/L10N?</title> <title>Why Should I Use I18N/L10N?</title>
<para>I18N/L10N is used whenever you wish to either view, input, or <para>I18N/L10N is used whenever you wish to either view,
process data in non-English languages.</para> input, or process data in non-English languages.</para>
</sect2> </sect2>
<sect2> <sect2>
<title>What Languages Are Supported in the I18N Effort?</title> <title>What Languages Are Supported in the I18N Effort?</title>
<para>I18N and L10N are not FreeBSD specific. Currently, one can <para>I18N and L10N are not FreeBSD specific. Currently, one
choose from most of the major languages of the World, including can choose from most of the major languages of the World,
but not limited to: Chinese, German, Japanese, Korean, French, including but not limited to: Chinese, German, Japanese,
Russian, Vietnamese and others.</para> Korean, French, Russian, Vietnamese and others.</para>
</sect2> </sect2>
</sect1> </sect1>
<sect1 id="using-localization"> <sect1 id="using-localization">
<title>Using Localization</title> <title>Using Localization</title>
<para>In all its splendor, I18N is not FreeBSD-specific and is a <para>In all its splendor, I18N is not FreeBSD-specific and is
convention. We encourage you to help FreeBSD in following this a convention. We encourage you to help FreeBSD in following
convention.</para> this convention.</para>
<indexterm><primary>locale</primary></indexterm> <indexterm><primary>locale</primary></indexterm>
<para>Localization settings are based on three main terms: <para>Localization settings are based on three main terms:
@ -116,16 +119,18 @@
<sect2> <sect2>
<title>Language and Country Codes</title> <title>Language and Country Codes</title>
<indexterm><primary>language codes</primary></indexterm> <indexterm><primary>language codes</primary></indexterm>
<indexterm><primary>country codes</primary></indexterm> <indexterm><primary>country codes</primary></indexterm>
<para>In order to localize a FreeBSD system to a specific language <para>In order to localize a FreeBSD system to a specific
(or any other I18N-supporting &unix; like systems), the user needs to find out language (or any other I18N-supporting &unix; like systems),
the codes for the specific country and language (country the user needs to find out the codes for the specific country
codes tell applications what variation of given and language (country codes tell applications what variation
language to use). In addition, web of given language to use). In addition, web browsers,
browsers, SMTP/POP servers, web servers, etc. make decisions based on SMTP/POP servers, web servers, etc. make decisions based on
them. The following are examples of language/country codes:</para> them. The following are examples of language/country
codes:</para>
<informaltable frame="none" pgwide="1"> <informaltable frame="none" pgwide="1">
<tgroup cols="2"> <tgroup cols="2">
@ -164,32 +169,36 @@
<sect2> <sect2>
<title>Encodings</title> <title>Encodings</title>
<indexterm><primary>encodings</primary></indexterm> <indexterm><primary>encodings</primary></indexterm>
<indexterm><primary>ASCII</primary></indexterm> <indexterm><primary>ASCII</primary></indexterm>
<para>Some languages use non-ASCII encodings that are 8-bit, wide <para>Some languages use non-ASCII encodings that are 8-bit,
or multibyte characters, see &man.multibyte.3; for more wide or multibyte characters, see &man.multibyte.3; for more
details. Older applications do not recognize them details. Older applications do not recognize them and mistake
and mistake them for control characters. Newer applications them for control characters. Newer applications usually do
usually do recognize 8-bit characters. Depending on the recognize 8-bit characters. Depending on the implementation,
implementation, users may be required to compile an application users may be required to compile an application with wide or
with wide or multibyte characters support, or configure it correctly. multibyte characters support, or configure it correctly.
To be able to input and process wide or multibyte characters, the <ulink To be able to input and process wide or multibyte characters,
url="&url.base;/ports/index.html">FreeBSD Ports Collection</ulink> has provided the <ulink
each language with different programs. Refer to the I18N url="&url.base;/ports/index.html">FreeBSD Ports
documentation in the respective FreeBSD Port.</para> Collection</ulink> has provided each language with different
programs. Refer to the I18N documentation in the respective
FreeBSD Port.</para>
<para>Specifically, the user needs to look at the application <para>Specifically, the user needs to look at the application
documentation to decide on how to configure it correctly or to documentation to decide on how to configure it correctly or
pass correct values into the configure/Makefile/compiler.</para> to pass correct values into the
configure/Makefile/compiler.</para>
<para>Some things to keep in mind are:</para> <para>Some things to keep in mind are:</para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>Language specific single C chars character sets <para>Language specific single C chars character sets
(see &man.multibyte.3;), e.g. (see &man.multibyte.3;), e.g. ISO8859-1, ISO8859-15,
ISO8859-1, ISO8859-15, KOI8-R, CP437.</para> KOI8-R, CP437.</para>
</listitem> </listitem>
<listitem> <listitem>
@ -202,7 +211,8 @@
url="http://www.iana.org/assignments/character-sets">IANA Registry</ulink>.</para> url="http://www.iana.org/assignments/character-sets">IANA Registry</ulink>.</para>
<note> <note>
<para>&os; uses X11-compatible locale encodings instead.</para> <para>&os; uses X11-compatible locale encodings
instead.</para>
</note> </note>
</sect2> </sect2>
@ -211,67 +221,71 @@
<title>I18N Applications</title> <title>I18N Applications</title>
<para>In the FreeBSD Ports and Package system, I18N applications <para>In the FreeBSD Ports and Package system, I18N applications
have been named with <literal>I18N</literal> in their names for have been named with <literal>I18N</literal> in their names
easy identification. However, they do not always support the for easy identification. However, they do not always support
language needed.</para> the language needed.</para>
</sect2> </sect2>
<sect2 id="setting-locale"> <sect2 id="setting-locale">
<title>Setting Locale</title> <title>Setting Locale</title>
<para>Usually it is sufficient to export the value of the locale name <para>Usually it is sufficient to export the value of the
as <envar>LANG</envar> in the login shell. This could be done in locale name as <envar>LANG</envar> in the login shell. This
the user's <filename>~/.login_conf</filename> file or in the could be done in the user's <filename>~/.login_conf</filename>
startup file of the user's shell (<filename>~/.profile</filename>, file or in the startup file of the user's shell
<filename>~/.bashrc</filename>, <filename>~/.cshrc</filename>). (<filename>~/.profile</filename>,
There is no need to set the locale subsets such as <filename>~/.bashrc</filename>,
<envar>LC_CTYPE</envar>, <envar>LC_CTIME</envar>. Please <filename>~/.cshrc</filename>). There is no need to set the
refer to language-specific FreeBSD documentation for more locale subsets such as <envar>LC_CTYPE</envar>,
information.</para> <envar>LC_CTIME</envar>. Please refer to language-specific
FreeBSD documentation for more information.</para>
<para>You should set the following two environment variables in your configuration <para>You should set the following two environment variables
files:</para> in your configuration files:</para>
<itemizedlist> <itemizedlist>
<indexterm><primary>POSIX</primary></indexterm> <indexterm><primary>POSIX</primary></indexterm>
<listitem> <listitem>
<para><envar>LANG</envar> for &posix; &man.setlocale.3; family <para><envar>LANG</envar> for &posix; &man.setlocale.3;
functions</para> family functions</para>
</listitem> </listitem>
<listitem> <listitem>
<indexterm><primary>MIME</primary></indexterm> <indexterm><primary>MIME</primary></indexterm>
<para><envar>MM_CHARSET</envar> for applications' MIME character <para><envar>MM_CHARSET</envar> for applications' MIME
set</para> character set</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
<para>This includes the user shell configuration, the specific application <para>This includes the user shell configuration, the specific
configuration, and the X11 configuration.</para> application configuration, and the X11 configuration.</para>
<sect3> <sect3>
<title>Setting Locale Methods</title> <title>Setting Locale Methods</title>
<indexterm><primary>locale</primary></indexterm> <indexterm><primary>locale</primary></indexterm>
<indexterm><primary>login class</primary></indexterm> <indexterm><primary>login class</primary></indexterm>
<para>There are two methods for setting locale, and both are <para>There are two methods for setting locale, and both are
described below. The first (recommended one) is by assigning described below. The first (recommended one) is by
the environment variables in <link linkend="login-class">login assigning the environment variables in
class</link>, and the second is by adding the environment <link linkend="login-class">login class</link>, and the
variable assignments to the system's shell <link second is by adding the environment variable assignments
linkend="startup-file">startup file</link>.</para> to the system's shell
<link linkend="startup-file">startup file</link>.</para>
<sect4 id="login-class"> <sect4 id="login-class">
<title>Login Classes Method</title> <title>Login Classes Method</title>
<para>This method allows environment variables needed for locale <para>This method allows environment variables needed for
name and MIME character sets to be assigned once for every locale name and MIME character sets to be assigned once
possible shell instead of adding specific shell assignments to for every possible shell instead of adding specific shell
each shell's startup file. <link linkend="usr-setup">User assignments to each shell's startup file.
Level Setup</link> can be done by an user himself and <link <link linkend="usr-setup">User Level Setup</link> can be
linkend="adm-setup">Administrator Level Setup</link> require done by an user himself and
superuser privileges.</para> <link linkend="adm-setup">Administrator Level Setup</link>
require superuser privileges.</para>
<sect5 id="usr-setup"> <sect5 id="usr-setup">
<title>User Level Setup</title> <title>User Level Setup</title>
@ -285,12 +299,14 @@
:charset=ISO-8859-1:\ :charset=ISO-8859-1:\
:lang=de_DE.ISO8859-1:</programlisting> :lang=de_DE.ISO8859-1:</programlisting>
<indexterm><primary>Traditional Chinese</primary><secondary>BIG-5 encoding</secondary></indexterm> <indexterm><primary>Traditional Chinese</primary>
<secondary>BIG-5 encoding</secondary></indexterm>
<para>Here is an example of a <para>Here is an example of a
<filename>.login_conf</filename> that sets the variables <filename>.login_conf</filename> that sets the variables
for Traditional Chinese in BIG-5 encoding. Notice the many for Traditional Chinese in BIG-5 encoding. Notice the
more variables set because some software does not respect many more variables set because some software does not
locale variables correctly for Chinese, Japanese, and Korean.</para> respect locale variables correctly for Chinese,
Japanese, and Korean.</para>
<programlisting>#Users who do not wish to use monetary units or time formats <programlisting>#Users who do not wish to use monetary units or time formats
#of Taiwan can manually change each variable #of Taiwan can manually change each variable
@ -307,7 +323,8 @@ me:\
:xmodifiers="@im=gcin": #Set gcin as the XIM Input Server</programlisting> :xmodifiers="@im=gcin": #Set gcin as the XIM Input Server</programlisting>
<para>See <link linkend="adm-setup">Administrator Level <para>See <link linkend="adm-setup">Administrator Level
Setup</link> and &man.login.conf.5; for more details.</para> Setup</link> and &man.login.conf.5; for more
details.</para>
</sect5> </sect5>
<sect5 id="adm-setup"> <sect5 id="adm-setup">
@ -323,8 +340,8 @@ me:\
:lang=<replaceable>locale_name</replaceable>:\ :lang=<replaceable>locale_name</replaceable>:\
:tc=default:</programlisting> :tc=default:</programlisting>
<para>So sticking with our previous example using Latin-1, it <para>So sticking with our previous example using Latin-1,
would look like this:</para> it would look like this:</para>
<programlisting>german|German Users Accounts:\ <programlisting>german|German Users Accounts:\
:charset=ISO-8859-1:\ :charset=ISO-8859-1:\
@ -337,58 +354,65 @@ me:\
<screen>&prompt.root; <userinput>cap_mkdb /etc/login.conf</userinput></screen> <screen>&prompt.root; <userinput>cap_mkdb /etc/login.conf</userinput></screen>
<para>to make new configuration in <para>to make new configuration in
<filename>/etc/login.conf</filename> visible to the system.</para> <filename>/etc/login.conf</filename> visible to the
system.</para>
<bridgehead renderas="sect4">Changing Login Classes with &man.vipw.8;</bridgehead> <bridgehead renderas="sect4">Changing Login Classes with
&man.vipw.8;</bridgehead>
<indexterm> <indexterm>
<primary><command>vipw</command></primary> <primary><command>vipw</command></primary>
</indexterm> </indexterm>
<para>Use <command>vipw</command> to add new users, and make <para>Use <command>vipw</command> to add new users, and
the entry look like this:</para> make the entry look like this:</para>
<programlisting>user:password:1111:11:<replaceable>language</replaceable>:0:0:User Name:/home/user:/bin/sh</programlisting> <programlisting>user:password:1111:11:<replaceable>language</replaceable>:0:0:User Name:/home/user:/bin/sh</programlisting>
<bridgehead renderas="sect4">Changing Login Classes with &man.adduser.8;</bridgehead> <bridgehead renderas="sect4">Changing Login Classes with
&man.adduser.8;</bridgehead>
<indexterm> <indexterm>
<primary><command>adduser</command></primary> <primary><command>adduser</command></primary>
</indexterm> </indexterm>
<indexterm><primary>login class</primary></indexterm> <indexterm><primary>login class</primary></indexterm>
<para>Use <command>adduser</command> to add new users, and do <para>Use <command>adduser</command> to add new users,
the following:</para> and do the following:</para>
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para>Set <literal>defaultclass = <para>Set <literal>defaultclass =
<replaceable>language</replaceable></literal> in <replaceable>language</replaceable></literal> in
<filename>/etc/adduser.conf</filename>. Keep in mind <filename>/etc/adduser.conf</filename>. Keep in
you must enter a <literal>default</literal> class for mind you must enter a <literal>default</literal>
all users of other languages in this case.</para> class for all users of other languages in this
case.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>An alternative variant is answering the specified <para>An alternative variant is answering the
language each time that specified language each time that
<screen><prompt>Enter login class: default []:</prompt></screen> <screen><prompt>Enter login class: default []:</prompt></screen>
appears from &man.adduser.8;.</para> appears from &man.adduser.8;.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Another alternative is to use the following for each <para>Another alternative is to use the following for
user of a different language that you wish to each user of a different language that you wish to
add:</para> add:</para>
<screen>&prompt.root; <userinput>adduser -class <replaceable>language</replaceable></userinput></screen> <screen>&prompt.root; <userinput>adduser -class <replaceable>language</replaceable></userinput></screen>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
<bridgehead renderas="sect4">Changing Login Classes with &man.pw.8;</bridgehead> <bridgehead renderas="sect4">Changing Login Classes with
&man.pw.8;</bridgehead>
<indexterm> <indexterm>
<primary><command>pw</command></primary> <primary><command>pw</command></primary>
</indexterm> </indexterm>
<para>If you use &man.pw.8; for adding new users, call it in <para>If you use &man.pw.8; for adding new users, call
this form:</para> it in this form:</para>
<screen>&prompt.root; <userinput>pw useradd <replaceable>user_name</replaceable> -L <replaceable>language</replaceable></userinput></screen> <screen>&prompt.root; <userinput>pw useradd <replaceable>user_name</replaceable> -L <replaceable>language</replaceable></userinput></screen>
</sect5> </sect5>
@ -398,19 +422,20 @@ me:\
<title>Shell Startup File Method</title> <title>Shell Startup File Method</title>
<note> <note>
<para>This method is not recommended because it requires a <para>This method is not recommended because it requires
different setup for each possible shell program chosen. Use a different setup for each possible shell program
the <link linkend="login-class">Login Class Method</link> chosen. Use the <link linkend="login-class">Login Class
instead.</para> Method</link> instead.</para>
</note> </note>
<indexterm><primary>MIME</primary></indexterm> <indexterm><primary>MIME</primary></indexterm>
<indexterm><primary>locale</primary></indexterm> <indexterm><primary>locale</primary></indexterm>
<para>To add the locale name and MIME character set, just set <para>To add the locale name and MIME character set, just
the two environment variables shown below in the set the two environment variables shown below in the
<filename>/etc/profile</filename> and/or <filename>/etc/profile</filename> and/or
<filename>/etc/csh.login</filename> shell startup files. We <filename>/etc/csh.login</filename> shell startup files.
will use the German language as an example below:</para> We will use the German language as an example
below:</para>
<para>In <filename>/etc/profile</filename>:</para> <para>In <filename>/etc/profile</filename>:</para>
@ -423,11 +448,11 @@ me:\
<envar>setenv MM_CHARSET ISO-8859-1</envar></programlisting> <envar>setenv MM_CHARSET ISO-8859-1</envar></programlisting>
<para>Alternatively, you can add the above instructions to <para>Alternatively, you can add the above instructions to
<filename>/usr/share/skel/dot.profile</filename> (similar to <filename>/usr/share/skel/dot.profile</filename> (similar
what was used in <filename>/etc/profile</filename> above), or to what was used in <filename>/etc/profile</filename>
<filename>/usr/share/skel/dot.login</filename> (similar to above), or <filename>/usr/share/skel/dot.login</filename>
what was used in <filename>/etc/csh.login</filename> (similar to what was used in
above).</para> <filename>/etc/csh.login</filename> above).</para>
<para>For X11:</para> <para>For X11:</para>
@ -456,9 +481,10 @@ me:\
font8x14=<replaceable>font_name</replaceable> font8x14=<replaceable>font_name</replaceable>
font8x8=<replaceable>font_name</replaceable></programlisting> font8x8=<replaceable>font_name</replaceable></programlisting>
<para>The <replaceable>font_name</replaceable> here is taken from <para>The <replaceable>font_name</replaceable> here is taken
the <filename>/usr/share/syscons/fonts</filename> directory, from the <filename>/usr/share/syscons/fonts</filename>
without the <filename>.fnt</filename> suffix.</para> directory, without the <filename>.fnt</filename>
suffix.</para>
<indexterm> <indexterm>
<primary><application>sysinstall</application></primary> <primary><application>sysinstall</application></primary>
@ -468,21 +494,24 @@ font8x8=<replaceable>font_name</replaceable></programlisting>
<para>If required, set the keymap and screenmap for your <para>If required, set the keymap and screenmap for your
single C chars character set through single C chars character set through
<command>sysinstall</command>. <command>sysinstall</command>.
Once inside <application>sysinstall</application>, choose <guimenuitem>Configure</guimenuitem>, then Once inside <application>sysinstall</application>, choose
<guimenuitem>Console</guimenuitem>. Alternatively, you can add the <guimenuitem>Configure</guimenuitem>, then
following to <filename>/etc/rc.conf</filename>:</para> <guimenuitem>Console</guimenuitem>. Alternatively, you can
add the following to <filename>/etc/rc.conf</filename>:</para>
<programlisting>scrnmap=<replaceable>screenmap_name</replaceable> <programlisting>scrnmap=<replaceable>screenmap_name</replaceable>
keymap=<replaceable>keymap_name</replaceable> keymap=<replaceable>keymap_name</replaceable>
keychange="<replaceable>fkey_number sequence</replaceable>"</programlisting> keychange="<replaceable>fkey_number sequence</replaceable>"</programlisting>
<para>The <replaceable>screenmap_name</replaceable> here is taken <para>The <replaceable>screenmap_name</replaceable> here is
from the <filename>/usr/share/syscons/scrnmaps</filename> taken from the
directory, without the <filename>.scm</filename> suffix. A <filename>/usr/share/syscons/scrnmaps</filename> directory,
screenmap with a corresponding mapped font is usually needed as a without the <filename>.scm</filename> suffix. A screenmap
workaround for expanding bit 8 to bit 9 on a VGA adapter's font with a corresponding mapped font is usually needed as a
character matrix in pseudographics area, i.e., to move letters out workaround for expanding bit 8 to bit 9 on a VGA adapter's
of that area if screen font uses a bit 8 column.</para> font character matrix in pseudographics area, i.e., to move
letters out of that area if screen font uses a bit 8
column.</para>
<para>If you have the <application>moused</application> daemon <para>If you have the <application>moused</application> daemon
enabled by setting the following enabled by setting the following
@ -496,27 +525,29 @@ keychange="<replaceable>fkey_number sequence</replaceable>"</programlisting>
<indexterm> <indexterm>
<primary><application>moused</application></primary> <primary><application>moused</application></primary>
</indexterm> </indexterm>
<para>By default the mouse cursor of the &man.syscons.4; driver occupies the <para>By default the mouse cursor of the &man.syscons.4; driver
0xd0-0xd3 range in the character set. If your language uses this occupies the 0xd0-0xd3 range in the character set. If your
range, you need to move the cursor's range outside of it. To enable language uses this range, you need to move the cursor's range
the workaround for &os;, add the following line to outside of it. To enable the workaround for &os;, add the
<filename>/etc/rc.conf</filename>:</para> following line to <filename>/etc/rc.conf</filename>:</para>
<programlisting>mousechar_start=3</programlisting> <programlisting>mousechar_start=3</programlisting>
<para>The <replaceable>keymap_name</replaceable> here is taken from <para>The <replaceable>keymap_name</replaceable> here is taken
the <filename>/usr/share/syscons/keymaps</filename> directory, from the <filename>/usr/share/syscons/keymaps</filename>
without the <filename>.kbd</filename> suffix. If you are directory, without the <filename>.kbd</filename> suffix. If
uncertain which keymap to use, you use can &man.kbdmap.1; to test you are uncertain which keymap to use, you use can
keymaps without rebooting.</para> &man.kbdmap.1; to test keymaps without rebooting.</para>
<para>The <literal>keychange</literal> is usually needed to program <para>The <literal>keychange</literal> is usually needed to
function keys to match the selected terminal type because program function keys to match the selected terminal type
function key sequences cannot be defined in the key map.</para> because function key sequences cannot be defined in the key
map.</para>
<para>Also be sure to set the correct console terminal type in <para>Also be sure to set the correct console terminal type
<filename>/etc/ttys</filename> for all <literal>ttyv*</literal> in <filename>/etc/ttys</filename> for all
entries. Current pre-defined correspondences are:</para> <literal>ttyv*</literal> entries. Current pre-defined
correspondences are:</para>
<informaltable frame="none" pgwide="1"> <informaltable frame="none" pgwide="1">
<tgroup cols="2"> <tgroup cols="2">
@ -566,13 +597,14 @@ keychange="<replaceable>fkey_number sequence</replaceable>"</programlisting>
</tgroup> </tgroup>
</informaltable> </informaltable>
<para>For wide or multibyte characters languages, use the correct <para>For wide or multibyte characters languages, use the
FreeBSD port in your correct FreeBSD port in your
<filename>/usr/ports/<replaceable>language</replaceable></filename> <filename>/usr/ports/<replaceable>language</replaceable></filename>
directory. Some ports appear as console while the system sees it directory. Some ports appear as console while the system
as serial vtty's, hence you must reserve enough vtty's for both sees it as serial vtty's, hence you must reserve enough vtty's
X11 and the pseudo-serial console. Here is a partial list of for both X11 and the pseudo-serial console. Here is a partial
applications for using other languages in console:</para> list of applications for using other languages in
console:</para>
<informaltable frame="none" pgwide="1"> <informaltable frame="none" pgwide="1">
<tgroup cols="2"> <tgroup cols="2">
@ -586,18 +618,22 @@ keychange="<replaceable>fkey_number sequence</replaceable>"</programlisting>
<tbody> <tbody>
<row> <row>
<entry>Traditional Chinese (BIG-5)</entry> <entry>Traditional Chinese (BIG-5)</entry>
<entry><filename role="package">chinese/big5con</filename></entry> <entry><filename
role="package">chinese/big5con</filename></entry>
</row> </row>
<row> <row>
<entry>Japanese</entry> <entry>Japanese</entry>
<entry><filename role="package">japanese/kon2-16dot</filename> or <entry><filename
<filename role="package">japanese/mule-freewnn</filename></entry> role="package">japanese/kon2-16dot</filename> or
<filename
role="package">japanese/mule-freewnn</filename></entry>
</row> </row>
<row> <row>
<entry>Korean</entry> <entry>Korean</entry>
<entry><filename role="package">korean/han</filename></entry> <entry><filename
role="package">korean/han</filename></entry>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>
@ -613,27 +649,33 @@ keychange="<replaceable>fkey_number sequence</replaceable>"</programlisting>
url="http://www.x.org/">&xorg; url="http://www.x.org/">&xorg;
web site</ulink> or whichever X11 Server you use.</para> web site</ulink> or whichever X11 Server you use.</para>
<para>In <filename>~/.Xresources</filename>, you can additionally <para>In <filename>~/.Xresources</filename>, you can
tune application specific I18N settings (e.g., fonts, menus, additionally tune application specific I18N settings (e.g.,
etc.).</para> fonts, menus, etc.).</para>
<sect3> <sect3>
<title>Displaying Fonts</title> <title>Displaying Fonts</title>
<indexterm><primary>X11 True Type font server</primary></indexterm>
<indexterm><primary>X11 True Type font
server</primary></indexterm>
<para>Install <application>&xorg;</application> server <para>Install <application>&xorg;</application> server
(<filename role="package">x11-servers/xorg-server</filename>), (<filename
then install the language &truetype; fonts. Setting the correct role="package">x11-servers/xorg-server</filename>),
locale should allow you to view your selected language in menus then install the language &truetype; fonts. Setting the
and such.</para> correct locale should allow you to view your selected
language in menus and such.</para>
</sect3> </sect3>
<sect3> <sect3>
<title>Inputting Non-English Characters</title> <title>Inputting Non-English Characters</title>
<indexterm><primary>X11 Input Method (XIM)</primary></indexterm>
<para>The X11 Input Method (XIM) Protocol is a new standard for <indexterm><primary>X11 Input Method
all X11 clients. All X11 applications should be written as XIM (XIM)</primary></indexterm>
clients that take input from XIM Input servers. There are <para>The X11 Input Method (XIM) Protocol is a new standard
several XIM servers available for different languages.</para> for all X11 clients. All X11 applications should be written
as XIM clients that take input from XIM Input servers.
There are several XIM servers available for different
languages.</para>
</sect3> </sect3>
</sect2> </sect2>
@ -641,44 +683,45 @@ keychange="<replaceable>fkey_number sequence</replaceable>"</programlisting>
<title>Printer Setup</title> <title>Printer Setup</title>
<para>Some single C chars character sets are usually hardware <para>Some single C chars character sets are usually hardware
coded into printers. Wide or multibyte coded into printers. Wide or multibyte character sets require
character sets require special setup and we recommend using special setup and we recommend using
<application>apsfilter</application>. You may also convert the <application>apsfilter</application>. You may also convert
document to &postscript; or PDF formats using language specific the document to &postscript; or PDF formats using language
converters.</para> specific converters.</para>
</sect2> </sect2>
<sect2> <sect2>
<title>Kernel and File Systems</title> <title>Kernel and File Systems</title>
<para>The FreeBSD fast filesystem (FFS) is 8-bit clean, so it can be used <para>The FreeBSD fast filesystem (FFS) is 8-bit clean, so it
with any single C chars character set (see &man.multibyte.3;), can be used with any single C chars character set (see
but there is no character set &man.multibyte.3;), but there is no character set name stored
name stored in the filesystem; i.e., it is raw 8-bit and does not in the filesystem; i.e., it is raw 8-bit and does not know
know anything about encoding order. Officially, FFS does not anything about encoding order. Officially, FFS does not
support any form of wide or multibyte character sets yet. However, some support any form of wide or multibyte character sets yet.
wide or multibyte character sets have independent patches for FFS However, some wide or multibyte character sets have
enabling such support. They are only temporary unportable independent patches for FFS enabling such support. They are
solutions or hacks and we have decided to not include them in the only temporary unportable solutions or hacks and we have
source tree. Refer to respective languages' web sites for more decided to not include them in the source tree. Refer to
information and the patch files.</para> respective languages' web sites for more information and the
patch files.</para>
<indexterm><primary>DOS</primary></indexterm> <indexterm><primary>DOS</primary></indexterm>
<indexterm><primary>Unicode</primary></indexterm> <indexterm><primary>Unicode</primary></indexterm>
<para>The FreeBSD &ms-dos; filesystem has the configurable ability to <para>The FreeBSD &ms-dos; filesystem has the configurable
convert between &ms-dos;, Unicode character sets and chosen ability to convert between &ms-dos;, Unicode character sets
FreeBSD filesystem character sets. See &man.mount.msdosfs.8; for and chosen FreeBSD filesystem character sets. See
details.</para> &man.mount.msdosfs.8; for details.</para>
</sect2> </sect2>
</sect1> </sect1>
<sect1 id="l10n-compiling"> <sect1 id="l10n-compiling">
<title>Compiling I18N Programs</title> <title>Compiling I18N Programs</title>
<para>Many FreeBSD Ports have been ported with I18N support. Some <para>Many FreeBSD Ports have been ported with I18N support.
of them are marked with -I18N in the port name. These and many Some of them are marked with -I18N in the port name. These
other programs have built in support for I18N and need no special and many other programs have built in support for I18N and
consideration.</para> need no special consideration.</para>
<indexterm> <indexterm>
<primary><application>MySQL</application></primary> <primary><application>MySQL</application></primary>
@ -705,13 +748,14 @@ keychange="<replaceable>fkey_number sequence</replaceable>"</programlisting>
</authorgroup> </authorgroup>
</sect2info> </sect2info>
<title>Russian Language (KOI8-R Encoding)</title> <title>Russian Language (KOI8-R Encoding)</title>
<indexterm> <indexterm>
<primary>localization</primary> <primary>localization</primary>
<secondary>Russian</secondary> <secondary>Russian</secondary>
</indexterm> </indexterm>
<para>For more information about KOI8-R encoding, see the <ulink <para>For more information about KOI8-R encoding, see the
url="http://koi8.pp.ru/">KOI8-R References <ulink url="http://koi8.pp.ru/">KOI8-R References
(Russian Net Character Set)</ulink>.</para> (Russian Net Character Set)</ulink>.</para>
<sect3> <sect3>
@ -724,8 +768,8 @@ keychange="<replaceable>fkey_number sequence</replaceable>"</programlisting>
:charset=KOI8-R:\ :charset=KOI8-R:\
:lang=ru_RU.KOI8-R:</programlisting> :lang=ru_RU.KOI8-R:</programlisting>
<para>See earlier in this chapter for examples of setting up the <para>See earlier in this chapter for examples of setting
<link linkend="setting-locale">locale</link>.</para> up the <link linkend="setting-locale">locale</link>.</para>
</sect3> </sect3>
<sect3> <sect3>
@ -758,18 +802,20 @@ font8x8="cp866-8x8"</programlisting>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
<para>See earlier in this chapter for examples of setting up the <para>See earlier in this chapter for examples of setting up
<link linkend="setting-console">console</link>.</para> the <link linkend="setting-console">console</link>.</para>
</sect3> </sect3>
<sect3> <sect3>
<title>Printer Setup</title> <title>Printer Setup</title>
<indexterm><primary>printers</primary></indexterm> <indexterm><primary>printers</primary></indexterm>
<para>Since most printers with Russian characters come with <para>Since most printers with Russian characters come with
hardware code page CP866, a special output filter is needed hardware code page CP866, a special output filter is needed
to convert from KOI8-R to CP866. Such a filter is installed by to convert from KOI8-R to CP866. Such a filter is installed
default as <filename>/usr/libexec/lpr/ru/koi2alt</filename>. by default as
A Russian printer <filename>/etc/printcap</filename> entry <filename>/usr/libexec/lpr/ru/koi2alt</filename>. A
Russian printer <filename>/etc/printcap</filename> entry
should look like:</para> should look like:</para>
<programlisting>lp|Russian local line printer:\ <programlisting>lp|Russian local line printer:\
@ -782,16 +828,17 @@ font8x8="cp866-8x8"</programlisting>
<sect3> <sect3>
<title>&ms-dos; FS and Russian Filenames</title> <title>&ms-dos; FS and Russian Filenames</title>
<para>The following example &man.fstab.5; entry enables support <para>The following example &man.fstab.5; entry enables
for Russian filenames in mounted &ms-dos; filesystems:</para> support for Russian filenames in mounted &ms-dos;
filesystems:</para>
<programlisting>/dev/ad0s2 /dos/c msdos rw,-Wkoi2dos,-Lru_RU.KOI8-R 0 0</programlisting> <programlisting>/dev/ad0s2 /dos/c msdos rw,-Wkoi2dos,-Lru_RU.KOI8-R 0 0</programlisting>
<para>The option <option>-L</option> selects the locale name <para>The option <option>-L</option> selects the locale name
used, and <option>-W</option> sets the character conversion used, and <option>-W</option> sets the character conversion
table. To use the <option>-W</option> option, be sure to table. To use the <option>-W</option> option, be sure to
mount <filename>/usr</filename> before the &ms-dos; partition mount <filename>/usr</filename> before the &ms-dos;
because the conversion tables are located in partition because the conversion tables are located in
<filename>/usr/libdata/msdosfs</filename>. For more <filename>/usr/libdata/msdosfs</filename>. For more
information, see the &man.mount.msdosfs.8; manual information, see the &man.mount.msdosfs.8; manual
page.</para> page.</para>
@ -808,25 +855,25 @@ font8x8="cp866-8x8"</programlisting>
<listitem> <listitem>
<para>If you use <application>&xorg;</application>, <para>If you use <application>&xorg;</application>,
install install <filename
<filename role="package">x11-fonts/xorg-fonts-cyrillic</filename> role="package">x11-fonts/xorg-fonts-cyrillic</filename>
package.</para> package.</para>
<para>Check the <literal>"Files"</literal> section <para>Check the <literal>"Files"</literal> section in
in your <filename>/etc/X11/xorg.conf</filename> file. your <filename>/etc/X11/xorg.conf</filename> file. The
The following following line must be added <emphasis>before</emphasis>
line must be added <emphasis>before</emphasis> any other any other <literal>FontPath</literal> entries:</para>
<literal>FontPath</literal> entries:</para>
<programlisting>FontPath "/usr/local/lib/X11/fonts/cyrillic"</programlisting> <programlisting>FontPath "/usr/local/lib/X11/fonts/cyrillic"</programlisting>
<note> <note>
<para>See ports for more cyrillic fonts.</para></note> <para>See ports for more cyrillic fonts.</para>
</note>
</listitem> </listitem>
<listitem> <listitem>
<para>To activate a Russian keyboard, add the following to the <para>To activate a Russian keyboard, add the following
<literal>"Keyboard"</literal> section of your to the <literal>"Keyboard"</literal> section of your
<filename>xorg.conf</filename> file:</para> <filename>xorg.conf</filename> file:</para>
<programlisting>Option "XkbLayout" "us,ru" <programlisting>Option "XkbLayout" "us,ru"
@ -837,26 +884,28 @@ Option "XkbOptions" "grp:toggle"</programlisting>
<para>For <literal>grp:toggle</literal> <para>For <literal>grp:toggle</literal>
the RUS/LAT switch will be <keycap>Right Alt</keycap>, the RUS/LAT switch will be <keycap>Right Alt</keycap>,
for <literal>grp:ctrl_shift_toggle</literal> switch will be for <literal>grp:ctrl_shift_toggle</literal> switch
<keycombo action="simul"><keycap>Ctrl</keycap><keycap>Shift</keycap></keycombo>. will be <keycombo
For <literal>grp:caps_toggle</literal> action="simul"><keycap>Ctrl</keycap><keycap>Shift</keycap></keycombo>.
the RUS/LAT switch will be <keycap>CapsLock</keycap>. For <literal>grp:caps_toggle</literal> the RUS/LAT
The old <keycap>CapsLock</keycap> function is still switch will be <keycap>CapsLock</keycap>. The old
available via <keycombo action="simul"><keycap>Shift</keycap><keycap>CapsLock</keycap></keycombo> (in LAT mode <keycap>CapsLock</keycap> function is still available
only). via <keycombo
<literal>grp:caps_toggle</literal> does not work in action="simul"><keycap>Shift</keycap><keycap>CapsLock</keycap></keycombo>
<application>&xorg;</application> for unknown reason.</para> (in LAT mode only). <literal>grp:caps_toggle</literal>
does not work in <application>&xorg;</application> for
unknown reason.</para>
<para>If you have <quote>&windows;</quote> keys on your keyboard, <para>If you have <quote>&windows;</quote> keys on your
and notice that some non-alphabetical keys are mapped keyboard, and notice that some non-alphabetical keys
incorrectly in RUS mode, add the following line in your are mapped incorrectly in RUS mode, add the following
<filename>xorg.conf</filename> file:</para> line in your <filename>xorg.conf</filename> file:</para>
<programlisting>Option "XkbVariant" ",winkeys"</programlisting> <programlisting>Option "XkbVariant" ",winkeys"</programlisting>
<note> <note>
<para>The Russian XKB keyboard may not work with non-localized <para>The Russian XKB keyboard may not work with
applications.</para> non-localized applications.</para>
</note> </note>
</listitem> </listitem>
</orderedlist> </orderedlist>
@ -864,8 +913,8 @@ Option "XkbOptions" "grp:toggle"</programlisting>
<para>Minimally localized applications <para>Minimally localized applications
should call a <function>XtSetLanguageProc (NULL, NULL, should call a <function>XtSetLanguageProc (NULL, NULL,
NULL);</function> function early in the program.</para> NULL);</function> function early in the program.</para>
<para>See <ulink
url="http://koi8.pp.ru/xwin.html"> <para>See <ulink url="http://koi8.pp.ru/xwin.html">
KOI8-R for X Window</ulink> for more instructions on KOI8-R for X Window</ulink> for more instructions on
localizing X11 applications.</para> localizing X11 applications.</para>
</note> </note>
@ -874,27 +923,31 @@ Option "XkbOptions" "grp:toggle"</programlisting>
<sect2> <sect2>
<title>Traditional Chinese Localization for Taiwan</title> <title>Traditional Chinese Localization for Taiwan</title>
<indexterm> <indexterm>
<primary>localization</primary> <primary>localization</primary>
<secondary>Traditional Chinese</secondary> <secondary>Traditional Chinese</secondary>
</indexterm> </indexterm>
<para>The FreeBSD-Taiwan Project has an Chinese HOWTO for <para>The FreeBSD-Taiwan Project has an Chinese HOWTO for
FreeBSD at <ulink url="http://netlab.cse.yzu.edu.tw/~statue/freebsd/zh-tut/"></ulink> FreeBSD at <ulink
using many Chinese ports. url="http://netlab.cse.yzu.edu.tw/~statue/freebsd/zh-tut/"></ulink>
Current editor for the <literal>FreeBSD Chinese HOWTO</literal> is using many Chinese ports. Current editor for the
Shen Chuan-Hsing <email>statue@freebsd.sinica.edu.tw</email>. <literal>FreeBSD Chinese HOWTO</literal> is Shen Chuan-Hsing
</para> <email>statue@freebsd.sinica.edu.tw</email>.</para>
<para>Chuan-Hsing Shen <email>statue@freebsd.sinica.edu.tw</email> has <para>Chuan-Hsing Shen
created the <ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/"> <email>statue@freebsd.sinica.edu.tw</email> has created the
Chinese FreeBSD Collection (CFC)</ulink> using FreeBSD-Taiwan's <ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/">
<literal>zh-L10N-tut</literal>. The packages and the script files Chinese FreeBSD Collection (CFC)</ulink> using
are available at <ulink url="ftp://freebsd.csie.nctu.edu.tw/pub/taiwan/CFC/"></ulink>.</para> FreeBSD-Taiwan's <literal>zh-L10N-tut</literal>. The packages
and the script files are available at <ulink
url="ftp://freebsd.csie.nctu.edu.tw/pub/taiwan/CFC/"></ulink>.</para>
</sect2> </sect2>
<sect2> <sect2>
<title>German Language Localization (for All ISO 8859-1 <title>German Language Localization (for All ISO 8859-1
Languages)</title> Languages)</title>
<indexterm> <indexterm>
<primary>localization</primary> <primary>localization</primary>
<secondary>German</secondary> <secondary>German</secondary>
@ -902,8 +955,8 @@ Option "XkbOptions" "grp:toggle"</programlisting>
<para>Slaven Rezic <email>eserte@cs.tu-berlin.de</email> wrote a <para>Slaven Rezic <email>eserte@cs.tu-berlin.de</email> wrote a
tutorial on using umlauts on a FreeBSD machine. The tutorial tutorial on using umlauts on a FreeBSD machine. The tutorial
is written in German and is available at is written in German and is available at <ulink
<ulink url="http://user.cs.tu-berlin.de/~eserte/FreeBSD/doc/umlaute/umlaute.html"></ulink>.</para> url="http://user.cs.tu-berlin.de/~eserte/FreeBSD/doc/umlaute/umlaute.html"></ulink>.</para>
</sect2> </sect2>
<sect2> <sect2>
@ -913,15 +966,17 @@ Option "XkbOptions" "grp:toggle"</programlisting>
<primary>localization</primary> <primary>localization</primary>
<secondary>Greek</secondary> <secondary>Greek</secondary>
</indexterm> </indexterm>
<para>Nikos Kokkalis <email>nickkokkalis@gmail.com</email> has written <para>Nikos Kokkalis <email>nickkokkalis@gmail.com</email> has
a complete article on Greek support in &os;. It is available as written a complete article on Greek support in &os;. It is
part of the official &os; Greek documentation, in <ulink available as part of the official &os; Greek documentation, in
<ulink
url="&url.doc.base;/el_GR.ISO8859-7/articles/greek-language-support/index.html">http://www.freebsd.org/doc/el_GR.ISO8859-7/articles/greek-language-support/index.html</ulink>. url="&url.doc.base;/el_GR.ISO8859-7/articles/greek-language-support/index.html">http://www.freebsd.org/doc/el_GR.ISO8859-7/articles/greek-language-support/index.html</ulink>.
Please note this is in Greek <emphasis>only</emphasis>.</para> Please note this is in Greek <emphasis>only</emphasis>.</para>
</sect2> </sect2>
<sect2> <sect2>
<title>Japanese and Korean Language Localization</title> <title>Japanese and Korean Language Localization</title>
<indexterm> <indexterm>
<primary>localization</primary> <primary>localization</primary>
<secondary>Japanese</secondary> <secondary>Japanese</secondary>
@ -939,8 +994,9 @@ Option "XkbOptions" "grp:toggle"</programlisting>
<sect2> <sect2>
<title>Non-English FreeBSD Documentation</title> <title>Non-English FreeBSD Documentation</title>
<para>Some FreeBSD contributors have translated parts of FreeBSD documentation to <para>Some FreeBSD contributors have translated parts of
other languages. They are available through links on the <ulink FreeBSD documentation to other languages. They are available
through links on the <ulink
url="&url.base;/index.html">main site</ulink> or in url="&url.base;/index.html">main site</ulink> or in
<filename>/usr/share/doc</filename>.</para> <filename>/usr/share/doc</filename>.</para>
</sect2> </sect2>