Page MenuHomePhabricator

Calendar day view: displayed weekday names aren't translated - even if the names have a proper translation provided
Closed, DuplicatePublic

Description

Problem is: php DateTime isn't aware of locales.

The following pht call does the trick (but only caused by the side effect of having proper translations for weekdays elsewhere in the code).

Maybe a better solution is to use locale aware date formating functions?

--- a/src/view/phui/calendar/PHUICalendarDayView.php
+++ b/src/view/phui/calendar/PHUICalendarDayView.php
@@ -314,7 +314,7 @@ final class PHUICalendarDayView extends AphrontView {
       } else if ($box_start_time == $tomorrow_time) {
         $title = pht('Tomorrow');
       } else {
-        $title = $box_start_time->format('l');
+       $title = pht($box_start_time->format('l'));
       }
 
       $sidebar_day_boxes[] = array(

Event Timeline

peter.schlaile assigned this task to lpriestley.
peter.schlaile updated the task description. (Show Details)
peter.schlaile added a project: Calendar.
peter.schlaile added a subscriber: peter.schlaile.