Browse Source

Use new naming scheme texdomain.lt_LT.UTF-8.po

master
Andrius Štikonas 10 years ago
parent
commit
dab3d700ce
5 changed files with 23 additions and 26 deletions
  1. +2
    -1
      compile
  2. +12
    -10
      pack
  3. +1
    -7
      statistics
  4. +6
    -6
      update
  5. +2
    -2
      variables

+ 2
- 1
compile View File

@@ -30,8 +30,9 @@ for BRANCH in $TRUNK $BRANCHES; do
fi
for file in `ls $DIR`; do
echo "Compiling $file";
$MSGFMT "$DIR/$file" -o "$MDIR/$BRANCH/`echo $file | sed "s/."$LCODE".po/.mo/"`"
$MSGFMT "$DIR/$file" -o "$MDIR/$BRANCH/`echo wesnoth-$file | sed "s/."$LCODE".po/.mo/" | sed "s/wesnoth-wesnoth//"`"
done
rm "$MDIR/$BRANCH/wesnoth-manpages.mo" "$MDIR/$BRANCH/wesnoth-manual.mo"
done

echo -e $GREEN"Finished."$ENDCOLOR

+ 12
- 10
pack View File

@@ -38,25 +38,27 @@ for BRANCH in $TRUNK $BRANCHES; do
echo -e "Branch: $BLUE$BRANCH"$ENDCOLOR
DIR="$PREFIX-$BRANCH"
mkdir "$LCODE-temp"
for file in `ls $DIR/wesnoth*.$LCODE.po`; do
for file in `find $DIR -name *.lt.po`; do
bfile=`basename $file`
echo -n "Processing catalog $bfile... ";
d=`echo "$bfile" | sed "s/.$LCODE.po//"`
$MSGMERGE --no-wrap --silent $file $file -o $file.temp
if [ -f "$BRANCH/$d/$LCODE.po" ]; then
$MSGMERGE --no-wrap --silent "$BRANCH/$d/$LCODE.po" "$BRANCH/$d/$LCODE.po" -o "$BRANCH/$d/$LCODE.po.temp"
if ! $DIFF -q "$file.temp" "$BRANCH/$d/$LCODE.po.temp" > /dev/null ; then
mkdir "$LCODE-temp/$d"
cp "$file" "$LCODE-temp/$d/$LCODE.po"
dirdomain=`echo wesnoth-$d | sed "s/wesnoth-wesnoth/wesnoth/"`
$MSGMERGE --silent "$file" "$file" -o $file.temp
mv $file.temp $file
if [ -f "$BRANCH/$dirdomain/$LCODE.po" ]; then
$MSGMERGE --silent "$BRANCH/$dirdomain/$LCODE.po" "$BRANCH/$dirdomain/$LCODE.po" -o "$BRANCH/$dirdomain/$LCODE.po.temp"
if ! $DIFF -q "$file" "$BRANCH/$dirdomain/$LCODE.po.temp" > /dev/null ; then
mkdir "$LCODE-temp/$dirdomain"
cp "$file" "$LCODE-temp/$dirdomain/$LCODE.po"
echo -e $GREEN"OK"$ENDCOLOR
counter=$(($counter+1))
else
echo -e $BLUE"Skipping"$ENDCOLOR
fi
rm $file.temp "$BRANCH/$d/$LCODE.po.temp"
rm "$BRANCH/$dirdomain/$LCODE.po.temp"
else
mkdir -p "$LCODE-temp/$d"
cp "$file" "$LCODE-temp/$d/$LCODE.po"
mkdir -p "$LCODE-temp/$dirdomain"
cp "$file" "$LCODE-temp/$dirdomain/$LCODE.po"
echo -e $GREEN"OK"$ENDCOLOR
counter=$(($counter+1))
fi

+ 1
- 7
statistics View File

@@ -188,15 +188,9 @@ for BRANCH in $TRUNK $BRANCHES; do

echo "<tr class=\"row-$CL\">" >> $STATSFILE
CL=$(( ($CL+1)%2 ))
if [ $(($f+$u)) -gt 0 ]; then
echo " <td align=\"left\"><strong><a href=\"$filename".po"\">`basename $filename`</a></strong></td>
echo " <td align=\"left\"><strong><a href=\"$filename".po"\">`basename $filename`</a></strong></td>
<td class=\"percentage-$CL\" align=\"center\">$st</td>
<td class=\"row-$CL\" align=\"right\">$t</td>" >> $STATSFILE
else
echo " <td align=\"left\"><strong>`basename $filename`</strong></td>
<td class=\"percentage-$CL\" align=\"center\">$st</td>
<td class=\"row-$CL\" align=\"right\">$t</td>" >> $STATSFILE
fi
printf '%s%d%s%.2f%s\n' " <td class=\"percentage-" $CL "\" align=\"right\">" $rt "</td>" >> $STATSFILE
echo " <td class=\"row-$CL\" align=\"right\">$f</td>" >> $STATSFILE
printf '%s%d%s%.2f%s\n' " <td class=\"percentage-" $CL "\" align=\"right\">" $rf "</td>" >> $STATSFILE

+ 6
- 6
update View File

@@ -77,19 +77,19 @@ for BRANCH in $TRUNK $BRANCHES; do
DIR="$PREFIX-$BRANCH"
echo -e "Merging: $BLUE$BRANCH"$ENDCOLOR
for dir in `ls $SVNDIR/wesnoth* -d`; do
echo "Processing "`basename $dir`"."$LCODE".po"
stat=`LC_MESSAGES=C $MSGFMT --statistics -o /dev/null $dir"/"$LCODE".po" 2>&1`
echo "Processing `basename $dir | sed s/wesnoth-//`$LCODE.po"
stat=`LC_MESSAGES=C $MSGFMT --statistics -o /dev/null "$dir/$LCODE.po" 2>&1`
u=`echo "$stat" | sed -ne 's/.* \([0-9]\+\) untranslated .*/\1/p'`; u=${u:-0}
f=`echo "$stat" | sed -ne 's/.* \([0-9]\+\) fuzzy translation.*/\1/p'`; f=${f:-0}
file=$DIR"/"`basename $dir`"."$LCODE".po"
file="$DIR/`basename $dir | sed s/wesnoth-//`.$LCODE.po"
if [ -f $dir"/"$LCODE".po" ]; then
if [ -f "$DIR/"`basename $dir`".$LCODE.po" ]; then
if [ -f "$file" ]; then
echo -e $BLUE"Merging:"$ENDCOLOR
$MSGMERGE -U -v $file $dir"/"`basename $dir`".pot"
$MSGMERGE -U -v "$file" "$dir/`basename $dir`.pot"
rm -f $file~
else
echo -e $RED"Copying:"$ENDCOLOR
cp $dir"/"$LCODE".po" $file
cp "$dir/$LCODE.po" "$file"
fi
else
if [ ! -f $file ]; then

+ 2
- 2
variables View File

@@ -17,8 +17,8 @@

# Repositories
REPO="http://svn.gna.org/svn/wesnoth"
BRANCHES="" # one or multiple branches separated by space. Can be blank.
TRUNK="trunk" # "trunk" or ""
BRANCHES="1.6" # one or multiple branches separated by space. Can be blank.
TRUNK="" # "trunk" or ""

# Options
LCODE="lt" # Language code. Only 1 language is supported.

Loading…
Cancel
Save