website view pt/doc/scratchbook/locale.html @ rev 551

Fix c6b2d9c4e031, pt: localy browseable (with file://)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Oct 26 10:30:55 2009 +0100 (2009-10-26)
parents c6b2d9c4e031
children
line source
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <title>SliTaz Scratchbook - Locale &amp; i18n</title>
6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
7 <meta name="description" content="" />
8 <meta name="expires" content="never" />
9 <meta name="modified" content="2008-11-22 17:00:00" />
10 <meta name="publisher" content="www.slitaz.org" />
11 <meta name="author" content="Christophe Lincoln"/>
12 <link rel="shortcut icon" href="favicon.ico" />
13 <link rel="stylesheet" type="text/css" href="book.css" />
14 </head>
15 <body bgcolor="#ffffff">
17 <!-- Header and quick navigation -->
18 <div id="header">
19 <div align="right" id="quicknav">
20 <a name="top"></a>
21 <a href="base-ncurses.html">Base ncurses</a> |
22 <a href="index.html">Table of contents</a> |
23 <a href="boot-scripts.html">Boot scripts</a>
24 </div>
25 <h1><font color="#3E1220">SliTaz Scratchbook</font></h1>
26 </div>
28 <!-- Content. -->
29 <div id="content">
30 <div class="content-right"></div>
33 <h2><font color="#df8f06">Locale &amp; i18n</font></h2>
34 <p>
35 Installation and configuration of locales.
36 </p>
37 <ul>
38 <li><a href="locale.html#install">Locale installation.</a></li>
39 <li><a href="locale.html#config">Config and use of locale on SliTaz.</a></li>
40 </ul>
41 <a name="install"></a>
42 <h3><font color="#6c0023">Locale installation</font></h3>
43 <p>
44 This chapter describes the installation of locales in SliTaz GNU/Linux from a SliTaz GNU/Linux host system.
45 The installation of locales contained in the X server are described in the chapter
46 <a href="x-window-system.html">X window system</a>. The various files copied in this chapter come from the
47 compiliation package glibc-2.3.6 forming part of the <em>toolchain</em>.
48 </p>
49 <h4>Various file directories</h4>
50 <p>
51 We begin by creating the directories that contain libraries and files relevant to the different locales.
52 The directory LC_MESSAGES contains the files for the translated messages (.mo), if they exist:
53 </p>
54 <pre> # mkdir -p rootfs/usr/share/{i18n,locale}
55 # mkdir -p rootfs/usr/lib/{locale,gconv}
56 # mkdir -p rootfs/usr/share/i18n/{charmaps,locales}
57 # mkdir -p rootfs/usr/share/locale/fr/LC_MESSAGES
58 </pre>
59 <p>
60 Copy the localization files for French, Swiss-French and Swiss-German in /usr/share/i18n/locales:
61 </p>
62 <pre> # cp -a /usr/share/i18n/locales/{de_CH,fr_CH,fr_FR,i18n,iso14651_t1} \
63 rootfs/usr/share/i18n/locales
64 </pre>
65 <p>
66 Copy the translit_* files in /usr/share/i18n/locales:
67 </p>
68 <pre> # cp -a /usr/share/i18n/locales/{translit_circle,translit_cjk_compat} \
69 rootfs/usr/share/i18n/locales
70 # cp -a /usr/share/i18n/locales/{translit_combining,translit_compat} \
71 rootfs/usr/share/i18n/locales
72 # cp -a /usr/share/i18n/locales/{translit_font,translit_fraction} \
73 rootfs/usr/share/i18n/locales
74 # cp -a /usr/share/i18n/locales/{translit_narrow,translit_neutral} \
75 rootfs/usr/share/i18n/locales
76 # cp -a /usr/share/i18n/locales/{translit_small,translit_wide} \
77 rootfs/usr/share/i18n/locales
78 </pre>
79 <p>
80 Copy the charmaps files in /usr/share/i18n/charmaps:
81 </p>
82 <pre> # cp -a /usr/share/i18n/charmaps/ANSI_X3.* rootfs/usr/share/i18n/charmaps
83 # cp -a /usr/share/i18n/charmaps/{ISO-8859-1.gz,ISO-8859-2.gz,ISO-8859-15.gz} \
84 rootfs/usr/share/i18n/charmaps
85 </pre>
86 <p>
87 Copy the gconv libraries in /usr/lib/gconv to rootfs of SliTaz:
88 </p>
89 <pre> # cp /usr/lib/gconv/{ANSI_X3.110.so,gconv-modules,UNICODE.so} \
90 rootfs/usr/lib/gconv
91 # cp /usr/lib/gconv/{ISO8859-1.so,ISO8859-2.so,ISO8859-15.so} \
92 rootfs/usr/lib/gconv
93 # strip -v rootfs/usr/lib/gconv/*.so
94 </pre>
95 <p>
96 Copy the locale utility:
97 </p>
98 <pre> # cp /usr/bin/locale rootfs/usr/bin
99 </pre>
100 <p>
101 It's necessary that the file /usr/lib/locale/locale-archive is generated,
102 for that we use the localedef utility while chrooted in SliTaz:
103 </p>
104 <pre> # cp /usr/bin/localedef rootfs/usr/bin
105 # chroot rootfs /bin/ash
106 </pre>
107 <p>
108 Use of <code>localedef</code> for French-speaking Switzerland and France:
109 </p>
110 <pre> /# localedef -i fr_CH -f ISO-8859-1 fr_CH
111 /# localedef -i fr_FR -f ISO-8859-1 fr_FR
112 /# exit
113 </pre>
114 <p>
115 You can delete the <code>localedef</code> binary to gain some space:
116 </p>
117 <pre> # rm rootfs/usr/bin/localedef
118 </pre>
119 <a name="config"></a>
120 <h3><font color="#6c0023">Config and use of locale</font></h3>
121 <p>
122 To use a language in a session, you can create a script launched at boot, or
123 add 2 lines to the ~/.profile specific to each user with:
124 </p>
125 <pre class="script">
126 export LANG=fr_CH
127 export LC_ALL=fr_CH
129 </pre>
130 <p>
131 Voil&agrave;, the French language should now function If you installed retawq or nano, you can check the
132 performance of locales by copying the .mo files in the sources of Retawq or Nano to /usr/share/locale/fr/LC_MESSAGES.
133 </p>
134 <h4>Following chapter</h4>
135 <p>
136 SliTaz uses the /etc/init.d/i18n.sh script and the /etc/locale.conf configuration file to
137 manage the system locale. This is detailed in the next chapter <a href="boot-scripts.html">Boot scripts</a>.
138 On a working system, just modify /etc/locale.conf with a text editor or launch 'tazlocale'
139 to change the default system locale Or to specify the language as a boot option: <code>lang=xx</code>.
140 </p>
143 <!-- End of content -->
144 </div>
146 <!-- Footer. -->
147 <div id="footer">
148 <div class="footer-right"></div>
149 <a href="locale.html#top">Top of the page</a> |
150 <a href="index.html">Table of contents</a>
151 </div>
153 <div id="copy">
154 Copyright &copy; 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> -
155 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
156 Documentation is under
157 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
158 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
159 </div>
161 </body>
162 </html>