wok annotate slitaz-i18n/stuff/locale-pack.functions @ rev 16433
glibc-base: Russian locale moved to "locale-ru"; slitaz-i18n: more locales to choose; locale-ru: some changes in the icons.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Apr 18 13:49:58 2014 +0300 (2014-04-18) |
parents | 1c56350ea155 |
children | c4533f65e171 |
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 |
pankso@15895 | 38 # NO: This we gen a huge /usr/lib/locale directory. We gen locale file |
pankso@15895 | 39 # at boot and glibc-locale is not needed for that. |
pankso@15895 | 40 # |
al@14908 | 41 # Pregenerate locale file so we dont need glibc-locale as dep. |
pankso@15895 | 42 #for def in $locales; do |
pankso@15895 | 43 # echo "* Generate $def locale definition" |
pankso@15895 | 44 # mkdir -p $fs/usr/lib/locale |
pankso@15895 | 45 # localedef -i $def -c -f $CHARMAP $fs/usr/lib/locale/$def |
pankso@15895 | 46 #done |
al@14908 | 47 |
al@16433 | 48 # OK, Christophe. So, we still need next // Aleksej |
al@16433 | 49 usil=usr/share/i18n/locales |
al@16433 | 50 for def in $locales; do |
al@16433 | 51 echo "* Copying $def locale files" |
al@16433 | 52 mkdir -p $fs/$usil |
al@16433 | 53 cp -a $WOK/glibc/install/$usil/$def $fs/$usil |
al@16433 | 54 done |
al@16433 | 55 |
al@14908 | 56 # Get timezones |
al@14908 | 57 countries=$(echo $locales | \ |
al@14908 | 58 sed 's|@[^ ]*||g; s|[^ _]*_||g' | tr ' ' '\n' | sort -u) |
al@14908 | 59 echo "* Copy timezone info for countries: "$countries |
al@14908 | 60 locations='' |
al@14908 | 61 for country in $countries; do |
al@14908 | 62 location=$(grep '^'$country \ |
al@14908 | 63 $WOK/glibc/install/usr/share/zoneinfo/zone.tab | awk '{ print $3}') |
al@14908 | 64 locations="$locations $location" |
al@14908 | 65 done |
al@14908 | 66 for location in $locations; do |
al@14908 | 67 for tz in $location posix/$location right/$location; do |
al@14908 | 68 install -Dm644 /usr/share/zoneinfo/$tz \ |
al@14908 | 69 $fs/usr/share/zoneinfo/$tz |
al@14908 | 70 done |
al@14908 | 71 done |
pankso@3087 | 72 } |