feat(i18n): fix widgets, pipeline & mechanic boards + missing translations
Follow-up to previous i18n pass — user reported many visible RO strings on
EN/RU locales because auto-wrap missed:
- Stat::make() first-arg labels in StatsOverview, FinanceOverview, PlatformStats
- $heading static in LowStockTable (converted to getHeading() method)
- Pipeline board Blade view: 40+ literal strings wrapped with {{ __() }}
- Mechanic board Blade view: statuses, buttons, block modal
- PipelineBoard.php hardcoded tag labels, stage labels, notify strings
- MechanicBoard.php confirmBlock notification
Added human RU + EN translations for the visible strings shown in the
screenshots (dashboard widgets, Client/Vehicle list breadcrumbs & columns,
pipeline board topbar/stats/filters/cards/detail panel/quick actions,
mechanic board stats/statuses/block modal). All 306 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -171,7 +171,7 @@ class PipelineBoard extends Page
|
||||
$list = array_values($cards[$key]);
|
||||
$sum = array_sum(array_map(fn ($c) => (float) $c['amount'], $list));
|
||||
$columns[$key] = [
|
||||
'label' => $label,
|
||||
'label' => __($label),
|
||||
'color' => $color,
|
||||
'count' => count($list),
|
||||
'sum' => $sum,
|
||||
@@ -238,7 +238,7 @@ class PipelineBoard extends Page
|
||||
}
|
||||
Lead::create(array_merge($data, ['status' => 'new']));
|
||||
$this->showNewForm = false;
|
||||
$this->notify('Cerere nouă adăugată');
|
||||
$this->notify(__('Cerere nouă adăugată'));
|
||||
}
|
||||
|
||||
public function exportCsv()
|
||||
@@ -398,10 +398,10 @@ class PipelineBoard extends Page
|
||||
'date' => today()->addDay(),
|
||||
'time_start' => '10:00',
|
||||
'time_end' => '11:00',
|
||||
'title' => $title ?: 'Programare',
|
||||
'title' => $title ?: __('Programare'),
|
||||
'status' => 'scheduled',
|
||||
]);
|
||||
$this->notify("Programare creată · mâine 10:00");
|
||||
$this->notify(__('Programare creată · mâine 10:00'));
|
||||
$this->openCardKey = null;
|
||||
}
|
||||
|
||||
@@ -439,7 +439,7 @@ class PipelineBoard extends Page
|
||||
$tags[] = ['label' => Lead::SOURCES[$lead->source] ?? $lead->source, 'color' => 'gray'];
|
||||
}
|
||||
if ($lead->status === 'no_answer') {
|
||||
$tags[] = ['label' => 'Fără răspuns', 'color' => 'red'];
|
||||
$tags[] = ['label' => __('Fără răspuns'), 'color' => 'red'];
|
||||
}
|
||||
$diffMin = $lead->created_at?->diffInMinutes(now()) ?? 0;
|
||||
$overdue = $diffMin > 60 && $lead->status !== 'contacted';
|
||||
@@ -450,7 +450,7 @@ class PipelineBoard extends Page
|
||||
'code' => 'CR-' . str_pad((string) $lead->id, 4, '0', STR_PAD_LEFT),
|
||||
'subject' => trim(($lead->car ?: '') . ' ' . ($lead->model ?: '')) ?: $lead->name,
|
||||
'plate' => $lead->car ?: '',
|
||||
'client_name' => $lead->name ?: 'Anonim',
|
||||
'client_name' => $lead->name ?: __('Anonim'),
|
||||
'phone' => $lead->phone,
|
||||
'source' => $lead->source,
|
||||
'amount' => (float) $lead->budget,
|
||||
@@ -470,7 +470,7 @@ class PipelineBoard extends Page
|
||||
{
|
||||
$tags = [];
|
||||
if ($deal->urgent) {
|
||||
$tags[] = ['label' => 'Urgent', 'color' => 'red'];
|
||||
$tags[] = ['label' => __('Urgent'), 'color' => 'red'];
|
||||
}
|
||||
if ($deal->source && in_array($deal->source, ['instagram', 'site', 'call', 'whatsapp', 'telegram'])) {
|
||||
$tags[] = ['label' => Lead::SOURCES[$deal->source] ?? $deal->source, 'color' => 'gray'];
|
||||
@@ -542,23 +542,23 @@ class PipelineBoard extends Page
|
||||
private function woCard(WorkOrder $wo): array
|
||||
{
|
||||
$tags = [];
|
||||
$tags[] = ['label' => "Fișă {$wo->number}", 'color' => 'purple'];
|
||||
$tags[] = ['label' => __('Fișă') . " {$wo->number}", 'color' => 'purple'];
|
||||
if ($wo->status === 'agreement') {
|
||||
$tags[] = ['label' => 'Necesită aprobare', 'color' => 'amber'];
|
||||
$tags[] = ['label' => __('Necesită aprobare'), 'color' => 'amber'];
|
||||
}
|
||||
if ($wo->status === 'awaiting_parts') {
|
||||
$tags[] = ['label' => 'Așteaptă piese', 'color' => 'amber'];
|
||||
$tags[] = ['label' => __('Așteaptă piese'), 'color' => 'amber'];
|
||||
}
|
||||
if ($wo->status === 'ready') {
|
||||
$tags[] = ['label' => 'Gata', 'color' => 'green'];
|
||||
$tags[] = ['label' => __('Gata'), 'color' => 'green'];
|
||||
if ($wo->pay_status === 'partial') {
|
||||
$tags[] = ['label' => 'Avans achitat', 'color' => 'blue'];
|
||||
$tags[] = ['label' => __('Avans achitat'), 'color' => 'blue'];
|
||||
} elseif ($wo->pay_status !== 'paid') {
|
||||
$tags[] = ['label' => 'Neachitat', 'color' => 'amber'];
|
||||
$tags[] = ['label' => __('Neachitat'), 'color' => 'amber'];
|
||||
}
|
||||
}
|
||||
if ($wo->status === 'done' && $wo->pay_status === 'paid') {
|
||||
$tags[] = ['label' => '✓ Achitat', 'color' => 'green'];
|
||||
$tags[] = ['label' => __('✓ Achitat'), 'color' => 'green'];
|
||||
}
|
||||
|
||||
$progress = null;
|
||||
@@ -710,7 +710,7 @@ class PipelineBoard extends Page
|
||||
default => 'edit',
|
||||
},
|
||||
'color' => 'blue',
|
||||
'text' => $a->description ?: ucfirst($a->event ?? 'actualizat'),
|
||||
'text' => $a->description ?: ucfirst($a->event ?? __('actualizat')),
|
||||
'time' => $a->created_at?->diffForHumans(),
|
||||
];
|
||||
}
|
||||
@@ -720,7 +720,7 @@ class PipelineBoard extends Page
|
||||
|
||||
private function stageStepper(int $currentIdx): array
|
||||
{
|
||||
$labels = ['Cerere', 'Calcul.', 'Programat', 'În lucru', 'Gata', 'Achitat'];
|
||||
$labels = [__('Cerere'), __('Calcul.'), __('Programat'), __('În lucru'), __('Gata'), __('Achitat')];
|
||||
$out = [];
|
||||
foreach ($labels as $i => $label) {
|
||||
$out[] = [
|
||||
|
||||
Reference in New Issue
Block a user