//首页
var zh_index = {
“index1″:”首页”,
“index2″:”产品实例”
};
var en_index = {
“index1″:”index”,
“index2″:”Product examples”
};
//服务支持
var zh_serviceSupport = {
“serviceSupport1″:”首页”,
“serviceSupport2″:”产品实例”
};
var en_serviceSupport = {
“serviceSupport1″:”index”,
“serviceSupport2″:”Product examples”
};
var zh = {“index”:zh_index,”serviceSupport”:zh_serviceSupport};
var en = {“index”:en_index,”serviceSupport”:en_serviceSupport};
var language = [zh,en];
$(function(){
var value = sessionStorage.getItem(“language”);
var pathname = window.location.pathname;
var index = pathname.lastIndexOf(“/”);
pathname = pathname.substring(index + 1, pathname.length).split(“.html”)[0];
if(value==null || value==0){
value=0;
}
var data = language[value][pathname];
for (var i = 1; i <= 2; i++) {
$(“#”+pathname+i).text(data[pathname+i])
}
});
$(“#change”).click(function() {
var value = sessionStorage.getItem(“language”);
if(value===”1″){
sessionStorage.setItem(“language”, “0”);
}else{
sessionStorage.setItem(“language”, “1”);
}
window.location.reload();
})
今天的文章java实现英文翻译中文_手机中英文切换在哪里[通俗易懂]分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/74057.html