Added ability to update single locale to script

This commit is contained in:
Marco Ciampa 2015-11-16 10:57:39 +01:00
parent b9484350cb
commit e559193222
1 changed files with 20 additions and 0 deletions

View File

@ -10,6 +10,11 @@
#
#####################################
if [ "$1" = "--help" ] || [ "$1" = "-h" ] ; then
echo "Usage: $0 [locale]"
exit
fi
SOURCEDIR=../kicad-source-mirror #Set this first!!!
#Autovars
@ -31,6 +36,21 @@ xgettext -f $LOCALDIR/POTFILES -k_ -k_HKI --force-po --from-code utf-8 -o $LOCAL
rm $LOCALDIR/POTFILES
#check if present in locale list
validate() { echo $LINGUAS | grep -F -q -w "$1"; }
#If supplied, update only the specified locale
if [ ! "$1" = "" ] ; then
if ! validate "$1"; then
echo "Error!"
echo "Locale argument \"$1\" not present in current locale list:"
for i in $LINGUAS; do echo -n "$i " ; done
exit 1
else
LINGUAS="$1"
fi
fi
for i in $LINGUAS
do
msgmerge --force-po $LOCALDIR/$i/kicad.po $LOCALDIR/kicad.pot -o $LOCALDIR/$i/kicad.po 2>&1 # >> /dev/null