summaryrefslogtreecommitdiff
path: root/release/image/mklang.sh
blob: aa79f44cfb7224543e0ff1b27a314ebdf3175e69 (plain)
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
#!/bin/sh
#set -x

MKSQ=../src/linux/linux/scripts/squashfs/mksquashfs
TRX=../tools/trx
ADDLANG=../tools/addlang

LANG="sc sp sw it de fr en"

if [ a$1 != a ] ; then
LANG=$1
fi

rm -rf lang_img
mkdir lang_img 

# Handle original EN language
#$MKSQ ../src/router/www/cisco_wrt54g_en oen.sq
#$TRX -o oen.trx oen.sq
#$ADDLANG -i oen.trx -o lang_img/oen_lang.bin

#rm -rf /tmp/www_m
#cp -rfa ../src/router/mipsel-uclibc/target/www/ /tmp/www_m
#rm -rf /tmp/www_m/lang_pack
#rm -rf /tmp/www_m/help

# Handle multiple language
for lang in $LANG ; do 
	#echo "lang=$lang"
	
	if [ ! -d ../src/router/www/lang_pack/${lang}_lang_pack/ ] ; then
		echo "Cann't find \"$lang\" language package."
		exit
	fi

	rm -rf /tmp/www_m
	cp -rfa ../src/router/mipsel-uclibc/target/www/ /tmp/www_m
	rm -rf /tmp/www_m/lang_pack
	rm -rf /tmp/www_m/help

	cp -rfa ../src/router/www/lang_pack/${lang}_lang_pack/ /tmp/www_m/lang_pack
	cp -rfa ../src/router/www/lang_pack/all_help/${lang}_help /tmp/www_m/help

	test -d ../src/router/www/lang_pack/${lang}_image/ && cp -rfa ../src/router/www/lang_pack/${lang}_image/*.gif /tmp/www_m/image/

	$MKSQ /tmp/www_m 2${lang}.sq 
done

for lang in $LANG ; do 
	$TRX -o 2${lang}.trx 2${lang}.sq
	$ADDLANG -i 2${lang}.trx -o lang_img/${lang}_lang.bin
done

rm -rf /tmp/www_m
rm -f *.trx
rm -f *.sq