wok view slitaz-i18n/stuff/locale-pack.functions @ rev 17315

Up: tazweb (1.10)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Nov 03 00:55:32 2014 +0200 (2014-11-03)
parents 92fe9ef9577e
children cea5a9fa7152
line source
1 get_locale()
2 {
3 [ "x$CHARMAP" == x ] && CHARMAP=UTF-8
5 # Get translated Openbox menu from SliTaz sub project slitaz-configs
6 obmenu=$WOK/slitaz-configs/install/etc/xdg/openbox/menu.$LOCALE.xml
7 if [ -f $obmenu ]; then
8 mkdir -p $fs/etc/xdg/openbox
9 echo "* Found $LOCALE translations for: openbox menu"
10 cp $obmenu $fs/etc/xdg/openbox
11 fi
13 # Get the core packages messages.
14 mkdir -p $fs/usr/share/locale/$LOCALE
15 for app in $CORE_PKGS; do
16 app_locale=$WOK/$app/install/usr/share/locale/$LOCALE
17 if [ -d $app_locale ]; then
18 echo "* Found $LOCALE translations for: $app"
19 cp -a $app_locale $fs/usr/share/locale
20 fi
21 done
23 # List of available locales
24 cd $WOK/glibc/install/usr/share/i18n/locales
25 locales=$(ls -1 | sed -n '/^'$LOCALE'$/p; /^'$LOCALE'_.*/p' | sed '/translit/d')
26 [ "x$LOCALEDEF" != x ] && locales=$LOCALEDEF
28 # Get X11 locale
29 for def in $locales; do
30 x11_locale=$WOK/xorg-libX11/install/usr/share/X11/locale/$def.$CHARMAP
31 if [ -d $x11_locale ]; then
32 echo "* Found $def.$CHARMAP locale for: X11"
33 mkdir -p $fs/usr/share/X11/locale
34 cp -a $x11_locale $fs/usr/share/X11/locale
35 fi
36 done
38 # Get locale definition files
39 usil=usr/share/i18n/locales
40 for def in $locales; do
41 echo "* Copying $def locale files"
42 mkdir -p $fs/$usil
43 cp -a $WOK/glibc/install/$usil/$def $fs/$usil
44 done
46 if [ "x$LOCALE_DEPENDS" != x ]; then
47 for dep in $LOCALE_DEPENDS; do
48 echo "* Copying additional $dep locale files"
49 cp -a $WOK/glibc/install/usr/share/i18n/locales/$dep \
50 $fs/usr/share/i18n/locales
51 done
52 fi
54 # Get timezones from tzdata
55 countries=$(echo $locales | \
56 sed 's|@[^ ]*||g; s|[^ _]*_||g' | tr ' ' '\n' | sort -u)
57 echo "* Copy timezone info for countries: "$countries
58 locations=''
59 for country in $countries; do
60 location=$(grep '^'$country \
61 $WOK/tzdata/install/usr/share/zoneinfo/zone.tab | awk '{ print $3}')
62 locations="$locations $location"
63 done
64 for location in $locations; do
65 for tz in $location; do
66 install -Dm644 $WOK/tzdata/install/usr/share/zoneinfo/$tz \
67 $fs/usr/share/zoneinfo/$tz
68 done
69 done
71 # Get country flags
72 echo "* Copy flag icons for countries: "$countries
73 usih=usr/share/icons/hicolor
74 for country in $countries; do
75 for size in 16x16 48x48; do
76 install -Dm644 \
77 $WOK/flag-icons/taz/*/fs/$usih/$size/intl/$country.png \
78 $fs/$usih/$size/intl/$country.png
79 done
80 done
81 # above icons credits
82 fusl=$fs/usr/share/licenses
83 mkdir -p $fusl
84 cp -a $WOK/flag-icons/source/*/LICENSE.txt $fusl/gosquared.txt
86 # Gconv modules for encodings other than default
87 if [ "x$GCONV" != x ]; then
88 mkdir -p $fs/usr/lib/gconv
89 for enc in $GCONV; do
90 echo "* Copying $enc gconv module"
91 cp -a $WOK/glibc/install/usr/lib/gconv/$enc.so $fs/usr/lib/gconv
92 done
93 fi
95 # Keyboard flags for default lxpanel keyboard applet
96 if [ "x$KB_FLAGS" != x ]; then
97 uslix=usr/share/lxpanel/images/xkb-flags
98 mkdir -p $fs/$uslix
99 for i in $KB_FLAGS; do
100 install -Dm644 \
101 $WOK/flag-icons/taz/*/fs/$usih/16x16/intl/${i%%:*}.png \
102 $fs/$usih/16x16/intl/${i%%:*}.png
103 ln -s /$usih/16x16/intl/${i%%:*}.png $fs/$uslix/${i##*:}.png
104 done
105 fi
107 # exit code OK
108 echo
109 }