sheets
This commit is contained in:
@@ -283,6 +283,125 @@ function denseAbbrevLabel(args: { key: string; locale: 'en' | 'de'; unit?: strin
|
||||
}
|
||||
}
|
||||
|
||||
function translateAbbreviation(abbrev: string, description: string, locale: 'en' | 'de'): string {
|
||||
const normalizedDesc = normalizeValue(description);
|
||||
if (!normalizedDesc) return description;
|
||||
|
||||
// German translations for common abbreviations
|
||||
if (locale === 'de') {
|
||||
switch (abbrev) {
|
||||
case 'DI':
|
||||
return 'Durchmesser über Isolation';
|
||||
case 'RI':
|
||||
return 'Widerstand Leiter';
|
||||
case 'Wi':
|
||||
return 'Isolationsdicke';
|
||||
case 'Ibl':
|
||||
return 'Strombelastbarkeit Luft';
|
||||
case 'Ibe':
|
||||
return 'Strombelastbarkeit Erde';
|
||||
case 'Wm':
|
||||
return 'Manteldicke';
|
||||
case 'Rbv':
|
||||
return 'Biegeradius';
|
||||
case 'Fzv':
|
||||
return 'Zugkraft';
|
||||
case 'G':
|
||||
return 'Gewicht';
|
||||
case 'Ik_cond':
|
||||
return 'Kurzschlussstrom Leiter';
|
||||
case 'Ik_screen':
|
||||
return 'Kurzschlussstrom Schirm';
|
||||
case 'Ø':
|
||||
return 'Außen-Ø';
|
||||
case 'Cond':
|
||||
return 'Leiter';
|
||||
case 'shape':
|
||||
return 'Form';
|
||||
case 'cap':
|
||||
return 'Kapazität';
|
||||
case 'X':
|
||||
return 'Reaktanz';
|
||||
case 'test_volt':
|
||||
return 'Prüfspannung';
|
||||
case 'rated_volt':
|
||||
return 'Nennspannung';
|
||||
case 'temp_range':
|
||||
return 'Temperaturbereich';
|
||||
case 'max_op_temp':
|
||||
return 'Leitertemperatur (max.)';
|
||||
case 'max_sc_temp':
|
||||
return 'Kurzschlusstemperatur (max.)';
|
||||
case 'min_store_temp':
|
||||
return 'Minimale Lagertemperatur';
|
||||
case 'min_lay_temp':
|
||||
return 'Minimale Verlegetemperatur';
|
||||
case 'cpr':
|
||||
return 'CPR-Klasse';
|
||||
case 'flame':
|
||||
return 'Flammhemmend';
|
||||
default:
|
||||
return normalizedDesc;
|
||||
}
|
||||
}
|
||||
|
||||
// English translations for common abbreviations
|
||||
switch (abbrev) {
|
||||
case 'DI':
|
||||
return 'Diameter over insulation';
|
||||
case 'RI':
|
||||
return 'DC resistance';
|
||||
case 'Wi':
|
||||
return 'Insulation thickness';
|
||||
case 'Ibl':
|
||||
return 'Current rating in air';
|
||||
case 'Ibe':
|
||||
return 'Current rating in ground';
|
||||
case 'Wm':
|
||||
return 'Sheath thickness';
|
||||
case 'Rbv':
|
||||
return 'Bending radius';
|
||||
case 'Fzv':
|
||||
return 'Pulling force';
|
||||
case 'G':
|
||||
return 'Weight';
|
||||
case 'Ik_cond':
|
||||
return 'Short-circuit current conductor';
|
||||
case 'Ik_screen':
|
||||
return 'Short-circuit current screen';
|
||||
case 'Ø':
|
||||
return 'Outer diameter';
|
||||
case 'Cond':
|
||||
return 'Conductor';
|
||||
case 'shape':
|
||||
return 'Shape';
|
||||
case 'cap':
|
||||
return 'Capacitance';
|
||||
case 'X':
|
||||
return 'Reactance';
|
||||
case 'test_volt':
|
||||
return 'Test voltage';
|
||||
case 'rated_volt':
|
||||
return 'Rated voltage';
|
||||
case 'temp_range':
|
||||
return 'Operating temperature range';
|
||||
case 'max_op_temp':
|
||||
return 'Max operating temperature';
|
||||
case 'max_sc_temp':
|
||||
return 'Max short-circuit temperature';
|
||||
case 'min_store_temp':
|
||||
return 'Min storage temperature';
|
||||
case 'min_lay_temp':
|
||||
return 'Min laying temperature';
|
||||
case 'cpr':
|
||||
return 'CPR class';
|
||||
case 'flame':
|
||||
return 'Flame retardant';
|
||||
default:
|
||||
return normalizedDesc;
|
||||
}
|
||||
}
|
||||
|
||||
function summarizeOptions(options: string[] | undefined): string {
|
||||
const vals = (options || []).map(normalizeValue).filter(Boolean);
|
||||
if (vals.length === 0) return '';
|
||||
@@ -658,9 +777,10 @@ function buildMediumVoltageCrossSectionTableFromNewExcel(args: {
|
||||
for (const col of abbrevCols) {
|
||||
const description = normalizeValue(String(mv.headerRow[col.colKey] || ''));
|
||||
if (description && description !== col.colKey) {
|
||||
const translatedDescription = translateAbbreviation(col.colKey, description, args.locale);
|
||||
legendItems.push({
|
||||
label: col.colKey,
|
||||
value: description,
|
||||
value: translatedDescription,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ export interface ProductData {
|
||||
name: string;
|
||||
options: string[];
|
||||
}>;
|
||||
voltageType?: string;
|
||||
}
|
||||
|
||||
export type KeyValueItem = { label: string; value: string; unit?: string };
|
||||
|
||||
Reference in New Issue
Block a user