关于Struts2中的i18n语言国际化的配置文件介绍

在今天的java商城开发中,外贸商城成为了沿海地区的一个主要开发的主流。而在三大框架中的Struts2中,我记得就为我们开发人员提供过一个语言国际化的i18n这个配置东西。下面我就将配置问价给大家看一看

language_en.properties英文表单的配置

userName=please into your name\:
title=Register
userAge=please into your age\:
birthdate=please into your birthdate
point=please into your point
submit=submit

language_zh_CN.properties英文表单的配置

userName=\u8BF7\u8F93\u5165\u7528\u6237\u540D\uFF1A
userAge=\u8BF7\u8F93\u5165\u5E74\u9F84\uFF1A
birthdate=\u8BF7\u8F93\u5165\u51FA\u751F\u65E5\u671F\uFF1A
point=\u8BF7\u8F93\u5165\u60A8\u7684\u5750\u6807\uFF1A
submit=\u63D0\u4EA4
title=\u6CE8\u518C

下面是Struts2的配置文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "struts-2.1.dtd" >
<struts>
<constant name="struts.devMode" value="true"></constant>
<constant name="struts.ui.theme" value="xhtml"></constant>
<constant name="struts.custom.i18n.resources" value="language"></constant>
<constant name="struts.i18n.encoding" value="utf-8"></constant>
<package name="bochystruts2" extends="struts-default">
 <action name="formaction" class="cn.com.bochy.action.Fromaction">
 <result name="success">/main.jsp</result>
 <result name="input">/index.jsp</result>
 </action>

</package>
</struts>
剩下的代码就和原来的一样了 ,扫描二维码您可以了解更多

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值