Commit 6545f51b authored by Rudolf Polzer's avatar Rudolf Polzer

Integrate with Transifex.

sh tx.sh - 3-way merge with changes on Transifex.
parent 58784cc8
[main]
host = http://www.transifex.com
[xonotic.commonpot]
file_filter = translations/xonotic.commonpot/<lang>..po
source_file = translations/xonotic.commonpot/en..po
source_lang = en
Fri Sep 13 10:53:40 CEST 2013
......@@ -27,7 +27,7 @@ esac
if [ x"$mode" = x"pot" ]; then
{
find qcsrc -type f -name \*.\* -not -name \*.po -not -name \*.txt
} | xgettext -LC -k_ -f- --from-code utf-8 -o common.pot >&2
} | xgettext -LC -k_ -f- --from-code utf-8 -F -o common.pot >&2
fi
if [ x"$mode" = x"po" ]; then
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -601,7 +601,7 @@ void URI_Get_Callback(float id, float status, string data)
}
else
{
print(sprintf(_("Received HTTP request data for an invalid id %d.\n"), id));
print(sprintf("Received HTTP request data for an invalid id %d.\n", id));
}
}
......
......@@ -708,6 +708,7 @@ string MapInfo_Type_ToText(float t)
for(e = MapInfo_Type_first; e; e = e.enemy)
if(t == e.items)
return e.message;
/* xgettext:no-c-format */
return _("@!#%'n Tuba Throwing");
}
......
......@@ -280,7 +280,7 @@ void URI_Get_Callback(float id, float status, string data)
}
else
{
print(sprintf(_("Received HTTP request data for an invalid id %d.\n"), id));
print(sprintf("Received HTTP request data for an invalid id %d.\n", id));
}
}
......
......@@ -8,6 +8,7 @@ REGISTER_WEAPON(
/* rating */ BOT_PICKUP_RATING_MID,
/* model */ "tuba",
/* shortname */ "tuba",
/* xgettext:no-c-format */
/* fullname */ _("@!#%'n Tuba")
);
#else
......
#!/bin/sh
# We store:
# .tx/merge-base - changed whenever translations get merged
mergebase=`git log --pretty=oneline -1 .tx/merge-base | cut -d ' ' -f 1`
set -e
# First upload our current .pot.
mkdir -p translations/xonotic.commonpot/
cp common.pot translations/xonotic.commonpot/en..po
tx push -s
# Then pull the rest.
tx pull -f -a
for f in common.*.po; do
lang=${f%.po}
lang=${lang#common.}
tcurfile=translations/xonotic.commonpot/$lang..po
goldfile=translations/xonotic.commonpot/$lang..po.orig
gnewfile=common.$lang.po
if [ -f "$tcurfile" ]; then
git show "$mergebase":"$gnewfile" > "$goldfile"
msgcat -s --no-location --strict "$tcurfile" | grep -v "^#" > "$tcurfile.sorted"
msgcat -s --no-location --strict "$goldfile" | grep -v "^#" > "$goldfile.sorted"
msgcat -s --no-location --strict "$gnewfile" | grep -v "^#" > "$gnewfile.sorted"
if diff -u "$goldfile.sorted" "$gnewfile.sorted" >/dev/null; then
# no change on git, changed on tx only
msgmerge -F -U "$tcurfile" common.pot
cp "$tcurfile" "$gnewfile"
else
if ! diff -u "$goldfile.sorted" "$gnewfile.sorted" | patch "$tcurfile.sorted"; then
while :; do
vim -o "$tcurfile.sorted.rej" "$tcurfile.sorted"
echo "OK?"
read -r OK || exit 1
[ x"$OK" != x"y" ] || break
done
rm -f "$tcurfile.sorted.rej"
fi
mv "$tcurfile.sorted" "$tcurfile"
msgmerge -F -U "$tcurfile" common.pot
cp "$tcurfile" "$gnewfile"
rm "$goldfile.sorted"
rm "$gnewfile.sorted"
rm "$goldfile"
fi
else
msgmerge -F -U "$gnewfile" common.pot
cp "$gnewfile" "$tcurfile"
fi
done
for f in translations/xonotic.commonpot/*..po; do
lang=${f%..po}
lang=${lang#translations/xonotic.commonpot/}
[ x"$lang" != x"en" ] || continue
tcurfile=translations/xonotic.commonpot/$lang..po
gnewfile=common.$lang.po
if ! [ -f "$gnewfile" ]; then
touch "$gnewfile"
git add "$gnewfile"
cp "$tcurfile" "$gnewfile"
fi
done
tx push -t
date > .tx/merge-base
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment