[BACK]Return to transl.sh CVS log [TXT][DIR] Up to [local] / web

File: [local] / web / transl.sh (download)

Revision 1.1, Sun Jul 12 19:34:06 2015 JST (8 years, 10 months ago) by hako
Branch: MAIN

Initial revision

#!/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\">\([^\"]*\)</dateModified\">$now</g" > index.xml)

cp index.xml index.html

for iso639 in `ls ~/web/keywords/$@` ; 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)

exit 0