4 # ** This script merges global PO to locale PO files.
5 # ** It creates a backup of the old PO file as squirrelmail.po.bak
6 # ** and puts the merged version in squirrelmail.po
8 # ** Usage: mergepo <locale id>
9 # ** Example: mergepo es_ES
11 # ** Philipe Mingo <mingo@rotedic.com>
12 # ** Konstantin Riabitsev <icon@duke.edu>
17 echo "USAGE: mergepo [localename]"
24 if [ ! -d $LOCALEDIR ]; then
25 # lessee if it's been renamed.
26 DCOUNT
=`find $WORKDIR/ -name $1* | wc -l`
27 if [ $DCOUNT -eq 1 ]; then
29 LOCALEDIR
=`find $WORKDIR/ -name $1*`
30 elif [ $DCOUNT -gt 1 ]; then
32 echo "More than one locale matching this name found:"
33 find $WORKDIR/ -name $1*
34 echo "You have to be more specific."
39 echo "Merging $LOCALEDIR/LC_MESSAGES/squirrelmail.po"
40 mv $LOCALEDIR/LC_MESSAGES
/squirrelmail.po \
41 $LOCALEDIR/LC_MESSAGES
/squirrelmail.po.bak
42 msgmerge
$LOCALEDIR/LC_MESSAGES
/squirrelmail.po.bak ..
/po
/squirrelmail.po
> \
43 $LOCALEDIR/LC_MESSAGES
/squirrelmail.po
45 # msgmerge will split long lines, such as the RCS Id line. If it did split
46 # it, join the pieces back together.
47 ed
-s $LOCALEDIR/LC_MESSAGES
/squirrelmail.po
<< END
48 /^"Project-Id-Version:/v/\\n"$/j\\
53 echo "Old po file renamed to squirrelmail.po.bak"