feat(pcat): translate part descriptions + vehicle attrs (body/engine/transmission)

PCAT was missing parity with EMEX in two places:
- Part `description` (notice) was stored raw English alongside translated `name`.
  Now batched into translateMany so users see Turkish notices.
- Vehicle body/engine/transmission attrs from VIN decode were raw upstream
  values. Wire up the existing emex.mapper dictionaries on the PCAT
  single-car, PCAT resolveById, and EMEX single-vehicle result paths.
- emex.mapper translateToTurkish now falls back to the original term on
  dictionary miss instead of null — upstream values are heterogeneous
  (engine codes, multi-word descriptors); losing them was worse than
  leaving them untranslated.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 10:45:12 +03:00
parent 543be19261
commit d14bcb7dca
3 changed files with 32 additions and 14 deletions

View File

@@ -91,7 +91,11 @@ function translateToTurkish(
): string | null {
if (!term) return null;
const normalized = term.toLowerCase().trim();
return dictionary[normalized] || null;
// Dictionary miss → return original term unchanged. Upstream values are
// often heterogeneous (engine codes, multi-word descriptors) that the
// single-word dictionary can't cover; losing them would be worse than
// leaving them untranslated.
return dictionary[normalized] ?? term;
}
export function translateBodyType(bodyType: string | null): string | null {