website diff en/doc/scratchbook/locale.html @ rev 427
en/asso.html: set minimum contribution value
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Apr 21 09:44:43 2009 +0200 (2009-04-21) |
parents | |
children | fa2c5bed2417 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/en/doc/scratchbook/locale.html Tue Apr 21 09:44:43 2009 +0200 1.3 @@ -0,0 +1,162 @@ 1.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 1.5 + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 1.6 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 1.7 +<head> 1.8 + <title>SliTaz Scratchbook - Locale & i18n</title> 1.9 + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> 1.10 + <meta name="description" content="" /> 1.11 + <meta name="expires" content="never" /> 1.12 + <meta name="modified" content="2008-11-22 17:00:00" /> 1.13 + <meta name="publisher" content="www.slitaz.org" /> 1.14 + <meta name="author" content="Christophe Lincoln"/> 1.15 + <link rel="shortcut icon" href="favicon.ico" /> 1.16 + <link rel="stylesheet" type="text/css" href="book.css" /> 1.17 +</head> 1.18 +<body bgcolor="#ffffff"> 1.19 + 1.20 +<!-- Header and quick navigation --> 1.21 +<div id="header"> 1.22 +<div align="right" id="quicknav"> 1.23 + <a name="top"></a> 1.24 + <a href="base-ncurses.html">Base ncurses</a> | 1.25 + <a href="index.html">Table of contents</a> | 1.26 + <a href="boot-scripts.html">Boot scripts</a> 1.27 +</div> 1.28 +<h1><font color="#3E1220">SliTaz Scratchbook</font></h1> 1.29 +</div> 1.30 + 1.31 +<!-- Content. --> 1.32 +<div id="content"> 1.33 +<div class="content-right"></div> 1.34 + 1.35 + 1.36 +<h2><font color="#df8f06">Locale & i18n</font></h2> 1.37 +<p> 1.38 +Installation and configuration of locales. 1.39 +</p> 1.40 +<ul> 1.41 + <li><a href="#install">Locale installation.</a></li> 1.42 + <li><a href="#config">Config and use of locale on SliTaz.</a></li> 1.43 +</ul> 1.44 +<a name="install"></a> 1.45 +<h3><font color="#6c0023">Locale installation</font></h3> 1.46 +<p> 1.47 +This chapter describes the installation of locales in SliTaz GNU/Linux from a SliTaz GNU/Linux host system. 1.48 +The installation of locales contained in the X server are described in the chapter 1.49 +<a href="x-window-system.html">X window system</a>. The various files copied in this chapter come from the 1.50 +compiliation package glibc-2.3.6 forming part of the <em>toolchain</em>. 1.51 +</p> 1.52 +<h4>Various file directories</h4> 1.53 +<p> 1.54 +We begin by creating the directories that contain libraries and files relevant to the different locales. 1.55 +The directory LC_MESSAGES contains the files for the translated messages (.mo), if they exist: 1.56 +</p> 1.57 +<pre> # mkdir -p rootfs/usr/share/{i18n,locale} 1.58 + # mkdir -p rootfs/usr/lib/{locale,gconv} 1.59 + # mkdir -p rootfs/usr/share/i18n/{charmaps,locales} 1.60 + # mkdir -p rootfs/usr/share/locale/fr/LC_MESSAGES 1.61 +</pre> 1.62 +<p> 1.63 +Copy the localization files for French, Swiss-French and Swiss-German in /usr/share/i18n/locales: 1.64 +</p> 1.65 +<pre> # cp -a /usr/share/i18n/locales/{de_CH,fr_CH,fr_FR,i18n,iso14651_t1} \ 1.66 + rootfs/usr/share/i18n/locales 1.67 +</pre> 1.68 +<p> 1.69 +Copy the translit_* files in /usr/share/i18n/locales: 1.70 +</p> 1.71 +<pre> # cp -a /usr/share/i18n/locales/{translit_circle,translit_cjk_compat} \ 1.72 + rootfs/usr/share/i18n/locales 1.73 + # cp -a /usr/share/i18n/locales/{translit_combining,translit_compat} \ 1.74 + rootfs/usr/share/i18n/locales 1.75 + # cp -a /usr/share/i18n/locales/{translit_font,translit_fraction} \ 1.76 + rootfs/usr/share/i18n/locales 1.77 + # cp -a /usr/share/i18n/locales/{translit_narrow,translit_neutral} \ 1.78 + rootfs/usr/share/i18n/locales 1.79 + # cp -a /usr/share/i18n/locales/{translit_small,translit_wide} \ 1.80 + rootfs/usr/share/i18n/locales 1.81 +</pre> 1.82 +<p> 1.83 +Copy the charmaps files in /usr/share/i18n/charmaps: 1.84 +</p> 1.85 +<pre> # cp -a /usr/share/i18n/charmaps/ANSI_X3.* rootfs/usr/share/i18n/charmaps 1.86 + # cp -a /usr/share/i18n/charmaps/{ISO-8859-1.gz,ISO-8859-2.gz,ISO-8859-15.gz} \ 1.87 + rootfs/usr/share/i18n/charmaps 1.88 +</pre> 1.89 +<p> 1.90 +Copy the gconv libraries in /usr/lib/gconv to rootfs of SliTaz: 1.91 +</p> 1.92 +<pre> # cp /usr/lib/gconv/{ANSI_X3.110.so,gconv-modules,UNICODE.so} \ 1.93 + rootfs/usr/lib/gconv 1.94 + # cp /usr/lib/gconv/{ISO8859-1.so,ISO8859-2.so,ISO8859-15.so} \ 1.95 + rootfs/usr/lib/gconv 1.96 + # strip -v rootfs/usr/lib/gconv/*.so 1.97 +</pre> 1.98 +<p> 1.99 +Copy the locale utility: 1.100 +</p> 1.101 +<pre> # cp /usr/bin/locale rootfs/usr/bin 1.102 +</pre> 1.103 +<p> 1.104 +It's necessary that the file /usr/lib/locale/locale-archive is generated, 1.105 +for that we use the localedef utility while chrooted in SliTaz: 1.106 +</p> 1.107 +<pre> # cp /usr/bin/localedef rootfs/usr/bin 1.108 + # chroot rootfs /bin/ash 1.109 +</pre> 1.110 +<p> 1.111 +Use of <code>localedef</code> for French-speaking Switzerland and France: 1.112 +</p> 1.113 +<pre> /# localedef -i fr_CH -f ISO-8859-1 fr_CH 1.114 + /# localedef -i fr_FR -f ISO-8859-1 fr_FR 1.115 + /# exit 1.116 +</pre> 1.117 +<p> 1.118 +You can delete the <code>localedef</code> binary to gain some space: 1.119 +</p> 1.120 +<pre> # rm rootfs/usr/bin/localedef 1.121 +</pre> 1.122 +<a name="config"></a> 1.123 +<h3><font color="#6c0023">Config and use of locale</font></h3> 1.124 +<p> 1.125 +To use a language in a session, you can create a script launched at boot, or 1.126 +add 2 lines to the ~/.profile specific to each user with: 1.127 +</p> 1.128 +<pre class="script"> 1.129 +export LANG=fr_CH 1.130 +export LC_ALL=fr_CH 1.131 + 1.132 +</pre> 1.133 +<p> 1.134 +Voilà, the French language should now function If you installed retawq or nano, you can check the 1.135 +performance of locales by copying the .mo files in the sources of Retawq or Nano to /usr/share/locale/fr/LC_MESSAGES. 1.136 +</p> 1.137 +<h4>Following chapter</h4> 1.138 +<p> 1.139 +SliTaz uses the /etc/init.d/i18n.sh script and the /etc/locale.conf configuration file to 1.140 +manage the system locale. This is detailed in the next chapter <a href="boot-scripts.html">Boot scripts</a>. 1.141 +On a working system, just modify /etc/locale.conf with a text editor or launch 'tazlocale' 1.142 +to change the default system locale Or to specify the language as a boot option: <code>lang=xx</code>. 1.143 +</p> 1.144 + 1.145 + 1.146 +<!-- End of content --> 1.147 +</div> 1.148 + 1.149 +<!-- Footer. --> 1.150 +<div id="footer"> 1.151 + <div class="footer-right"></div> 1.152 + <a href="#top">Top of the page</a> | 1.153 + <a href="index.html">Table of contents</a> 1.154 +</div> 1.155 + 1.156 +<div id="copy"> 1.157 + Copyright © 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> - 1.158 + <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br /> 1.159 + Documentation is under 1.160 + <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a> 1.161 + and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>. 1.162 +</div> 1.163 + 1.164 +</body> 1.165 +</html>