~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/po/update_po_files.sh

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
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
 
5
 
 
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."
 
12
    exit
 
13
  fi
 
14
else
 
15
  echo "Could not create POT file (intltool-update not found). Exiting."
 
16
  exit
 
17
fi
 
18
 
 
19
PO_FILE_COUNT=0
 
20
 
 
21
find . -noleaf -type f -name "*.po"|sort|\
 
22
(
 
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
 
27
    echo "$FILENAME"
 
28
    msgmerge "$FILENAME".old "$POT_FILENAME" > "$FILENAME"
 
29
    if [ "$?" -ne "0" ]; then
 
30
      echo "Could not merge \"$FILENAME.old\"."
 
31
    fi
 
32
  else
 
33
    echo "Could not rename \"$FILENAME\". File skipped."
 
34
  fi
 
35
done
 
36
 
 
37
echo; echo "Total number of PO files: $PO_FILE_COUNT"
 
38
)
 
39
 
 
40
echo