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
Comment #1
mkruisselbrink commentedThis 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.
Comment #2
trunks commentedMy two cents for this issue. This patch works perfectly for me in a Spanish environment.
Comment #3
trunks commentedSorry, 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.
Comment #4
karens commentedI 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.