55 lines
1.6 KiB
Bash
Executable File
55 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
|
|
#
|
|
# #
|
|
# # This script is free software; you can redistribute it and/or modify
|
|
# # it under the terms of the GNU General Public License 2 as published by
|
|
# # the Free Software Foundation.
|
|
#
|
|
# # This script is distributed in the hope that it will be useful,
|
|
# # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# # GNU General Public License for more details.
|
|
# #
|
|
# # You should have received a copy of the GNU General Public License
|
|
# # along with this script; if not, write to the Free Software
|
|
# # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
#
|
|
# ths-stripfuzzy.sh - makes all fuzzy strings non-fuzzy in a translation project.
|
|
|
|
source "`dirname $0`/ths-variables"
|
|
|
|
if [ ! $MSGMERGE ]; then
|
|
echo -e $RED"This program needs the msgmerge utility."$ENDCOLOR
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! $MSGATTRIB ]; then
|
|
echo -e $RED"This program needs the msgattrib utility."$ENDCOLOR
|
|
exit 1
|
|
fi
|
|
|
|
if [ $# -ne 2 ]; then
|
|
echo "Usage `basename $0` <pofile directory> <templates directory>"
|
|
exit 1
|
|
fi
|
|
|
|
pofiles=$1
|
|
templates=$2
|
|
|
|
echo "Completely removing the fuzzy strings from the pofiles..."
|
|
for po in `cd $pofiles ; find . -name "*.po"`
|
|
do
|
|
echo -n $pofiles/$po
|
|
$MSGATTRIB -o $pofiles/$po --no-fuzzy $pofiles/$po
|
|
done
|
|
|
|
|
|
echo "Restoring the previously fuzzy as untranslated strings..."
|
|
for po in `cd $pofiles ; find . -name "*.po"`
|
|
do
|
|
echo -n $pofiles/$po
|
|
$MSGMERGE --no-fuzzy-matching --backup=off --update $pofiles/$po $templates/${po}t
|
|
done
|