Hello, i want to have a date popup (with a cck date field in a content type) with his input format translated regarding the language when we add/edit the node.

I tried many things but i didn't found a solution to do that, so i have made a little patch :

In the function date_input_format of date_elements.inc (date/date module) :

Replace (line 555) :

return $field['widget']['input_format_custom'];

by :

return t($field['widget']['input_format_custom']);

And replace (line 558) :

return $field['widget']['input_format'];

by :

return t($field['widget']['input_format']);

After, we can translate input format with the translate interface to have the right format for differents languages in edit mode.

If somebody please can confirm this or maybe there is already a solution for this problem that i don't found.

Thank you

Comments

theohawse’s picture

Okay this helped me a bit, but I'm getting a warning while adding the content:

warning: date_format() expects parameter 1 to be DateTime, string given in J:\wamp\www\casaresources\sites\all\modules\date\date_api.module on line 678.
warning: date_format() expects parameter 1 to be DateTime, string given in J:\wamp\www\casaresources\sites\all\modules\date\date_api.module on line 710.
warning: date_format() expects parameter 1 to be DateTime, string given in J:\wamp\www\casaresources\sites\all\modules\date\date_api.module on line 710.
warning: date_format() expects parameter 1 to be DateTime, string given in J:\wamp\www\casaresources\sites\all\modules\date\date_api.module on line 710.
warning: date_format() expects parameter 1 to be DateTime, string given in J:\wamp\www\casaresources\sites\all\modules\date\date_api.module on line 710.
warning: date_format() expects parameter 1 to be DateTime, string given in J:\wamp\www\casaresources\sites\all\modules\date\date_api.module on line 710.

Turning off date popup fixes the error above, but then I can't get translated dates anymore!

jiv_e’s picture

Component: Date CCK Field » Code
Issue summary: View changes
Status: Active » Closed (won't fix)

Thanks for your contribution! There has been no activity on this so I'll close the ticket. Please feel free to reopen if this is still an issue.