Update public-api.js via upload script - 2026-11-02 15:02:18

This commit is contained in:
mike 2026-11-02 15:02:25 +08:00
parent cc42aa19a3
commit 789a8dbc7a
1 changed files with 2 additions and 2 deletions

View File

@ -307,13 +307,13 @@ async function translateTemplateHtml(ai, products) {
// ===== 网站产品介绍:没手动填英文介绍的产品,由 AI 根据参数自动写一段 =====
// 参数变了会重新生成(缓存按参数内容算);手动填了英文介绍就一直用手动的。
const TYPE_EN = { '迷你UPS': 'Mini DC UPS', '离线式UPS': 'Offline UPS', '离线式锂电UPS': 'Lithium-ion offline UPS', '在线互动式UPS': 'Line-interactive UPS', '机架式UPS': 'Rack-mount online double-conversion UPS', '机架式锂电UPS': 'Lithium-ion rack-mount online double-conversion UPS', '模块化UPS': 'Modular online UPS with hot-swappable power modules', '机架式模块化UPS': 'Rack-mount modular online UPS with hot-swappable power modules', '工频UPS': 'Industrial-frequency (transformer-based) online UPS with output isolation transformer' };
const TYPE_EN = { '迷你UPS': 'Mini DC UPS', '离线式UPS': 'Offline UPS', '离线式锂电UPS': 'Lithium-ion offline UPS', '在线互动式UPS': 'Line-interactive UPS', '机架式UPS': 'Rack-mount online double-conversion UPS', '机架式锂电UPS': 'Lithium-ion rack-mount online double-conversion UPS', '模块化UPS': 'Modular online UPS with hot-swappable power modules', '机架式模块化UPS': 'Rack-mount modular online UPS with hot-swappable power modules', '工频UPS': 'Industrial-frequency (transformer-based) online UPS with output isolation transformer', '在线式高频UPS': 'Online double-conversion high-frequency tower UPS' };
const DESC_SKIP = new Set(['model', 'brand', 'category', 'type', 'machineVariant', 'description', 'sale', 'youtube', 'sellingPoints', 'sockets', 'extraSpecs', 'pack']);
const SOCKET_EN = { SCHUKO: 'Schuko', NEMA: 'NEMA 5-15', UK: 'BS 1363 (UK)', UNIVERSAL: 'universal', IEC: 'IEC C13', AU: 'Type I (AU/CN)' };
function descFacts(p) {
const f = { model: p.model };
if (TYPE_EN[p.type]) f.type = TYPE_EN[p.type];
if ((p.type === '机架式UPS' || p.type === '机架式锂电UPS') && p.machineVariant) f.variant = /长/.test(p.machineVariant) ? 'Long-run model: no internal batteries, connects to an external battery bank' : 'Standard model with internal batteries';
if ((p.type === '机架式UPS' || p.type === '机架式锂电UPS' || p.type === '在线式高频UPS') && p.machineVariant) f.variant = /长/.test(p.machineVariant) ? 'Long-run model: no internal batteries, connects to an external battery bank' : 'Standard model with internal batteries';
for (const [k, v] of Object.entries(p)) {
if (DESC_SKIP.has(k) || k.startsWith('_') || ['slug', 'images', 'detailImages', 'templateImages', 'templateDetail', 'templateHtml', 'specI18n'].includes(k)) continue;
const en = p.specI18n && p.specI18n[k] && p.specI18n[k].en;