A patch from Leon to get the correct "jquery.ui.datepicker-xx-XX.js" (https://issues.apache.org/jira/browse/OFBIZ-4377)

It uses "locale" (e.g. zh_TW) to form the jquery.ui.datepicker file name in method JsLanguageFileMappingCreator.createJsLanguageFileMapping, but jquery uses dash ("-") instead of underscore ("_") to concat the language code and country code, such as zh-TW vs. zh_TW.

A very trivial update to JsLanguageFileMappingCreator.java, and after that, update the JsLanguageFileMapping.java file by running service "createJsLanguageFileMapping". In attached, contains both of patches to these two files.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1163533 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sascha Rodekamp
2011-08-31 08:57:29 +00:00
parent fa3a1a241c
commit d6c19a4ac8
2 changed files with 5 additions and 5 deletions
@@ -119,11 +119,11 @@ public class JsLanguageFileMappingCreator {
if (file.exists()) {
fileUrl = jqueryUiLocaleRelPath + jqueryUiLocalePrefix + strippedLocale + jsFilePostFix;
} else {
fileName = componentRoot + jqueryUiLocaleRelPath + jqueryUiLocalePrefix + locale + jsFilePostFix;
fileName = componentRoot + jqueryUiLocaleRelPath + jqueryUiLocalePrefix + modifiedDisplayCountry + jsFilePostFix;
file = FileUtil.getFile(fileName);
if (file.exists()) {
fileUrl = jqueryUiLocaleRelPath + jqueryUiLocalePrefix + locale + jsFilePostFix;
fileUrl = jqueryUiLocaleRelPath + jqueryUiLocalePrefix + modifiedDisplayCountry + jsFilePostFix;
}
}
@@ -227,10 +227,10 @@ public final class JsLanguageFilesMapping {
localeFiles.put("ca", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-ca.js");
localeFiles.put("ca_ES", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-ca.js");
localeFiles.put("zh", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-en.js");
localeFiles.put("zh_CN", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-en.js");
localeFiles.put("zh_HK", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-en.js");
localeFiles.put("zh_CN", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-zh-CN.js");
localeFiles.put("zh_HK", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-zh-HK.js");
localeFiles.put("zh_SG", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-en.js");
localeFiles.put("zh_TW", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-en.js");
localeFiles.put("zh_TW", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-zh-TW.js");
localeFiles.put("hr", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-hr.js");
localeFiles.put("hr_HR", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-hr.js");
localeFiles.put("cs", "/images/jquery/ui/development-bundle/ui/i18n/jquery.ui.datepicker-cs.js");