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

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

Revision 1.6, Mon Jun 4 21:26:27 2018 JST (5 years, 11 months ago) by hako
Branch: MAIN
CVS Tags: BIBDESK_XML
Changes since 1.5: +5 -5 lines

misc

#!/bin/sh
# Translation of the home page
# by Hiroshi Hakoyama
# powered by sintl (by Kristaps Dzonsons) 
# example:
# cd www
# transl.sh

# timestamp
now=`date`
(rm index.xml; sed -e "s/dateModified\">[^<]*</dateModified\">$now</g" > index.xml) < index.xml

cp index.xml index.html

descr_en=`grep name=\"description\" index.html | sed -e 's/^.*content=\"//' -e 's/\".*>//'` 
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`
  (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) < ./${iso639}/index.html
done

# remove sintl tags 
(rm index.html; \
  sed -e s/"its:translate=\"yes\""//g > index.html) < index.html

#ja modifications
(rm ./ja/index.html; \
  sed -e s/"\/about"/"\/ja\/about"/g > ./ja/index.html) < ./ja/index.html

(rm ./ja/index.html; \
  sed -e s/"\/CV"/"\/ja\/CV"/g > ./ja/index.html) < ./ja/index.html

(rm ./ja/index.html; \
  sed -e s/"\/publications"/"\/ja\/publications"/g > ./ja/index.html) < ./ja/index.html

(rm ./ja/index.html; \
  sed -e s/"\/talks"/"\/ja\/talks"/g > ./ja/index.html) < ./ja/index.html

(rm ./ja/index.html; \
  sed -e s/"\/course"/"\/ja\/course"/g > ./ja/index.html) < ./ja/index.html

exit 0