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:
@@ -705,9 +705,10 @@ export class CategoriesService {
|
||||
}
|
||||
}
|
||||
|
||||
const trMap = await this.translationsService.translateMany(
|
||||
rawParts.map((p) => p.name).filter(Boolean),
|
||||
);
|
||||
const trMap = await this.translationsService.translateMany([
|
||||
...rawParts.map((p) => p.name).filter(Boolean),
|
||||
...rawParts.map((p) => p.notice).filter((n): n is string => !!n),
|
||||
]);
|
||||
|
||||
const allParts: Array<typeof parts.$inferInsert> = rawParts.map((p) => ({
|
||||
vehicleId: vehicle.id,
|
||||
@@ -715,7 +716,7 @@ export class CategoriesService {
|
||||
oemCode: p.number,
|
||||
name: trMap.get(p.name) ?? p.name ?? "Unknown",
|
||||
nameOriginal: p.name || null,
|
||||
description: p.notice,
|
||||
description: p.notice ? (trMap.get(p.notice) ?? p.notice) : null,
|
||||
quantity: null,
|
||||
position: p.positionNumber,
|
||||
hotspotIndex: p.positionNumber
|
||||
|
||||
Reference in New Issue
Block a user