wok annotate slitaz-i18n/stuff/locale-pack.functions @ rev 16591

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