~ubuntu-branches/debian/experimental/arduino/experimental

« back to all changes in this revision

Viewing changes to app/src/processing/app/i18n_update.sh

  • Committer: Package Import Robot
  • Author(s): Scott Howard
  • Date: 2012-03-11 18:19:42 UTC
  • mfrom: (1.1.5) (5.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20120311181942-be2clnbz1gcehixb
Tags: 1:1.0.1~rc1+dfsg-1
New upstream release, experimental.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
#
 
4
# Extract the text catalog from the source code,
 
5
# and merge with the already translated texts.
 
6
#
 
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.
 
9
#
 
10
 
 
11
# by Shigeru KANEMOTO at SWITCHSCIENCE.
 
12
# on 2011-10-15
 
13
 
 
14
catalog="/tmp/$$.po"
 
15
files="/tmp/$$.files"
 
16
 
 
17
trap "rm -f '$catalog' '$files'" 0 1 2 15
 
18
 
 
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"
 
23
 
 
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.
 
31
done