fix: 对齐平台渠道与最新情报快照

2026-08-14 平台渠道专项更新:前端和静态SEO只展示平台官网、官方入驻及非中文入驻页辅助翻译;移除类目入口翻译、消费者官网翻译和内部成熟度/新兴参考分文案。

同步59/59权威源、65场跨境活动、28个平台和208条趋势内容;修正IBTE、CCBEC、法国教育部、Shopee和Shopify语种判断,更新README与CHANGELOG并通过Python、Node及静态构建验证。
This commit is contained in:
Jack
2026-08-14 22:18:51 +08:00
parent f1ce583fd1
commit 7e74bd989e
14 changed files with 64302 additions and 63460 deletions
+9 -1
View File
@@ -10,7 +10,7 @@ test("独立首页只展示家纺情报并加载独立入口", async () => {
const dongguanCss = await text("public/assets/fonts/dongguan-bold/result.css");
assert.match(html, /三笙AI情报局/);
assert.match(html, /assets\/js\/app\.js/);
assert.match(html, /assets\/js\/app\.js\?v=20260814p/);
assert.match(html, /assets\/js\/app\.js\?v=20260814q/);
assert.match(html, /assets\/css\/base\.css\?v=20260814h/);
assert.match(html, /assets\/css\/intelligence\.css\?v=20260814s/);
assert.match(html, /<details[^>]+class="intelligence-metrics"/);
@@ -42,6 +42,14 @@ test("七个业务入口与趋势四子类均保留", async () => {
}
assert.doesNotMatch(modules, /设计师检索|设计师图片检索台/);
assert.match(modules, /appendPrefixedTranslationLink/);
assert.match(modules, /appendPrefixedTranslationLink\(actions, item, "seller"\)/);
assert.doesNotMatch(modules, /appendPrefixedTranslationLink\(actions, item, "official"\)/);
assert.doesNotMatch(modules, /appendPrefixedTranslationLink\(actions, item, "homepage"\)/);
assert.doesNotMatch(modules, /查看家纺类目/);
assert.doesNotMatch(modules, /家纺类目成熟度|新兴渠道参考分/);
assert.match(modules, /打开平台官网/);
assert.match(modules, /去官方入驻/);
assert.match(modules, /辅助翻译入驻说明/);
assert.match(modules, /官方/);
assert.match(modules, /requires-cross-border-network/);
});
+17 -6
View File
@@ -156,10 +156,16 @@ class StandaloneProjectContractTests(unittest.TestCase):
self.assertNotIn("Bandages", cbp_titles)
self.assertTrue(all("bing.com/images/search" in item["visual_reference_url"] for item in intelligence["calendar_insights"] if item.get("visual_reference_url")))
for platform in intelligence["platforms"]:
for prefix in ("official", "homepage", "seller"):
if platform[f"{prefix}_needs_translation"]:
self.assertIn("tl=zh-CN", platform[f"{prefix}_translation_url"])
self.assertIn("translate.yandex.com/translate", platform[f"{prefix}_translation_fallback_url"])
for prefix in ("official", "homepage"):
for field in ("needs_translation", "translation_url", "translation_fallback_url"):
self.assertNotIn(f"{prefix}_{field}", platform)
if platform["seller_needs_translation"]:
self.assertIn("tl=zh-CN", platform["seller_translation_url"])
self.assertIn("translate.yandex.com/translate", platform["seller_translation_fallback_url"])
platforms = {platform["id"]: platform for platform in intelligence["platforms"]}
self.assertTrue(platforms["temu"]["seller_needs_translation"])
self.assertFalse(platforms["shopee"]["seller_needs_translation"])
self.assertFalse(platforms["shopify"]["seller_needs_translation"])
def test_known_translation_restrictions_match_verified_services(self) -> None:
translation_fields = load_translation_module().translation_fields
@@ -171,6 +177,9 @@ class StandaloneProjectContractTests(unittest.TestCase):
self.assertIn("translate.yandex.com/translate", fields["translation_fallback_url"])
self.assertFalse(abai["translation_url"])
self.assertFalse(abai["translation_fallback_url"])
shopify_zh = translation_fields("https://www.shopify.com/zh")
self.assertFalse(shopify_zh["needs_translation"])
self.assertFalse(shopify_zh["translation_url"])
chinese_html = translation_fields(
"https://intertextile-shanghai-hometextiles-autumn.hk.messefrankfurt.com/shanghai/zh-cn.html",
"en",
@@ -181,7 +190,7 @@ class StandaloneProjectContractTests(unittest.TestCase):
ccpit = translation_fields("https://bizevent.ccpit.org/meetings/4575")
self.assertFalse(ccpit["needs_translation"])
self.assertFalse(ccpit["translation_url"])
ibte = translation_fields("https://ibte.co.id/")
ibte = translation_fields("https://ibte.co.id/", "zh-CN", "国际展会")
self.assertTrue(ibte["needs_translation"])
self.assertIn("translate.google.com/translate", ibte["translation_url"])
self.assertIn("translate.yandex.com/translate", ibte["translation_fallback_url"])
@@ -233,7 +242,9 @@ class StandaloneProjectContractTests(unittest.TestCase):
def test_source_files_remain_maintainable(self) -> None:
seo_builder = (ROOT / "scripts/build_seo.py").read_text(encoding="utf-8")
self.assertIn("official_translation_url", seo_builder)
self.assertIn("seller_translation_url", seo_builder)
self.assertNotIn("official_translation_url", seo_builder)
self.assertNotIn("homepage_translation_url", seo_builder)
self.assertIn("source_translation_url", seo_builder)
self.assertIn("seo_config", seo_builder)
self.assertNotIn("selected = items[:", seo_builder)