wok view slitaz-i18n/stuff/locale-pack.functions @ rev 16125
ARM: add xorg-libXdamage and conky
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sun Mar 23 22:52:11 2014 +0100 (2014-03-23) |
parents | 874b0d62ff7e |
children | fbd26a7703dd |
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 # NO: This we gen a huge /usr/lib/locale directory. We gen locale file
39 # at boot and glibc-locale is not needed for that.
40 #
41 # Pregenerate locale file so we dont need glibc-locale as dep.
42 #for def in $locales; do
43 # echo "* Generate $def locale definition"
44 # mkdir -p $fs/usr/lib/locale
45 # localedef -i $def -c -f $CHARMAP $fs/usr/lib/locale/$def
46 #done
48 # Get timezones
49 countries=$(echo $locales | \
50 sed 's|@[^ ]*||g; s|[^ _]*_||g' | tr ' ' '\n' | sort -u)
51 echo "* Copy timezone info for countries: "$countries
52 locations=''
53 for country in $countries; do
54 location=$(grep '^'$country \
55 $WOK/glibc/install/usr/share/zoneinfo/zone.tab | awk '{ print $3}')
56 locations="$locations $location"
57 done
58 for location in $locations; do
59 for tz in $location posix/$location right/$location; do
60 install -Dm644 /usr/share/zoneinfo/$tz \
61 $fs/usr/share/zoneinfo/$tz
62 done
63 done
64 }