mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Small change to "i18n_update.sh"
* The shell should be "bash" not "sh". * Added an ability to update specific files only.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
#
|
#
|
||||||
# Extract the text catalog from the source code,
|
# Extract the text catalog from the source code,
|
||||||
@ -21,11 +21,22 @@ trap "rm -f '$catalog' '$files'" 0 1 2 15
|
|||||||
find .. -name '*.java' -print > "$files"
|
find .. -name '*.java' -print > "$files"
|
||||||
xgettext -L Java --from-code=utf-8 -k_ --output="$catalog" --files-from="$files"
|
xgettext -L Java --from-code=utf-8 -k_ --output="$catalog" --files-from="$files"
|
||||||
|
|
||||||
# Then, merge with already translated texts.
|
update()
|
||||||
for target in *.po; do
|
{
|
||||||
echo "Updating $target..."
|
echo "Updating $1..."
|
||||||
cat "$catalog" | python i18n_update.py "$target"
|
cat "$catalog" | python i18n_update.py "$1"
|
||||||
msgcat -p "$target" > $(basename "$target" .po).properties
|
msgcat -p "$1" > $(basename "$1" .po).properties
|
||||||
# msgcat may complain about "CHARSET" if you didn't replace "CHARSET" with
|
# msgcat may complain about "CHARSET" if you didn't replace "CHARSET" with
|
||||||
# your correct charset.
|
# your correct charset.
|
||||||
done
|
}
|
||||||
|
|
||||||
|
# Then, merge with already translated texts.
|
||||||
|
if [ $# = 0 ]; then
|
||||||
|
for target in *.po; do
|
||||||
|
update $target
|
||||||
|
done
|
||||||
|
else
|
||||||
|
for target in $*; do
|
||||||
|
update Resources_$target.po
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
Reference in New Issue
Block a user