Dear Gurus,
I tried to use groovy file to customize the back-end language setting with the following steps: 1. Change the "GlobalDecorator" Screen of the file framework\common\widget\commonscreens.xml by adding the following highlighted underlined codes: <!-- Global decorator for General Screens/Pages --> <screen name="GlobalDecorator"> <section> <widgets> <include-screen name="GlobalActions" /> <section> <actions> <set field="layoutSettings.commonHeaderImageLinkUrl" from-field="layoutSettings.commonHeaderImageLinkUrl" default-value="main" global="true" /> <set field="iconsLocation" from-field="layoutSettings.VT_ICONS_LOC[0]" default-value="/images/icons/famfamfam" global="true" /> <set field="headerTemplateLocation" from-field="layoutSettings.VT_HDR_TMPLT_LOC[0]" /> <set field="footerTemplateLocation" from-field="layoutSettings.VT_FTR_TMPLT_LOC[0]" /> <set field="appbarTemplateLocation" from-field="layoutSettings.VT_NAV_TMPLT_LOC[0]" /> <set field="appbarOpenTemplateLocation" from-field="layoutSettings.VT_NAV_OPEN_TMPLT[0]" /> <set field="appbarCloseTemplateLocation" from-field="layoutSettings.VT_NAV_CLOSE_TMPLT[0]" /> <set field="messagesTemplateLocation" from-field="layoutSettings.VT_MSG_TMPLT_LOC[0]" /> <set field="layoutSettings.suppressTab" value="ofbizsetup"/><!-- diseable ofbiz setup by default --> <script location="component://common/groovyScripts/SetLocale.groovy"/> </actions> <widgets /> </section> ...... 2. Then I added the SetLocale.groovy file in the above location as follows: import org.apache.ofbiz.base.util.UtilHttp setLocale(request,"zh_CN") 3. After a reboot, I got the following error message and could not figure out why. (Error running script at location [component://common/groovyScripts/SetLocale.groovy]: groovy.lang.MissingMethodException: No signature of method: SetLocale.setLocale() is applicable for argument types: (org.apache.catalina.connector.RequestFacade, java.lang.String) values: [org.apache.catalina.connector.RequestFacade@2a5d73ab, zh_CN]))) Pls help me! Thanks! Best Regards Schumann |
Hello Schumann
On 27/03/2018 13:31, Schumann Ye wrote: > I tried to use groovy file to customize the back-end language setting with the following steps: Did you try to configure your locale from general.properties ? and start.properties ? git diff ./framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties framework/common/config/general.properties diff --git a/framework/common/config/general.properties b/framework/common/config/general.properties index e77ae9d8d82..74c29574375 100644 --- a/framework/common/config/general.properties +++ b/framework/common/config/general.properties @@ -51,7 +51,7 @@ locale.properties.fallback=en # which locales the user can select from. If this property is not used, # then the user will be able to select from all the locales available # in the JVM. The list below corresponds to the languages really available OOTB (2010-16-02) -#locales.available=ar,de,en,es,fr,hi,it,nl,pt,ro,ru,th,zh +locales.available=zh # -- Time zones made available, separated by commas. This property controls # which time zones the user can select from. If this property is not used, diff --git a/framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties b/framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties index e1bf39d12ab..67bc2d9fd8e 100644 --- a/framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties +++ b/framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties @@ -56,7 +56,7 @@ ofbiz.admin.key=so3du5kasd5dn #java.awt.headless=false # -- The locale for this OFBiz instance. Default is en -#ofbiz.locale.default=en_US +ofbiz.locale.default=zh # -- The time zone for this OFBiz instance. Default depends on JVM environment #ofbiz.timeZone.default=GMT Nicolas |
Dear Nicolas, Dear Rishi,
I guess you were trying to reply me on the topic "How to change defaultOrganizationPartyCurrencyUomId" instead of the current one "groovy.lang.MissingMethodException: No signature of method". If so, to your question, I did configure both start.properties and general.properties as shown by you below. However, when I go to Party Manager and create a new person, it's still "American Dollar - USD" shown in the field captioned "Preferred Currency Uom Id". As I check the PartyForms.xml, I find it's using the field "defaultOrganizationPartyCurrencyUomId". So I think there must be somewhere where I can set the field value. Thanks Schumann -----邮件原件----- 发件人: Nicolas Malin <[hidden email]> 发送时间: 2018年3月27日 19:43 收件人: [hidden email]; Schumann Ye <[hidden email]> 主题: Re: groovy.lang.MissingMethodException: No signature of method Hello Schumann On 27/03/2018 13:31, Schumann Ye wrote: > I tried to use groovy file to customize the back-end language setting with the following steps: Did you try to configure your locale from general.properties ? and start.properties ? git diff ./framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties framework/common/config/general.properties diff --git a/framework/common/config/general.properties b/framework/common/config/general.properties index e77ae9d8d82..74c29574375 100644 --- a/framework/common/config/general.properties +++ b/framework/common/config/general.properties @@ -51,7 +51,7 @@ locale.properties.fallback=en # which locales the user can select from. If this property is not used, # then the user will be able to select from all the locales available # in the JVM. The list below corresponds to the languages really available OOTB (2010-16-02) -#locales.available=ar,de,en,es,fr,hi,it,nl,pt,ro,ru,th,zh +locales.available=zh # -- Time zones made available, separated by commas. This property controls # which time zones the user can select from. If this property is not used, diff --git a/framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties b/framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties index e1bf39d12ab..67bc2d9fd8e 100644 --- a/framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties +++ b/framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties @@ -56,7 +56,7 @@ ofbiz.admin.key=so3du5kasd5dn #java.awt.headless=false # -- The locale for this OFBiz instance. Default is en -#ofbiz.locale.default=en_US +ofbiz.locale.default=zh # -- The time zone for this OFBiz instance. Default depends on JVM environment #ofbiz.timeZone.default=GMT Nicolas |
Schumann,
I replied you in another thread where you asked for currency. As I asked you what you want to achieve with set of options, to help you better. Anyways, if you are looking for in which entity this data store against party then it is PartyAcctgPreference. If you are looking for something else then please let me know. Thanks! Regards, Rishi Solanki On 27 Mar 2018 7:57 pm, "Schumann Ye" <[hidden email]> wrote: Dear Nicolas, Dear Rishi, I guess you were trying to reply me on the topic "How to change defaultOrganizationPartyCurrencyUomId" instead of the current one "groovy.lang.MissingMethodException: No signature of method". If so, to your question, I did configure both start.properties and general.properties as shown by you below. However, when I go to Party Manager and create a new person, it's still "American Dollar - USD" shown in the field captioned "Preferred Currency Uom Id". As I check the PartyForms.xml, I find it's using the field " defaultOrganizationPartyCurrencyUomId". So I think there must be somewhere where I can set the field value. Thanks Schumann -----邮件原件----- 发件人: Nicolas Malin <[hidden email]> 发送时间: 2018年3月27日 19:43 收件人: [hidden email]; Schumann Ye <[hidden email]> 主题: Re: groovy.lang.MissingMethodException: No signature of method Hello Schumann On 27/03/2018 13:31, Schumann Ye wrote: > I tried to use groovy file to customize the back-end language setting with the following steps: Did you try to configure your locale from general.properties ? and start.properties ? git diff ./framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties framework/common/config/general.properties diff --git a/framework/common/config/general.properties b/framework/common/config/general.properties index e77ae9d8d82..74c29574375 100644 --- a/framework/common/config/general.properties +++ b/framework/common/config/general.properties @@ -51,7 +51,7 @@ locale.properties.fallback=en # which locales the user can select from. If this property is not used, # then the user will be able to select from all the locales available # in the JVM. The list below corresponds to the languages really available OOTB (2010-16-02) -#locales.available=ar,de,en, es,fr,hi,it,nl,pt,ro,ru,th,zh +locales.available=zh # -- Time zones made available, separated by commas. This property controls # which time zones the user can select from. If this property is not used, diff --git a/framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties b/framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties index e1bf39d12ab..67bc2d9fd8e 100644 --- a/framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties +++ b/framework/start/src/main/java/org/apache/ofbiz/base/start/start.properties @@ -56,7 +56,7 @@ ofbiz.admin.key=so3du5kasd5dn #java.awt.headless=false # -- The locale for this OFBiz instance. Default is en -#ofbiz.locale.default=en_US +ofbiz.locale.default=zh # -- The time zone for this OFBiz instance. Default depends on JVM environment #ofbiz.timeZone.default=GMT Nicolas |
Free forum by Nabble | Edit this page |