2
# Updates PO files from the current POT file
3
# Please run this program from the po/ directory
4
# Existing po.old files will be overwritten
6
type -p intltool-update >/dev/null 2>/dev/null
7
if [ "$?" -eq "0" ]; then
8
intltool-update --pot >/dev/null 2>&1
9
POT_FILENAME="`ls -1rt *.pot 2>/dev/null|tail -1 2>/dev/null`"
10
if [ ! -r "$POT_FILENAME" ]; then
11
echo "Could not create POT file. Exiting."
15
echo "Could not create POT file (intltool-update not found). Exiting."
21
find . -noleaf -type f -name "*.po"|sort|\
23
while read FILENAME; do
24
PO_FILE_COUNT=`expr $PO_FILE_COUNT + 1`
25
mv -f "$FILENAME" "$FILENAME".old # do not ask questions, because the answers would come from the pipe
26
if [ "$?" -eq "0" ]; then
28
msgmerge "$FILENAME".old "$POT_FILENAME" > "$FILENAME"
29
if [ "$?" -ne "0" ]; then
30
echo "Could not merge \"$FILENAME.old\"."
33
echo "Could not rename \"$FILENAME\". File skipped."
37
echo; echo "Total number of PO files: $PO_FILE_COUNT"