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

slitaz-i18n: Fix and improve - Get files from slitaz-configs and slitaz-tools
author Christophe Lincoln <pankso@slitaz.org>
date Wed Jun 01 13:54:49 2011 +0200 (2011-06-01)
parents 872ecb790c84
children f6ca653dfa74
rev   line source
pankso@3087 1 #!/bin/sh
pankso@3087 2
paul@4858 3 # Standard directories having translated files.
pankso@3087 4 mk_locale_dir()
pankso@3087 5 {
pankso@3087 6 mkdir -p \
pankso@3087 7 $fs/usr/share/locale/$LOCALE \
pankso@3087 8 $fs/usr/share/slitaz/messages \
pankso@3087 9 $fs/etc/xdg/openbox
pankso@3087 10 }
pankso@3087 11
pankso@10783 12 # Get translated files from SliTaz sub projects: configs & tools.
pankso@3087 13 get_slitaz_messages()
pankso@3087 14 {
pankso@10783 15 configs=$WOK/slitaz-configs/source
pankso@10783 16 openbox=$configs/slitaz-configs-*/rootfs/etc/xdg/openbox
pankso@10783 17 tools=$WOK/slitaz-tools/source
pankso@10783 18
pankso@10783 19 [ ! -d $configs ] && echo "ERROR: missing source slitaz-configs" && exit 1
pankso@10783 20 [ ! -d $tools ] && echo "ERROR: missing source slitaz-tools" && exit 1
pankso@3087 21
pankso@10783 22 if [ -f $openbox/menu.${LOCALE}.xml ]; then
pankso@10783 23 echo "* Found $LOCALE locale for: openbox menu"
pankso@10783 24 cp $openbox/menu.${LOCALE}.xml $fs/etc/xdg/openbox
pankso@10783 25 fi
pankso@10783 26
pankso@10783 27 # Tools messages will be replace in time by POT files.
pankso@10783 28 if [ -d $tools/slitaz-tools-*/messages/$LOCALE ]; then
pankso@10783 29 echo "* Found $LOCALE locale for: slitaz-tools"
pankso@10783 30 cp -a $tools/slitaz-tools-*/messages/$LOCALE \
pankso@10783 31 $fs/usr/share/slitaz/messages
pankso@10783 32 fi
pankso@10783 33
pankso@10783 34 if [ -d $tools/slitaz-tools-*/po/mo/$LOCALE ]; then
pankso@10783 35 for app in $(ls $tools/slitaz-tools-*/po/mo/$LOCALE)
pankso@10783 36 do
pankso@10783 37 echo "* Found $LOCALE locale for: ${app%.mo}"
pankso@10783 38 cp -a $tools/slitaz-tools-*/po/mo/$LOCALE/$app \
pankso@10783 39 $fs/usr/share/locale/$LOCALE
pankso@10783 40 done
pankso@10783 41 fi
pankso@3087 42 }
pankso@3087 43
pankso@3087 44 # Get the core packages messages.
pankso@3087 45 get_core_messages()
pankso@3087 46 {
pankso@10740 47 for i in $CORE_PKGS
pankso@3087 48 do
pankso@10740 49 if [ -d $WOK/$i/install/usr/share/locale/$LOCALE ]; then
pankso@10751 50 echo "* Found $LOCALE locale for: $i"
pankso@10740 51 cp -a $WOK/$i/install/usr/share/locale/$LOCALE \
pankso@3087 52 $fs/usr/share/locale
pankso@3087 53 fi
pankso@3087 54 done
pankso@3087 55 }