feat(glossary): 实现 Rust Glossary V1

This commit is contained in:
2026-09-07 22:38:53 +08:00
parent 8fc93b8f39
commit 94483ff14d
42 changed files with 4543 additions and 92 deletions
+130 -1
View File
@@ -461,6 +461,86 @@ paths:
description: Missing or invalid admin token.
"503":
description: Rust bat Translation Memory backend is unavailable.
/admin/translation/glossary/summary:
get:
summary: Read Rust-owned Glossary summary
parameters:
- name: glossary_path
in: query
schema:
type: string
responses:
"200":
description: Glossary availability and review-state counts.
"401":
description: Missing or invalid admin token.
"503":
description: Rust bat Glossary backend is unavailable.
/admin/translation/glossary/query:
get:
summary: Query Rust-owned Glossary terms
parameters:
- name: source_text
in: query
schema:
type: string
- name: category
in: query
schema:
type: string
- name: review_status
in: query
schema:
type: string
enum: [draft, approved, deprecated, rejected]
- name: limit
in: query
schema:
type: integer
format: int64
minimum: 1
maximum: 1000
default: 100
- name: glossary_path
in: query
schema:
type: string
responses:
"200":
description: Glossary terms with source and review history.
"400":
description: Invalid Glossary query.
"401":
description: Missing or invalid admin token.
"503":
description: Rust bat Glossary backend is unavailable.
/admin/translation/glossary/diagnose:
get:
summary: Run deterministic Glossary diagnostics
parameters:
- name: source_text
in: query
required: true
schema:
type: string
- name: context
in: query
description: JSON object whose values are strings.
schema:
type: string
- name: glossary_path
in: query
schema:
type: string
responses:
"200":
description: Glossary constraints, diagnostics, and blocked decision.
"400":
description: Missing source text or invalid context.
"401":
description: Missing or invalid admin token.
"503":
description: Rust bat Glossary backend is unavailable.
/admin/translation/status:
get:
summary: Read Rust-owned localized release status
@@ -480,7 +560,7 @@ paths:
required: true
schema:
type: string
enum: [reload, refresh, restart, sync, verify, repair, catalog-refresh, schedule-add, schedule-update, schedule-remove, schedule-run, task-cancel, translation-task-update, translation-worker-run, translation-proofread, translation-memory-confirm, localized-publish, localized-rollback]
enum: [reload, refresh, restart, sync, verify, repair, catalog-refresh, schedule-add, schedule-update, schedule-remove, schedule-run, task-cancel, translation-task-update, translation-worker-run, translation-proofread, translation-memory-confirm, translation-glossary-add, translation-glossary-update, translation-glossary-approve, translation-glossary-deprecate, localized-publish, localized-rollback]
requestBody:
required: false
content:
@@ -573,8 +653,57 @@ paths:
type: string
translation_memory_path:
type: string
glossary_path:
type: string
record_id:
type: string
term_id:
type: string
source_term:
type: string
aliases:
type: array
items:
type: string
recommended_translation:
type: string
allowed_translations:
type: array
items:
type: string
source_language:
type: string
target_language:
type: string
category:
type: string
priority:
type: integer
format: int64
scope:
type: object
additionalProperties:
type: string
review_status:
type: string
enum: [draft, approved, deprecated, rejected]
source:
type: object
additionalProperties: false
required: [source_kind, observed_unix_seconds]
properties:
source_kind:
type: string
enum: [manual, imported]
source_ref:
type: string
source_author:
type: string
source_note:
type: string
observed_unix_seconds:
type: integer
format: int64
reviewer:
type: string
reason: