#!/bin/sh # Translation of the home page # by Hiroshi Hakoyama # powered by sintl (by Kristaps Dzonsons) # example: # cd www # transl.sh # note: # Use sintl-0.1.2 for XLIFF 2.0 (<= sintl-0.2.3 uses XLIFF 1.2 but 2.0) # todo: Should I revert the XLIFF version to 1.2? # timestamp now=`date` sed -i -e "s/dateModified\">[^<]*$now//'` keywd_en=`grep name=\"keywords\" index.html | sed -e 's/^.*content=\"//' -e 's/\".*>//'` 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_transl=`cat ~/web/description/$iso639` keywd_transl=`cat ~/web/keywords/$iso639` sed -i -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 sed -i -e s/"its:translate=\"yes\""//g index.html #ja modifications sed -i -e s/"\/about"/"\/ja\/about"/g \ -e s/"\/CV"/"\/ja\/CV"/g \ -e s/"\/publications"/"\/ja\/publications"/g \ -e s/"\/talks"/"\/ja\/talks"/g \ -e s/"\/course"/"\/ja\/course"/g ./ja/index.html exit 0