feat(translation): 增加离线任务状态查询

This commit is contained in:
2026-08-01 19:04:54 +08:00
parent a05d3ee6af
commit 12c5d365ab
11 changed files with 718 additions and 46 deletions
+11
View File
@@ -161,6 +161,7 @@ SQLite `ResourceRepository`,索引不存在时返回 `ok=true` 且
| `parse.status` | 已实现 | `null` | 当前官方 release 的解析缓存状态。 |
| `parse.text_units` | 已实现 | `{ "offset": 0, "limit": 100, "destination": "*Table*", "archive_entry": "*.bytes", "path_id": 1, "class_id": 114, "field_path": "*Text*", "format": "json" }` | 当前官方 release 的 TextUnit 明细分页。 |
| `parse.errors` | 已实现 | `{ "offset": 0, "limit": 100, "destination": "*Table*", "archive_entry": "*.bytes", "path_id": 1, "class_id": 114, "field_path": "*Text*", "format": "json" }` | 当前官方 release 的解析错误分页。 |
| `translation.tasks` | 已实现 | `{ "offset": 0, "limit": 100, "task_id": "...", "release_id": "...", "destination": "...", "archive_entry": "...", "status": "skipped_parse_failed", "parse_status": "failed", "format": "json", "has_reason": true }` | 当前官方 release 的离线 TextUnit 翻译任务状态分页。 |
`parse.status` 是只读查询;没有当前 release 或没有解析缓存时返回
`ok=true``data.available=false`。解析缓存来自官方原版资源目录,不读取
@@ -194,6 +195,16 @@ offset 和 error。TypeTree-covered managed reference 字段会进入结构化
完整 managed reference registry 等暂不支持结构会进入解析错误,而不是静默降级为
低保真文本。
`translation.tasks` 查询 `official-textunit-tasks.json`,用于查看离线
TextUnit 翻译任务候选、跳过状态和失败/跳过原因;没有当前 release 或没有任务队列时
返回 `ok=true``data.available=false`。过滤参数包括 `task_id`
`official_release_id`/`release_id``destination``path_pattern`
`archive_entry``status`/`task_status``parse_status``text_unit_format`/`format`
`has_reason``entries[]` 会包含 `official_release_id``destination`
`archive_entry``parse_status``status``reason`、TextAsset/TextUnit 摘要和
校验指纹。当前它只反映 Rust 侧离线 handoff 状态;真实 Crowdin worker 消费、
重试和完成状态仍需后续 worker 模型写回后才能暴露。
### localized
| 方法 | 状态 | params | data |