Add REST endpoints and frontend wiring for per-language project actions:
- POST /api/workspace/{project}/translation/{lang}/queue — queue translation
- POST /api/workspace/{project}/audio/{lang}/queue — queue audio generation
- GET/POST /api/workspace/{project}/format/{lang} — format metadata (EPUB/PDF)
- GET /api/workspace/{project}/review/{lang}/chapters/{chapter} — utterance review
- GET/POST /api/workspace/{project}/front-matter/{lang} — front matter editor
- GET /api/workspace/{project}/chapters/{lang} — chapter list
- GET /api/workspace/{project}/chapter-content/{lang}/{chapter} — chapter text
Frontend fixes:
- Review page shows per-language text (English source, Chinese translation, etc.)
- Non-translated languages show 'Queue translation' button only
- Speaker data from English source matched by paragraph ID
- UmbraAudio column layout: Speaker, Variation, Text, Actions
- Chapter tree in left sidebar: Front matter, Back matter, Body
- Audio Format label at top of sidebar
- Pandoc formatting toolbar for front matter text editing
289 lines
14 KiB
Plaintext
289 lines
14 KiB
Plaintext
DEAL HUNTER — SIMPLIFIED CHINESE TRANSLATION
|
|
STATUS
|
|
Updated: 2026-10-19 13:44 UTC
|
|
Phase: 3 — sample translation (Chapter 1 in progress; front matter re-run queued)
|
|
|
|
---------------------------------------------------------------------------
|
|
1. OBJECTIVE
|
|
---------------------------------------------------------------------------
|
|
Translate the English novel Deal Hunter by B. D. Murphy into Simplified
|
|
Chinese. The translation must carry intent, register and character voice, not
|
|
word-for-word substitution. The reading copy is produced as AsciiDoc and as
|
|
an OpenDocument text file (ODT) for review. Front matter, body and back matter
|
|
have different formatting.
|
|
|
|
The source is the UmbraAudio controller bundle:
|
|
/home/umbra/audio-read/bundles/dh-bundle/manifest.jsonl
|
|
sha256 21ce568787540cf7164b6ab4028f1caee51996447537022154d1e5768cde87ba
|
|
|
|
---------------------------------------------------------------------------
|
|
2. WHAT WAS DONE
|
|
---------------------------------------------------------------------------
|
|
- Read the relevant specifications:
|
|
UmbraAudio specs 27 (multi-pass semantic translation), 25 (speaker audit),
|
|
28 (UI language selection), 29 (accent/voice); UmbraTrans
|
|
docs/plan-translation-pipeline.md.
|
|
- Extracted the book from the bundle into a stable source model:
|
|
1 book, 32 chapter rows, 4,319 utterances, 55 speakers, 66,884 words.
|
|
- Classified matter: 4 front, 27 body, 1 back.
|
|
- Reconstructed 3,047 readable paragraphs. Source utterance indices are kept
|
|
on every paragraph. The spoken "Chapter one, Salvage" production cue and
|
|
the duplicated "Author's Note" heading were removed from the reading text.
|
|
- Built an initial Chinese glossary and style guide (characters, roles,
|
|
places, terms, punctuation, unknown-name policy).
|
|
- Built the multi-pass pipeline:
|
|
Pass 0 paragraph/scene/chunk assembly (local, no LLM)
|
|
Pass 1 scene intent analysis (lfm2.5-2.6b)
|
|
Pass 2 context-aware draft translation (qwen3.5-9b)
|
|
Pass 3 chapter consistency (implemented, optional)
|
|
Pass 4 bilingual critic, different model (deepseek-r1-8b,
|
|
fallback qwen3.5-9b)
|
|
Every call is cached by prompt hash; every analysis, draft and critique is
|
|
a file; a run can be stopped and resumed.
|
|
- Fixed the first prompt iteration's title/proper-name drift:
|
|
Deal Hunter / Hunter / Umbra Audio stay English; no invented full names
|
|
or titles. The front matter must be re-run to pick this up.
|
|
- Fixed a second class of mechanical defects found in the first Chapter 1
|
|
chunks:
|
|
- the drafter no longer sees the "(dialogue; speaker)" labels, so it
|
|
cannot copy them into the Chinese text;
|
|
- a hard-term block (system=星系, sector=星区, jump=跃迁, salvage=打捞,
|
|
bounty=赏金, XO=副舰长 …) blocks the common mistranslations;
|
|
- a deterministic pass strips leaked ids/labels, normalises straight
|
|
quotes to “ ”, pairs unbalanced quotes, removes the spurious quote the
|
|
model wrapped around unquoted narration, and fixes known title forms;
|
|
- stray lowercase English words are detected and repaired in place;
|
|
- the remaining Latin words are recorded per paragraph as warnings
|
|
(proper names go to glossary review, not silent transliteration).
|
|
- Added the QA, names and review tools:
|
|
- qa.py missing paragraphs, metadata leaks, straight/unbalanced
|
|
quotes, double punctuation, title drift, English residue,
|
|
system->系统, proper-name review queue.
|
|
- names.py merges analyst proposed_terms with mid-sentence capitalised
|
|
source names into glossary/candidates.md (no auto-merge).
|
|
- review.py self-contained bilingual HTML review page, issues attached
|
|
to each paragraph, "only flagged" and "hide English" filters.
|
|
- Renderer fixes: Chinese chapter numerals (第一章 打捞), renamed the heading
|
|
styles to avoid LibreOffice built-in collisions, two-character first-line
|
|
indent, cleaner AsciiDoc document header, right-aligned TOC page numbers
|
|
with dot leaders (the tab-stop attributes were in the wrong namespace),
|
|
title-page author line B·D·墨菲, and a review note that points to
|
|
review.html.
|
|
- Critic hardening: model ids contain "/", which was being used literally in
|
|
the cache filename and crashed every critic call; the filename is now
|
|
sanitised. A failed critic (primary and fallback) is recorded as
|
|
"skipped" instead of aborting a long run. Confirmation-only issues, source-
|
|
grammar notes and empty minor suggestions are filtered out.
|
|
- Built the renderer:
|
|
- AsciiDoc book (title, TOC, chapter headings, dialogue roles, scene
|
|
breaks, source comments).
|
|
- Flat ODF -> ODT through LibreOffice, with title page, copyright page,
|
|
TOC, A4 layout, running header, page numbers, distinct front/body/back
|
|
styles.
|
|
- TOC page numbers are populated through UNO; a plain --convert-to
|
|
leaves the index empty.
|
|
- PDF export for quick review.
|
|
- Rendered a 9-page front-matter sample (title page, TOC, review note,
|
|
copyright, author's note, audio preface).
|
|
|
|
---------------------------------------------------------------------------
|
|
3. CURRENT METRICS
|
|
---------------------------------------------------------------------------
|
|
Source:
|
|
Chapters 32 (4 front, 27 body, 1 back)
|
|
Utterances 4,319
|
|
Reconstructed 3,047 paragraphs
|
|
Source words 66,884
|
|
Speakers 55
|
|
|
|
Translated:
|
|
Front matter 4 chapters / 26 paragraphs (re-run with corrected prompt)
|
|
Chapter 1 24/24 chunks, 232 paragraphs
|
|
Back matter 1 chapter / 3 paragraphs
|
|
Sample total 261 paragraphs, 8,943 Chinese characters
|
|
|
|
Glossary:
|
|
Core cast and roles, 9 places, ~60 terms. 204 source name candidates and 14
|
|
analyst term proposals are queued in glossary/candidates.md for approval.
|
|
|
|
Render:
|
|
deal-hunter-zh-sample.asciidoc
|
|
deal-hunter-zh-sample.odt
|
|
deal-hunter-zh-sample.pdf (22 pages: title, TOC, review note, copyright,
|
|
author's note, audio preface, Chapter 1, back
|
|
matter, sample end)
|
|
review.html (bilingual side-by-side review page)
|
|
run-manifest.json (hashes, models, counts)
|
|
|
|
---------------------------------------------------------------------------
|
|
4. SAMPLE SCOPE
|
|
---------------------------------------------------------------------------
|
|
The sample is intended to prove the whole chain on a meaningful slice:
|
|
- front matter: Sample Track, Opening Track, Copyright, Author's Note
|
|
- body: Chapter 1, Salvage (232 paragraphs, all 24 chunks)
|
|
- back matter: Closing Track
|
|
|
|
The sample is complete at the draft/QA/render level. The critic pass covers
|
|
the front/back matter and the first four Chapter 1 chunks; the remaining
|
|
Chapter 1 chunks are deliberately left for the full-book critic pass.
|
|
|
|
---------------------------------------------------------------------------
|
|
5. WHAT IS RUNNING
|
|
---------------------------------------------------------------------------
|
|
A background process is running the bounded qwen critic on the sample and
|
|
then re-rendering:
|
|
log: productions/deal-hunter-zh/runs/qwen-critic.log
|
|
mode: critic on front/back matter + first four Chapter 1 chunks
|
|
note: the critic model is qwen3.5-9b for this sample. DeepSeek R1 8B was
|
|
tested and rejected: on Chapter 1 chunk c000 it produced 28 issues,
|
|
almost all duplicates of three contradictory term claims (it wanted
|
|
"236 systems" rendered as 系统 rather than 星系). Qwen is also the
|
|
drafter, so this pass is a consistency check, not an independent
|
|
critic; the full-run critic model is still a decision for the author.
|
|
|
|
Do not start a second full-book run until this finishes; the LM Studio server
|
|
serialises requests and two runs would only slow each other down.
|
|
|
|
---------------------------------------------------------------------------
|
|
6. BLOCKERS AND DECISIONS
|
|
---------------------------------------------------------------------------
|
|
Blocking a full-book run (answers in docs/Questions.txt):
|
|
Q1 original DOCX for exact paragraphing (default: proceed with heuristic)
|
|
Q3 title treatment (default: 《Deal Hunter》, subtitle 交易猎人)
|
|
Q4 name/rank table (default: current glossary, 公爵夫人)
|
|
Q5 Simplified vs Traditional (default: Simplified, zh-CN)
|
|
Q15 model budget (default: current 9B/2.6B mix for the sample)
|
|
Q16 sample approval before the full run (default: yes)
|
|
|
|
Not blocking:
|
|
Q2 reading edition vs audiobook script (default: reading edition)
|
|
Q6-Q8 voice/register/content (defaults recorded)
|
|
Q9-Q11 front/back matter and numbering (defaults recorded)
|
|
Q12-Q14 output and review artefacts (defaults recorded)
|
|
Q17-Q18 data location and glossary additions (defaults recorded)
|
|
|
|
Known limitations:
|
|
- Paragraph boundaries are reconstructed, not original. The DOCX would
|
|
settle them.
|
|
- The translation is machine output. It has not had native-speaker review.
|
|
- The 27B model is not loaded; the 9B is the quality/speed compromise.
|
|
- The sample critic is qwen, the same model as the drafter. DeepSeek R1 8B
|
|
was tested and its term judgments were too unreliable to use without a
|
|
human filter.
|
|
- The critic covers only the first four Chapter 1 chunks in the sample.
|
|
- Full-book estimate at the measured rate (~1.6 min/chunk, ~315 chunks) is
|
|
about 8-9 h for the draft, plus 3-5 h for the critic. This is higher than
|
|
the earlier 4-6 h estimate and should be planned for accordingly.
|
|
- The ODT has been checked in LibreOffice only; Word compatibility is
|
|
untested.
|
|
- The glossary candidate list is heuristic (204 entries) and needs manual
|
|
pruning; unapproved names stay English by policy.
|
|
|
|
---------------------------------------------------------------------------
|
|
7. NEXT ACTIONS
|
|
---------------------------------------------------------------------------
|
|
1. Finish the bounded qwen critic and re-render (background).
|
|
2. Operator spot-check of the 22-page sample: layout, names, register,
|
|
paragraphing, punctuation, no English residue.
|
|
3. Decide the full-run critic model (qwen consistency check vs DeepSeek with
|
|
human filtering vs a larger model when available).
|
|
4. Answer Q1, Q3-Q5, Q15, Q16; prune glossary/candidates.md and freeze the
|
|
glossary.
|
|
5. If approved, launch the full-book run (~8-9 h at the measured rate), then
|
|
the critic pass, then native review.
|
|
|
|
---------------------------------------------------------------------------
|
|
8. FILES
|
|
---------------------------------------------------------------------------
|
|
Docs:
|
|
docs/Questions.txt
|
|
docs/TaskList.txt
|
|
docs/Status.txt
|
|
|
|
Tools (tracked):
|
|
tools/translation/book.py source model / paragraph reconstruction
|
|
tools/translation/llm.py LM Studio client, cache, JSON handling
|
|
tools/translation/prompts.py analyst/drafter/critic prompts
|
|
tools/translation/pipeline.py Pass 0-4 orchestration, cleanup, warnings
|
|
tools/translation/render.py AsciiDoc + FODT/ODT/PDF
|
|
tools/translation/qa.py mechanical QA and issue extraction
|
|
tools/translation/names.py glossary candidate collector
|
|
tools/translation/review.py bilingual HTML review page
|
|
tools/translation/README.md tool usage notes
|
|
|
|
Production (git-ignored, copyrighted text):
|
|
productions/deal-hunter-zh/source/book.json
|
|
productions/deal-hunter-zh/glossary/glossary.json
|
|
productions/deal-hunter-zh/glossary/candidates.md
|
|
productions/deal-hunter-zh/runs/<chapter>/*.analysis.json
|
|
productions/deal-hunter-zh/runs/<chapter>/*.draft.json
|
|
productions/deal-hunter-zh/runs/<chapter>/*.critic.json
|
|
productions/deal-hunter-zh/runs/<chapter>/translation.json
|
|
productions/deal-hunter-zh/runs/usage.jsonl
|
|
productions/deal-hunter-zh/runs/qa.json
|
|
productions/deal-hunter-zh/output/deal-hunter-zh-sample.*
|
|
productions/deal-hunter-zh/output/review.html
|
|
|
|
---------------------------------------------------------------------------
|
|
9. COMMANDS
|
|
---------------------------------------------------------------------------
|
|
Extract:
|
|
python3 tools/translation/book.py \
|
|
--out productions/deal-hunter-zh/source/book.json
|
|
|
|
Translate a chapter:
|
|
python3 tools/translation/pipeline.py \
|
|
--book productions/deal-hunter-zh/source/book.json \
|
|
--glossary productions/deal-hunter-zh/glossary/glossary.json \
|
|
--run-dir productions/deal-hunter-zh/runs \
|
|
--chapters ch-6
|
|
|
|
Translate the whole book (after approval):
|
|
python3 tools/translation/pipeline.py \
|
|
--book productions/deal-hunter-zh/source/book.json \
|
|
--glossary productions/deal-hunter-zh/glossary/glossary.json \
|
|
--run-dir productions/deal-hunter-zh/runs \
|
|
--chapters all --consistency
|
|
|
|
Render:
|
|
python3 tools/translation/render.py \
|
|
--book productions/deal-hunter-zh/source/book.json \
|
|
--run-dir productions/deal-hunter-zh/runs \
|
|
--out-dir productions/deal-hunter-zh/output \
|
|
--sample
|
|
|
|
Report:
|
|
python3 tools/translation/pipeline.py \
|
|
--book productions/deal-hunter-zh/source/book.json \
|
|
--glossary productions/deal-hunter-zh/glossary/glossary.json \
|
|
--run-dir productions/deal-hunter-zh/runs --report
|
|
|
|
QA, glossary candidates and review page:
|
|
python3 tools/translation/qa.py \
|
|
--book productions/deal-hunter-zh/source/book.json \
|
|
--run-dir productions/deal-hunter-zh/runs \
|
|
--json-out productions/deal-hunter-zh/runs/qa.json
|
|
|
|
python3 tools/translation/names.py \
|
|
--book productions/deal-hunter-zh/source/book.json \
|
|
--run-dir productions/deal-hunter-zh/runs \
|
|
--glossary productions/deal-hunter-zh/glossary/glossary.json \
|
|
--out productions/deal-hunter-zh/glossary/candidates.md
|
|
|
|
python3 tools/translation/review.py \
|
|
--book productions/deal-hunter-zh/source/book.json \
|
|
--run-dir productions/deal-hunter-zh/runs \
|
|
--out productions/deal-hunter-zh/output/review.html
|
|
|
|
---------------------------------------------------------------------------
|
|
10. DECISIONS RECORDED
|
|
---------------------------------------------------------------------------
|
|
- Keep "Deal Hunter" (book title and ship AI), "Hunter" and "Umbra Audio" in
|
|
English.
|
|
- Character names are transliterated by sound, not translated by meaning.
|
|
- Narration is restrained written Chinese; dialogue is colloquial and
|
|
character-specific.
|
|
- Unknown names stay in English until the glossary is approved; no invented
|
|
transliterations.
|
|
- Production data stays out of the public repository.
|