i18n(calendar): translate 'h/zi', matrix howto, load legend, day-count word
- Post/mechanic meta 'h/zi' → __('h/zi') so RU shows 'ч/день', EN 'h/day'
- Wrap the 3 load-legend labels (0–5h/10, 5–8.5h/10, ≥9h/10) so 'h' → 'ч' on RU
- Split the long howto sentence so 'Pod'/'Mecanic' + 'Zile' translate
- Default fallback 'Pod 1 (default)' now uses __('Pod') + __('implicit')
Adds 5 new translations. Post NAMES themselves are DB rows (user data)
and are shown as-is — they're not translated by the app.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -169,7 +169,7 @@ class CalendarBoard extends Page
|
||||
'id' => $u->id,
|
||||
'name' => $u->name,
|
||||
'color' => $u->color ?: '#3b82f6',
|
||||
'meta' => $u->specialization ?: '8h/zi',
|
||||
'meta' => $u->specialization ?: ('8' . __('h/zi')),
|
||||
'capacity_hours' => 8.0,
|
||||
])->all();
|
||||
// Always include "Fără maistru" row at the bottom
|
||||
@@ -181,7 +181,7 @@ class CalendarBoard extends Page
|
||||
// Fallback: synthesize a default post if none configured yet
|
||||
if ($posts->isEmpty()) {
|
||||
return [
|
||||
['kind' => 'post', 'id' => 0, 'name' => 'Pod 1 (default)', 'color' => '#3b82f6', 'meta' => '10h/zi', 'capacity_hours' => 10.0],
|
||||
['kind' => 'post', 'id' => 0, 'name' => __('Pod') . ' 1 (' . __('implicit') . ')', 'color' => '#3b82f6', 'meta' => '10' . __('h/zi'), 'capacity_hours' => 10.0],
|
||||
];
|
||||
}
|
||||
return $posts->map(fn ($p) => [
|
||||
@@ -189,7 +189,7 @@ class CalendarBoard extends Page
|
||||
'id' => $p->id,
|
||||
'name' => $p->name,
|
||||
'color' => $p->color ?: '#3b82f6',
|
||||
'meta' => ($p->hours_per_day ? $p->hours_per_day . 'h/zi' : '10h/zi') . ($p->description ? ' · ' . $p->description : ''),
|
||||
'meta' => ($p->hours_per_day ? $p->hours_per_day . __('h/zi') : '10' . __('h/zi')) . ($p->description ? ' · ' . $p->description : ''),
|
||||
'capacity_hours' => (float) ($p->hours_per_day ?: 10),
|
||||
])->all();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user