i18n(scanner): translate full page (13 keys) + wrap inline blade + JS errors

- Wrap inline blade text ('Mod recepție'), placeholder, and JS error
  messages (via @json(__(...)) so they land as JS strings).
- +13 translations covering all UI text on /app/scanner.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-16 11:15:12 +00:00
parent b937bc8e1d
commit 2831dbd1c1
3 changed files with 29 additions and 19 deletions
@@ -37,7 +37,7 @@
@if ($purchase = $this->getActivePurchase())
@php $pending = $this->getPendingItems(); @endphp
<div style="background:#ecfdf5;border-left:3px solid #10b981;padding:12px 14px;margin-bottom:12px;border-radius:6px;font-size:13px;">
<div style="font-weight:600;color:#065f46;margin-bottom:4px;">📦 Mod recepție {{ $purchase->number }}</div>
<div style="font-weight:600;color:#065f46;margin-bottom:4px;">📦 {{ __('Mod recepție') }} {{ $purchase->number }}</div>
<div style="color:#047857;">{{ __('Scanează codurile pieselor pentru a marca ca recepționate.') }} <strong>{{ count($pending) }}</strong> {{ __('linii neîncasate.') }}</div>
@if (! empty($receivedToasts))
<div style="margin-top:8px;font-size:12px;color:#065f46;">
@@ -75,7 +75,7 @@
<div class="sc-manual">
<form wire:submit="submitManual" style="display:flex;gap:8px;align-items:stretch;">
<input type="text" wire:model="manual" placeholder="Sau introdu manual (cod articol / barcode)…" />
<input type="text" wire:model="manual" placeholder="{{ __('Sau introdu manual (cod articol / barcode)…') }}" />
<button type="submit" class="sc-btn">{{ __('Caută') }}</button>
</form>
</div>
@@ -99,7 +99,7 @@
try {
this.scanner = new Html5Qrcode('reader');
const cams = await Html5Qrcode.getCameras();
if (!cams.length) { this.error = 'Nicio cameră detectată.'; return; }
if (!cams.length) { this.error = @json(__('Nicio cameră detectată.')); return; }
const camId = cams.find(c => /back|rear|environment/i.test(c.label))?.id || cams[0].id;
await this.scanner.start(
camId,
@@ -109,7 +109,7 @@
);
this.running = true;
} catch (e) {
this.error = 'Nu pot porni camera: ' + (e.message || e);
this.error = @json(__('Nu pot porni camera: ')) + (e.message || e);
}
},