i18n(dates): use app locale for month names on MechanicKpi + PDF appointments
MechanicKpi getPeriodLabel() was hardcoded to ->locale('ro') which
forced Romanian month names ('iulie 2026') regardless of the app
locale. Same on PDF appointments day-label. Both now switch to
app()->getLocale() so RU shows «июль 2026», EN 'July 2026'.
SetLocale middleware already calls Carbon::setLocale on every
request, so translatedFormat() elsewhere already respects the app
locale — no other files needed patching.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -93,6 +93,6 @@ class MechanicKpi extends Page
|
|||||||
|
|
||||||
public function getPeriodLabel(): string
|
public function getPeriodLabel(): string
|
||||||
{
|
{
|
||||||
return Carbon::parse($this->period . '-01')->locale('ro')->isoFormat('MMMM YYYY');
|
return Carbon::parse($this->period . '-01')->locale(app()->getLocale())->isoFormat('MMMM YYYY');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<div class="sub">Generat la {{ $generatedAt }} · {{ $appointments->flatten()->count() }} programări total</div>
|
<div class="sub">Generat la {{ $generatedAt }} · {{ $appointments->flatten()->count() }} programări total</div>
|
||||||
|
|
||||||
@forelse ($appointments as $date => $dayAppts)
|
@forelse ($appointments as $date => $dayAppts)
|
||||||
@php $dateLabel = \Carbon\Carbon::parse($date)->locale('ro')->isoFormat('dddd, D MMMM YYYY'); @endphp
|
@php $dateLabel = \Carbon\Carbon::parse($date)->locale(app()->getLocale())->isoFormat('dddd, D MMMM YYYY'); @endphp
|
||||||
<h2>{{ ucfirst($dateLabel) }} · {{ $dayAppts->count() }} programări</h2>
|
<h2>{{ ucfirst($dateLabel) }} · {{ $dayAppts->count() }} programări</h2>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
Reference in New Issue
Block a user