wok-next view slitaz-i18n/stuff/locale-pack.functions @ rev 16554
slitaz-i18n: actualize build_depends list, add "ar" to locale_pack.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Wed Apr 30 10:05:22 2014 +0000 (2014-04-30) |
parents | 5c027260e632 |
children | c667db027c32 |
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 # Get timezones from tzdata
47 countries=$(echo $locales | \
48 sed 's|@[^ ]*||g; s|[^ _]*_||g' | tr ' ' '\n' | sort -u)
49 echo "* Copy timezone info for countries: "$countries
50 locations=''
51 for country in $countries; do
52 location=$(grep '^'$country \
53 $WOK/tzdata/install/usr/share/zoneinfo/zone.tab | awk '{ print $3}')
54 locations="$locations $location"
55 done
56 for location in $locations; do
57 for tz in $location; do
58 install -Dm644 $WOK/tzdata/install/usr/share/zoneinfo/$tz \
59 $fs/usr/share/zoneinfo/$tz
60 done
61 done
63 # Get country flags
64 echo "* Copy flag icons for countries: "$countries $ADD_FLAGS
65 usih=usr/share/icons/hicolor
66 for country in $countries $ADD_FLAGS; do
67 for size in 16x16 48x48; do
68 install -Dm644 \
69 $WOK/flag-icons/taz/*/fs/$usih/$size/intl/$country.png \
70 $fs/$usih/$size/intl/$country.png
71 done
72 done
73 # above icons credits
74 fusl=$fs/usr/share/licenses
75 mkdir -p $fusl
76 cp -a $WOK/flag-icons/source/*/LICENSE.txt $fusl/gosquared.txt
78 # Keyboard flags for default lxpanel keyboard applet
79 if [ "x$LXPANEL_FLAGS" != "x" ]; then
80 uslix=usr/share/lxpanel/images/xkb-flags
81 mkdir -p $fs/$uslix
82 for i in $LXPANEL_FLAGS; do
83 ln -s /$usih/16x16/intl/$(echo $i | tr a-z A-Z).png $fs/$uslix/$i.png
84 done
85 fi
87 echo
88 }