summaryrefslogtreecommitdiff
path: root/scripts/set_untranslated
blob: 44a6ebf7f898be84d5223fbf003a2f9f91112429 (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
#!/bin/sh

# This script is used for translations using .po files.

# This script is meant to be used only once for the transition
# from translating the .xml files to using .po files.

basedir="$(cd "$(dirname $0)"; pwd)"
POFILE=$2
TEMPFILE="/tmp/set_untranslated.$$"

print_usage () {
    echo "Usage: $0 <range> <filename>"
    echo "       where <range> is <number> or <start:end>"
}

if [ "$1" = "--help" ] ; then
    print_usage
    exit 0
fi
if [ $# -ne 2 ] || [ ! -f $POFILE ] ; then
    print_usage
    exit 1
fi


gawk -f $basedir/mark_untranslated.awk -v RANGE="$1" $POFILE >$TEMPFILE
if [ $? -eq 0 ] ; then
    cp $POFILE $POFILE.sv
    cp $TEMPFILE $POFILE

    echo ""
    echo "NOTE"
    echo "The original file has been replaced!"
    echo "A copy of the original file was saved as '$POFILE.sv'."
fi

rm $TEMPFILE
exit 0