diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php index 8d7c1bed..54a86bd5 100644 --- a/includes/controller/shifts_controller.php +++ b/includes/controller/shifts_controller.php @@ -280,7 +280,7 @@ function shift_delete_controller() error(sprintf( __('Do you want to delete the shift %s from %s to %s?'), $shift->shiftType->name, - $shift->start->format(__('Y-m-d H:i')), + $shift->start->format(__('general.datetime')), $shift->end->format(__('H:i')) ), true), form([ diff --git a/includes/helper/legacy_helper.php b/includes/helper/legacy_helper.php index 617e787f..220a6268 100644 --- a/includes/helper/legacy_helper.php +++ b/includes/helper/legacy_helper.php @@ -32,7 +32,7 @@ function dateWithEventDay(string $day): string { $date = Carbon::createFromFormat('Y-m-d', $day); $dayOfEvent = DayOfEvent::get($date); - $dateFormatted = $date->format(__('Y-m-d')); + $dateFormatted = $date->format(__('general.date')); if (!config('enable_show_day_of_event') || is_null($dayOfEvent)) { return $dateFormatted; diff --git a/includes/helper/shift_helper.php b/includes/helper/shift_helper.php index 153c628d..0b9f0ef8 100644 --- a/includes/helper/shift_helper.php +++ b/includes/helper/shift_helper.php @@ -45,8 +45,8 @@ class Shift $title, $type, $location->name, - $start->format(__('Y-m-d H:i')), - $end->format(__('Y-m-d H:i')) + $start->format(__('general.datetime')), + $end->format(__('general.datetime')) ); $workLog->save(); diff --git a/includes/mailer/shifts_mailer.php b/includes/mailer/shifts_mailer.php index 56e02090..2531c9ac 100644 --- a/includes/mailer/shifts_mailer.php +++ b/includes/mailer/shifts_mailer.php @@ -36,8 +36,8 @@ function mail_shift_change(Shift $old_shift, Shift $new_shift) if ($old_shift->start->timestamp != $new_shift->start->timestamp) { $message .= sprintf( __('* Shift Start changed from %s to %s'), - $old_shift->start->format(__('Y-m-d H:i')), - $new_shift->start->format(__('Y-m-d H:i')) + $old_shift->start->format(__('general.datetime')), + $new_shift->start->format(__('general.datetime')) ) . "\n"; $noticeable_changes = true; } @@ -45,8 +45,8 @@ function mail_shift_change(Shift $old_shift, Shift $new_shift) if ($old_shift->end->timestamp != $new_shift->end->timestamp) { $message .= sprintf( __('* Shift End changed from %s to %s'), - $old_shift->end->format(__('Y-m-d H:i')), - $new_shift->end->format(__('Y-m-d H:i')) + $old_shift->end->format(__('general.datetime')), + $new_shift->end->format(__('general.datetime')) ) . "\n"; $noticeable_changes = true; } @@ -66,7 +66,7 @@ function mail_shift_change(Shift $old_shift, Shift $new_shift) $message .= $new_shift->shiftType->name . "\n"; $message .= $new_shift->title . "\n"; - $message .= $new_shift->start->format(__('Y-m-d H:i')) . ' - ' . $new_shift->end->format(__('H:i')) . "\n"; + $message .= $new_shift->start->format(__('general.datetime')) . ' - ' . $new_shift->end->format(__('H:i')) . "\n"; $message .= $new_location->name . "\n\n"; $message .= url('/shifts', ['action' => 'view', 'shift_id' => $new_shift->id]) . "\n"; @@ -92,7 +92,7 @@ function mail_shift_assign(User $user, Shift $shift) $message = __('You have been assigned to a Shift:') . "\n"; $message .= $shift->shiftType->name . "\n"; $message .= $shift->title . "\n"; - $message .= $shift->start->format(__('Y-m-d H:i')) . ' - ' . $shift->end->format(__('H:i')) . "\n"; + $message .= $shift->start->format(__('general.datetime')) . ' - ' . $shift->end->format(__('H:i')) . "\n"; $message .= $shift->location->name . "\n\n"; $message .= url('/shifts', ['action' => 'view', 'shift_id' => $shift->id]) . "\n"; @@ -108,7 +108,7 @@ function mail_shift_removed(User $user, Shift $shift) $message = __('You have been removed from a Shift:') . "\n"; $message .= $shift->shiftType->name . "\n"; $message .= $shift->title . "\n"; - $message .= $shift->start->format(__('Y-m-d H:i')) . ' - ' . $shift->end->format(__('H:i')) . "\n"; + $message .= $shift->start->format(__('general.datetime')) . ' - ' . $shift->end->format(__('H:i')) . "\n"; $message .= $shift->location->name . "\n"; engelsystem_email_to_user($user, __('Removed from Shift'), $message, true); diff --git a/includes/pages/admin_arrive.php b/includes/pages/admin_arrive.php index a51fbb9b..891822f6 100644 --- a/includes/pages/admin_arrive.php +++ b/includes/pages/admin_arrive.php @@ -103,10 +103,10 @@ function admin_arrive() $arrivalDate = $usr->state->arrival_date; $plannedArrivalDate = $usr->personalData->planned_arrival_date; $usr['rendered_planned_departure_date'] = $plannedDepartureDate - ? $plannedDepartureDate->format(__('Y-m-d')) + ? $plannedDepartureDate->format(__('general.date')) : '-'; - $usr['rendered_planned_arrival_date'] = $plannedArrivalDate ? $plannedArrivalDate->format(__('Y-m-d')) : '-'; - $usr['rendered_arrival_date'] = $arrivalDate ? $arrivalDate->format(__('Y-m-d')) : '-'; + $usr['rendered_planned_arrival_date'] = $plannedArrivalDate ? $plannedArrivalDate->format(__('general.date')) : '-'; + $usr['rendered_arrival_date'] = $arrivalDate ? $arrivalDate->format(__('general.date')) : '-'; $usr['arrived'] = icon_bool($usr->state->arrived); $usr['actions'] = form([ form_hidden('action', $usr->state->arrived ? 'reset' : 'arrived'), @@ -165,7 +165,7 @@ function admin_arrive() foreach ($arrival_count_at_day as $day => $entry) { $arrival_sum += $entry['count']; $arrival_at_day[$day] = [ - 'day' => $entry['day']->format(__('Y-m-d')), + 'day' => $entry['day']->format(__('general.date')), 'count' => $entry['count'], 'sum' => $arrival_sum, ]; @@ -176,7 +176,7 @@ function admin_arrive() foreach ($planned_arrival_count_at_day as $day => $entry) { $planned_arrival_sum += $entry['count']; $planned_arrival_at_day[$day] = [ - 'day' => $entry['day']->format(__('Y-m-d')), + 'day' => $entry['day']->format(__('general.date')), 'count' => $entry['count'], 'sum' => $planned_arrival_sum, ]; @@ -187,7 +187,7 @@ function admin_arrive() foreach ($planned_departure_count_at_day as $day => $entry) { $planned_departure_sum += $entry['count']; $planned_departure_at_day[$day] = [ - 'day' => $entry['day']->format(__('Y-m-d')), + 'day' => $entry['day']->format(__('general.date')), 'count' => $entry['count'], 'sum' => $planned_departure_sum, ]; diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php index da9fd2f8..e7bb0880 100644 --- a/includes/pages/admin_shifts.php +++ b/includes/pages/admin_shifts.php @@ -319,9 +319,9 @@ function admin_shifts() $shifts_table_entry = [ 'timeslot' => icon('clock-history') . ' ' - . $start->format(__('Y-m-d H:i')) + . $start->format(__('general.datetime')) . ' - ' - . '' + . '' . $end->format(__('H:i')) . '' . ', ' . round($end->copy()->diffInMinutes($start) / 60, 2) . 'h' diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index dbb5dcfe..1bd96ac1 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -60,7 +60,7 @@ function admin_user() $html .= '' . "\n"; $html .= ' ' . "\n"; $html .= ' ' . "\n"; if (config('enable_user_name')) { $html .= ' ' . "\n"; diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php index 4c807657..dfee0b92 100644 --- a/includes/pages/user_myshifts.php +++ b/includes/pages/user_myshifts.php @@ -96,7 +96,7 @@ function user_myshifts() return ShiftEntry_edit_view( $shifts_user, - $shift->start->format(__('Y-m-d H:i')) . ', ' . shift_length($shift), + $shift->start->format(__('general.datetime')) . ', ' . shift_length($shift), $shift->location->name, $shift->shiftType->name, $shiftEntry->angelType->name, diff --git a/includes/view/ShiftEntry_view.php b/includes/view/ShiftEntry_view.php index 4722523a..9ef090e5 100644 --- a/includes/view/ShiftEntry_view.php +++ b/includes/view/ShiftEntry_view.php @@ -21,8 +21,8 @@ function ShiftEntry_delete_view_admin(Shift $shift, AngelType $angeltype, User $ __('Do you want to sign off %s from shift %s from %s to %s as %s?'), User_Nick_render($signoff_user), $shift->shiftType->name, - $shift->start->format(__('Y-m-d H:i')), - $shift->end->format(__('Y-m-d H:i')), + $shift->start->format(__('general.datetime')), + $shift->end->format(__('general.datetime')), $angeltype->name ), true), form([ @@ -49,8 +49,8 @@ function ShiftEntry_delete_view(Shift $shift, AngelType $angeltype, User $signof info(sprintf( __('Do you want to sign off from your shift %s from %s to %s as %s?'), $shift->shiftType->name, - $shift->start->format(__('Y-m-d H:i')), - $shift->end->format(__('Y-m-d H:i')), + $shift->start->format(__('general.datetime')), + $shift->end->format(__('general.datetime')), $angeltype->name ), true), @@ -90,7 +90,7 @@ function ShiftEntry_create_view_admin( $signup_user, $users_select ) { - $start = $shift->start->format(__('Y-m-d H:i')); + $start = $shift->start->format(__('general.datetime')); return page_with_title( ShiftEntry_create_title() . ': ' . $shift->shiftType->name . ' %c', @@ -123,7 +123,7 @@ function ShiftEntry_create_view_supporter( $signup_user, $users_select ) { - $start = $shift->start->format(__('Y-m-d H:i')); + $start = $shift->start->format(__('general.datetime')); return page_with_title( ShiftEntry_create_title() . ': ' . $shift->shiftType->name . ' %c', @@ -152,7 +152,7 @@ function ShiftEntry_create_view_supporter( */ function ShiftEntry_create_view_user(Shift $shift, Location $location, AngelType $angeltype, $comment) { - $start = $shift->start->format(__('Y-m-d H:i')); + $start = $shift->start->format(__('general.datetime')); return page_with_title( ShiftEntry_create_title() . ': ' . $shift->shiftType->name . ' %c', diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php index d944fe9c..7508fc14 100644 --- a/includes/view/Shifts_view.php +++ b/includes/view/Shifts_view.php @@ -31,7 +31,7 @@ function Shift_view_header(Shift $shift, Location $location) div('col-sm-3 col-xs-6', [ '

' . __('shifts.start') . '

', '

', - icon('calendar-event') . $shift->start->format(__('Y-m-d')), + icon('calendar-event') . $shift->start->format(__('general.date')), '
', icon('clock') . $shift->start->format('H:i'), '

', @@ -39,7 +39,7 @@ function Shift_view_header(Shift $shift, Location $location) div('col-sm-3 col-xs-6', [ '

' . __('shifts.end') . '

', '

', - icon('calendar-event') . $shift->end->format(__('Y-m-d')), + icon('calendar-event') . $shift->end->format(__('general.date')), '
', icon('clock') . $shift->end->format('H:i'), '

', @@ -61,14 +61,14 @@ function Shift_editor_info_render(Shift $shift) if (!empty($shift->created_by)) { $info[] = sprintf( icon('plus-lg') . __('created at %s by %s'), - $shift->created_at->format(__('Y-m-d H:i')), + $shift->created_at->format(__('general.datetime')), User_Nick_render($shift->createdBy) ); } if (!empty($shift->updated_by)) { $info[] = sprintf( icon('pencil') . __('edited at %s by %s'), - $shift->updated_at->format(__('Y-m-d H:i')), + $shift->updated_at->format(__('general.datetime')), User_Nick_render($shift->updatedBy) ); } @@ -166,7 +166,7 @@ function Shift_view( if (config('signup_advance_hours') && $shift->start->timestamp > time() + config('signup_advance_hours') * 3600) { $content[] = info(sprintf( __('This shift is in the far future and becomes available for signup at %s.'), - date(__('Y-m-d H:i'), $shift->start->timestamp - config('signup_advance_hours') * 3600) + date(__('general.datetime'), $shift->start->timestamp - config('signup_advance_hours') * 3600) ), true); } @@ -202,7 +202,7 @@ function Shift_view( $content[] = Shift_editor_info_render($shift); } - $start = $shift->start->format(__('Y-m-d H:i')); + $start = $shift->start->format(__('general.datetime')); $link = button(url('/user-shifts'), icon('chevron-left'), 'btn-sm'); return page_with_title( diff --git a/includes/view/User_view.php b/includes/view/User_view.php index 7eb5b3bd..5a02857e 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -110,10 +110,10 @@ function Users_view( } } $u['arrival_date'] = $user->personalData->planned_arrival_date - ? $user->personalData->planned_arrival_date->format(__('Y-m-d')) : ''; + ? $user->personalData->planned_arrival_date->format(__('general.date')) : ''; $u['departure_date'] = $user->personalData->planned_departure_date - ? $user->personalData->planned_departure_date->format(__('Y-m-d')) : ''; - $u['last_login_at'] = $user->last_login_at ? $user->last_login_at->format(__('m/d/Y h:i a')) : ''; + ? $user->personalData->planned_departure_date->format(__('general.date')) : ''; + $u['last_login_at'] = $user->last_login_at ? $user->last_login_at->format(__('general.datetime')) : ''; $u['actions'] = table_buttons([ button_icon(url('/admin-user', ['id' => $user->id]), 'pencil', 'btn-sm'), ]); @@ -216,8 +216,8 @@ function User_shift_state_render($user) $start = $nextShiftEntry->shift->start; $end = $nextShiftEntry->shift->end; - $startFormat = $start->format(__('Y-m-d H:i')); - $endFormat = $end->format(__('Y-m-d H:i')); + $startFormat = $start->format(__('general.datetime')); + $endFormat = $end->format(__('general.datetime')); $startTimestamp = $start->timestamp; $endTimestamp = $end->timestamp; @@ -259,7 +259,7 @@ function User_last_shift_render($user) $lastShiftEntry = $last_shifts->first(); $end = $lastShiftEntry->shift->end; - return '' + return '' . __('Shift ended %c') . ''; } @@ -308,7 +308,7 @@ function User_view_myshift(Shift $shift, $user_source, $its_me) $myshift = [ 'date' => icon('calendar-event') - . $shift->start->format(__('Y-m-d')) . '
' + . $shift->start->format(__('general.date')) . '
' . icon('clock-history') . $shift->start->format('H:i') . ' - ' . $shift->end->format(__('H:i')), @@ -448,7 +448,7 @@ function User_view_worklog(Worklog $worklog, $admin_user_worklog_privilege) } return [ - 'date' => icon('calendar-event') . date(__('Y-m-d'), $worklog->worked_at->timestamp), + 'date' => icon('calendar-event') . date(__('general.date'), $worklog->worked_at->timestamp), 'duration' => sprintf('%.2f', $worklog->hours) . ' h', 'location' => '', 'shift_info' => __('Work log entry'), @@ -456,7 +456,7 @@ function User_view_worklog(Worklog $worklog, $admin_user_worklog_privilege) . sprintf( __('Added by %s at %s'), User_Nick_render($worklog->creator), - $worklog->created_at->format(__('Y-m-d H:i')) + $worklog->created_at->format(__('general.datetime')) ), 'actions' => $actions, ]; @@ -726,7 +726,7 @@ function User_view_state_admin($freeloader, $user_source) $state[] = '' . icon('house') . sprintf( __('Arrived at %s'), - $user_source->state->arrival_date ? $user_source->state->arrival_date->format(__('Y-m-d')) : '' + $user_source->state->arrival_date ? $user_source->state->arrival_date->format(__('general.date')) : '' ) . ''; @@ -743,7 +743,7 @@ function User_view_state_admin($freeloader, $user_source) $state[] = '' . ($arrivalDate ? sprintf( __('Not arrived (Planned: %s)'), - $arrivalDate->format(__('Y-m-d')) + $arrivalDate->format(__('general.date')) ) : __('Not arrived')) . ''; } diff --git a/resources/lang/de_DE/default.po b/resources/lang/de_DE/default.po index 7101771b..0ac700e4 100644 --- a/resources/lang/de_DE/default.po +++ b/resources/lang/de_DE/default.po @@ -55,7 +55,7 @@ msgstr "Autorisierung ist abgelaufen" msgid "The provided CSRF token is invalid or has expired" msgstr "Das angegebene CSRF Token ist ungültig oder abgelaufen" -msgid "Y-m-d" +msgid "general.date" msgstr "d.m.Y" msgid "%1$s, from %2$s to %3$s" @@ -486,9 +486,6 @@ msgstr "" "Dein %s-Konto wurde gelöscht. Wenn Du dazu Fragen hast, kontaktiere bitte " "den Himmel." -msgid "m/d/Y h:i a" -msgstr "d.m.Y H:i" - msgid "Active angels" msgstr "Aktive Engel" @@ -760,12 +757,9 @@ msgstr "Aktiv erzwingen" msgid "Edit user" msgstr "User bearbeiten" -msgid "Y-m-d H:i" +msgid "general.datetime" msgstr "d.m.Y H:i" -msgid "Y-m-d H:i:s" -msgstr "d.m.Y H:i:s" - msgid "Key changed." msgstr "Key geändert." diff --git a/resources/lang/en_US/default.po b/resources/lang/en_US/default.po index 58806813..940ecf12 100644 --- a/resources/lang/en_US/default.po +++ b/resources/lang/en_US/default.po @@ -672,6 +672,12 @@ msgstr "Please enter a mobile number in your settings!" msgid "confirmation.delete" msgstr "Do you really want to delete it?" +msgid "general.datetime" +msgstr "Y-m-d H:i" + +msgid "general.date" +msgstr "Y-m-d" + msgid "general.id" msgstr "ID" diff --git a/resources/views/admin/log.twig b/resources/views/admin/log.twig index 1c0a28d7..eb7644e0 100644 --- a/resources/views/admin/log.twig +++ b/resources/views/admin/log.twig @@ -47,7 +47,7 @@ {%- endif %}
- + diff --git a/resources/views/admin/schedule/edit.twig b/resources/views/admin/schedule/edit.twig index 28325292..ad411144 100644 --- a/resources/views/admin/schedule/edit.twig +++ b/resources/views/admin/schedule/edit.twig @@ -10,7 +10,7 @@ {% block row_content %} {% if schedule and schedule.updated_at %}
-

{{ __('schedule.last_update', [schedule.updated_at.format(__('Y-m-d H:i'))]) }}

+

{{ __('schedule.last_update', [schedule.updated_at.format(__('general.datetime'))]) }}

{% endif %} diff --git a/resources/views/admin/schedule/load.twig b/resources/views/admin/schedule/load.twig index a3c1427a..c48ad031 100644 --- a/resources/views/admin/schedule/load.twig +++ b/resources/views/admin/schedule/load.twig @@ -67,7 +67,7 @@ {% for shift in shifts %} - + diff --git a/resources/views/admin/shifts/history.twig b/resources/views/admin/shifts/history.twig index c5f7b1d0..b3056523 100644 --- a/resources/views/admin/shifts/history.twig +++ b/resources/views/admin/shifts/history.twig @@ -43,10 +43,10 @@ {% endif %} - - + + - + {% endfor %} diff --git a/resources/views/pages/news/edit.twig b/resources/views/pages/news/edit.twig index 3299698c..e3ff2d3f 100644 --- a/resources/views/pages/news/edit.twig +++ b/resources/views/pages/news/edit.twig @@ -17,12 +17,12 @@

- {{ m.icon('clock') }} {{ news.updated_at.format(__('Y-m-d H:i')) }} + {{ m.icon('clock') }} {{ news.updated_at.format(__('general.datetime')) }} {% if news.updated_at != news.created_at %}  {{ __('news.updated') }}
- {{ m.icon('clock') }} {{ news.created_at.format(__('Y-m-d H:i')) }} + {{ m.icon('clock') }} {{ news.created_at.format(__('general.datetime')) }} {% endif %}  {{ m.user(news.user) }} diff --git a/resources/views/pages/news/news.twig b/resources/views/pages/news/news.twig index cea15b22..25111c28 100644 --- a/resources/views/pages/news/news.twig +++ b/resources/views/pages/news/news.twig @@ -23,7 +23,7 @@

- +
' . __('general.nick') . '' . '
' . __('Last login') . '

' - . ($user_source->last_login_at ? $user_source->last_login_at->format(__('Y-m-d H:i')) : '-') + . ($user_source->last_login_at ? $user_source->last_login_at->format(__('general.datetime')) : '-') . '

' . __('settings.profile.firstname') . '' . '
{{ entry.created_at.format(__('Y-m-d H:i')) }}{{ entry.created_at.format(__('general.datetime')) }} {{ entry.level|capitalize }}
{{ shift.date.format(__('Y-m-d H:i')) }} - {{ shift.endDate.format(__('H:i')) }}{{ shift.date.format(__('general.datetime')) }} - {{ shift.endDate.format(__('H:i')) }} {{ shift.type }} {{ shift.title }}{% if shift.subtitle %}
{{ shift.subtitle }}{% endif %}
{{ shift.room.name }} {{ shift.count }}{{ shift.start.format(__('Y-m-d H:i')) }}{{ shift.end.format(__('Y-m-d H:i')) }}{{ shift.start.format(__('general.datetime')) }}{{ shift.end.format(__('general.datetime')) }} {{ m.user(shift.createdBy) }}{{ shift.created_at.format(__('Y-m-d H:i')) }}{{ shift.created_at.format(__('general.datetime')) }}
{{ csrf() }} diff --git a/resources/views/emails/worklog-from-shift.twig b/resources/views/emails/worklog-from-shift.twig index 14b82930..d19dab45 100644 --- a/resources/views/emails/worklog-from-shift.twig +++ b/resources/views/emails/worklog-from-shift.twig @@ -7,7 +7,7 @@ {% block message %} {{ name }} {{ title }} -{{ start.format(__('Y-m-d H:i')) }} - {{ end.format(__('Y-m-d H:i')) }} +{{ start.format(__('general.datetime')) }} - {{ end.format(__('general.datetime')) }} {{ location.name }} {% if start <= date() and not freeloaded %} diff --git a/resources/views/layouts/parts/footer.twig b/resources/views/layouts/parts/footer.twig index 33fd7dba..3549fa81 100644 --- a/resources/views/layouts/parts/footer.twig +++ b/resources/views/layouts/parts/footer.twig @@ -8,8 +8,8 @@ {% if config('event_start') and config('event_end') %} {{ __('%1$s, from %2$s to %3$s', [ config('name'), - config('event_start').format(__('Y-m-d')), - config('event_end').format(__('Y-m-d')) + config('event_start').format(__('general.date')), + config('event_end').format(__('general.date')) ]) }} {%- if config('enable_show_day_of_event') and day_of_event is defined -%} , {{ __('event.day', [day_of_event]) }} @@ -17,7 +17,7 @@ {% elseif config('event_start') %} {{ __('%1$s, starting %2$s', [ config('name'), - config('event_start').format(__('Y-m-d')) + config('event_start').format(__('general.date')) ]) }} {%- if config('enable_show_day_of_event') and day_of_event is defined -%} , {{ __('event.day', [day_of_event]) }} @@ -27,8 +27,8 @@ {% endif %}
{% elseif config('event_start') and config('event_end') %} {{ __('Event from %1$s to %2$s', [ - config('event_start').format(__('Y-m-d')), - config('event_end').format(__('Y-m-d')) + config('event_start').format(__('general.date')), + config('event_end').format(__('general.date')) ]) }} {%- if config('enable_show_day_of_event') and day_of_event is defined -%} , {{ __('event.day', [day_of_event]) }} diff --git a/resources/views/pages/design.twig b/resources/views/pages/design.twig index ced7421f..e8b8eb41 100644 --- a/resources/views/pages/design.twig +++ b/resources/views/pages/design.twig @@ -476,20 +476,20 @@ Por scientie, musica, sport etc, litot Europa usa li sam vocabular.

Countdowns

    -
  • 30s: %c
  • -
  • 30m: %c
  • -
  • 59m: %c
  • -
  • 1h: %c
  • -
  • 1h 30m: %c
  • -
  • 1h 31m: %c
  • -
  • 2h: %c
  • -
  • 2d: %c
  • -
  • 3m: %c
  • -
  • 22y: %c
  • +
  • 30s: %c
  • +
  • 30m: %c
  • +
  • 59m: %c
  • +
  • 1h: %c
  • +
  • 1h 30m: %c
  • +
  • 1h 31m: %c
  • +
  • 2h: %c
  • +
  • 2d: %c
  • +
  • 3m: %c
  • +
  • 22y: %c
    -
  • 30m ago: %c
  • -
  • 45m ago: %c
  • +
  • 30m ago: %c
  • +
  • 45m ago: %c
diff --git a/resources/views/pages/faq/edit.twig b/resources/views/pages/faq/edit.twig index 395e9d25..4fc4dee8 100644 --- a/resources/views/pages/faq/edit.twig +++ b/resources/views/pages/faq/edit.twig @@ -17,12 +17,12 @@

- {{ m.icon('clock') }} {{ faq.updated_at.format(__('Y-m-d H:i')) }} + {{ m.icon('clock') }} {{ faq.updated_at.format(__('general.datetime')) }} {% if faq.updated_at != faq.created_at %}  {{ __('form.updated') }}
- {{ m.icon('clock') }} {{ faq.created_at.format(__('Y-m-d H:i')) }} + {{ m.icon('clock') }} {{ faq.created_at.format(__('general.datetime')) }} {% endif %}

diff --git a/resources/views/pages/faq/overview.twig b/resources/views/pages/faq/overview.twig index 38f4019f..a61b2f07 100644 --- a/resources/views/pages/faq/overview.twig +++ b/resources/views/pages/faq/overview.twig @@ -51,7 +51,7 @@
- {{ c.latest_message.created_at.format(__('Y-m-d H:i')) }} + {{ c.latest_message.created_at.format(__('general.datetime')) }}
{{ session.id[:15] }}…
{{ session.last_activity.format(__('Y-m-d H:i:s')) }}{{ session.last_activity.format(__('general.datetime')) }} {% if session.id != current_session %} diff --git a/src/Controllers/DesignController.php b/src/Controllers/DesignController.php index f31177cb..a8ff1f0b 100644 --- a/src/Controllers/DesignController.php +++ b/src/Controllers/DesignController.php @@ -54,7 +54,7 @@ class DesignController extends BaseController for ($i = 1; $i <= 600; $i++) { $dateKey = $date->format('Y-m-d'); - $formattedDisplayDate = $date->format(__('Y-m-d')); + $formattedDisplayDate = $date->format(__('general.date')); $dateSelectOptions[$dateKey] = $formattedDisplayDate; $date = $date->addDay(); } diff --git a/src/Helpers/BarChart.php b/src/Helpers/BarChart.php index 3f718f16..0177c499 100644 --- a/src/Helpers/BarChart.php +++ b/src/Helpers/BarChart.php @@ -29,7 +29,7 @@ class BarChart $groupLabels[$groupKey] = $groupKey; if ($date) { - $groupLabels[$groupKey] = $date->format(__('Y-m-d')); + $groupLabels[$groupKey] = $date->format(__('general.date')); } foreach ($rowLabels as $rowKey => $rowName) { diff --git a/tests/Unit/Helpers/BarChartTest.php b/tests/Unit/Helpers/BarChartTest.php index 2999942e..bf7146d9 100644 --- a/tests/Unit/Helpers/BarChartTest.php +++ b/tests/Unit/Helpers/BarChartTest.php @@ -37,7 +37,7 @@ class BarChartTest extends TestCase { parent::setUp(); $this->rendererMock = $this->mockRenderer(false); - $this->mockTranslator(); + $this->mockTranslator(fn(string $key, array $replace = []) => $key == 'general.date' ? 'Y-m-d' : $key); } public function provideRenderTestData(): Generator diff --git a/tests/Unit/TestCase.php b/tests/Unit/TestCase.php index ef3978c1..4f849d7f 100644 --- a/tests/Unit/TestCase.php +++ b/tests/Unit/TestCase.php @@ -61,7 +61,7 @@ abstract class TestCase extends PHPUnitTestCase /** * @return Translator&MockObject */ - protected function mockTranslator(bool $mockImplementation = true): Translator + protected function mockTranslator(bool|callable $mockImplementation = true): Translator { $translator = $this->getMockBuilder(Translator::class) ->disableOriginalConstructor() @@ -70,7 +70,11 @@ abstract class TestCase extends PHPUnitTestCase if ($mockImplementation) { $translator->method('translate') - ->willReturnCallback(fn(string $key, array $replace = []) => $key); + ->willReturnCallback( + is_callable($mockImplementation) + ? $mockImplementation + : fn(string $key, array $replace = []) => $key + ); } $this->app->instance('translator', $translator);