You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2010/11/21 12:37:59 UTC
svn commit: r1037424 - in /ofbiz/branches/jquery/framework: common/widget/
images/webapp/images/jquery/ui/development-bundle/ui/i18n/
Author: jleroux
Date: Sun Nov 21 11:37:59 2010
New Revision: 1037424
URL: http://svn.apache.org/viewvc?rev=1037424&view=rev
Log:
Part of "The time part (cursors) of the Date Time picker is not internationalized" (https://issues.apache.org/jira/browse/OFBIZ-4015) OFBIZ-4015
>From a Sascah's modified patch (I enhanced previous code I wrote for Prototype, in order to handle correctly the language_country case (like jquery.ui.datepicker-de-CH.js or jquery.ui.datepicker-fr-CH.js).
I also removed the now useless files jquery.ui.datepicker-fr-FR.js and jquery.ui.datepicker-fr_FR.js
Removed:
ofbiz/branches/jquery/framework/images/webapp/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-fr-FR.js
ofbiz/branches/jquery/framework/images/webapp/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-fr_FR.js
Modified:
ofbiz/branches/jquery/framework/common/widget/CommonScreens.xml
Modified: ofbiz/branches/jquery/framework/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/common/widget/CommonScreens.xml?rev=1037424&r1=1037423&r2=1037424&view=diff
==============================================================================
--- ofbiz/branches/jquery/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/branches/jquery/framework/common/widget/CommonScreens.xml Sun Nov 21 11:37:59 2010
@@ -122,8 +122,18 @@ under the License.
<set field="layoutSettings.javaScripts[+0]" value="/images/jquery/plugins/validate/jquery.validate.min.js" global="true"/>
<set field="layoutSettings.javaScripts[+0]" value="/images/jquery/plugins/fjTimer/jquerytimer-min.js" global="true"/>
<set field="layoutSettings.javaScripts[+0]" value="/images/jquery/ui/development-bundle/ui/jquery.ui.datepicker.js" global="true"/>
- <set field="initialLocale" type="String" value="${parameters.userLogin.lastLocale}" default-value="${groovy:locale.toString()}"/>
- <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-${initialLocale}.js" global="true"/>
+
+ <!-- What a mess? OK a Groovy script could be used, but anyway we need this to have real locale for calendar... -->
+ <set field="initialLocaleComplete" type="String" value="${groovy:parameters?.userLogin?.lastLocale}" default-value="${groovy:locale.toString()}"/>
+ <set field="initialLocale" type="String" value="${groovy:parameters?.userLogin?.lastLocale?.substring(0,2)}" default-value="${groovy:locale.toString()?.substring(0,2)?:'en'}"/>
+ <set field="localeFileNameComplete" type="String" value="/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-${initialLocaleComplete}.js"/>
+ <set field="localeFileNameComplete" type="String" value="${groovy: localeFileNameComplete.replace('_', '-')}"/> <!-- those files are build this way OOTB (ie a - not a _ between language and country -->
+ <set field="fileNameComplete" type="String" value="${groovy: org.ofbiz.base.location.FlexibleLocation.resolveLocation('component://images/webapp' + localeFileNameComplete)}"/>
+ <set field="fileNameComplete" type="String" value="${groovy: fileNameComplete.replace('file:/', '')}"/>
+ <set field="localeFileName" type="String" value="/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-${initialLocale}.js"/>
+ <set field="localeJsFile" type="String" value="${groovy: File localeFileComplete = new File(fileNameComplete); localeFileComplete.exists() ? localeFileNameComplete : localeFileName}"/>
+ <set field="layoutSettings.javaScripts[+0]" value="${localeJsFile}" global="true"/>
+
<set field="layoutSettings.javaScripts[+0]" value="/images/jquery/jquery-1.4.2.min.js" global="true"/>
<!-- jQuery CSSs -->
<set field="layoutSettings.styleSheets[+0]" value="/images/jquery/plugins/asmselect/jquery.asmselect-1.0.4a-beta.css" global="true"/>
@@ -151,7 +161,6 @@ under the License.
<widgets>
<!-- render header -->
<platform-specific><html><html-template location="${headerTemplateLocation}"/></html></platform-specific>
-
<!-- render appbar or its opening part -->
<section>
<condition>
@@ -208,6 +217,13 @@ under the License.
<!-- render content area -->
<container style="contentarea">
+ <label>initialLocaleComplete ${initialLocaleComplete}</label>
+ <label>initialLocale ${initialLocale}</label>
+ <label>localeFileNameComplete ${localeFileNameComplete}</label>
+ <label>localeFileName ${localeFileName}</label>
+ <label>localeJsFile ${localeJsFile}</label>
+
+
<decorator-section-include name="pre-body"/>
<decorator-section-include name="body"/>
</container>
@@ -336,7 +352,7 @@ under the License.
<set field="layoutSettings.javaScripts[+0]" value="/images/jquery/plugins/fjTimer/jquerytimer-min.js" global="true"/>
<set field="layoutSettings.javaScripts[+0]" value="/images/jquery/plugins/validate/jquery.validate.min.js" global="true"/>
<set field="layoutSettings.javaScripts[+0]" value="/images/jquery/ui/development-bundle/ui/jquery.ui.datepicker.js" global="true"/>
- <set field="initialLocale" type="String" value="${parameters.userLogin.lastLocale}" default-value="${groovy:locale.toString()}"/>
+ <set field="initialLocale" type="String" value="${groovy:parameters?.userLogin?.lastLocale?.substring(0,2)}" default-value="${groovy:locale.toString()?.substring(0,2)?:'en'}"/>
<set field="layoutSettings.javaScripts[+0]" value="/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-${initialLocale}.js" global="true"/>
<set field="layoutSettings.javaScripts[+0]" value="/images/jquery/jquery-1.4.2.min.js" global="true"/>
<!-- jQuery CSSs -->