mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-12-05 23:39:28 +08:00
feat(ai-news-radar): 调和冲突并升级本地 MIT 包至 3c663dd (2026.12.01) (#418)
## 概述 / Summary 手工三方调和并升级 `ai-news-radar` 本地 MIT 派生包:`LearnPrompt/ai-news-radar` `689395109cc962a27c369bdd6fa50d1e090eb319`(`2026.11.24`)→ `3c663ddab7da78e62365e1ee0e58f34cc9cef09a`(`2026.12.01`,与 `9fda56e8c82aca27e2e0fecbbe383a231a89311f` 相比所有受跟踪代码/文档文件逐字节一致,仅 `data/*` 有新快照)。 ### 冲突调和与同步明细 1. **`assets/styles.css`**:合入上游新增的「今天值得做」卡片样式,并与上游逐字节对齐(消除此前仅 1 处末尾空行差异,避免后续 CSS 更新再次触发冲突)。 2. **`classic/index.html`**:合入上游新区块与静态资源版本号,继续保留适配 `<base href="../">` 的 `./assets/service-status.*` 路径修正。 3. **`README.md` / `references/upstream-project-readme*.md` / `docs/SOURCE_COVERAGE.md`**:根目录 `README.md` 保留本地安装说明;上游新 `README.md`、`README.en.md` 与 `docs/SOURCE_COVERAGE.md` 同步到对应引用位置,保留引用声明头与固定 commit 链接。 4. **同步其余受跟踪上游文件 & 补齐新引用资源**:同步 `scripts/update_news.py`、`index.html`、`assets/app.js`、`assets/service-status.js`、`assets/view-mode.js`、`classic/assets/app.js`、`classic/assets/styles.css`;补齐新版 `index.html` 引用的 `assets/i18n.js`、`assets/i18n/zh.js`、`assets/i18n/en.js`(避免断链)。继续排除 `#350` 明确不安装的 `data/`、测试与上游工作流。 5. **元数据与映射同步**:同步更新 `config/verified-updates.v1.json`、`skills/ai-news-radar/UPSTREAM.md`、`skills/ai-news-radar/catalog-metadata.v1.json`。 ## 验证 / Validation - `python3 -B skills/ai-news-radar/scripts/update_news.py --help` - `uv run --offline --quiet --with pytest --with pyyaml --with jsonschema python -m pytest scripts/catalog/test_tracked_updates.py -q` - `uv run --offline --quiet scripts/catalog/validate_catalog_metadata.py --require-complete` - `uv run --offline --quiet scripts/i18n/validate-i18n.py` - `uv run --offline --quiet scripts/i18n/translate.py --check` - `git diff --check` 合并后可关闭仅记录阻断状态的旧草稿 [#399](https://github.com/desirecore/market/pull/399)。
This commit is contained in:
1 parent
be8d8307af
commit
0e9ae3b4a1
20 files changed
+1918
-291
No files matched your search
+385
-179
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,78 @@
|
||||
// i18n:按 <html lang> 选择 zh / en 词典(assets/i18n/zh.js、en.js 由 scripts/build_i18n.mjs 从 JSON 生成,先于本文件加载)。
|
||||
// 经典脚本,不用模块;对外只有 window.AINewsRadarI18n。
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
const root = typeof window !== "undefined" ? window : globalThis;
|
||||
const doc = typeof document !== "undefined" ? document : root.document;
|
||||
const htmlLang = String((doc && doc.documentElement && doc.documentElement.lang) || "");
|
||||
const LANG = /^en/i.test(htmlLang) ? "en" : "zh";
|
||||
const LOCALE = LANG === "en" ? "en-US" : "zh-CN";
|
||||
const messages = (root.__I18N && typeof root.__I18N === "object") ? root.__I18N : {};
|
||||
|
||||
const numberFormat = new Intl.NumberFormat(LOCALE);
|
||||
const pluralRules = new Intl.PluralRules(LOCALE);
|
||||
const collator = new Intl.Collator(LOCALE);
|
||||
|
||||
function fmtNumber(n) {
|
||||
return numberFormat.format(n || 0);
|
||||
}
|
||||
|
||||
function fmtDate(d, opts) {
|
||||
const date = d instanceof Date ? d : new Date(d);
|
||||
if (Number.isNaN(date.getTime())) return "";
|
||||
return new Intl.DateTimeFormat(LOCALE, opts).format(date);
|
||||
}
|
||||
|
||||
function has(key) {
|
||||
return Object.prototype.hasOwnProperty.call(messages, key);
|
||||
}
|
||||
|
||||
// {name} 占位符插值;数字参数按当前语言做千分位,字符串原样放入;缺参数保留占位符。
|
||||
function interpolate(template, params) {
|
||||
if (!params) return template;
|
||||
return template.replace(/\{(\w+)\}/g, (whole, name) => {
|
||||
if (!Object.prototype.hasOwnProperty.call(params, name)) return whole;
|
||||
const value = params[name];
|
||||
if (value === null || value === undefined) return "";
|
||||
return typeof value === "number" ? fmtNumber(value) : String(value);
|
||||
});
|
||||
}
|
||||
|
||||
// 复数条目是 {one, other, ...},按 params.n 选类别;zh 的 PluralRules 恒为 other。
|
||||
function t(key, params) {
|
||||
if (!has(key)) return key;
|
||||
let entry = messages[key];
|
||||
if (entry && typeof entry === "object") {
|
||||
const n = Number(params && params.n);
|
||||
const category = pluralRules.select(Number.isFinite(n) ? n : 0);
|
||||
entry = entry[category] !== undefined ? entry[category] : (entry.other !== undefined ? entry.other : entry.one);
|
||||
if (entry === undefined) return key;
|
||||
}
|
||||
return interpolate(String(entry), params);
|
||||
}
|
||||
|
||||
// 相对时间:ms 为毫秒时间戳,缺失/非法返回“时间未知”。
|
||||
function fmtRelative(ms, now) {
|
||||
if (!ms) return t("common.unknownTime");
|
||||
const diff = (now === undefined ? Date.now() : now) - ms;
|
||||
if (diff < 0) return t("rel.justNow");
|
||||
const minutes = Math.round(diff / 60000);
|
||||
if (minutes < 60) return t("rel.minutes", { n: Math.max(1, minutes) });
|
||||
const hours = Math.round(minutes / 60);
|
||||
if (hours < 48) return t("rel.hours", { n: hours });
|
||||
return t("rel.days", { n: Math.round(hours / 24) });
|
||||
}
|
||||
|
||||
root.AINewsRadarI18n = {
|
||||
LANG,
|
||||
locale: LOCALE,
|
||||
isEN: LANG === "en",
|
||||
t,
|
||||
has,
|
||||
fmtNumber,
|
||||
fmtDate,
|
||||
fmtRelative,
|
||||
collator,
|
||||
};
|
||||
})();
|
||||
@@ -0,0 +1,215 @@
|
||||
// 由 scripts/build_i18n.mjs 从 en.json 生成,勿手改。
|
||||
window.__I18N = {
|
||||
"page.todayProjectsTitle": "Worth building today",
|
||||
"page.githubLink": "GitHub & setup guide",
|
||||
"common.source": "Source",
|
||||
"common.unknownTime": "Time unknown",
|
||||
"common.unknownDate": "Unknown date",
|
||||
"common.untitled": "Untitled update",
|
||||
"common.loadFailed": "Load failed",
|
||||
"common.allSites": "All sites",
|
||||
"error.load": "Failed to load {file}: {status}",
|
||||
"error.badFormat": "Invalid project data format",
|
||||
"news.loadFailed": "Failed to load news data",
|
||||
"sourceKind.official": "Official",
|
||||
"sourceKind.curatedMedia": "Curated media",
|
||||
"sourceKind.newsletter": "Daily digest",
|
||||
"sourceKind.xSearch": "X search",
|
||||
"sourceKind.douyin": "Douyin",
|
||||
"sourceKind.xiaohongshu": "Xiaohongshu",
|
||||
"sourceKind.aggregate": "Aggregator",
|
||||
"sourceKind.blogs": "Blogs",
|
||||
"sourceKind.aiSites": "AI sites",
|
||||
"sourceKind.community": "Community",
|
||||
"aihotSub.wechat": "WeChat",
|
||||
"section.all.label": "All",
|
||||
"section.all.description": "Show every signal without filtering by section",
|
||||
"section.models.label": "Models",
|
||||
"section.models.description": "Model releases, capability upgrades, evals and open weights",
|
||||
"section.products.label": "Products",
|
||||
"section.products.description": "AI apps, agents, generative tools and consumer product updates",
|
||||
"section.devtools.label": "Developers",
|
||||
"section.devtools.description": "Coding tools, APIs, open-source projects, inference and engineering practice",
|
||||
"section.industry.label": "Industry",
|
||||
"section.industry.description": "Company strategy, funding and M&A, regulation, chips and industry shifts",
|
||||
"section.research.label": "Research",
|
||||
"section.research.description": "Papers, benchmarks, methods, datasets and research-team news",
|
||||
"section.community.label": "Community",
|
||||
"section.community.description": "Hacker News, tech communities and community chatter",
|
||||
"section.creator.label": "Creators",
|
||||
"section.creator.description": "Content from creators on Douyin, Xiaohongshu and similar platforms",
|
||||
"section.fallback": "Section",
|
||||
"today.failed": "Project data failed to load. Please try again later.",
|
||||
"today.updating": "Today's project picks are being updated.",
|
||||
"today.none": "No suitable project picks today.",
|
||||
"today.count": {
|
||||
"one": "{n} project",
|
||||
"other": "{n} projects"
|
||||
},
|
||||
"today.sourceFallback": "Project source",
|
||||
"today.recentUpdate": "Recently updated",
|
||||
"today.open": "Open project ↗",
|
||||
"today.openAria": "Open project: {name}",
|
||||
"rel.justNow": "Just now",
|
||||
"rel.minutes": {
|
||||
"one": "{n} minute ago",
|
||||
"other": "{n} minutes ago"
|
||||
},
|
||||
"rel.hours": {
|
||||
"one": "{n} hour ago",
|
||||
"other": "{n} hours ago"
|
||||
},
|
||||
"rel.days": {
|
||||
"one": "{n} day ago",
|
||||
"other": "{n} days ago"
|
||||
},
|
||||
"rel.updatedAt": "Updated {time}",
|
||||
"status.loading": "Loading source status",
|
||||
"status.ok": "{ok}/{total} sources OK",
|
||||
"status.okFailed": "{ok}/{total} sources OK · {failed} failed",
|
||||
"mode.selected": "Curated",
|
||||
"mode.all": "All",
|
||||
"mode.dedupOn": "Dedup on",
|
||||
"mode.dedupOff": "Dedup off",
|
||||
"mode.hint": {
|
||||
"one": "{mode} · {n} item",
|
||||
"other": "{mode} · {n} items"
|
||||
},
|
||||
"mode.hintAria": {
|
||||
"one": "Current mode: {mode}, {n} item",
|
||||
"other": "Current mode: {mode}, {n} items"
|
||||
},
|
||||
"filters.clear": "Clear filters",
|
||||
"filters.clearN": {
|
||||
"one": "Clear {n} adjustment",
|
||||
"other": "Clear {n} adjustments"
|
||||
},
|
||||
"dataSource.label": "Data source: {base}",
|
||||
"count.items": {
|
||||
"one": "{n} item",
|
||||
"other": "{n} items"
|
||||
},
|
||||
"site.scanned": "24h 0 · {n} scanned",
|
||||
"site.scannedZero": "0 scanned",
|
||||
"site.ratio": "{count}/{raw} · {pct}% AI",
|
||||
"item.sourceTitle": "Feed: {source}",
|
||||
"item.multiTotal": "{n} sources in total",
|
||||
"item.multiCollapsed": "{n} sources ▸",
|
||||
"item.multiExpanded": "{n} sources ▾",
|
||||
"item.score": "Score {n}",
|
||||
"item.original": "Read original ↗",
|
||||
"list.emptyTitle": "No matching results",
|
||||
"list.emptyMessage": "Try a different keyword, or reset to the default view.",
|
||||
"list.emptyReset": "Clear filters and show everything",
|
||||
"list.loading": {
|
||||
"one": "Preparing {label} · {n} item",
|
||||
"other": "Preparing {label} · {n} items"
|
||||
},
|
||||
"list.more": {
|
||||
"one": "Show {n} more",
|
||||
"other": "Show {n} more"
|
||||
},
|
||||
"list.loadingAll": "Loading all updates...",
|
||||
"hot.meta": {
|
||||
"one": "{n} hot story · sorted by heat",
|
||||
"other": "{n} hot stories · sorted by heat"
|
||||
},
|
||||
"hot.metaDefault": "Sorted by heat",
|
||||
"hot.empty": "No story is covered by 2 or more sources under the current filters. Change the filters or switch to All.",
|
||||
"hot.sources": {
|
||||
"one": "{n} source",
|
||||
"other": "{n} sources"
|
||||
},
|
||||
"persona.pragmatic": "The Pragmatist",
|
||||
"persona.cynic": "The Cynic",
|
||||
"persona.paperPolice": "The Stickler",
|
||||
"reason.creatorEngagement": "Weekly engagement: {parts}",
|
||||
"reason.likes": "Likes {n}",
|
||||
"reason.collects": "Saves {n}",
|
||||
"reason.comments": "Comments {n}",
|
||||
"reason.shares": "Shares {n}",
|
||||
"reason.freshBonus": "24h bonus",
|
||||
"reason.signalsPrefix": "Matched topics: ",
|
||||
"reason.corePrefix": "Core topics: ",
|
||||
"reason.cluePrefix": "Related clues: ",
|
||||
"reason.clues": "Related clues: {signals}.",
|
||||
"reason.default": "Passed the source and title signal filter",
|
||||
"aiLabel.ai_general": "AI signal",
|
||||
"aiLabel.model_release": "Model release",
|
||||
"aiLabel.agent_workflow": "Agent workflow",
|
||||
"aiLabel.ai_product_update": "Product update",
|
||||
"aiLabel.developer_tooling": "Developer tools",
|
||||
"aiLabel.developer_tool": "Developer tools",
|
||||
"aiLabel.infrastructure": "Infrastructure",
|
||||
"aiLabel.infra_compute": "Infrastructure",
|
||||
"aiLabel.industry_business": "Industry news",
|
||||
"aiLabel.research_paper": "Research paper",
|
||||
"aiLabel.robotics": "Robotics",
|
||||
"aiLabel.curated_hotlist": "Trending",
|
||||
"aiLabel.ai_tech": "Tech trends",
|
||||
"aiLabel.fallback": "Curated signal",
|
||||
"importance.official": "Official update",
|
||||
"importance.multi_source": "Multi-source buzz",
|
||||
"importance.industry": "Industry news",
|
||||
"importance.watch": "Worth watching",
|
||||
"signal.aihot": "AI HOT picks",
|
||||
"signal.hn": "HN buzz",
|
||||
"signal.github": "GitHub trending",
|
||||
"signal.official": "Official updates",
|
||||
"signal.douyin": "Douyin creators",
|
||||
"signal.xiaohongshu": "Xiaohongshu creators",
|
||||
"waytoagi.updatedAt": "Updated: {time}",
|
||||
"waytoagi.root": "Home page",
|
||||
"waytoagi.history": "Update history",
|
||||
"waytoagi.today": {
|
||||
"one": "Latest update day ({date}): {n} item",
|
||||
"other": "Latest update day ({date}): {n} items"
|
||||
},
|
||||
"waytoagi.week": {
|
||||
"one": "Last 7 days: {n} item",
|
||||
"other": "Last 7 days: {n} items"
|
||||
},
|
||||
"waytoagi.error": "Failed to load WaytoAGI data",
|
||||
"waytoagi.emptyToday": "No updates on the latest update day. Switch to the last 7 days to see more.",
|
||||
"waytoagi.empty7d": "No updates in the last 7 days",
|
||||
"authors.title": "X authors seen this run",
|
||||
"authors.meta": "{authors} authors · {items} items pooled",
|
||||
"authors.view": "View {name}'s posts on X",
|
||||
"authors.collapse": "Hide X author list ▲",
|
||||
"authors.expand": "View X authors this run ({n}) ▸",
|
||||
"health.errorTitle": "Source status error",
|
||||
"health.missingTitle": "Source status not generated",
|
||||
"health.waiting": "Waiting for source-status.json",
|
||||
"health.collected": "Collected today: {n}",
|
||||
"health.pooled": "Pooled: {n}",
|
||||
"health.relevant": "Strongly AI-related: {n}",
|
||||
"health.failed": "Failed: {n}",
|
||||
"table.aiRaw": "AI / Raw",
|
||||
"table.aiRatio": "AI share",
|
||||
"table.status": "Status",
|
||||
"table.ok": "OK",
|
||||
"table.bad": "Error",
|
||||
"table.total": {
|
||||
"one": "{n} source",
|
||||
"other": "{n} sources"
|
||||
},
|
||||
"hint.optional": "Optional integrations: {items}",
|
||||
"hint.rssOff": "RSS not enabled",
|
||||
"hint.agentmailOff": "AgentMail not configured",
|
||||
"hint.replaced": "Replaced/skipped {a}/{b}",
|
||||
"svc.investigating": "Investigating",
|
||||
"svc.identified": "Identified",
|
||||
"svc.monitoring": "Monitoring recovery",
|
||||
"svc.elevatedErrors": "Elevated error rates at OpenAI",
|
||||
"svc.incidentFallback": "Service incident",
|
||||
"svc.processing": "In progress",
|
||||
"svc.heading": "ChatGPT / OpenAI service status",
|
||||
"svc.count": {
|
||||
"one": "{n} official incident",
|
||||
"other": "{n} official incidents"
|
||||
},
|
||||
"svc.aria": {
|
||||
"one": "ChatGPT and OpenAI service status: {n} incident being handled",
|
||||
"other": "ChatGPT and OpenAI service status: {n} incidents being handled"
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,215 @@
|
||||
// 由 scripts/build_i18n.mjs 从 zh.json 生成,勿手改。
|
||||
window.__I18N = {
|
||||
"page.todayProjectsTitle": "今天值得做",
|
||||
"page.githubLink": "GitHub 与接入指南",
|
||||
"common.source": "来源",
|
||||
"common.unknownTime": "时间未知",
|
||||
"common.unknownDate": "未知日期",
|
||||
"common.untitled": "未命名更新",
|
||||
"common.loadFailed": "加载失败",
|
||||
"common.allSites": "全部站点",
|
||||
"error.load": "加载 {file} 失败: {status}",
|
||||
"error.badFormat": "项目数据格式错误",
|
||||
"news.loadFailed": "新闻数据加载失败",
|
||||
"sourceKind.official": "官方",
|
||||
"sourceKind.curatedMedia": "精选媒体",
|
||||
"sourceKind.newsletter": "日报",
|
||||
"sourceKind.xSearch": "X 搜索",
|
||||
"sourceKind.douyin": "抖音",
|
||||
"sourceKind.xiaohongshu": "小红书",
|
||||
"sourceKind.aggregate": "聚合",
|
||||
"sourceKind.blogs": "博客",
|
||||
"sourceKind.aiSites": "AI站点",
|
||||
"sourceKind.community": "社区",
|
||||
"aihotSub.wechat": "公众号",
|
||||
"section.all.label": "全部",
|
||||
"section.all.description": "不筛选内容栏目,查看全部信号",
|
||||
"section.models.label": "模型",
|
||||
"section.models.description": "模型发布、能力升级、评测与开源权重",
|
||||
"section.products.label": "产品",
|
||||
"section.products.description": "AI 应用、Agent、生成工具和用户产品更新",
|
||||
"section.devtools.label": "开发者",
|
||||
"section.devtools.description": "编程工具、API、开源项目、推理与工程实践",
|
||||
"section.industry.label": "行业",
|
||||
"section.industry.description": "公司战略、融资收购、监管、芯片与产业变化",
|
||||
"section.research.label": "论文",
|
||||
"section.research.description": "论文、基准、方法、数据集与研究团队动态",
|
||||
"section.community.label": "社区",
|
||||
"section.community.description": "HN、中文技术社区与社群动态",
|
||||
"section.creator.label": "自媒体",
|
||||
"section.creator.description": "抖音、小红书等自媒体创作者内容",
|
||||
"section.fallback": "栏目",
|
||||
"today.failed": "项目数据暂时加载失败,请稍后再试。",
|
||||
"today.updating": "今天的项目推荐更新中。",
|
||||
"today.none": "今天暂无合适的项目推荐。",
|
||||
"today.count": {
|
||||
"one": "{n} 个项目",
|
||||
"other": "{n} 个项目"
|
||||
},
|
||||
"today.sourceFallback": "项目来源",
|
||||
"today.recentUpdate": "近期更新",
|
||||
"today.open": "打开项目 ↗",
|
||||
"today.openAria": "打开项目:{name}",
|
||||
"rel.justNow": "刚刚",
|
||||
"rel.minutes": {
|
||||
"one": "{n} 分钟前",
|
||||
"other": "{n} 分钟前"
|
||||
},
|
||||
"rel.hours": {
|
||||
"one": "{n} 小时前",
|
||||
"other": "{n} 小时前"
|
||||
},
|
||||
"rel.days": {
|
||||
"one": "{n} 天前",
|
||||
"other": "{n} 天前"
|
||||
},
|
||||
"rel.updatedAt": "更新于 {time}",
|
||||
"status.loading": "源状态加载中",
|
||||
"status.ok": "{ok}/{total} 源正常",
|
||||
"status.okFailed": "{ok}/{total} 源正常 · 失败 {failed}",
|
||||
"mode.selected": "精选",
|
||||
"mode.all": "全量",
|
||||
"mode.dedupOn": "去重开",
|
||||
"mode.dedupOff": "去重关",
|
||||
"mode.hint": {
|
||||
"one": "{mode} {n} 条",
|
||||
"other": "{mode} {n} 条"
|
||||
},
|
||||
"mode.hintAria": {
|
||||
"one": "当前{mode}模式,{n} 条",
|
||||
"other": "当前{mode}模式,{n} 条"
|
||||
},
|
||||
"filters.clear": "清除筛选",
|
||||
"filters.clearN": {
|
||||
"one": "清除 {n} 项调整",
|
||||
"other": "清除 {n} 项调整"
|
||||
},
|
||||
"dataSource.label": "数据源:{base}",
|
||||
"count.items": {
|
||||
"one": "{n} 条",
|
||||
"other": "{n} 条"
|
||||
},
|
||||
"site.scanned": "24h 0 · 已扫 {n}",
|
||||
"site.scannedZero": "已扫 0",
|
||||
"site.ratio": "{count}/{raw} · {pct}%AI",
|
||||
"item.sourceTitle": "分区: {source}",
|
||||
"item.multiTotal": "共 {n} 个来源",
|
||||
"item.multiCollapsed": "多源 {n} ▸",
|
||||
"item.multiExpanded": "多源 {n} ▾",
|
||||
"item.score": "{n} 分",
|
||||
"item.original": "查看原文 ↗",
|
||||
"list.emptyTitle": "没有找到匹配内容",
|
||||
"list.emptyMessage": "可以换个关键词,或一键恢复默认视图。",
|
||||
"list.emptyReset": "清除筛选,查看全部",
|
||||
"list.loading": {
|
||||
"one": "正在整理 {label} · {n} 条",
|
||||
"other": "正在整理 {label} · {n} 条"
|
||||
},
|
||||
"list.more": {
|
||||
"one": "展开更多 {n} 条",
|
||||
"other": "展开更多 {n} 条"
|
||||
},
|
||||
"list.loadingAll": "正在加载全量更新...",
|
||||
"hot.meta": {
|
||||
"one": "当前 {n} 条热点 · 按热度降序",
|
||||
"other": "当前 {n} 条热点 · 按热度降序"
|
||||
},
|
||||
"hot.metaDefault": "按热度排序",
|
||||
"hot.empty": "当前筛选下没有 2 个以上信源交叉的热点,可切换筛选或查看全量。",
|
||||
"hot.sources": {
|
||||
"one": "{n} 个信源",
|
||||
"other": "{n} 个信源"
|
||||
},
|
||||
"persona.pragmatic": "实用派",
|
||||
"persona.cynic": "毒舌评论员",
|
||||
"persona.paperPolice": "较真党",
|
||||
"reason.creatorEngagement": "一周互动:{parts}",
|
||||
"reason.likes": "赞 {n}",
|
||||
"reason.collects": "藏 {n}",
|
||||
"reason.comments": "评 {n}",
|
||||
"reason.shares": "转 {n}",
|
||||
"reason.freshBonus": "24h 加分",
|
||||
"reason.signalsPrefix": "命中方向:",
|
||||
"reason.corePrefix": "核心方向:",
|
||||
"reason.cluePrefix": "相关线索:",
|
||||
"reason.clues": "相关线索:{signals}。",
|
||||
"reason.default": "来源与标题信号通过筛选",
|
||||
"aiLabel.ai_general": "AI信号",
|
||||
"aiLabel.model_release": "模型发布",
|
||||
"aiLabel.agent_workflow": "Agent工作流",
|
||||
"aiLabel.ai_product_update": "产品更新",
|
||||
"aiLabel.developer_tooling": "开发工具",
|
||||
"aiLabel.developer_tool": "开发工具",
|
||||
"aiLabel.infrastructure": "基础设施",
|
||||
"aiLabel.infra_compute": "基础设施",
|
||||
"aiLabel.industry_business": "行业动态",
|
||||
"aiLabel.research_paper": "研究论文",
|
||||
"aiLabel.robotics": "机器人",
|
||||
"aiLabel.curated_hotlist": "热点",
|
||||
"aiLabel.ai_tech": "技术趋势",
|
||||
"aiLabel.fallback": "精选信号",
|
||||
"importance.official": "官方更新",
|
||||
"importance.multi_source": "多源热议",
|
||||
"importance.industry": "行业动态",
|
||||
"importance.watch": "值得关注",
|
||||
"signal.aihot": "AI HOT精选",
|
||||
"signal.hn": "HN热议",
|
||||
"signal.github": "GitHub趋势",
|
||||
"signal.official": "官方更新",
|
||||
"signal.douyin": "抖音自媒体",
|
||||
"signal.xiaohongshu": "小红书自媒体",
|
||||
"waytoagi.updatedAt": "更新时间:{time}",
|
||||
"waytoagi.root": "主页面",
|
||||
"waytoagi.history": "历史更新页",
|
||||
"waytoagi.today": {
|
||||
"one": "最近更新日({date}):{n} 条",
|
||||
"other": "最近更新日({date}):{n} 条"
|
||||
},
|
||||
"waytoagi.week": {
|
||||
"one": "近 7 日:{n} 条",
|
||||
"other": "近 7 日:{n} 条"
|
||||
},
|
||||
"waytoagi.error": "WaytoAGI 数据加载失败",
|
||||
"waytoagi.emptyToday": "最近更新日没有更新,可切换到近7日查看。",
|
||||
"waytoagi.empty7d": "近 7 日没有更新",
|
||||
"authors.title": "本轮 X 扫到的博主",
|
||||
"authors.meta": "{authors} 位博主 · {items} 条入池内容",
|
||||
"authors.view": "查看 {name} 的 X 内容",
|
||||
"authors.collapse": "收起 X 博主列表 ▲",
|
||||
"authors.expand": "查看本轮 X 博主 ({n}) ▸",
|
||||
"health.errorTitle": "源状态异常",
|
||||
"health.missingTitle": "源状态未生成",
|
||||
"health.waiting": "等待 source-status.json",
|
||||
"health.collected": "今日采集 {n} 条",
|
||||
"health.pooled": "入池 {n}",
|
||||
"health.relevant": "AI 强相关 {n}",
|
||||
"health.failed": "失败 {n}",
|
||||
"table.aiRaw": "AI / 原始",
|
||||
"table.aiRatio": "AI占比",
|
||||
"table.status": "状态",
|
||||
"table.ok": "正常",
|
||||
"table.bad": "异常",
|
||||
"table.total": {
|
||||
"one": "共 {n} 源",
|
||||
"other": "共 {n} 源"
|
||||
},
|
||||
"hint.optional": "可选接入:{items}",
|
||||
"hint.rssOff": "RSS 未启用",
|
||||
"hint.agentmailOff": "AgentMail 未配置",
|
||||
"hint.replaced": "替换/跳过 {a}/{b}",
|
||||
"svc.investigating": "调查中",
|
||||
"svc.identified": "已定位",
|
||||
"svc.monitoring": "恢复监控中",
|
||||
"svc.elevatedErrors": "OpenAI 服务错误率升高",
|
||||
"svc.incidentFallback": "服务异常",
|
||||
"svc.processing": "处理中",
|
||||
"svc.heading": "ChatGPT / OpenAI 服务状态",
|
||||
"svc.count": {
|
||||
"one": "{n} 项官方故障",
|
||||
"other": "{n} 项官方故障"
|
||||
},
|
||||
"svc.aria": {
|
||||
"one": "ChatGPT 与 OpenAI 服务状态:{n} 项故障正在处理",
|
||||
"other": "ChatGPT 与 OpenAI 服务状态:{n} 项故障正在处理"
|
||||
}
|
||||
};
|
||||
@@ -2,10 +2,30 @@
|
||||
const panel = document.getElementById("serviceStatusPanel");
|
||||
if (!panel) return;
|
||||
|
||||
// i18n 由 assets/i18n.js 提供(先于本文件加载)。经典版页面不加载 i18n,退回下面这份中文词条
|
||||
// (与 assets/i18n/zh.json 的 svc.* 一致,由 tests/i18n.test.mjs 校验)。
|
||||
const i18n = window.AINewsRadarI18n;
|
||||
const ZH_FALLBACK = {
|
||||
"svc.investigating": "调查中",
|
||||
"svc.identified": "已定位",
|
||||
"svc.monitoring": "恢复监控中",
|
||||
"svc.elevatedErrors": "OpenAI 服务错误率升高",
|
||||
"svc.incidentFallback": "服务异常",
|
||||
"svc.processing": "处理中",
|
||||
"svc.heading": "ChatGPT / OpenAI 服务状态",
|
||||
"svc.count": "{n} 项官方故障",
|
||||
"svc.aria": "ChatGPT 与 OpenAI 服务状态:{n} 项故障正在处理",
|
||||
};
|
||||
const t = i18n
|
||||
? i18n.t
|
||||
: (key, params) => String(ZH_FALLBACK[key] || key).replace(/\{(\w+)\}/g, (whole, name) => (params && name in params ? String(params[name]) : whole));
|
||||
const IS_EN = Boolean(i18n && i18n.isEN);
|
||||
const LOCALE = i18n ? i18n.locale : "zh-CN";
|
||||
|
||||
const STATUS_LABELS = {
|
||||
investigating: "调查中",
|
||||
identified: "已定位",
|
||||
monitoring: "恢复监控中",
|
||||
investigating: t("svc.investigating"),
|
||||
identified: t("svc.identified"),
|
||||
monitoring: t("svc.monitoring"),
|
||||
};
|
||||
|
||||
function resolveDataBaseUrl() {
|
||||
@@ -27,7 +47,7 @@
|
||||
function formatTime(value) {
|
||||
const date = new Date(value || "");
|
||||
if (Number.isNaN(date.getTime())) return "";
|
||||
return new Intl.DateTimeFormat("zh-CN", {
|
||||
return new Intl.DateTimeFormat(LOCALE, {
|
||||
month: "numeric",
|
||||
day: "numeric",
|
||||
hour: "2-digit",
|
||||
@@ -50,9 +70,10 @@
|
||||
|
||||
function incidentTitle(incident) {
|
||||
if (incident?.title === "Elevated Error Rates") {
|
||||
return "OpenAI 服务错误率升高";
|
||||
return t("svc.elevatedErrors");
|
||||
}
|
||||
return incident?.title_zh || incident?.title || "服务异常";
|
||||
// 英文版只用官方英文标题,不取 title_zh
|
||||
return (IS_EN ? incident?.title : (incident?.title_zh || incident?.title)) || t("svc.incidentFallback");
|
||||
}
|
||||
|
||||
function incidentNode(incident) {
|
||||
@@ -71,7 +92,7 @@
|
||||
|
||||
const phase = document.createElement("span");
|
||||
phase.className = "service-phase";
|
||||
phase.textContent = STATUS_LABELS[incident.status] || incident.status || "处理中";
|
||||
phase.textContent = STATUS_LABELS[incident.status] || incident.status || t("svc.processing");
|
||||
meta.append(provider, phase);
|
||||
|
||||
const title = document.createElement("a");
|
||||
@@ -115,12 +136,12 @@
|
||||
dot.className = "service-status-dot";
|
||||
dot.setAttribute("aria-hidden", "true");
|
||||
const title = document.createElement("strong");
|
||||
title.textContent = "ChatGPT / OpenAI 服务状态";
|
||||
title.textContent = t("svc.heading");
|
||||
titleWrap.append(dot, title);
|
||||
|
||||
const count = document.createElement("span");
|
||||
count.className = "service-status-count";
|
||||
count.textContent = `${incidents.length} 项官方故障`;
|
||||
count.textContent = t("svc.count", { n: incidents.length });
|
||||
heading.append(titleWrap, count);
|
||||
|
||||
const list = document.createElement("div");
|
||||
@@ -133,10 +154,7 @@
|
||||
incidents.some((incident) => ["major", "critical"].includes(incident.impact)),
|
||||
);
|
||||
panel.hidden = false;
|
||||
panel.setAttribute(
|
||||
"aria-label",
|
||||
`ChatGPT 与 OpenAI 服务状态:${incidents.length} 项故障正在处理`,
|
||||
);
|
||||
panel.setAttribute("aria-label", t("svc.aria", { n: incidents.length }));
|
||||
}
|
||||
|
||||
const controller = new AbortController();
|
||||
|
||||
@@ -2072,3 +2072,93 @@ summary:focus-visible {
|
||||
color: var(--accent);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
|
||||
/* Compact project recommendations, shared by the mobile and classic views. */
|
||||
.today-projects-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
padding: 16px 18px;
|
||||
}
|
||||
|
||||
#todayProjectsMeta {
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.today-project-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
padding: 16px;
|
||||
border: 1px solid var(--line-soft);
|
||||
border-radius: var(--radius);
|
||||
background: var(--surface-soft);
|
||||
}
|
||||
|
||||
.today-project-heading {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: baseline;
|
||||
gap: 6px 10px;
|
||||
}
|
||||
|
||||
.today-project-heading h3 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
line-height: 1.45;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.today-project-source {
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.today-project-reason {
|
||||
margin: 0;
|
||||
color: var(--ink-soft);
|
||||
font-size: 14px;
|
||||
line-height: 1.65;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.today-project-link {
|
||||
align-self: flex-start;
|
||||
margin-top: auto;
|
||||
color: var(--accent);
|
||||
font-size: 13px;
|
||||
font-weight: 650;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.today-project-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.today-project-link:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 4px;
|
||||
}
|
||||
|
||||
.today-projects-empty {
|
||||
grid-column: 1 / -1;
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@media (max-width: 760px) {
|
||||
.today-projects-list {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.today-project-card {
|
||||
padding: 14px;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@
|
||||
const script = document.currentScript;
|
||||
const rootHint = script?.dataset.root || "./";
|
||||
const rootUrl = new URL(rootHint, window.location.href);
|
||||
// 英文版(data-root=/en/)只有手机版一个视角:经典版暂无英文,不渲染入口,也不读取/写入视角偏好。
|
||||
const classicAvailable = !/^\/en\/?$/.test(rootHint);
|
||||
const currentView = document.documentElement.dataset.radarView || "mobile";
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const requestedView = params.get("view") || "";
|
||||
@@ -63,7 +65,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (requestedView === "auto") {
|
||||
if (!classicAvailable) {
|
||||
// 英文版:忽略 ?view= 与已存偏好,不动 localStorage 里中文站的视角选择
|
||||
} else if (requestedView === "auto") {
|
||||
writePreference("");
|
||||
writeMobileOverride("");
|
||||
} else if (!isMobileViewport && VALID_VIEWS.has(requestedView)) {
|
||||
@@ -77,10 +81,12 @@
|
||||
? ""
|
||||
: (VALID_VIEWS.has(requestedView) ? requestedView : readPreference()));
|
||||
const deviceDefault = "mobile";
|
||||
const targetView = preference || deviceDefault;
|
||||
const targetView = classicAvailable ? (preference || deviceDefault) : deviceDefault;
|
||||
|
||||
function destination(view) {
|
||||
const url = new URL(view === "classic" ? "classic/" : "./", rootUrl);
|
||||
// trailingSlash=false 时 /en/ 会 308 到 /en,规范地址不带斜杠
|
||||
if (url.pathname === "/en/") url.pathname = "/en";
|
||||
const passthrough = new URLSearchParams(window.location.search);
|
||||
passthrough.delete("view");
|
||||
url.search = passthrough.toString();
|
||||
@@ -95,7 +101,7 @@
|
||||
}
|
||||
|
||||
function chooseView(view) {
|
||||
if (!VALID_VIEWS.has(view)) return;
|
||||
if (!VALID_VIEWS.has(view) || !classicAvailable) return;
|
||||
if (isMobileViewport) writeMobileOverride(view);
|
||||
else writePreference(view);
|
||||
if (view === currentView) return;
|
||||
|
||||
Reference in new issue
Block a user