[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>
<?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>