Author: jleroux
Date: Thu Oct 13 09:07:12 2011 New Revision: 1182731 URL: http://svn.apache.org/viewvc?rev=1182731&view=rev Log: Fix a bug reported by Chatree "JavaScript location is empty causes a double requests problem" https://issues.apache.org/jira/browse/OFBIZ-4477 In r1178199, I missed to use the default DateTime file (jquery.ui.datepicker-en.js) being still with the idea that it was handled internally. I have also refactored/simplified JsLanguageFileMappingCreator class and put comments to better explain how all that works Modified: ofbiz/trunk/framework/common/servicedef/services.xml ofbiz/trunk/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java ofbiz/trunk/framework/common/src/org/ofbiz/common/JsLanguageFilesMapping.java ofbiz/trunk/framework/common/template/JsLanguageFilesMapping.ftl Modified: ofbiz/trunk/framework/common/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services.xml?rev=1182731&r1=1182730&r2=1182731&view=diff ============================================================================== --- ofbiz/trunk/framework/common/servicedef/services.xml (original) +++ ofbiz/trunk/framework/common/servicedef/services.xml Thu Oct 13 09:07:12 2011 @@ -783,6 +783,7 @@ under the License. <service name="createJsLanguageFileMapping" engine="java" auth="false" use-transaction="false" location="org.ofbiz.common.JsLanguageFileMappingCreator" invoke="createJsLanguageFileMapping"> + <description>Create or update the JsLanguageFilesMapping.java. You still need to compile thereafter</description> <attribute name="encoding" mode="IN" type="String" optional="true" default-value="UTF-8"></attribute> </service> Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java?rev=1182731&r1=1182730&r2=1182731&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/JsLanguageFileMappingCreator.java Thu Oct 13 09:07:12 2011 @@ -18,6 +18,8 @@ import org.ofbiz.base.util.template.Free import org.ofbiz.service.DispatchContext; import org.ofbiz.service.ServiceUtil; +// Use the createJsLanguageFileMapping service to create or update the JsLanguageFilesMapping.java. You will still need to compile thereafter + public class JsLanguageFileMappingCreator { private static final String module = JsLanguageFileMappingCreator.class.getName(); @@ -69,90 +71,73 @@ public class JsLanguageFileMappingCreato if (file.exists()) { fileUrl = dateJsLocaleRelPath + dateJsLocalePrefix + modifiedDisplayCountry + jsFilePostFix; - } - - if (fileUrl == null) { + } else { // Try to guess a language String tmpLocale = strippedLocale + "-" + strippedLocale.toUpperCase(); fileName = componentRoot + dateJsLocaleRelPath + dateJsLocalePrefix + tmpLocale + jsFilePostFix; file = FileUtil.getFile(fileName); if (file.exists()) { fileUrl = dateJsLocaleRelPath + dateJsLocalePrefix + tmpLocale + jsFilePostFix; + } else { + // use default language en-US + fileUrl = dateJsLocaleRelPath + dateJsLocalePrefix + defaultLocaleDateJs + jsFilePostFix; } } - - if (fileUrl == null) { - // use default language en-US - fileUrl = dateJsLocaleRelPath + dateJsLocalePrefix + defaultLocaleDateJs + jsFilePostFix; - } - dateJsLocaleFile.put(displayCountry, fileUrl); - fileUrl = null; - /* * Try to open the jquery validation language file */ fileName = componentRoot + validateRelPath + validateLocalePrefix + strippedLocale + jsFilePostFix; file = FileUtil.getFile(fileName); - if (file.exists()) { fileUrl = validateRelPath + validateLocalePrefix + strippedLocale + jsFilePostFix; - } - - if (fileUrl == null) { + } else { + // use default language en fileUrl = validateRelPath + validateLocalePrefix + defaultLocaleJquery + jsFilePostFix; } validationLocaleFile.put(displayCountry, fileUrl); - fileUrl = null; - /* * Try to open the jquery timepicker language file */ - file = null; - fileUrl = null; - fileName = componentRoot + jqueryUiLocaleRelPath + jqueryUiLocalePrefix + strippedLocale + jsFilePostFix; file = FileUtil.getFile(fileName); if (file.exists()) { fileUrl = jqueryUiLocaleRelPath + jqueryUiLocalePrefix + strippedLocale + jsFilePostFix; } else { + // Try to guess a language fileName = componentRoot + jqueryUiLocaleRelPath + jqueryUiLocalePrefix + modifiedDisplayCountry + jsFilePostFix; file = FileUtil.getFile(fileName); - if (file.exists()) { fileUrl = jqueryUiLocaleRelPath + jqueryUiLocalePrefix + modifiedDisplayCountry + jsFilePostFix; + } else { + // use default language en + fileUrl = jqueryUiLocaleRelPath + jqueryUiLocalePrefix + defaultLocaleJquery + jsFilePostFix; } } - - if (fileUrl == null) { - fileUrl = jqueryUiLocaleRelPath + jqueryUiLocalePrefix + defaultLocaleJquery + jsFilePostFix; - } - jQueryLocaleFile.put(displayCountry, fileUrl); /* * Try to open the datetimepicker language file */ - file = null; - fileUrl = null; - fileName = componentRoot + dateTimePickerJsLocaleRelPath + dateTimePickerPrefix + strippedLocale + jsFilePostFix; file = FileUtil.getFile(fileName); if (file.exists()) { fileUrl = dateTimePickerJsLocaleRelPath + dateTimePickerPrefix + strippedLocale + jsFilePostFix; } else { + // Try to guess a language fileName = componentRoot + dateTimePickerJsLocaleRelPath + dateTimePickerPrefix + modifiedDisplayCountry + jsFilePostFix; file = FileUtil.getFile(fileName); - if (file.exists()) { fileUrl = dateTimePickerJsLocaleRelPath + dateTimePickerPrefix + modifiedDisplayCountry + jsFilePostFix; + } else { + // use default language en + fileUrl = dateTimePickerJsLocaleRelPath + dateTimePickerPrefix + defaultLocaleJquery + jsFilePostFix; } } - dateTimePickerLocaleFile.put(displayCountry, fileUrl); } Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/JsLanguageFilesMapping.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/JsLanguageFilesMapping.java?rev=1182731&r1=1182730&r2=1182731&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/JsLanguageFilesMapping.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/JsLanguageFilesMapping.java Thu Oct 13 09:07:12 2011 @@ -16,13 +16,19 @@ * specific language governing permissions and limitations * under the License. *******************************************************************************/ + + package org.ofbiz.common; import java.util.Map; import javolution.util.FastMap; + public final class JsLanguageFilesMapping { + + // DO NOT EDIT THIS FILE! THIS IS AUTO GENERATED AND WILL GET WRITTEN OVER PERIODICALLY WHEN THE DATA CHANGE + // Rather use the createJsLanguageFileMapping to create or update it. You will still need to compile thereafter public static class datejs { @@ -30,7 +36,7 @@ public final class JsLanguageFilesMappin private static String defaultDateJs = "/images/jquery/plugins/datejs/date-en-US.js"; static { - localeFiles.put("sq", "/images/jquery/plugins/datejs/date-en-US.js"); + localeFiles.put("sq", "/images/jquery/plugins/datejs/date-en-US.js"); localeFiles.put("sq_AL", "/images/jquery/plugins/datejs/date-sq-AL.js"); localeFiles.put("ar", "/images/jquery/plugins/datejs/date-en-US.js"); localeFiles.put("ar_DZ", "/images/jquery/plugins/datejs/date-ar-DZ.js"); @@ -530,64 +536,65 @@ public final class JsLanguageFilesMappin public static class dateTime { private static Map<String, String> localeFiles = FastMap.newInstance(); + private static String defaultDateTime = "/images/webapp/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-en.js"; static { - localeFiles.put("sq", ""); - localeFiles.put("sq_AL", ""); - localeFiles.put("ar", ""); - localeFiles.put("ar_DZ", ""); - localeFiles.put("ar_BH", ""); - localeFiles.put("ar_EG", ""); - localeFiles.put("ar_IQ", ""); - localeFiles.put("ar_JO", ""); - localeFiles.put("ar_KW", ""); - localeFiles.put("ar_LB", ""); - localeFiles.put("ar_LY", ""); - localeFiles.put("ar_MA", ""); - localeFiles.put("ar_OM", ""); - localeFiles.put("ar_QA", ""); - localeFiles.put("ar_SA", ""); - localeFiles.put("ar_SD", ""); - localeFiles.put("ar_SY", ""); - localeFiles.put("ar_TN", ""); - localeFiles.put("ar_AE", ""); - localeFiles.put("ar_YE", ""); - localeFiles.put("be", ""); - localeFiles.put("be_BY", ""); - localeFiles.put("bg", ""); - localeFiles.put("bg_BG", ""); - localeFiles.put("ca", ""); - localeFiles.put("ca_ES", ""); - localeFiles.put("zh", ""); - localeFiles.put("zh_CN", ""); - localeFiles.put("zh_HK", ""); - localeFiles.put("zh_SG", ""); - localeFiles.put("zh_TW", ""); - localeFiles.put("hr", ""); - localeFiles.put("hr_HR", ""); + localeFiles.put("sq", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("sq_AL", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_DZ", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_BH", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_EG", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_IQ", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_JO", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_KW", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_LB", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_LY", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_MA", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_OM", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_QA", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_SA", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_SD", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_SY", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_TN", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_AE", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ar_YE", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("be", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("be_BY", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("bg", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("bg_BG", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ca", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ca_ES", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("zh", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("zh_CN", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("zh_HK", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("zh_SG", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("zh_TW", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("hr", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("hr_HR", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); localeFiles.put("cs", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-cs.js"); localeFiles.put("cs_CZ", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-cs.js"); - localeFiles.put("da", ""); - localeFiles.put("da_DK", ""); + localeFiles.put("da", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("da_DK", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); localeFiles.put("nl", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-nl.js"); localeFiles.put("nl_BE", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-nl.js"); localeFiles.put("nl_NL", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-nl.js"); - localeFiles.put("en", ""); - localeFiles.put("en_AU", ""); - localeFiles.put("en_CA", ""); - localeFiles.put("en_IN", ""); - localeFiles.put("en_IE", ""); - localeFiles.put("en_MT", ""); - localeFiles.put("en_NZ", ""); - localeFiles.put("en_PH", ""); - localeFiles.put("en_SG", ""); - localeFiles.put("en_ZA", ""); - localeFiles.put("en_GB", ""); - localeFiles.put("en_US", ""); + localeFiles.put("en", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("en_AU", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("en_CA", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("en_IN", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("en_IE", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("en_MT", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("en_NZ", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("en_PH", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("en_SG", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("en_ZA", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("en_GB", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("en_US", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); localeFiles.put("et", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-et.js"); localeFiles.put("et_EE", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-et.js"); - localeFiles.put("fi", ""); - localeFiles.put("fi_FI", ""); + localeFiles.put("fi", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("fi_FI", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); localeFiles.put("fr", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-fr.js"); localeFiles.put("fr_BE", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-fr.js"); localeFiles.put("fr_CA", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-fr.js"); @@ -602,56 +609,56 @@ public final class JsLanguageFilesMappin localeFiles.put("el", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-el.js"); localeFiles.put("el_CY", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-el.js"); localeFiles.put("el_GR", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-el.js"); - localeFiles.put("iw", ""); - localeFiles.put("iw_IL", ""); - localeFiles.put("hi_IN", ""); + localeFiles.put("iw", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("iw_IL", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("hi_IN", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); localeFiles.put("hu", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-hu.js"); localeFiles.put("hu_HU", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-hu.js"); - localeFiles.put("is", ""); - localeFiles.put("is_IS", ""); - localeFiles.put("in", ""); - localeFiles.put("in_ID", ""); - localeFiles.put("ga", ""); - localeFiles.put("ga_IE", ""); + localeFiles.put("is", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("is_IS", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("in", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("in_ID", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ga", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ga_IE", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); localeFiles.put("it", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-it.js"); localeFiles.put("it_IT", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-it.js"); localeFiles.put("it_CH", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-it.js"); - localeFiles.put("ja", ""); - localeFiles.put("ja_JP", ""); - localeFiles.put("ja_JP_JP", ""); - localeFiles.put("ko", ""); - localeFiles.put("ko_KR", ""); - localeFiles.put("lv", ""); - localeFiles.put("lv_LV", ""); + localeFiles.put("ja", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ja_JP", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ja_JP_JP", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ko", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ko_KR", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("lv", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("lv_LV", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); localeFiles.put("lt", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-lt.js"); localeFiles.put("lt_LT", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-lt.js"); - localeFiles.put("mk", ""); - localeFiles.put("mk_MK", ""); - localeFiles.put("ms", ""); - localeFiles.put("ms_MY", ""); - localeFiles.put("mt", ""); - localeFiles.put("mt_MT", ""); - localeFiles.put("no", ""); - localeFiles.put("no_NO", ""); - localeFiles.put("no_NO_NY", ""); - localeFiles.put("pl", ""); - localeFiles.put("pl_PL", ""); - localeFiles.put("pt", ""); - localeFiles.put("pt_BR", ""); - localeFiles.put("pt_PT", ""); - localeFiles.put("ro", ""); - localeFiles.put("ro_RO", ""); + localeFiles.put("mk", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("mk_MK", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ms", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ms_MY", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("mt", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("mt_MT", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("no", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("no_NO", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("no_NO_NY", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("pl", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("pl_PL", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("pt", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("pt_BR", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("pt_PT", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ro", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("ro_RO", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); localeFiles.put("ru", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-ru.js"); localeFiles.put("ru_RU", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-ru.js"); - localeFiles.put("sr", ""); - localeFiles.put("sr_BA", ""); - localeFiles.put("sr_ME", ""); - localeFiles.put("sr_CS", ""); - localeFiles.put("sr_RS", ""); - localeFiles.put("sk", ""); - localeFiles.put("sk_SK", ""); - localeFiles.put("sl", ""); - localeFiles.put("sl_SI", ""); + localeFiles.put("sr", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("sr_BA", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("sr_ME", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("sr_CS", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("sr_RS", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("sk", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("sk_SK", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("sl", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("sl_SI", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); localeFiles.put("es", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-es.js"); localeFiles.put("es_AR", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-es.js"); localeFiles.put("es_BO", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-es.js"); @@ -673,22 +680,22 @@ public final class JsLanguageFilesMappin localeFiles.put("es_US", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-es.js"); localeFiles.put("es_UY", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-es.js"); localeFiles.put("es_VE", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-es.js"); - localeFiles.put("sv", ""); - localeFiles.put("sv_SE", ""); - localeFiles.put("th", ""); - localeFiles.put("th_TH", ""); - localeFiles.put("th_TH_TH", ""); + localeFiles.put("sv", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("sv_SE", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("th", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("th_TH", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("th_TH_TH", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); localeFiles.put("tr", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-tr.js"); localeFiles.put("tr_TR", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-tr.js"); - localeFiles.put("uk", ""); - localeFiles.put("uk_UA", ""); + localeFiles.put("uk", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); + localeFiles.put("uk_UA", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-en.js"); localeFiles.put("vi", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-vi.js"); localeFiles.put("vi_VN", "/images/jquery/plugins/datetimepicker/localization/jquery-ui-timepicker-vi.js"); } public static String getFilePath(String locale) { if (dateTime.localeFiles.get(locale) == null) { - return null; + return dateTime.defaultDateTime; } return dateTime.localeFiles.get(locale); } Modified: ofbiz/trunk/framework/common/template/JsLanguageFilesMapping.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/template/JsLanguageFilesMapping.ftl?rev=1182731&r1=1182730&r2=1182731&view=diff ============================================================================== --- ofbiz/trunk/framework/common/template/JsLanguageFilesMapping.ftl (original) +++ ofbiz/trunk/framework/common/template/JsLanguageFilesMapping.ftl Thu Oct 13 09:07:12 2011 @@ -16,13 +16,21 @@ * specific language governing permissions and limitations * under the License. *******************************************************************************/ + +<#-- Use the createJsLanguageFileMapping service to create or update the JsLanguageFilesMapping.java. You will still need to compile thereafter --> + package org.ofbiz.common; import java.util.Map; import javolution.util.FastMap; + <#-- The comment in UPPERCASE below is dynamically put in the JsLanguageFilesMapping.java generated file, so please keep it... --> + public final class JsLanguageFilesMapping { + + // DO NOT EDIT THIS FILE! THIS IS AUTO GENERATED AND WILL GET WRITTEN OVER PERIODICALLY WHEN THE DATA CHANGE + // Rather use the createJsLanguageFileMapping service to create or update it. You will still need to compile thereafter public static class datejs { @@ -86,6 +94,7 @@ public final class JsLanguageFilesMappin public static class dateTime { private static Map<String, String> localeFiles = FastMap.newInstance(); + private static String defaultDateTime = "/images/webapp/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-en.js"; static { <#list dateTime.keySet() as dateTimeFiles> @@ -96,7 +105,7 @@ public final class JsLanguageFilesMappin public static String getFilePath(String locale) { if (dateTime.localeFiles.get(locale) == null) { - return null; + return dateTime.defaultDateTime; } return dateTime.localeFiles.get(locale); } |
Free forum by Nabble | Edit this page |