wok view slitaz-i18n/stuff/locale-pack.functions @ rev 11389

Compat: make local-pack.functions in slitaz-i18n compatible with tazwok
author Antoine Bodin <gokhlayeh@slitaz.org>
date Sat Dec 10 05:03:51 2011 +0100 (2011-12-10)
parents a4bc0aff568e
children 6916f08d8107
line source
1 #!/bin/sh
3 # Standard directories having translated files.
4 mk_locale_dir()
5 {
6 mkdir -p \
7 $fs/usr/share/locale/$LOCALE \
8 $fs/usr/share/slitaz/messages \
9 $fs/etc/xdg/openbox
10 }
12 # Get translated files from SliTaz sub projects: configs & tools.
13 get_slitaz_messages()
14 {
15 configs=$WOK/slitaz-configs/source
16 openbox=$configs/slitaz-configs-*/rootfs/etc/xdg/openbox
17 tools=$WOK/slitaz-tools/source
19 # Make tazwok compatible with this.
20 if [ ! -x /usr/bin/cook ]; them
21 [ -d $configs ] || tazwok get-src slitaz-configs --target=$configs
22 [ -d $tools ] || tazwok get-src slitaz-tools --target=$tools
23 fi
25 [ ! -d $configs ] && echo "ERROR: missing source slitaz-configs" && exit 1
26 [ ! -d $tools ] && echo "ERROR: missing source slitaz-tools" && exit 1
28 if [ -f $openbox/menu.${LOCALE}.xml ]; then
29 echo "* Found $LOCALE locale for: openbox menu"
30 cp $openbox/menu.${LOCALE}.xml $fs/etc/xdg/openbox
31 fi
33 # Tools messages will be replace in time by POT files.
34 if [ -d $tools/slitaz-tools-*/messages/$LOCALE ]; then
35 echo "* Found $LOCALE locale for: slitaz-tools"
36 cp -a $tools/slitaz-tools-*/messages/$LOCALE \
37 $fs/usr/share/slitaz/messages
38 fi
40 if [ -d $tools/slitaz-tools-*/po/mo/$LOCALE ]; then
41 for app in $(ls $tools/slitaz-tools-*/po/mo/$LOCALE)
42 do
43 echo "* Found $LOCALE locale for: ${app%.mo}"
44 cp -a $tools/slitaz-tools-*/po/mo/$LOCALE/$app \
45 $fs/usr/share/locale/$LOCALE
46 done
47 fi
48 }
50 # Get the core packages messages.
51 get_core_messages()
52 {
53 for i in $CORE_PKGS
54 do
55 if [ -d $WOK/$i/install/usr/share/locale/$LOCALE ]; then
56 echo "* Found $LOCALE locale for: $i"
57 cp -a $WOK/$i/install/usr/share/locale/$LOCALE \
58 $fs/usr/share/locale
59 fi
60 done
61 }