It seems that Agenda doesn't translate day's name nor moth's. I'm using a google calendar with italian language and a full translated drupal 7. Is this a missing feature or is it just me that I'm missing something?

Comments

BlinX’s picture

Same for me (translation to Dutch). Already posted in the forum, no reply's.
After updating form Agenda 7.x-1.2 --> 7.x-1.3, the dates shown above each event are displayed in english instead of being translated to Dutch.
In the previous version it was translated as expected!

Altough Today (Vandaag) and Tomorrow (morgen) are being translated as expected!

Date formatting in "Configure agenda block" is set to l, j F
It seems "Date formatting" is changed in this new version.

Where can we find info about the expected value of this field "Date formatting"?
Or can anybody point the right way for this?
Thanks!

aidanlis’s picture

The dates are generated like this:

  $start   = new DateTime((string) $gd->when->attributes()->startTime, $tz);
  $end     = new DateTime((string) $gd->when->attributes()->endTime, $tz);

  $event['start date']      = $start->format($block->dateformat);
  $event['start time']      = $start->format($block->timeformat);

I'm not sure how to force the translation with this object, but I'll ask Gabor to take a look.

gábor hojtsy’s picture

Drupal has long been providing this functionality in http://api.drupal.org/api/drupal/includes--common.inc/function/format_da...

aidanlis’s picture

I can't use format_date because it's impossible to get timezones (especially DST) correct in D6.

gábor hojtsy’s picture

@aidanlis: the issue version number says 7.x-1.3.

aidanlis’s picture

Status: Active » Postponed

Not sure why I said D6 there - this issue #1016336: Events are displaying in the wrong date -- a day earlier (D7) is all about the problems I've had with format_date in D6 and D7.

If the DateTime object doesn't support native translation it may be necessary to grab the timestamp from the DateTime object and feed that to format_date, but I don't have time to experiment with this. Thanks for the feedback Gabor.

eyeworry’s picture

Assigned: Unassigned » eyeworry
Status: Postponed » Needs work

Any new ideas about this problem...

I need the days and months in german :( Pls help

aidanlis’s picture

Assigned: eyeworry » Unassigned
Status: Needs work » Postponed

Unless you can provide patches I don't have time to fix this, I'm sorry!

k.skarlatos’s picture

StatusFileSize
new3.1 KB

Hi, this is a small patch we wrote in order to fix this issue. In our setup it works ok, but please test it if you can.

k.skarlatos’s picture

And also this is my first patch, so if I made any noob mistakes please forgive me :)

gábor hojtsy’s picture

First thing: please don't change the line ending or make the patch without respect to line ending changes, so we can see the actual change. It is pretty hard to review as-is.

k.skarlatos’s picture

StatusFileSize
new719 bytes

Sorry for the previous patch, I think this is the correct one

tmgd’s picture

The patch work for me. Thanks!

lukslo’s picture

Works like a charm. Thanks a lot!

BlinX’s picture

Super!!
Thanks!!

petertoen’s picture

Will this patch be included in th next release? I would appreciate it. Cheers

cndbs’s picture

thanks you dude! It works perfectly!
( At the beginning i did'nt understand how to install it ^^)

lilbebel’s picture

Hi CNDBS,

I'm also having trouble applying the patch. Would you be able to provide a screenshot of the code with the patch applied? That would be super helpful.

Thanks,

M

quiquee’s picture

Works great, thank you !!

( patch agenda-block.tpl.php ../patch_7.diff didn't work and I had to edit manually :-?? )

balis_m’s picture

Version: 7.x-1.3 » 7.x-2.0-beta1
Category: Support request » Bug report
Issue summary: View changes
Status: Postponed » Active
StatusFileSize
new1.7 KB

This problem also exists at 7.x-2.0-beta1.

I made this patch to fix this issue.

guschilds’s picture

Status: Active » Needs review

The last submitted patch, 9: patch.diff, failed testing.

The last submitted patch, 12: patch.diff, failed testing.

Status: Needs review » Needs work

The last submitted patch, 20: day_of_the_week_and_month_not_translated-1273200-20.patch, failed testing.

  • guschilds committed 546e180 on 7.x-2.x authored by balis_m
    Issue #1273200 by balis_m, guschilds: Added ability to translate day of...
guschilds’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev
Status: Needs work » Fixed

Thanks, balis_m! I have committed your fix. The patch test had failed because of an issue with the test that has since been fixed.

While this patch will allow for translation, the caching approach used in the 7.x-2.x version will introduce a bug on multilingual sites. I've created an issue for that here: #2388289: Built-in caching causes problem on multi-lingual sites.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.