diff options
Diffstat (limited to 'scripts/set_untranslated')
-rwxr-xr-x | scripts/set_untranslated | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/scripts/set_untranslated b/scripts/set_untranslated new file mode 100755 index 000000000..44a6ebf7f --- /dev/null +++ b/scripts/set_untranslated @@ -0,0 +1,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 |