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