ths-scripts/stripfuzzy

43 righe
1.3 KiB
Plaintext

2023-02-25 16:27:22 +00:00
#!/bin/bash -e
2009-02-09 21:47:24 +00:00
#
# 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.
if [ $# -ne 2 ]; then
2023-02-25 16:27:22 +00:00
echo "Usage $(basename "$0") <pofile directory> <templates directory>"
2009-02-09 21:47:24 +00:00
exit 1
fi
pofiles=$1
templates=$2
echo "Completely removing the fuzzy strings from the pofiles..."
2023-02-25 16:27:22 +00:00
for po in $(cd "$pofiles" ; find . -name "*.po")
2009-02-09 21:47:24 +00:00
do
2023-02-25 16:27:22 +00:00
echo -n "$pofiles/$po"
msgattrib -o "$pofiles/$po" --no-fuzzy "$pofiles/$po"
2009-02-09 21:47:24 +00:00
done
echo "Restoring the previously fuzzy as untranslated strings..."
2023-02-25 16:27:22 +00:00
for po in $(cd "$pofiles" ; find . -name "*.po")
2009-02-09 21:47:24 +00:00
do
2023-02-25 16:27:22 +00:00
echo -n "$pofiles/$po"
msgmerge --no-fuzzy-matching --backup=off --update "$pofiles/$po" "$templates/${po}t"
2009-03-17 15:57:59 +00:00
done