2009-03-23 20:41:53 +00:00
|
|
|
#!/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/>.
|
|
|
|
|
2010-07-06 14:03:55 +01:00
|
|
|
source "`dirname $0`/ths-variables"
|
2009-08-12 09:20:42 +01:00
|
|
|
source $THS
|
2009-03-23 20:41:53 +00:00
|
|
|
|
|
|
|
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
|
|
|
|
echo "Usage `basename $0` <messages-tree> <pot-tree>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $# -eq 2 ]; then
|
2009-08-12 09:20:42 +01:00
|
|
|
messages="$1"
|
|
|
|
pot="$2"
|
2009-03-23 20:41:53 +00:00
|
|
|
else
|
2009-08-12 09:20:42 +01:00
|
|
|
messages="$potrunk"
|
|
|
|
pot="$pottrunk"
|
2009-03-23 20:41:53 +00:00
|
|
|
fi
|
2010-07-06 14:03:55 +01:00
|
|
|
|
|
|
|
wdir="`pwd`"
|
2009-03-23 20:41:53 +00:00
|
|
|
cd $pot
|
|
|
|
for dir in `ls`; do
|
2010-07-06 14:03:55 +01:00
|
|
|
cd "$dir"
|
|
|
|
podir="$wdir/$messages/$dir"
|
2009-08-12 09:20:42 +01:00
|
|
|
if [ ! -e "$podir" ]; then
|
|
|
|
mkdir "$podir"
|
|
|
|
svn add "$podir"
|
2009-03-23 20:41:53 +00:00
|
|
|
fi
|
2011-01-30 17:33:16 +00:00
|
|
|
for file in `find . -name '*.pot'`; do
|
2011-01-30 18:05:25 +00:00
|
|
|
po=`echo $file | sed 's/.\{1\}$//'`
|
2009-08-12 09:20:42 +01:00
|
|
|
if [ ! -e "$podir/$po" ]; then
|
2009-03-23 20:41:53 +00:00
|
|
|
echo -e $RED"$dir/$po"$ENDCOLOR
|
2009-08-12 09:20:42 +01:00
|
|
|
msginit -i "$file" -o "$podir/$po" --no-translator
|
|
|
|
svn add "$podir/$po"
|
2011-11-11 15:54:15 +00:00
|
|
|
sed -ie 's/\"Plural-Forms: nplurals=3; plural=(n%10==1 \&\& n%100!=11 ? 0 : n%10>=2 \&\& (n"/"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : n%10>=2 \&\& (n%100<10 || n"/
|
|
|
|
s/\"%100<10 || n%100>=20) ? 1 : 2);\\n\"/"%100>=20) ? 1 : n%10==0 || (n%100>10 \&\& n%100<20) ? 2 : 3);\\n"/
|
2011-01-30 17:33:16 +00:00
|
|
|
/\"Language: lt\\n\"/d' "$podir/$po"
|
|
|
|
rm "$podir/$po"e
|
|
|
|
fi
|
2009-03-23 20:41:53 +00:00
|
|
|
done
|
|
|
|
cd ..
|
|
|
|
done
|