From owner-svn-doc-all@FreeBSD.ORG Tue Feb 11 16:35:55 2014 Return-Path: Delivered-To: svn-doc-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6800B2CA; Tue, 11 Feb 2014 16:35:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F9A914D6; Tue, 11 Feb 2014 16:35:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1BGZtP7076615; Tue, 11 Feb 2014 16:35:55 GMT (envelope-from dru@svn.freebsd.org) Received: (from dru@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1BGZt2o076614; Tue, 11 Feb 2014 16:35:55 GMT (envelope-from dru@svn.freebsd.org) Message-Id: <201402111635.s1BGZt2o076614@svn.freebsd.org> From: Dru Lavigne Date: Tue, 11 Feb 2014 16:35:55 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r43873 - head/en_US.ISO8859-1/books/handbook/l10n X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire doc trees \(except for " user" , " projects" , and " translations" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Feb 2014 16:35:55 -0000 Author: dru Date: Tue Feb 11 16:35:54 2014 New Revision: 43873 URL: http://svnweb.freebsd.org/changeset/doc/43873 Log: More tightening and clarification in this chapter. More commits to follow. Sponsored by: iXsystems Modified: head/en_US.ISO8859-1/books/handbook/l10n/chapter.xml Modified: head/en_US.ISO8859-1/books/handbook/l10n/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/handbook/l10n/chapter.xml Tue Feb 11 15:38:07 2014 (r43872) +++ head/en_US.ISO8859-1/books/handbook/l10n/chapter.xml Tue Feb 11 16:35:54 2014 (r43873) @@ -173,64 +173,60 @@ Setting Locale for Login Shell - Usually it is sufficient to export the value of the - locale name as LANG in the login shell. This - could be done in the user's ~/.login_conf + Locale settings are configured either in a user's + ~/.login_conf or in the startup file of the user's shell: - (~/.profile, + ~/.profile, ~/.bashrc, or - ~/.cshrc). There is no need to set the - locale subsets such as LC_CTYPE or - LC_CTIME. Refer to language-specific &os; - documentation for more information. + ~/.cshrc. - Each user should set the following two environment - variables in their configuration files: + Two environment + variables should be set: - LANG for &posix; + LANG, which sets the locale POSIX - - &man.setlocale.3; family functions + MIME - MM_CHARSET for applications' MIME - character set + MM_CHARSET which sets the MIME + character set used by applications - These should be set in the user's shell configuration, the - specific application configuration, and the + In addition to the user's shell configuration, these + variables should also be set for + specific application configuration and Xorg configuration. locale login class - This section describes the two methods for setting - locale. The first is recommended and assigns the - environment variables in the - login class. The second - method adds the environment variable assignments to the - system's shell - startup file. + Two methods are available for making the needed variable + assignments: the + login class method, which + is the recommended method, and the + startup file method. + The next two sections demonstrate how to use both methods. Login Classes Method - This method assigns the required environment variables for + 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 be either be - performed by each user or it can be performed for all users by the + This setup can either be + performed by each user or it can be configured for all users by the superuser. - This minimal example sets both variables for the - Latin-1 encoding. These lines were added to the - .login_conf in an individual user's + This minimal example sets both variables for + Latin-1 encoding in the + .login_conf of an individual user's home directory: me:\ @@ -240,9 +236,9 @@ Traditional Chinese BIG-5 encoding Here is an example of a user's - .login_conf that sets the variables + ~/.login_conf that sets the variables for Traditional Chinese in BIG-5 encoding. More - variables are set because some applications do not + variables are needed because some applications do not correctly respect locale variables for Chinese, Japanese, and Korean: @@ -260,19 +256,16 @@ me:\ :charset=big5:\ :xmodifiers="@im=gcin": #Set gcin as the XIM Input Server - See &man.login.conf.5; for more - details. - - Alternately, the superuser can configure all users of the system for localization. The following variables in the user's login class in - /etc/login.conf set the correct - language: + Alternately, the superuser can configure all users of the system for localization. The following variables in + /etc/login.conf are used to set the locale and + MIME character sete: language_name|Account Type Description:\ :charset=MIME_charset:\ :lang=locale_name:\ :tc=default: - The previous Latin-1 example would look like + So, the previous Latin-1 example would look like this: german|German Users Accounts:\ @@ -280,73 +273,61 @@ me:\ :lang=de_DE.ISO8859-1:\ :tc=default: + See &man.login.conf.5; for more + details about these variables. + Whenever /etc/login.conf is edited, remember to execute the following command to update the capability database: &prompt.root; cap_mkdb /etc/login.conf - Changing Login Classes with - &man.vipw.8; + Utilities Which Change Login Classes vipw + + In addition to manually editing + /etc/login.conf, several utilities + are available for setting the locale for newly created + users. + When using vipw to add new users, - use language to set the - language: + specify the language to set the + locale: user:password:1111:11:language:0:0:User Name:/home/user:/bin/sh - - - - Changing Login Classes with - &man.adduser.8; adduser login class When using adduser to add new - users, configure the language as follows: + users, the default language can be pre-configured for + all new users or specified for an individual user. - - If all new users use the same language, set defaultclass = language in /etc/adduser.conf. - - - Alternatively, input the specified language at - this prompt: + To override this setting when creating a + user, either input the required locale at + this prompt: Enter login class: default []: - when creating a new user using - &man.adduser.8;. - - - - Another alternative is to use the following - when creating a user that uses a different language - than the one set in - /etc/adduser.conf: + or specify the locale to set when invoking + adduser: &prompt.root; adduser -class language - - - - - Changing Login Classes with - &man.pw.8; pw - If &man.pw.8; is used to add new users, call - it in this form: + If pw is used to add new users, specify the + locale as follows: &prompt.root; pw useradd user_name -L language @@ -355,39 +336,33 @@ me:\ Shell Startup File Method - - This method is not recommended because it requires - a different setup for each shell. Use the Login Class Method - instead. - - - MIME - locale - To add the locale name and MIME character set, set - the two environment variables shown below in the - /etc/profile or - /etc/csh.login shell startup files. - This example sets the German language: - - In /etc/profile: + 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 sh shell, these + lines could be added to ~/.profile to set the shell for that user only. + Thse lines could also be added to /etc/profile or + /usr/share/skel/dot.profile to set that shell for all users: LANG=de_DE.ISO8859-1; export LANG MM_CHARSET=ISO-8859-1; export MM_CHARSET - Or in /etc/csh.login: + However, the name of the configuration file and the + syntax used differs for the + csh shell. These are the equivalent + settings for ~/.csh.login, + /etc/csh.login, or + /usr/share/skel/dot.login: setenv LANG de_DE.ISO8859-1 setenv MM_CHARSET ISO-8859-1 - Alternatively, add the above settings to - /usr/share/skel/dot.profile or - /usr/share/skel/dot.login. - - To configure Xorg, add - one of the following to - ~/.xinitrc, depending upon the - shell: + To complicate matters, the syntax needed to configure + Xorg in + ~/.xinitrc also depends upon the + shell. The first example is for the sh + shell and the second is for the csh + shell. LANG=de_DE.ISO8859-1; export LANG