2011-03-13 09:05:19 +03:00
|
|
|
#!/bin/sh
|
2016-06-17 15:47:43 +03:00
|
|
|
|
2016-06-27 11:58:47 +03:00
|
|
|
# Let this be executed in the po/ subdir.
|
2016-04-18 06:39:07 +03:00
|
|
|
cd "$(dirname "$0")" || exit
|
2016-06-17 15:47:43 +03:00
|
|
|
|
|
|
|
echo "Updating translations via TP"
|
2011-03-13 09:05:19 +03:00
|
|
|
rsync -Lrtvz translationproject.org::tp/latest/nano/ .
|
2016-06-17 15:47:43 +03:00
|
|
|
|
|
|
|
# Are there now PO files that are not in git yet?
|
|
|
|
NEWSTUFF=$(git status --porcelain *.po | grep "^??")
|
|
|
|
|
2016-04-18 06:39:07 +03:00
|
|
|
if [ -n "${NEWSTUFF}" ]; then
|
2016-06-17 15:47:43 +03:00
|
|
|
echo "New languages found; updating LINGUAS"
|
|
|
|
echo "# List of available languages." >LINGUAS
|
|
|
|
echo $(printf '%s\n' *.po | LC_ALL=C sort | sed 's/\.po//g') >>LINGUAS
|
2011-03-13 09:05:19 +03:00
|
|
|
fi
|
2016-06-17 15:47:43 +03:00
|
|
|
|
2016-06-27 11:58:47 +03:00
|
|
|
echo "Regenerating POT file and remerging and recompiling PO files..."
|
|
|
|
make update-po
|
2016-10-15 16:06:18 +03:00
|
|
|
|
2016-10-15 16:08:14 +03:00
|
|
|
# Ensure that the PO files are newer than the POT.
|
|
|
|
touch *.po
|
|
|
|
|
2016-10-15 16:06:18 +03:00
|
|
|
# If needed, fix a problem in the Makefile template.
|
|
|
|
grep -q '^datarootdir' Makefile.in.in || \
|
|
|
|
sed -i 's/^\(datadir.*\)/datarootdir = @datarootdir@\n\1/' Makefile.in.in
|