wok-6.x view slitaz-i18n/stuff/locale-pack.functions @ rev 17620

jnettop: link with libtinfo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Feb 13 09:58:34 2015 +0100 (2015-02-13)
parents c667db027c32
children ec332cdcdbc1
line source
1 get_locale()
2 {
3 [ "x$CHARMAP" == x ] && CHARMAP=UTF-8
5 case "$SLITAZ_ARCH" in
6 arm*) ;;
7 i?86)
8 # Get translated Openbox menu from SliTaz sub project slitaz-configs
9 obmenu=$WOK/slitaz-configs/install/etc/xdg/openbox/menu.$LOCALE.xml
10 if [ -f $obmenu ]; then
11 mkdir -p $fs/etc/xdg/openbox
12 echo "* Found $LOCALE translations for: openbox menu"
13 cp $obmenu $fs/etc/xdg/openbox
14 fi
15 ;;
16 esac
18 # Get the core packages messages.
19 case "$SLITAZ_ARCH" in
20 arm*) CORE_PKGS="$CORE_PKGS_ARM" ;;
21 esac
22 mkdir -p $fs/usr/share/locale/$LOCALE
23 for app in $CORE_PKGS; do
24 app_locale=$WOK/$app/install/usr/share/locale/$LOCALE
25 if [ -d $app_locale ]; then
26 echo "* Found $LOCALE translations for: $app"
27 cp -a $app_locale $fs/usr/share/locale
28 fi
29 done
31 # List of available locales
32 cd $WOK/glibc/install/usr/share/i18n/locales
33 locales=$(ls -1 | sed -n '/^'$LOCALE'$/p; /^'$LOCALE'_.*/p' | sed '/translit/d')
34 [ "x$LOCALEDEF" != x ] && locales=$LOCALEDEF
36 # Get X11 locale
37 for def in $locales; do
38 x11_locale=$WOK/xorg-libX11/install/usr/share/X11/locale/$def.$CHARMAP
39 if [ -d $x11_locale ]; then
40 echo "* Found $def.$CHARMAP locale for: X11"
41 mkdir -p $fs/usr/share/X11/locale
42 cp -a $x11_locale $fs/usr/share/X11/locale
43 fi
44 done
46 # Get locale definition files
47 usil=usr/share/i18n/locales
48 for def in $locales; do
49 echo "* Copying $def locale files"
50 mkdir -p $fs/$usil
51 cp -a $WOK/glibc/install/$usil/$def $fs/$usil
52 done
54 if [ "x$LOCALE_DEPENDS" != x ]; then
55 for dep in $LOCALE_DEPENDS; do
56 echo "* Copying additional $dep locale files"
57 cp -a $WOK/glibc/install/usr/share/i18n/locales/$dep \
58 $fs/usr/share/i18n/locales
59 done
60 fi
62 # Get timezones from tzdata
63 countries=$(echo $locales | \
64 sed 's|@[^ ]*||g; s|[^ _]*_||g' | tr ' ' '\n' | sort -u)
65 echo "* Copy timezone info for countries: "$countries
66 locations=''
67 for country in $countries; do
68 location=$(grep '^'$country \
69 $WOK/tzdata/install/usr/share/zoneinfo/zone.tab | awk '{ print $3}')
70 locations="$locations $location"
71 done
72 for location in $locations; do
73 for tz in $location; do
74 install -Dm644 $WOK/tzdata/install/usr/share/zoneinfo/$tz \
75 $fs/usr/share/zoneinfo/$tz
76 done
77 done
79 case "$SLITAZ_ARCH" in
80 arm*) exit 0 ;;
81 esac
83 # Get country flags
84 echo "* Copy flag icons for countries: "$countries
85 usih=usr/share/icons/hicolor
86 for country in $countries; do
87 for size in 16x16 48x48; do
88 install -Dm644 \
89 $WOK/flag-icons/taz/*/fs/$usih/$size/intl/$country.png \
90 $fs/$usih/$size/intl/$country.png
91 done
92 done
93 # above icons credits
94 fusl=$fs/usr/share/licenses
95 mkdir -p $fusl
96 cp -a $WOK/flag-icons/source/*/LICENSE.txt $fusl/gosquared.txt
98 # Gconv modules for encodings other than default
99 if [ "x$GCONV" != x ]; then
100 mkdir -p $fs/usr/lib/gconv
101 for enc in $GCONV; do
102 echo "* Copying $enc gconv module"
103 cp -a $WOK/glibc/install/usr/lib/gconv/$enc.so $fs/usr/lib/gconv
104 done
105 fi
107 # Keyboard flags for default lxpanel keyboard applet
108 if [ "x$KB_FLAGS" != x ]; then
109 uslix=usr/share/lxpanel/images/xkb-flags
110 mkdir -p $fs/$uslix
111 for i in $KB_FLAGS; do
112 install -Dm644 \
113 $WOK/flag-icons/taz/*/fs/$usih/16x16/intl/${i%%:*}.png \
114 $fs/$usih/16x16/intl/${i%%:*}.png
115 ln -s /$usih/16x16/intl/${i%%:*}.png $fs/$uslix/${i##*:}.png
116 done
117 fi
119 # exit code OK
120 echo
121 }