You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jonas Falberg (JIRA)" <ji...@apache.org> on 2011/05/02 09:10:03 UTC

[jira] [Commented] (OFBIZ-4014) i18n from DateTime display fields

    [ https://issues.apache.org/jira/browse/OFBIZ-4014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13027567#comment-13027567 ] 

Jonas Falberg commented on OFBIZ-4014:
--------------------------------------

"So I think your datejs localized file is not loaded, if it exists."
It does get loaded, checked that. It doesn't get loaded by default though. I had to edit the jsLanguageFilesMapping.java to get it to use the right file.

Hi Sascha,

When using da-DK it's fine. The problem (and I can see this happening loads of places in the file), is that it does not load the propper file if the locale is just "da".
If you look at the file then any locale where the first two letters and the last two letters are not the same in the long locale (fx. da-DK, instead of da-DA), it will load the default en-US for the two-letter locale "da". More examples at the bottom.

It does work with ofbiz, translating dates propperly that are already in the DB. The problem is that it seems to misinterpret some inputs. But as Erwan linked, it seems that problem - the switching dates - might lie in dateJS itself, as the problem also happens on their site. In which case, I don't think there's a whole lot to be done about it...

---
// This works because nl-NL is present
localeFiles.put("nl", "/images/jquery/plugins/datejs/date-nl-NL.js");
localeFiles.put("nl_BE", "/images/jquery/plugins/datejs/date-nl-BE.js");
localeFiles.put("nl_NL", "/images/jquery/plugins/datejs/date-nl-NL.js");

// This doesn't work because zh-ZH isn't present
localeFiles.put("zh", "/images/jquery/plugins/datejs/date-en-US.js");
localeFiles.put("zh_CN", "/images/jquery/plugins/datejs/date-zh-CN.js");
localeFiles.put("zh_HK", "/images/jquery/plugins/datejs/date-zh-HK.js");
localeFiles.put("zh_SG", "/images/jquery/plugins/datejs/date-zh-SG.js");
localeFiles.put("zh_TW", "/images/jquery/plugins/datejs/date-zh-TW.js");



> i18n from DateTime display fields 
> ----------------------------------
>
>                 Key: OFBIZ-4014
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4014
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Sascha Rodekamp
>            Assignee: Sascha Rodekamp
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4014_ModelFormField_DateTimeField_i18n.patch, OFBIZ-4014_ModelFormField_DateTimeField_i18n.patch, OFBIZ-4014_dateJs.zip, OFBIZ-4014_dateJs.zip, OFBIZ-4014_dateJs.zip, OFBIZ-4014_i18nTimepicker.patch, OFBIZ-4014_i18nTimepicker_And_DateTimeField.patch, OFBIZ-4014_i18nTimepicker_And_DateTimeField.patch, OFBIZ-4014_i18nTimepicker_And_DateTimeField.patch, OFBIZ-4014_languageFileLoading.zip, OFBIZ-4014_lazyLoadJsLanguageFiles.patch, OFBIZ-4014_lazyLoadJsLanguageFiles.patch
>
>
> Hi everybody,
> i did a little improvement in the "display" form fields from type date and date-time. 
> In the past the timestamps where read from the DB and the string was simply cut, that didn't match with (i.e.) German date pattern. I changed this substring stuff and used the locale and timezone with the dateFormatter to create a i18n date string.
> This patch works for: <display type="date" /> and <display type="date-time" />
> Hope that helps.
> Have a nice day
> Sascha

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira