赞
踩
1,下载语言切换所需要的js jquery.localize.js http://webscripts.softpedia.com/script/Modules/jQuery-Plugins/jQuery-localizationTool-js-83407.html
2,在web.xml中添加代码,拦截json格式数据,配置文件是json文件
- <servlet-mapping>
- <servlet-name>default</servlet-name>
- <url-pattern>*.json</url-pattern>
- </servlet-mapping>
3,定义三个json文件,text-zh.json,text-ja.json,text-en.json(中文需要转义 防止可能出现乱码)
(1)text-en.json
- {
- "acc": {
- "HelpCenter": "Help center",
- "BusinessCenter": "Business Center",
- "Exit": "[Exit]",
- "BusinessSupport": "Business Support"
- }
- }
(2)text-zh.json
- {
- "acc": {
- "HelpCenter": "帮助中心",
- "BusinessCenter": "商家中心",
- "Exit": "[退出]",
- "BusinessSupport": "商家支持"
- }
- }
(3)text-ja.json
- {
- "acc": {
- "HelpCenter": "ヘルプセンター",
- "BusinessCenter": "商家センター",
- "Exit": "[名目]",
- "BusinessSupport": "企業支持"
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。