14 echo "Sorry, you are not supposed to use this script."
15 echo "This script is solely for use by the Xonotic Core Team."
16 echo "Unauthorized use of it can cause HIGHLY annoying merge"
27 if [ x"$mode" = x"pot" ]; then
29 find qcsrc -type f -name \*.\* -not -name \*.po -not -name \*.txt
30 } | xgettext -LC -k_ -f- --from-code utf-8 -F -o common.pot >&2
33 if [ x"$mode" = x"po" ]; then
34 for X in common.*.po; do
35 [ -f "$X" ] || continue
36 if [ -n "$language" ]; then
37 if [ x"${X#*.dat.}" != x"$language.po" ]; then
41 if [ x"${X#*.dat.}" = x"en.po" ]; then
45 msgmerge -F -U "$X" common.pot >&2
46 msgfmt -o /dev/null --check-format --check-header --use-fuzzy "$X" 2>&1 \
47 | grep . > "$X".errors || rm -f "$X".errors
48 msgattrib --untranslated "$X" | grep . > "$X".untranslated || rm -f "$X".untranslated
49 msgattrib --fuzzy "$X" | grep . > "$X".fuzzy || rm -f "$X".fuzzy
50 ne=$((`wc -l < "$X".errors 2>/dev/null` + 0))
51 nu=$((`grep -c ^#: "$X".untranslated 2>/dev/null` + 0))
52 nf=$((`grep -c ^#: "$X".fuzzy 2>/dev/null` + 0))
53 n=$(($ne + $nu + $nf))
55 for Y in ~/check-translations/"$X".*; do
56 [ -f "$Y" ] || continue
59 set fileencoding=utf-8
64 if ! msgcat "$Y" >/dev/null; then
65 echo "File $Y has syntax errors. Skipped."
68 msgcat -F --use-first "$Y" "$X" > "$X".new
76 msgfmt -o /dev/null --check-format --check-header --use-fuzzy "$X" 2>&1 \
77 | grep . > "$X".errors || rm -f "$X".errors
78 msgattrib --untranslated "$X" | grep . > "$X".untranslated || rm -f "$X".untranslated
79 msgattrib --fuzzy "$X" | grep . > "$X".fuzzy || rm -f "$X".fuzzy
80 ne=$((`wc -l < "$X".errors 2>/dev/null` + 0))
81 nu=$((`grep -c ^#: "$X".untranslated 2>/dev/null` + 0))
82 nf=$((`grep -c ^#: "$X".fuzzy 2>/dev/null` + 0))
83 n=$(($ne + $nu + $nf))
86 echo "TODO for translation $X:"
87 echo "Errors: $ne (was: $ne0)"
88 echo "Untranslated: $nu (was: $nu0)"
89 echo "Fuzzy: $nf (was: $nf0)"
90 ltr=`grep '^"Last-Translator: ' "$X" | cut -d ' ' -f 2- | cut -d '\\' -f 1 | egrep -v '<LL@li.org>|<EMAIL@ADDRESS>'`
91 ltm=`grep '^"Language-Team: ' "$X" | cut -d ' ' -f 2- | cut -d '\\' -f 1 | egrep -v '<LL@li.org>|<EMAIL@ADDRESS>'`
92 echo "Translators: $ltr, $ltm"
100 if [ x"$ltr" = x"$ltm" ]; then
107 if [ -n "$to" ]; then
110 if [ -n "$cc" ]; then
113 if [ -n "$to" ]; then
115 echo "Send mail? [y/n]"
120 if [ $ne -gt 0 ]; then
121 attach="$attach $X.errors"
123 if [ $nu -gt 0 ]; then
124 attach="$attach $X.untranslated"
126 if [ $nf -gt 0 ]; then
127 attach="$attach $X.fuzzy"
133 as you provided us with translations in the past, we kindly ask you
134 to update the translation to match changes in the Xonotic source. Can
135 you please work on them and provide updates to us?
137 For reference, the current version of the translation file is at:
138 http://git.xonotic.org/?p=xonotic/xonotic-data.pk3dir.git;a=blob;f=$X
140 If you do not wish to be contacted for translation updates any more,
141 please tell us in a reply to this message.
144 if [ $nu -gt 0 ]; then
146 Attached to this message is a file
148 with $nu yet to be translated messages. Please translate them and reply
149 with the file containing the translations in the "msgstr" fields.
153 if [ $nf -gt 0 ]; then
155 Attached to this message is a file
157 with $nf automatically generated translations. Please verify and/or fix
158 them and reply with the file having been verified by you.
168 -e "set from=\"divVerent@xonotic.org\"" \
169 -e "set use_from=yes" \
170 -e "set use_envelope_from=yes" \
171 -s "Need update for translations: $X" \
173 -b "admin@xonotic.org" \
185 echo "$X is complete!"
189 for X in common.*.po.disabled; do
190 [ -f "$X" ] || continue
191 if [ -n "$language" ]; then
192 if [ x"${X#*.dat.}" != x"$language.po" ]; then
196 msgmerge -F -U "$X" common.pot >/dev/null 2>&1