4
# Extract the text catalog from the source code,
5
# and merge with the already translated texts.
7
# Please be aware that this OVERWRITES the existing *.po and *.properties files.
8
# You may want to commit to your repository before running this script.
11
# by Shigeru KANEMOTO at SWITCHSCIENCE.
17
trap "rm -f '$catalog' '$files'" 0 1 2 15
19
# Generate the new text catalog without the already translated texts.
20
# The 'merge existing' option for xgetext does not work propery for our purpose.
21
find . -name '*.java' -print > "$files"
22
xgettext -L Java --from-code=utf-8 -k_ --output="$catalog" --files-from="$files"
24
# Then, merge with already translated texts.
25
for target in *.po; do
26
echo "Updating $target..."
27
cat "$catalog" | python i18n_update.py "$target"
28
msgcat -p "$target" > $(basename "$target" .po).properties
29
# msgcat may complain about "CHARSET" if you didn't replace "CHARSET" with
30
# your correct charset.