Skip to content

Commit 5b65ae0

Browse files
author
Shigeru KANEMOTO
committed
Small change to "i18n_update.sh"
* The shell should be "bash" not "sh". * Added an ability to update specific files only.
1 parent aca0c87 commit 5b65ae0

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

app/src/processing/app/i18n/i18n_update.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
#
44
# Extract the text catalog from the source code,
@@ -21,11 +21,22 @@ trap "rm -f '$catalog' '$files'" 0 1 2 15
2121
find .. -name '*.java' -print > "$files"
2222
xgettext -L Java --from-code=utf-8 -k_ --output="$catalog" --files-from="$files"
2323

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
24+
update()
25+
{
26+
echo "Updating $1..."
27+
cat "$catalog" | python i18n_update.py "$1"
28+
msgcat -p "$1" > $(basename "$1" .po).properties
2929
# msgcat may complain about "CHARSET" if you didn't replace "CHARSET" with
3030
# your correct charset.
31-
done
31+
}
32+
33+
# Then, merge with already translated texts.
34+
if [ $# = 0 ]; then
35+
for target in *.po; do
36+
update $target
37+
done
38+
else
39+
for target in $*; do
40+
update Resources_$target.po
41+
done
42+
fi

0 commit comments

Comments
 (0)