slitaz-doc-wiki-data view pages/en/scratchbook/locale.txt @ rev 91

Added tag 2011.08.14 for changeset a5e4261ee978
author Christopher Rogers <slaxemulator@gmail.com>
date Sun Aug 14 12:45:47 2011 +0000 (2011-08-14)
parents
children
line source
1 ====== Locale & i18n ======
3 Installation and configuration of locales.
5 ===== Locale installation =====
7 This chapter describes the installation of locales in SliTaz GNU/Linux from a SliTaz GNU/Linux host system. The installation of locales contained in the X server are described in the chapter [[x-window-system|X window system]]. The various files copied in this chapter come from the compiliation package glibc-2.3.6 forming part of the //toolchain//.
9 ==== Various file directories ====
11 We begin by creating the directories that contain libraries and files relevant to the different locales. The directory LC_MESSAGES contains the files for the translated messages (.mo), if they exist:
13 # mkdir -p rootfs/usr/share/{i18n,locale}
14 # mkdir -p rootfs/usr/lib/{locale,gconv}
15 # mkdir -p rootfs/usr/share/i18n/{charmaps,locales}
16 # mkdir -p rootfs/usr/share/locale/fr/LC_MESSAGES
18 Copy the localization files for French, Swiss-French and Swiss-German in /usr/share/i18n/locales:
20 # cp -a /usr/share/i18n/locales/{de_CH,fr_CH,fr_FR,i18n,iso14651_t1} \
21 rootfs/usr/share/i18n/locales
23 Copy the translit_* files in /usr/share/i18n/locales:
25 # cp -a /usr/share/i18n/locales/{translit_circle,translit_cjk_compat} \
26 rootfs/usr/share/i18n/locales
27 # cp -a /usr/share/i18n/locales/{translit_combining,translit_compat} \
28 rootfs/usr/share/i18n/locales
29 # cp -a /usr/share/i18n/locales/{translit_font,translit_fraction} \
30 rootfs/usr/share/i18n/locales
31 # cp -a /usr/share/i18n/locales/{translit_narrow,translit_neutral} \
32 rootfs/usr/share/i18n/locales
33 # cp -a /usr/share/i18n/locales/{translit_small,translit_wide} \
34 rootfs/usr/share/i18n/locales
36 Copy the charmaps files in /usr/share/i18n/charmaps:
38 # cp -a /usr/share/i18n/charmaps/ANSI_X3.* rootfs/usr/share/i18n/charmaps
39 # cp -a /usr/share/i18n/charmaps/{ISO-8859-1.gz,ISO-8859-2.gz,ISO-8859-15.gz} \
40 rootfs/usr/share/i18n/charmaps
42 Copy the gconv libraries in /usr/lib/gconv to rootfs of SliTaz:
44 # cp /usr/lib/gconv/{ANSI_X3.110.so,gconv-modules,UNICODE.so} \
45 rootfs/usr/lib/gconv
46 # cp /usr/lib/gconv/{ISO8859-1.so,ISO8859-2.so,ISO8859-15.so} \
47 rootfs/usr/lib/gconv
48 # strip -v rootfs/usr/lib/gconv/*.so
50 Copy the locale utility:
52 # cp /usr/bin/locale rootfs/usr/bin
54 It's necessary that the file /usr/lib/locale/locale-archive is generated, for that we use the localedef utility while chrooted in SliTaz:
56 # cp /usr/bin/localedef rootfs/usr/bin
57 # chroot rootfs /bin/ash
59 Use of "localedef" for French-speaking Switzerland and France:
61 # localedef -i fr_CH -f ISO-8859-1 fr_CH
62 # localedef -i fr_FR -f ISO-8859-1 fr_FR
63 # exit
65 You can delete the "localedef" binary to gain some space:
67 # rm rootfs/usr/bin/localedef
69 ===== Config and use of locale =====
71 To use a language in a session, you can create a script launched at boot, or add 2 lines to the ~/.profile specific to each user with:
72 <file>
73 export LANG=fr_CH
74 export LC_ALL=fr_CH
75 </file>
76 VoilĂ , the French language should now function If you installed retawq or nano, you can check the performance of locales by copying the .mo files in the sources of Retawq or Nano to /usr/share/locale/fr/LC_MESSAGES.
78 ==== Following chapter ====
80 SliTaz uses the /etc/init.d/i18n.sh script and the /etc/locale.conf configuration file to manage the system locale. This is detailed in the next chapter [[boot-scripts|Boot scripts]]. On a working system, just modify /etc/locale.conf with a text editor or launch 'tazlocale' to change the default system locale Or to specify the language as a boot option: "lang=xx".