| 1 |
#!/bin/sh
|
| 2 |
|
| 3 |
# This script is used for translations using .po files.
|
| 4 |
|
| 5 |
# This script is meant to be used only once for the transition
|
| 6 |
# from translating the .xml files to using .po files.
|
| 7 |
|
| 8 |
basedir="$(cd "$(dirname $0)"; pwd)"
|
| 9 |
POFILE=$2
|
| 10 |
TEMPFILE="/tmp/set_untranslated.$$"
|
| 11 |
|
| 12 |
print_usage () {
|
| 13 |
echo "Usage: $0 <range> <filename>"
|
| 14 |
echo " where <range> is <number> or <start:end>"
|
| 15 |
}
|
| 16 |
|
| 17 |
if [ "$1" = "--help" ] ; then
|
| 18 |
print_usage
|
| 19 |
exit 0
|
| 20 |
fi
|
| 21 |
if [ $# -ne 2 ] || [ ! -f $POFILE ] ; then
|
| 22 |
print_usage
|
| 23 |
exit 1
|
| 24 |
fi
|
| 25 |
|
| 26 |
|
| 27 |
gawk -f $basedir/mark_untranslated.awk -v RANGE="$1" $POFILE >$TEMPFILE
|
| 28 |
if [ $? -eq 0 ] ; then
|
| 29 |
cp $POFILE $POFILE.sv
|
| 30 |
cp $TEMPFILE $POFILE
|
| 31 |
|
| 32 |
echo ""
|
| 33 |
echo "NOTE"
|
| 34 |
echo "The original file has been replaced!"
|
| 35 |
echo "A copy of the original file was saved as '$POFILE.sv'."
|
| 36 |
fi
|
| 37 |
|
| 38 |
rm $TEMPFILE
|
| 39 |
exit 0
|