Hi,

When submiting an event, in the "end settings" of the event repeat, the date field displayed is not "localized" properly, eventhough the localization is ok for the event itself.

The translation is done properly (French in my case), but the order of the date elements is not changed accordingly. We should have :
day# month year (as correctly displayed in the Start Date and the End Date of the event).

Instead the English structure is displayed : Month day#, year

Is there something I've missed? Or a minor "bug"?

Thank you in advance for your help!

Comments

seanbfuller’s picture

I just looked at the event.module code, and I don't actually see anything that would localize the order of the date elements. I think it is actually in that order by default.

I don't know if localization actually has any information about the order of dates. I just looked at the date and time settings at admn/settings/date-time, and Drupal defines the three formats, but doesn't really highlight one as the option for forms. CCK date also doesn't have an option for the order of form elements for a date.

I can definitely flip the order of day and month to match event.module. Otherwise, is this something that should happen at the level of either core or the locale module?

BobLouis’s picture

Sean,

Apparently, the event module automatically flips the order of day and month (and also removes the comma) when localized/translated into french.
I have no idea how it works, at the core level or the locale module level, but it would actually be great to have the same functionality for the event repeat module :)

Do you think that would be feasible?

seanbfuller’s picture

Really? Well, shows what I know. :)

I'll try and dig a bit deeper and figure out where that's happening. In the meantime, if anyone else can point me in the right direction / roll up a patch, it would be appreciated. Thanks!

BobLouis’s picture

StatusFileSize
new63.21 KB

Just for info, I attach a screenshot of the submit form in french, with the event date in the "right localized format", and the event repeat (with exceptions) date with the "flipped day and month format".

BobLouis’s picture

Hello, do you have more info on that issue?

It seems that someone had the same problem here with the 4.6 version: http://drupal.org/node/33681
They solved it here: http://drupal.org/node/7836#comment-119406

However, that solution doesn't seem to apply to 5.x versions.
It would be greatly appreciated to have a solution here, since it affects the user interface.

BobLouis’s picture

Hello, do you have more info on that issue?

It seems that someone had the same problem here with the 4.6 version: http://drupal.org/node/33681
It was solved here: http://drupal.org/node/7836#comment-119406

However, that solution doesn't seem to apply to 5.x versions.
It would be greatly appreciated to have a solution here, since it affects the user interface.

seanbfuller’s picture

Status: Active » Needs review
StatusFileSize
new3.47 KB

I took a second look at this, and i think the issue is that event.module actually orders these elements day, month, year by default. So there is no actual localization happening, it's just Euro-friendly by the way it was coded.

The method you outline is actually also for display elements, not form elements. It just adds a fomat_date in a spot where event was not correctly calling that at some point.

After thinking about it, eventrepeat is inconsistent with event.module. The attached patch adds a setting to event repeat that allows the admin to choose which format to use. Euro-friendly is the default. Give this a try and see if it works for you.

I've also changed the -Select- dropdowns with the words day, month and year. These pass through t(), so you should be able to localize them. Seemed to make sense given this change.

I know there is a call for internationalization testers for Drupal 6, so I'll put that on my list to check out the possibility of getting a localized date form routine.

BobLouis’s picture

Thank you for replying and for the patch.
However, it doesn't work for me:

"5 out of 5 hunks FAILED -- saving rejects to eventrepeat.module.rej"

I attach eventrepeat.module.rej here for info.

seanbfuller’s picture

Status: Needs review » Fixed

I've applied the patch to 5.x-1.x

seanbfuller’s picture

Sorry, I was in a hurry yesterday. That last comment should have read something along the lines of:

Sorry that the patch didn't work. Not sure why. I was able to get it to work directly on my server using patch -p3. Line endings seem to be correct, but I just switched to Eclipse PDT so that may be causing some problems. I think this is probably fairly stable, so I'll just commit it to get this moving. Please grab 5.x-1.x when you get a chance and let me know if it works for you. Thanks.

I've also committed this to HEAD.

BobLouis’s picture

No worries Sean.
Actually I am running the 5.1 version of Drupal. So you are saying that the patch should be working on that?

seanbfuller’s picture

Download the new version of 5.x-1.x and you should see the new setting option.

Anonymous’s picture

Status: Fixed » Closed (fixed)