@ -19,9 +19,9 @@
#
# ths-poupdate.sh - takes a bunch of files from a single directory and transfers the translations therein to a translation file tree; may use the new files either as primary, or as secondary translations.
## BŪTINIEJI PATIKRINIMAI PRIEŠ CIKLĄ
## First - the necessary checks before going into the loop
## FUNKCIJOS
## Declaring Functions
function usage( ) {
echo " Usage `basename $0 ` [options] <updated-file-dir> <translations-file-tree> <translations-template-tree> "
echo
@ -54,12 +54,12 @@ do
esac
done
# PATIKRINIMAS IR NAUDOJIMO PRANEŠIMAS
# Check and, if incorrect usage, print usage
if [ $# -ne 3 ] ; then
usage
fi
## KELIŲ INTERPRETAVIMAS
## Change paths to variables
upddir = $1
tradir = $2
tpldir = $3
@ -83,7 +83,7 @@ else
fi
fi
## PAGRINDINIS CIKLAS
## MAIN LOOP
for updfile in $newtrans
do
@ -92,8 +92,7 @@ if [ `cd $tpldir; find ${updfile}t 2> /dev/null | wc -l` -gt 1 ]; then
echo " Strange, there is more than one template for `basename $updfile `, "
echo "cannot determine the right one,"
echo "SKIPPING..."
# kopijuoti naują failą į vertimų medį
continue # o gal ir ne taip daroma
continue
fi
if [ ` cd $tradir ; find ${ updfile } 2> /dev/null | wc -l` -gt 1 ] ; then
@ -103,8 +102,7 @@ if [ `cd $tradir; find ${updfile} 2> /dev/null | wc -l` -gt 1 ]; then
echo "unneeded file in your translation tree, check it out!"
echo "Cannot determine the right file to translate,"
echo "SKIPPING..."
# kopijuoti naują failą į vertimų medį
continue # o gal ir ne taip daroma
continue
fi
if [ ` cd $tpldir ; find ${ updfile } t 2> /dev/null | wc -l` -lt 1 ] ; then
@ -117,7 +115,7 @@ if [ `cd $tpldir; find ${updfile}t 2> /dev/null | wc -l` -lt 1 ]; then
skipped_files = $(( $skipped_files + 1 ))
fi
continue
# o gal ir ne taip daroma
fi
if [ ` cd $tradir ; find ${ updfile } 2> /dev/null | wc -l` -lt 1 ] ; then
@ -130,7 +128,7 @@ if [ `cd $tradir; find ${updfile} 2> /dev/null | wc -l` -lt 1 ]; then
cp $upddir /$updfile $tradir /$secdir /$updfile
fi
# atlikti msgmerge ir kitus veiksmu s
# perform msgmerge and other action s
trafile = ` cd $tradir ; find $updfile `
tplfile = ` cd $tpldir ; find ${ updfile } t`
mv $tradir /$trafile $tradir /${ trafile } .old
@ -153,6 +151,7 @@ else
fi
fi
# delete the Rosetta/Launchpad headers, only needed if the file was imported from Rosetta
cat $tradir /${ trafile } .new | sed '/X-Rosetta-Export-Date/d' > $tradir /$trafile
rm $tradir /${ trafile } .new
rm $tradir /${ trafile } .old