White space fix only. Translators can ignore.

Sponsored by: iXsystems
This commit is contained in:
Dru Lavigne 2014-02-11 16:55:42 +00:00
parent 14f6f9faeb
commit 1951bf0bf6
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=43874

View file

@ -110,14 +110,15 @@
<indexterm><primary>language codes</primary></indexterm>
<indexterm><primary>country codes</primary></indexterm>
<para>The <replaceable>LanguageCode</replaceable> and <replaceable>CountryCode</replaceable> are used
to determine the country
and the specific language
variation. <xref linkend="locale-lang-country"/> provides some
examples of <replaceable>LanguageCode</replaceable>_<replaceable>CountryCode</replaceable>:</para>
<para>The <replaceable>LanguageCode</replaceable> and
<replaceable>CountryCode</replaceable> are used to determine
the country and the specific language variation. <xref
linkend="locale-lang-country"/> provides some examples of
<replaceable>LanguageCode</replaceable>_<replaceable>CountryCode</replaceable>:</para>
<table xml:id="locale-lang-country" frame="none" pgwide="1">
<title>Common Language and Country Codes</title>
<tgroup cols="2">
<thead>
<row>
@ -148,10 +149,10 @@
<indexterm><primary>encodings</primary></indexterm>
<indexterm><primary>ASCII</primary></indexterm>
<para>Some languages, such as Chinese or Japanese, cannot be represented using ASCII characters
and require an extended language encoding using either
wide or multibyte characters. Older applications
may mistake these encodings for control
<para>Some languages, such as Chinese or Japanese, cannot be
represented using ASCII characters and require an extended
language encoding using either wide or multibyte characters.
Older applications may mistake these encodings for control
characters while newer applications usually recognize 8-bit
characters. Depending on the implementation, users may be
required to compile an application with wide or multibyte
@ -161,13 +162,13 @@
considerations for finding or compiling applications with i18n
support.</para>
<para>A complete listing of available locales can be found by
<para>A complete listing of available locales can be found by
typing:</para>
<screen>&prompt.user; <userinput>locale -a | more</userinput></screen>
<para>To determine the current locale setting:</para>
<screen>&prompt.user; <userinput>locale</userinput></screen>
<sect2 xml:id="setting-locale">
@ -186,8 +187,7 @@
<itemizedlist>
<listitem>
<para><envar>LANG</envar>, which sets the locale<indexterm>
<primary>POSIX</primary>
</indexterm></para>
<primary>POSIX</primary></indexterm></para>
</listitem>
<listitem>
@ -203,46 +203,44 @@
specific application configuration and
<application>Xorg</application> configuration.</para>
<indexterm><primary>locale</primary></indexterm>
<indexterm><primary>login class</primary></indexterm>
<indexterm><primary>locale</primary></indexterm>
<indexterm><primary>login class</primary></indexterm>
<para>Two methods are available for making the needed variable
assignments: the
<link linkend="login-class">login class</link> method, which
is the recommended method, and the
<link linkend="startup-file">startup file</link> method.
The next two sections demonstrate how to use both methods.</para>
<para>Two methods are available for making the needed variable
assignments: the <link linkend="login-class">login
class</link> method, which is the recommended method, and
the <link linkend="startup-file">startup file</link> method.
The next two sections demonstrate how to use both
methods.</para>
<sect3 xml:id="login-class">
<title>Login Classes Method</title>
<sect3 xml:id="login-class">
<title>Login Classes Method</title>
<para>This first method is the recommended method as it
assigns the required environment variables for
locale name and MIME character sets
for every possible shell.
This setup can either be
performed by each user or it can be configured for all users by the
superuser.</para>
<para>This first method is the recommended method as it
assigns the required environment variables for locale name
and MIME character sets for every possible shell. This
setup can either be performed by each user or it can be
configured for all users by the superuser.</para>
<para>This minimal example sets both variables for
Latin-1 encoding in the
<filename>.login_conf</filename> of an individual user's
home directory:</para>
<para>This minimal example sets both variables for Latin-1
encoding in the <filename>.login_conf</filename> of an
individual user's home directory:</para>
<programlisting>me:\
<programlisting>me:\
:charset=ISO-8859-1:\
:lang=de_DE.ISO8859-1:</programlisting>
<indexterm><primary>Traditional Chinese</primary>
<secondary>BIG-5 encoding</secondary></indexterm>
<para>Here is an example of a user's
<filename>~/.login_conf</filename> that sets the variables
for Traditional Chinese in BIG-5 encoding. More
variables are needed because some applications do not
correctly respect locale variables for Chinese,
Japanese, and Korean:</para>
<indexterm><primary>Traditional Chinese</primary>
<secondary>BIG-5 encoding</secondary></indexterm>
<programlisting>#Users who do not wish to use monetary units or time formats
<para>Here is an example of a user's
<filename>~/.login_conf</filename> that sets the variables
for Traditional Chinese in BIG-5 encoding. More variables
are needed because some applications do not correctly
respect locale variables for Chinese, Japanese, and
Korean:</para>
<programlisting>#Users who do not wish to use monetary units or time formats
#of Taiwan can manually change each variable
me:\
:lang=zh_TW.Big5:\
@ -256,103 +254,108 @@ me:\
:charset=big5:\
:xmodifiers="@im=gcin": #Set gcin as the XIM Input Server</programlisting>
<para>Alternately, the superuser can configure all users of the system for localization. The following variables in
<filename>/etc/login.conf</filename> are used to set the locale and
MIME character sete:</para>
<para>Alternately, the superuser can configure all users of
the system for localization. The following variables in
<filename>/etc/login.conf</filename> are used to set the
locale and MIME character sete:</para>
<programlisting><replaceable>language_name</replaceable>|<replaceable>Account Type Description</replaceable>:\
<programlisting><replaceable>language_name</replaceable>|<replaceable>Account Type Description</replaceable>:\
:charset=<replaceable>MIME_charset</replaceable>:\
:lang=<replaceable>locale_name</replaceable>:\
:tc=default:</programlisting>
<para>So, the previous Latin-1 example would look like
this:</para>
<para>So, the previous Latin-1 example would look like
this:</para>
<programlisting>german|German Users Accounts:\
<programlisting>german|German Users Accounts:\
:charset=ISO-8859-1:\
:lang=de_DE.ISO8859-1:\
:tc=default:</programlisting>
<para>See &man.login.conf.5; for more
details about these variables.</para>
<para>See &man.login.conf.5; for more details about these
variables.</para>
<para>Whenever <filename>/etc/login.conf</filename> is edited, remember to execute the following
command to update the capability database:</para>
<para>Whenever <filename>/etc/login.conf</filename> is edited,
remember to execute the following command to update the
capability database:</para>
<screen>&prompt.root; <userinput>cap_mkdb /etc/login.conf</userinput></screen>
<screen>&prompt.root; <userinput>cap_mkdb /etc/login.conf</userinput></screen>
<sect4>
<title>Utilities Which Change Login Classes</title>
<sect4>
<title>Utilities Which Change Login Classes</title>
<indexterm>
<primary><command>vipw</command></primary>
</indexterm>
<para>In addition to manually editing
<filename>/etc/login.conf</filename>, several utilities
are available for setting the locale for newly created
users.</para>
<indexterm>
<primary><command>vipw</command></primary>
</indexterm>
<para>When using <command>vipw</command> to add new users,
specify the <replaceable>language</replaceable> to set the
locale:</para>
<para>In addition to manually editing
<filename>/etc/login.conf</filename>, several utilities
are available for setting the locale for newly created
users.</para>
<programlisting>user:password:1111:11:<replaceable>language</replaceable>:0:0:User Name:/home/user:/bin/sh</programlisting>
<para>When using <command>vipw</command> to add new users,
specify the <replaceable>language</replaceable> to set the
locale:</para>
<indexterm>
<primary><command>adduser</command></primary>
</indexterm>
<indexterm><primary>login class</primary></indexterm>
<para>When using <command>adduser</command> to add new
users, the default language can be pre-configured for
all new users or specified for an individual user.</para>
<programlisting>user:password:1111:11:<replaceable>language</replaceable>:0:0:User Name:/home/user:/bin/sh</programlisting>
<para>If all new users use the same language, set
<literal>defaultclass =
language</literal> in
<filename>/etc/adduser.conf</filename>.</para>
<indexterm>
<primary><command>adduser</command></primary>
</indexterm>
<indexterm><primary>login class</primary></indexterm>
<para>To override this setting when creating a
user, either input the required locale at
this prompt:</para>
<para>When using <command>adduser</command> to add new
users, the default language can be pre-configured for all
new users or specified for an individual user.</para>
<screen><prompt>Enter login class: default []:</prompt></screen>
<para>If all new users use the same language, set
<literal>defaultclass = language</literal> in
<filename>/etc/adduser.conf</filename>.</para>
<para>or specify the locale to set when invoking
<command>adduser</command>:</para>
<para>To override this setting when creating a user, either
input the required locale at this prompt:</para>
<screen>&prompt.root; <userinput>adduser -class language</userinput></screen>
<screen><prompt>Enter login class: default []:</prompt></screen>
<indexterm>
<primary><command>pw</command></primary>
</indexterm>
<para>If <command>pw</command> is used to add new users, specify the
locale as follows:</para>
<para>or specify the locale to set when invoking
<command>adduser</command>:</para>
<screen>&prompt.root; <userinput>pw useradd user_name -L language</userinput></screen>
<screen>&prompt.root; <userinput>adduser -class language</userinput></screen>
<indexterm>
<primary><command>pw</command></primary>
</indexterm>
<para>If <command>pw</command> is used to add new users,
specify the locale as follows:</para>
<screen>&prompt.root; <userinput>pw useradd user_name -L language</userinput></screen>
</sect4>
</sect3>
<sect3 xml:id="startup-file">
<title>Shell Startup File Method</title>
<para>This method is not recommended as each shell that is used requires
manual configuration, where each shell has a different configuration file
and differing syntax. As an example, to set the German
language for the <command>sh</command> shell, these
lines could be added to <filename>~/.profile</filename> to set the shell for that user only.
Thse lines could also be added to <filename>/etc/profile</filename> or
<filename>/usr/share/skel/dot.profile</filename> to set that shell for all users:</para>
<para>This method is not recommended as each shell that is
used requires manual configuration, where each shell has a
different configuration file and differing syntax. As an
example, to set the German language for the
<command>sh</command> shell, these lines could be added to
<filename>~/.profile</filename> to set the shell for that
user only. Thse lines could also be added to
<filename>/etc/profile</filename> or
<filename>/usr/share/skel/dot.profile</filename> to set
that shell for all users:</para>
<programlisting><envar>LANG=de_DE.ISO8859-1; export LANG</envar>
<envar>MM_CHARSET=ISO-8859-1; export MM_CHARSET</envar></programlisting>
<para>However, the name of the configuration file and the
syntax used differs for the
<command>csh</command> shell. These are the equivalent
settings for <filename>~/.csh.login</filename>,
<filename>/etc/csh.login</filename>, or
<filename>/usr/share/skel/dot.login</filename>:</para>
<para>However, the name of the configuration file and the
syntax used differs for the <command>csh</command> shell.
These are the equivalent settings for
<filename>~/.csh.login</filename>,
<filename>/etc/csh.login</filename>, or
<filename>/usr/share/skel/dot.login</filename>:</para>
<programlisting><envar>setenv LANG de_DE.ISO8859-1</envar>
<envar>setenv MM_CHARSET ISO-8859-1</envar></programlisting>
@ -604,45 +607,40 @@ keychange="<replaceable>fkey_number sequence</replaceable>"</programlisting>
<sect1 xml:id="l10n-compiling">
<title>Compiling <acronym>i18n</acronym> Programs</title>
<para>The &os;
<link xlink:href="&url.base;/ports/index.html">&os; Ports
Collection</link> contains programs which provide
application support for wide or multibyte characters for several languages.
Refer to the <acronym>i18n</acronym> documentation in the
respective &os; port
for more information on how to configure the application correctly or to
determine which compile options to use when building the
port.</para>
<para>The &os; <link xlink:href="&url.base;/ports/index.html">&os;
Ports Collection</link> contains programs which provide
application support for wide or multibyte characters for several
languages. Refer to the <acronym>i18n</acronym> documentation
in the respective &os; port for more information on how to
configure the application correctly or to determine which
compile options to use when building the port.</para>
<para>Some things to keep in mind are:</para>
<para>Some things to keep in mind are:</para>
<itemizedlist>
<listitem>
<para>Language specific single C chars character sets
such as ISO8859-1, ISO8859-15, KOI8-R, and CP437. These
are described in &man.multibyte.3;.</para>
</listitem>
<itemizedlist>
<listitem>
<para>Language specific single C chars character sets such as
ISO8859-1, ISO8859-15, KOI8-R, and CP437. These are
described in &man.multibyte.3;.</para>
</listitem>
<listitem>
<para>Wide or multibyte encodings such as EUC and
Big5.</para>
</listitem>
</itemizedlist>
<listitem>
<para>Wide or multibyte encodings such as EUC and Big5.</para>
</listitem>
</itemizedlist>
<para>The active list of character sets can be found at the
<link
xlink:href="http://www.iana.org/assignments/character-sets">IANA
Registry</link>.</para>
<para>The active list of character sets can be found at the <link
xlink:href="http://www.iana.org/assignments/character-sets">IANA
Registry</link>.</para>
<note>
<para>&os; uses Xorg-compatible locale encodings
instead.</para>
</note>
<note>
<para>&os; uses Xorg-compatible locale encodings instead.</para>
</note>
<para>In the &os; Ports Collection, <acronym>i18n</acronym>
applications include <literal>i18n</literal> in their names
for easy identification. However, they do not always support
the language needed.</para>
<para>In the &os; Ports Collection, <acronym>i18n</acronym>
applications include <literal>i18n</literal> in their names for
easy identification. However, they do not always support the
language needed.</para>
<para>Many applications in the &os; Ports Collection have been
ported with <acronym>i18n</acronym> support. Some of these