ths-scripts/init-po-files

50 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# Copyright (C) 2009 Andrius Štikonas <stikonas@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
source "`dirname $0`/ths-variables"
source "$THS"
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
echo "Usage `basename $0` <messages-tree> <pot-tree>"
exit 1
fi
if [ $# -eq 2 ]; then
messages=$1
pot=$2
else
messages=$potrunk
pot=$pottrunk
fi
cd $pot
for dir in `ls`; do
cd $dir
podir=../../$messages/$dir
if [ ! -e $podir ]; then
mkdir $podir
svn add $podir
fi
for file in `ls`; do
po=`echo $file | sed s/.pot/.po/`
if [ ! -e $podir/$po ]; then
echo -e $RED"$dir/$po"$ENDCOLOR
msginit -i $file -o $podir/$po --no-translator
svn add $podir/$po
fi
done
cd ..
done