diff --git a/docs/superpowers/plans/2026-10-22-trade-pro-theme-port.md b/docs/superpowers/plans/2026-10-22-trade-pro-theme-port.md index af6d253..d1d3549 100644 --- a/docs/superpowers/plans/2026-10-22-trade-pro-theme-port.md +++ b/docs/superpowers/plans/2026-10-22-trade-pro-theme-port.md @@ -375,6 +375,7 @@ def test_theme_color_map_covers_trade_pro(): 3. **spec §6 "渲染快照"以 E2E 页面断言实现**(构建后逐页 200 + 结构选择器 + 文案断言),不另建 Jinja 快照测试文件。 4. **/api/themes(main.py:267)经 core.THEMES 动态化自动生效**,不设专项测试(catalog 由既有测试覆盖)。 5. **前端入口 option 文案**:三个 HTML 下拉用"Trade Pro · 外贸 B2B(英文)"中文风格与各文件现状一致(theme-gallery 用英文)。 +6. **平台数据层中文残留(Task 5 质量审查发现)**:bootstrap 生成的 8 个标准页(/about/ /contact/ /products/ /news/ 等)的 ``、`<h1>`、面包屑来自平台造的中文标题(关于我们/联系我们/产品中心…),主题层无法翻译用户数据。Phase 3 视觉验收时接受(真实站点内容为英文导入数据时自然英文),若 bootstrap 英文化成为需求属平台任务另行立项。 ## 风险与回退 diff --git a/tests/test_theme_registry.py b/tests/test_theme_registry.py index 99fbaf9..1a03222 100644 --- a/tests/test_theme_registry.py +++ b/tests/test_theme_registry.py @@ -110,6 +110,7 @@ def test_trade_pro_builds_real_site(factory): home = factory.get(f'/preview/{sid}/{bid}/') assert home.status_code == 200, home.text[:400] assert 'lang="en"' in home.text + assert '>Products<' in home.text # English fallback nav actually rendered assert '>首页<' not in home.text assert '<meta name="theme-color" content="#0b3d91"' in home.text diff --git a/themes/trade-pro/blocks.css b/themes/trade-pro/blocks.css deleted file mode 100644 index cb661c9..0000000 --- a/themes/trade-pro/blocks.css +++ /dev/null @@ -1 +0,0 @@ -/* trade-pro component styles: filled in Phase 3 */ diff --git a/themes/trade-pro/manifest.json b/themes/trade-pro/manifest.json index 4736eed..8572126 100644 --- a/themes/trade-pro/manifest.json +++ b/themes/trade-pro/manifest.json @@ -5,7 +5,7 @@ "version": "1.0.0", "style": "international-b2b", "entry": "pro.html", - "styles": ["theme.css", "blocks.css"], + "styles": ["theme.css"], "page_templates": ["home","about","contact","listing","category","product","article","brand","case","service","faq","standard","notfound"], "blocks": ["hero","richtext","features","stats","collection","image_text","gallery","faq","cta","attributes","spacer","layout","carousel","video","tabs","pricing","map","form_link"], "responsive": true, diff --git a/themes/trade-pro/page-presets.json b/themes/trade-pro/page-presets.json index 8ae1aa6..aceabef 100644 --- a/themes/trade-pro/page-presets.json +++ b/themes/trade-pro/page-presets.json @@ -4,10 +4,10 @@ "id": "0cdf18bf7f", "type": "hero", "visible": true, - "title": "工程质量,值得信赖", - "subtitle": "INDUSTRIAL ENGINEERING", + "title": "Trusted Quality for Global Buyers", + "subtitle": "INTERNATIONAL B2B SOURCING", "description": "{{site.tagline}}", - "button": "查看产品", + "button": "View Products", "href": "/product/", "align": "left" }, @@ -15,19 +15,19 @@ "id": "f846a2ff6b", "type": "features", "visible": true, - "title": "制造与服务能力", + "title": "Trade capabilities & service", "items": [ { - "title": "专业服务", - "text": "从咨询到交付" + "title": "Professional service", + "text": "From inquiry to delivery" }, { - "title": "品质保障", - "text": "严格的质量流程" + "title": "Quality assurance", + "text": "Rigorous quality processes" }, { - "title": "全球网络", - "text": "连接不同市场" + "title": "Global network", + "text": "Connecting markets worldwide" } ] }, @@ -35,33 +35,33 @@ "id": "ff4655d684", "type": "collection", "visible": true, - "title": "工业产品系列", + "title": "Trade catalogue", "subtitle": "PRODUCT SOLUTIONS", "source": "product", "limit": 6, "columns": 3, - "button": "查看全部", + "button": "View All", "href": "/product/" }, { "id": "4355daaba0", "type": "image_text", "visible": true, - "title": "工程标准与服务流程", + "title": "Standards & working process", "subtitle": "QUALITY FIRST", - "description": "展示业务流程和服务理念。", + "description": "How we work and what we stand for.", "image": "", "image_side": "right", - "button": "了解更多", + "button": "Learn More", "href": "/about/" }, { "id": "9e5056370d", "type": "cta", "visible": true, - "title": "获取专业产品方案", - "subtitle": "告诉我们您的需求,我们将提供适合的方案。", - "button": "联系我们", + "title": "Get a tailored product solution", + "subtitle": "Tell us what you need and we will propose the right solution.", + "button": "Contact Us", "href": "/contact/" } ], @@ -70,31 +70,31 @@ "id": "8ced1e0493", "type": "image_text", "visible": true, - "title": "认识我们", + "title": "Who we are", "subtitle": "OUR APPROACH", - "description": "展示业务流程和服务理念。", + "description": "How we work and what we stand for.", "image": "", "image_side": "right", - "button": "了解更多", + "button": "Learn More", "href": "/about/" }, { "id": "52b6064084", "type": "stats", "visible": true, - "title": "我们的实力", + "title": "Our strength", "items": [ { "value": "50,000+", - "label": "服务案例" + "label": "Projects delivered" }, { "value": "70+", - "label": "市场覆盖" + "label": "Markets served" }, { "value": "30+", - "label": "合作伙伴" + "label": "Partners worldwide" } ] }, @@ -102,19 +102,19 @@ "id": "cf39bcb75d", "type": "features", "visible": true, - "title": "我们的优势", + "title": "Why choose us", "items": [ { - "title": "专业服务", - "text": "从咨询到交付" + "title": "Professional service", + "text": "From inquiry to delivery" }, { - "title": "品质保障", - "text": "严格的质量流程" + "title": "Quality assurance", + "text": "Rigorous quality processes" }, { - "title": "全球网络", - "text": "连接不同市场" + "title": "Global network", + "text": "Connecting markets worldwide" } ] } @@ -124,16 +124,16 @@ "id": "597f6ffb08", "type": "richtext", "visible": true, - "title": "联系我们", - "body": "<p>请填写企业联系方式与地址。</p>" + "title": "Contact us", + "body": "<p>Add your company contact details and address here.</p>" }, { "id": "8c02c61415", "type": "cta", "visible": true, - "title": "欢迎联系", - "subtitle": "告诉我们您的需求,我们将提供适合的方案。", - "button": "联系我们", + "title": "Get in touch", + "subtitle": "Tell us what you need and we will propose the right solution.", + "button": "Contact Us", "href": "/contact/" } ], @@ -142,12 +142,12 @@ "id": "2c3106baf6", "type": "collection", "visible": true, - "title": "工业产品目录", - "subtitle": "为客户提供适合的解决方案", + "title": "Product catalogue", + "subtitle": "The right solutions for every buyer", "source": "product", "limit": 24, "columns": 3, - "button": "查看全部", + "button": "View All", "href": "/product/" } ], @@ -156,34 +156,34 @@ "id": "42925dc8e3", "type": "image_text", "visible": true, - "title": "产品介绍", + "title": "Product overview", "subtitle": "OUR APPROACH", "description": "{{page.summary}}", "image": "{{page.cover}}", "image_side": "right", - "button": "了解更多", + "button": "Learn More", "href": "/about/" }, { "id": "503266af35", "type": "attributes", "visible": true, - "title": "产品规格与参数" + "title": "Specifications" }, { "id": "b2b1f5293c", "type": "richtext", "visible": true, - "title": "产品详情", + "title": "Product details", "body": "{{page.body}}" }, { "id": "3837f66074", "type": "cta", "visible": true, - "title": "开启新的合作", - "subtitle": "告诉我们您的需求,我们将提供适合的方案。", - "button": "联系我们", + "title": "Start a new partnership", + "subtitle": "Tell us what you need and we will propose the right solution.", + "button": "Contact Us", "href": "/contact/" } ], @@ -206,19 +206,19 @@ "description": "{{page.summary}}", "image": "{{page.cover}}", "image_side": "right", - "button": "了解更多", + "button": "Learn More", "href": "/about/" }, { "id": "b3faf08170", "type": "collection", "visible": true, - "title": "品牌产品", - "subtitle": "为客户提供适合的解决方案", + "title": "Brand products", + "subtitle": "The right solutions for every buyer", "source": "product", "limit": 6, "columns": 3, - "button": "查看全部", + "button": "View All", "href": "/product/" } ], @@ -236,9 +236,9 @@ "id": "59383d762e", "type": "cta", "visible": true, - "title": "页面暂时无法访问", - "subtitle": "告诉我们您的需求,我们将提供适合的方案。", - "button": "返回首页", + "title": "Page not available", + "subtitle": "Tell us what you need and we will propose the right solution.", + "button": "Back to Home", "href": "/" } ], @@ -251,7 +251,7 @@ }, { "type": "richtext", - "title": "项目概述", + "title": "Project overview", "body": "{{page.body}}" } ], @@ -263,23 +263,23 @@ }, { "type": "cta", - "title": "了解更多", + "title": "Learn more", "href": "/contact/" } ], "faq": [ { "type": "faq", - "title": "常见问题", + "title": "Frequently asked questions", "items": [] } ], "category": [ { "type": "collection", - "title": "分类产品", + "title": "Products in this category", "source": "product", "limit": 24 } ] -} \ No newline at end of file +} diff --git a/themes/trade-pro/pro.html b/themes/trade-pro/pro.html index 3c3032f..991c44c 100644 --- a/themes/trade-pro/pro.html +++ b/themes/trade-pro/pro.html @@ -9,7 +9,12 @@ guarantees, so no fallback link can become a broken link. #} {% set tp_default_hrefs=['/','/about/','/brands/','/cases/','/contact/','/news/','/products/'] %} {% set tp_needs_en_nav=(not chrome_is_custom) and (nav|map(attribute='route')|list|sort==tp_default_hrefs) %} -{% set tp_nav=[{'title':'Home','route':'/'},{'title':'Products','route':'/products/'},{'title':'News','route':'/news/'},{'title':'About','route':'/about/'},{'title':'Contact','route':'/contact/'}] if tp_needs_en_nav else nav %} +{# Known false-positive window: the legacy nav editor can save settings.nav with + custom titles but no published site design (chrome_is_custom stays false). If + such a nav happens to keep exactly the default 7 hrefs, its titles are + overridden by the English fallback below. Mitigated (not eliminated) by + keeping all 7 default sections so only the labels change, never coverage. #} +{% set tp_nav=[{'title':'Home','route':'/'},{'title':'Products','route':'/products/'},{'title':'Brands','route':'/brands/'},{'title':'News','route':'/news/'},{'title':'Cases','route':'/cases/'},{'title':'About','route':'/about/'},{'title':'Contact','route':'/contact/'}] if tp_needs_en_nav else nav %} {% if chrome_is_custom %}<div class="pro-utility"{% if not chrome.header.show_announcement %} hidden{% endif %}><div class="pro-wrap"><span>{{ chrome.header.announcement }}</span><span>{{ site.tagline or site.name }}</span></div></div>{% else %}<div class="pro-utility"><div class="pro-wrap"><span>GLOBAL SOURCING · QUALITY · DELIVERY</span><span>INTERNATIONAL B2B SOLUTIONS</span></div></div>{% endif %} <header class="sf-site-head pro-header"><div class="pro-wrap pro-head-inner"><a class="pro-logo" href="/" aria-label="{{site.name}} home">{% if safe_image(site.logo) %}<img class="pro-brand-logo" src="{{safe_image(site.logo)}}" alt="{{site.name}} Logo">{% else %}<span class="pro-logo-symbol">▣</span>{% endif %}<span class="pro-logo-name">{{site.name}}<small> GLOBAL B2B</small></span></a><button class="pro-mobile-toggle" type="button" data-pro-menu aria-controls="pro-navigation" aria-expanded="false" aria-label="Open navigation">☰</button><nav id="pro-navigation" class="pro-navigation" aria-label="Main navigation">{% for link in tp_nav %}{% if link.children %}<div class="pro-nav-group"><a href="{{link.route}}">{{link.title}}</a><button type="button" class="pro-nav-disclose" aria-expanded="false" aria-label="Expand {{link.title}} submenu">▾</button><div class="pro-nav-children" hidden>{% for child in link.children %}<a href="{{child.route}}">{{child.title}}</a>{% for leaf in child.children %}<a class="pro-nav-leaf" href="{{leaf.route}}">— {{leaf.title}}</a>{% endfor %}{% endfor %}</div></div>{% else %}<a href="{{link.route}}">{{link.title}}</a>{% endif %}{% endfor %}{% if chrome.header.show_search %}<a class="pro-search-link" href="/search/">Search ⌕</a>{% endif %}</nav><button class="pro-catalog-toggle" type="button" data-pro-catalog aria-controls="pro-mega-content" aria-expanded="false">Products ▾</button>{% if chrome_is_custom %}{% if chrome.header.show_cta %}<a href="{{chrome.header.cta_href}}" class="sf-tp-btn pro-header-cta">{{chrome.header.cta_text}} <span>↗</span></a>{% endif %}{% else %}<a href="/contact/" class="sf-tp-btn pro-header-cta">Request a Quote <span>↗</span></a>{% endif %}</div>{% if categories %}<div class="pro-mega pro-wrap" data-pro-mega id="pro-mega-content" hidden><span>Product categories</span><div>{% for cat in categories[:12] %}<a href="{{cat.url}}">{{cat.name}} ↗</a>{% endfor %}</div></div>{% endif %}</header> {% if not designer_replace %}{% include 'trade-pro/pages/' ~ kind ~ '.html' %}{% endif %}