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