I am an Italian speaking user of date module.
I appreciate a lot the efforts towards the correct translating of "May" string but I think there is still a problem in date_t function.
The original function has the following code:

    foreach (date_month_names_translated() as $delta => $month) {
      $replace[$untranslated[$delta]] = $month;
      $replace[drupal_substr($untranslated[$delta], 0, 3)] = drupal_substr($month, 0, 3);
    }

The result is that May is ALWAYS translated in the abbreviated form.
If I change the order of the instructions

    foreach (date_month_names_translated() as $delta => $month) {
      $replace[drupal_substr($untranslated[$delta], 0, 3)] = drupal_substr($month, 0, 3);
      $replace[$untranslated[$delta]] = $month;
    }

"May" is ALWAYS translated as a long month name (even when it is abbreviated).

I think that a possible solution is to add the $format argument to function date_t in order to tell when it is abbreviated and when it is in long format and, consequently, to choose the right translation.

Comments

mkruisselbrink’s picture

This issue isn't even the biggest problem with date_t's treatment of abbreviated month/day names. I think an even bigger problem is that date_t assumes that in all languages the abbreviated version of a month/day name is the first 3 chars of the full version, and not surprisingly this isn't true.

trunks’s picture

Status: Active » Needs review
StatusFileSize
new1.2 KB

My two cents for this issue. This patch works perfectly for me in a Spanish environment.

trunks’s picture

Status: Needs review » Needs work
StatusFileSize
new1.72 KB

Sorry, previous patch doesn't work correctly (in fact, it reproduces the reverse way for this bug). This new one works for "short", "medium" and "long" date format in Drupal, but needs work to get running Ok for "custom" date format.

karens’s picture

Status: Needs work » Closed (duplicate)

I want to move all discussion about translating abbreviations to a single issue. We now have a new Date locale system for date formats that might help, but whatever the solution is it doesn't help matters to have the discussion split into a half dozen separate threads. So moving this to #338253: Translation of short strings.