Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I noticed that dates are not localized in the check-out detail form. I solved it changing lines 159 and 483 (hotel_booking.panes.inc) from
night_formatted = $night_date->format('l F j, Y'); //format object
to
$night_formatted = t($night_date->format('l')) . " " . t($night_date->format('F')) . $night_date->format(' j, Y'); //format object
and lines 194 and 518 from
$check_out_formatted = $night_date->format('l F j, Y');
to
$check_out_formatted = t($night_date->format('l')) . " " . t($night_date->format('F')) . $night_date->format(' j, Y'); //format object
Is there any better way?
Thanks in advance!
Comments
Comment #1
larowlanI'll have a look at how the date module does it, if possible we should hook into their translations to prevent creating a new set of translation strings.
Comment #2
larowlanComment #3
agsh CreditAttribution: agsh commentedOk. Thanks a lot for your support!