Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[3f9ab6]: mac / localised.sh Maximize Restore History

Download this file

localised.sh    74 lines (59 with data), 2.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
# $Id: localised.sh 2004 2007-05-11 00:17:50Z ippei $
wxWidgetsLocaleDir="$WX_LOCALE_DIR"
resdir="$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources"
huginsrcdir="../src/hugin1/hugin"
xrcsrcdir="$huginsrcdir/xrc"
translationsdir="../src/translations"
mkdir -p "$resdir"
for lang in "en" $(ls $translationsdir/*.po | sed -e "s/^.*\///g" -e "s/\.po//g")
do
echo
echo "Language: $lang"
localisedresdir="$resdir/$lang.lproj"
localedir="$localisedresdir/locale"
rm -fR $localisedresdir
echo "deleting $localisedresdir"
mkdir "$localisedresdir"
echo "making $localisedresdir"
mkdir "$localedir"
echo "making $localedir"
if [ $lang = "en" ]
then
continue
fi
echo "$lang/hugin.mo from $lang.po"
msgfmt -v -o "$localedir/hugin.mo" "$translationsdir/$lang.po"
echo "$lang/wxstd.mo from $wxWidgetsLocaleDir/$lang.po"
if [ -f "$wxWidgetsLocaleDir/$lang.po" ]
then
msgfmt -v -o "$localedir/wxstd.mo" "$wxWidgetsLocaleDir/$lang.po"
else
echo "$lang.po not found;"
parentLang=`echo $lang|sed s/_.*//`
echo "$lang/wxstd.mo from $wxWidgetsLocaleDir/$parentLang.po"
if [ -f "$wxWidgetsLocaleDir/$parentLang.po" ]
then
msgfmt -v -o "$localedir/wxstd.mo" "$wxWidgetsLocaleDir/$parentLang.po"
else
echo "$parentLang.po not found;"
fi
fi
for file in `ls $xrcsrcdir/data | grep _$lang.htm`
do
echo copying $file to $localisedresdir/`echo $file|sed s/_$lang//`
echo rewriting \'src=\"\' to \'src=\"../xrc/data/\'
sed s/src\=\"/src\=\"..\\/xrc\\/data\\// "$xrcsrcdir/data/$file" > $localisedresdir/`echo $file|sed s/_$lang//`
done
for file in `ls $xrcsrcdir/data | grep _$lang.html`
do
echo copying $file to $localisedresdir/`echo $file|sed s/_$lang//`
echo rewriting \'src=\"\' to \'src=\"../xrc/data/\'
sed s/src\=\"/src\=\"..\\/xrc\\/data\\// "$xrcsrcdir/data/$file" > $localisedresdir/`echo $file|sed s/_$lang//`
done
# for file in `ls $xrcsrcdir/data | grep _$lang-UTF8.txt`
# do
# echo copying $file to $localisedresdir/`echo $file|sed s/_$lang//`
# cp "$xrcsrcdir/data/$file" $localisedresdir/`echo $file|sed s/_$lang//`
# done
done