505ce759 |
1 | #!/bin/sh |
2 | |
3 | # ** |
4 | # ** This script compiles locale PO files |
5 | # ** |
6 | # ** Usage: compilepo <locale id> |
7 | # ** Example: compilepo es |
8 | # ** |
9 | # ** Philipe Mingo <mingo@rotedic.com> |
10 | # ** Konstantin Riabitsev <icon@duke.edu> |
11 | # ** |
12 | # ** $Id$ |
13 | |
14 | if [ -z "$1" ]; then |
15 | echo "USAGE: compilepo [localename]" |
16 | exit 1 |
17 | fi |
18 | |
19 | WORKDIR=../locale |
20 | LOCALEDIR=$WORKDIR/$1 |
21 | |
22 | if [ ! -d $LOCALEDIR ]; then |
23 | # lessee if it's been renamed. |
24 | DCOUNT=`find $WORKDIR/ -name $1* | wc -l` |
25 | if [ $DCOUNT -eq 1 ]; then |
26 | # aha |
27 | LOCALEDIR=`find $WORKDIR/ -name $1*` |
28 | elif [ $DCOUNT -gt 1 ]; then |
29 | # err out |
30 | echo "More than one locale matching this name found:" |
31 | find $WORKDIR/ -name $1* |
32 | echo "You have to be more specific." |
33 | exit 1 |
34 | fi |
35 | fi |
36 | |
37 | echo "Compiling $LOCALEDIR/LC_MESSAGES/squirrelmail.po" |
38 | msgfmt -o $LOCALEDIR/LC_MESSAGES/squirrelmail.mo \ |
39 | $LOCALEDIR/LC_MESSAGES/squirrelmail.po |
40 | |