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

Annotation of web/transl.sh, Revision 1.4

1.1       hako        1: #!/bin/sh
                      2: # Translation of the home page
                      3: # by Hiroshi Hakoyama
                      4: # powered by sintl (by Kristaps Dzonsons)
                      5: # example:
                      6: # cd www
                      7: # transl.sh
                      8:
                      9: # timestamp
                     10: now=`date`
1.4     ! hako       11: (rm index.xml; sed -e "s/dateModified\">\([^\"]*\)</dateModified\">$now</g" > index.xml) < index.xml
1.1       hako       12:
                     13: cp index.xml index.html
                     14:
1.4     ! hako       15: descr_en=`grep name=\"description\" index.html | sed -e 's/^.*content=\"//' -e 's/\".*>//'`
        !            16: keywd_en=`grep name=\"keywords\" index.html | sed -e 's/^.*content=\"//' -e 's/\".*>//'`
        !            17:
1.2       hako       18: for iso639 in `ls -F ~/web/keywords/$@ | grep -v /` ; do
1.1       hako       19:   if [ ! -e $iso639 ]; then mkdir $iso639; fi
                     20:   sintl -j ~/web/xlf/${iso639}.xlf index.html > ./${iso639}/index.html
                     21:   descr_transl=`cat ~/web/description/$iso639`
                     22:   keywd_transl=`cat ~/web/keywords/$iso639`
1.4     ! hako       23:   (rm ./${iso639}/index.html; \
1.1       hako       24:     sed -e 2s/en/$iso639/ -e s/"\ its:translate=\"yes\""//g \
                     25:     -e s/"$descr_en"/"$descr_transl"/g -e s/"$keywd_en"/"$keywd_transl"/g \
1.4     ! hako       26:     > ./${iso639}/index.html) < ./${iso639}/index.html
1.1       hako       27: done
                     28:
                     29: # remove sintl tags
1.4     ! hako       30: (rm index.html; \
        !            31:   sed -e s/"its:translate=\"yes\""//g > index.html) < index.html
1.1       hako       32:
                     33: #ja modifications
1.4     ! hako       34: (rm ./ja/index.html; \
        !            35:   sed -e s/"http:\/\/hako.space\/publications\/"/"http:\/\/hako.space\/ja\/publications\/"/g > ./ja/index.html) < ./ja/index.html
1.1       hako       36:
1.4     ! hako       37: (rm ./ja/index.html; \
        !            38:   sed -e s/"http:\/\/hako.space\/talks\/"/"http:\/\/hako.space\/ja\/talks\/"/g > ./ja/index.html) < ./ja/index.html
1.1       hako       39:
1.4     ! hako       40: (rm ./ja/index.html; \
        !            41:   sed -e s/"http:\/\/hako.space\/CV\/"/"http:\/\/hako.space\/ja\/CV\/"/g > ./ja/index.html) < ./ja/index.html
1.1       hako       42:
1.4     ! hako       43: (rm ./ja/index.html; \
        !            44:   sed -e s/"http:\/\/hako.space\/course\/"/"http:\/\/hako.space\/ja\/course\/"/g > ./ja/index.html) < ./ja/index.html
1.1       hako       45:
1.4     ! hako       46: (rm ./ja/index.html; \
        !            47:   sed -e s/"http:\/\/hako.space\/about\/"/"http:\/\/hako.space\/ja\/about\/"/g > ./ja/index.html) < ./ja/index.html
1.3       hako       48:
1.1       hako       49: exit 0