Skip to content

Commit

Permalink
Adding title of chapter to the summary
Browse files Browse the repository at this point in the history
  • Loading branch information
batmat committed Sep 26, 2011
1 parent c706df5 commit e959578
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions show-translation-percentage.sh
Expand Up @@ -13,11 +13,12 @@ do
localeVersion=`echo $englishVersion| sed "s/hudsonbook-content/hudsonbook-content-\$translation/g"`
englishSize=`du -sk $englishVersion| cut -f1`
localeSize=`du -sk $localeVersion| cut -f1`

totalSize=$(( $englishSize + $totalSize ))

#echo "$englishVersion ($englishSize kb) -> $localeVersion ($localeSize kb)"

title=`grep "<title>" $englishVersion|head -1|sed "s/ *<title>//g"|sed "s/ *<\/title>//g"`

echo -n "$englishVersion: "
if [[ `diff $englishVersion $localeVersion` ]]
then
Expand All @@ -26,10 +27,12 @@ do
translatedSize=$(( `diff $englishVersion $localeVersion | egrep '^[<>]' | wc -c`/2000 ))
totalTranslatedSize=$(( $totalTranslatedSize + $translatedSize ))
#Note that sometimes, translation can be bigger than original, so display below can be disturbing :-) : 51/49 e.g.
echo "$translatedSize/$englishSize kB"
echo -n "$translatedSize/$englishSize kB"
else
echo "Untouched yet."
echo -n "Untouched yet."
fi
echo " (title: $title)"

done
echo "Summary: $totalTranslatedSize/$totalSize"

0 comments on commit e959578

Please sign in to comment.