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