域名停放就到“玉米娃”为站长交易提供免费中介服务!必看:为什么你会被屏蔽论坛帐号?
发新话题
打印

无聊写的,可以让你的网站有 多语言

无聊写的,可以让你的网站有 多语言

yyhfy.asp

<%
Dim write
Dim fileSysObj, tf, yyhid
yyhid = "yyhid.inc"
yyhid = LEFT(Server.Mappath(Request.ServerVariables("PATH_INFO")), InStrRev(Server.Mappath(Request.ServerVariables("PATH_INFO")), "\")) & yyhid
Set fileSysObj = createObject("Scripting.FileSystemObject")
IF (fileSysObj.FileExists(yyhid)) Then
Set tf = filesysobj.OpenTextFile(yyhid, 1)
yyhid= tf.Read(2)
tf.Close
ELSE
yyhid= 1
END IF
%>

       <% if int(right(yyhid,1))=1 then %>
                        <div align="center">
                          <table width="100%" border="0">
                                <tr>
                                 <td><div align="center">将此页翻译为: <a href=# onClick="JavaScript:window.open('http://www.worldlingo.com/wl/translate?wl_lp=ZH_CN-ZH_TW&wl_fl=2&wl_g_table=-3&wl_url='+document.location+'&k=1','_self','')">中文版(繁)</a> <a href=# onClick="JavaScript:window.open('http://www.worldlingo.com/wl/translate?wl_lp=ZH_CN-EN&wl_fl=2&wl_g_table=-3&wl_url='+document.location+'&k=1','_self','')">英文版</a> <a href=# onClick="JavaScript:window.open('http://www.worldlingo.com/wl/translate?wl_lp=ZH_CN-JA&wl_fl=2&wl_g_table=-3&wl_url='+document.location,'_self','')">日文版</a></div></td>
                                </tr>
                          </table>
                        </div>
       <%end if%>
               
       <%if int(right(yyhid,1))=2 then %>
                <div align="center">
                  <table width="100%" border="0">
                          <tr>
                                <td width="1241" align="center" valign="middle"><div align="center">将此页翻译为:
                                        <select name="yyhselect">
                                          <option value="EN" selected> 英文版</option>
                                          <option value="ZH_CN">中文版(简)</option>
                                          <option value="ZH_TW">中文版(繁)</option>
                                          <option value="JA"> 日文版</option>
                                        </select>
                                         <input name=Submit type=submit onClick=JavaScript:window.open('http://www.worldlingo.com/wl/translate?wl_lp=ZH_CN-'+yyhselect.value+'&wl_fl=2&wl_g_table=-3&wl_url='+document.location,'_self','') value=翻译>
                                  </div></td>
                          </tr>
                  </table>
            </div>
        <%end if%>

yyhid.inc
1

注意一下啊。这里有两种样式,在yyhid.inc里。改成1就是第一种样式,改2就是第二种。
在任何页面加上<!-- #include file="yyhfy.asp" --> 就OK了。哈哈。这个是最简单好写的
我回头试试
如果可以那太好了
由于工作繁忙,有问题请不要单独PM我,有事请发帖!谢谢
本人系中科院高级潜水院院士,三次诺贝尔长期掉线奖得主,刚刚荣获奥斯卡终身隐身奖~~~

搜您想要的源码:http://www.codepub.com/d/search. ... &keyword=情人节
帮您找需要的代码:http://bbs.codepub.com/thread-45160-1-1.html
什么叫如果可以啊。。。
可是我写的啊!

回复 #3 yhindex 的帖子

没注意看
要通过这个站点?
'http://www.worldlingo.com
由于工作繁忙,有问题请不要单独PM我,有事请发帖!谢谢
本人系中科院高级潜水院院士,三次诺贝尔长期掉线奖得主,刚刚荣获奥斯卡终身隐身奖~~~

搜您想要的源码:http://www.codepub.com/d/search. ... &keyword=情人节
帮您找需要的代码:http://bbs.codepub.com/thread-45160-1-1.html
嗯。
要通过站点的。你细看一下代码就知道了嘛 !
挺不错的。。。
发新话题