From 2a2f943bf4c69f460549d9b4730f2f6f1e081a89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= `、面包屑来自平台造的中文标题(关于我们/联系我们/产品中心…),主题层无法翻译用户数据。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 '请填写企业联系方式与地址。
Add your company contact details and address here.
" }, { "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 %}