OFBiz国际化设置

[color=red][b]文件如何定义[/b][/color]:[color=blue]/config/XXXUILabels.xml[/color]
<?xml version="1.0" encoding="UTF-8"?>
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<property key="AjaxExamples">
<value xml:lang="en">Ajax Examples</value>
<value xml:lang="fr">Exemples Ajax</value>
<value xml:lang="it">Esempi Ajax</value>
<value xml:lang="zh">应用程序</value>
</property>
<property key="AjaxIntro">
<value xml:lang="en">To use this Ajax demonstration, you must have JavaScript enabled on your browser.</value>
<value xml:lang="fr">Pour utiliser cette démonstration Ajax, vous devez avoir activé Javascript </value>
<value xml:lang="it">Per usare questa dimostrazione Ajax, tu devi avere JavaScript abilitato sul tuo browser.</value>
</property>
</resource>

[color=red][b]如何加载:[/b][/color]
[color=blue]ofbiz-component.xml[/color]
<classpath type="dir" location="config"/>

[color=red][b]导入 定义统一名字[/b][/color]
CommonScreen.xml
<screen name="main-decorator">
<section>
<actions>
<!-- base/top/specific map first, then more common map added for shared labels -->
[color=blue]<property-map resource="XXXUILabels" map-name="uiLabelMap" global="true"/>[/color]
</actions>
<widgets>
<include-screen name="GlobalDecorator" location="component://common/widget/CommonScreens.xml"/>
</widgets>
</section>
</screen>

[color=red][b]实际应用 [/b][/color] 比如Screen.xml

<screen name="Test">
<section>
<actions>
<set field="headerItem" value="***"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="component://XXX/widget/CommonScreen.xml">
<decorator-section name="body">
<section>
<condition>
<if-has-permission permission="EXAMPLE" action="_VIEW"/>
</condition>
<widgets>
<container style="h1"><label>[color=blue]${uiLabelMap.AjaxExamples}[/color]</label></container>

。。。。。

<fail-widgets>
<label style="h3">${uiLabelMap.ExampleViewPermissionError}</label>
</fail-widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>

[color=red]最后想知道的是如何 让前台显示[/color]
<value xml:lang="en">Ajax Examples</value>
<value xml:lang="fr">Exemples Ajax</value>
<value xml:lang="it">Esempi Ajax</value>
<value xml:lang="zh">应用程序</value>
[color=red]是其中的哪一种值得呢[/color]

经查找 OFBiz启动时候 一开始回去load [color=red]start.properties [/color]
此文件中配置有
ofbiz.locale.default=zh 或者[color=orange]ofbiz.locale.default=en[/color]
[color=orange]但 经过比对 发现 此处设置 根本无效 [/color]

[b][color=red]非常期待 得到解决[/color][/b]


[color=red]另外有一种解释[/color]
参考 http://hi.baidu.com/lcjbest/item/b066565f0567ab17aaf6d799
具体某个模块 项目加载的时候 配置初始化参数
ofbiz-component.xml

<webapp name="ecommerce"

title="eCommerce"

server="default-server"

location="webapp/ecommerce"

mount-point="/ecommerce"

app-bar-display="false">

[b][color=red] <init-param name="Locale" value="zh"/>[/color][/b]

<init-param name="Currency" value="CNY"/>

</webapp>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值