#!/bin/sh # Translation of the home page # by Hiroshi Hakoyama # powered by sintl (by Kristaps Dzonsons) # example: # cd www # transl.sh # timestamp now=`date` cat index.xml | (rm index.xml; \ sed -e "s/dateModified\">\([^\"]*\)$now index.xml) cp index.xml index.html for iso639 in `ls -F ~/web/keywords/$@ | grep -v /` ; do if [ ! -e $iso639 ]; then mkdir $iso639; fi sintl -j ~/web/xlf/${iso639}.xlf index.html > ./${iso639}/index.html descr_en=`cat ./${iso639}/index.html | grep name=\"description\" | \ sed -e 's/^.*content=\"//' -e 's/\".*>//'` keywd_en=`cat ./${iso639}/index.html | grep name=\"keywords\" | \ sed -e 's/^.*content=\"//' -e 's/\".*>//'` descr_transl=`cat ~/web/description/$iso639` keywd_transl=`cat ~/web/keywords/$iso639` cat ./${iso639}/index.html | (rm ./${iso639}/index.html; \ sed -e 2s/en/$iso639/ -e s/"\ its:translate=\"yes\""//g \ -e s/"$descr_en"/"$descr_transl"/g -e s/"$keywd_en"/"$keywd_transl"/g \ > ./${iso639}/index.html) done # remove sintl tags cat index.html | (rm index.html; \ sed -e s/"its:translate=\"yes\""//g > index.html) #ja modifications cat ./ja/index.html | (rm ./ja/index.html; \ sed -e s/"http:\/\/hako.space\/publications\/"/"http:\/\/hako.space\/ja\/publications\/"/g > ./ja/index.html) cat ./ja/index.html | (rm ./ja/index.html; \ sed -e s/"http:\/\/hako.space\/talks\/"/"http:\/\/hako.space\/ja\/talks\/"/g > ./ja/index.html) cat ./ja/index.html | (rm ./ja/index.html; \ sed -e s/"http:\/\/hako.space\/CV\/"/"http:\/\/hako.space\/ja\/CV\/"/g > ./ja/index.html) cat ./ja/index.html | (rm ./ja/index.html; \ sed -e s/"http:\/\/hako.space\/course\/"/"http:\/\/hako.space\/ja\/course\/"/g > ./ja/index.html) cat ./ja/index.html | (rm ./ja/index.html; \ sed -e s/"http:\/\/hako.space\/about\/"/"http:\/\/hako.space\/ja\/about\/"/g > ./ja/index.html) exit 0