date_month_names_translated uses incorrect translation keys
| Project: | Date |
| Version: | 6.x-2.x-dev |
| Component: | Date API |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
date_month_names_translated, and thus date_t, fails to translate month names because it omits the '!long-month-name ' prefix.
I think the error was introduced during this committ: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/date/date_a...
The reason why '!long-month-name ' is necessary is explained in core's common.php#format_date: "May" is both a short and a long month name in English, but in order to translate it to languages where the number of characters varies some context-information (do we want a short or long name) is necessary. Thus Drupal core uses the convention with translation keys 'May', '!long-month-name May', 'Jun', '!long-month-name June' and so forth. The key 'June' does not normally exist in a standard installation's translation database, so when the current date_month_names_translated tries such translations they fail (unless some other module or user has added these non-standard translations too).
Patch is attached.
| Attachment | Size |
|---|---|
| date_long_month_translation.diff | 1.02 KB |

#1
Yes, I knew about this but for some reason had it in my head that the special formatting was for the short month names instead of the long month names. Patch committed, thanks!
#2
The patch got applied to date_month_names_untranslated rather than
date_month_names_translateda few lines down. I guess there was a line number offset between the version that I rolled the patch on and version that you applied it on.The mixup hower made me realize the amount of code could be reduced by reusing the untranslated array instead of redefining the same array in
date_month_names_translated. Hopefully this patch should apply better since it covers both functions and thus should prevent a mixup.#3
That wasn't your mistake, it was mine. I manually applied the patch to the wrong place :(
Thanks!
#4
Automatically closed -- issue fixed for two weeks with no activity.