novelws 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +161 -0
- package/LICENSE +22 -0
- package/README.md +372 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +50 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/check.d.ts +6 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +32 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +160 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/plugin.d.ts +6 -0
- package/dist/commands/plugin.d.ts.map +1 -0
- package/dist/commands/plugin.js +135 -0
- package/dist/commands/plugin.js.map +1 -0
- package/dist/commands/upgrade.d.ts +6 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +92 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/core/config.d.ts +72 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +136 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/errors.d.ts +59 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +125 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/platform.d.ts +27 -0
- package/dist/core/platform.d.ts.map +1 -0
- package/dist/core/platform.js +75 -0
- package/dist/core/platform.js.map +1 -0
- package/dist/core/template.d.ts +35 -0
- package/dist/core/template.d.ts.map +1 -0
- package/dist/core/template.js +94 -0
- package/dist/core/template.js.map +1 -0
- package/dist/plugins/identifier.d.ts +13 -0
- package/dist/plugins/identifier.d.ts.map +1 -0
- package/dist/plugins/identifier.js +72 -0
- package/dist/plugins/identifier.js.map +1 -0
- package/dist/plugins/installers/base.d.ts +27 -0
- package/dist/plugins/installers/base.d.ts.map +1 -0
- package/dist/plugins/installers/base.js +30 -0
- package/dist/plugins/installers/base.js.map +1 -0
- package/dist/plugins/installers/github.d.ts +22 -0
- package/dist/plugins/installers/github.d.ts.map +1 -0
- package/dist/plugins/installers/github.js +133 -0
- package/dist/plugins/installers/github.js.map +1 -0
- package/dist/plugins/installers/local.d.ts +16 -0
- package/dist/plugins/installers/local.d.ts.map +1 -0
- package/dist/plugins/installers/local.js +69 -0
- package/dist/plugins/installers/local.js.map +1 -0
- package/dist/plugins/installers/npm.d.ts +20 -0
- package/dist/plugins/installers/npm.d.ts.map +1 -0
- package/dist/plugins/installers/npm.js +99 -0
- package/dist/plugins/installers/npm.js.map +1 -0
- package/dist/plugins/manager.d.ts +77 -0
- package/dist/plugins/manager.d.ts.map +1 -0
- package/dist/plugins/manager.js +349 -0
- package/dist/plugins/manager.js.map +1 -0
- package/dist/plugins/registry.d.ts +48 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +111 -0
- package/dist/plugins/registry.js.map +1 -0
- package/dist/plugins/types.d.ts +66 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +2 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/plugins/validator.d.ts +19 -0
- package/dist/plugins/validator.d.ts.map +1 -0
- package/dist/plugins/validator.js +164 -0
- package/dist/plugins/validator.js.map +1 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +48 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/project.d.ts +24 -0
- package/dist/utils/project.d.ts.map +1 -0
- package/dist/utils/project.js +61 -0
- package/dist/utils/project.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +21 -0
- package/dist/version.js.map +1 -0
- package/package.json +76 -0
- package/plugins/authentic-voice/README.md +31 -0
- package/plugins/authentic-voice/commands/authentic-voice.md +73 -0
- package/plugins/authentic-voice/commands/authenticity-audit.md +37 -0
- package/plugins/authentic-voice/config.yaml +30 -0
- package/plugins/authentic-voice/experts/authentic-editor.md +27 -0
- package/plugins/export/README.md +319 -0
- package/plugins/export/commands/export.md +460 -0
- package/plugins/export/commands/generate-cover.md +256 -0
- package/plugins/export/commands/metadata.md +309 -0
- package/plugins/export/config.yaml +47 -0
- package/plugins/export/experts/publishing-expert.md +171 -0
- package/plugins/export/templates/epub/chapter-template.html +13 -0
- package/plugins/export/templates/epub/cover-template.html +14 -0
- package/plugins/export/templates/epub/stylesheet.css +200 -0
- package/plugins/export/templates/pdf/ebook-style.css +137 -0
- package/plugins/export/templates/pdf/print-style.css +179 -0
- package/plugins/export/templates/platforms/jinjiang-format.md +101 -0
- package/plugins/export/templates/platforms/qidian-format.md +108 -0
- package/plugins/export/templates/platforms/tomato-format.md +95 -0
- package/plugins/translate/README.md +265 -0
- package/plugins/translate/commands/glossary.md +731 -0
- package/plugins/translate/commands/translate-preview.md +543 -0
- package/plugins/translate/commands/translate.md +649 -0
- package/plugins/translate/config.yaml +43 -0
- package/plugins/translate/experts/literary-translator.md +605 -0
- package/templates/commands/analyze.md +1485 -0
- package/templates/commands/checklist.md +434 -0
- package/templates/commands/clarify.md +257 -0
- package/templates/commands/constitution.md +257 -0
- package/templates/commands/expert.md +136 -0
- package/templates/commands/plan.md +749 -0
- package/templates/commands/recap.md +613 -0
- package/templates/commands/relations.md +96 -0
- package/templates/commands/revise.md +341 -0
- package/templates/commands/specify.md +682 -0
- package/templates/commands/tasks.md +142 -0
- package/templates/commands/timeline.md +73 -0
- package/templates/commands/track-init.md +137 -0
- package/templates/commands/track.md +463 -0
- package/templates/commands/write.md +1264 -0
- package/templates/config/keyword-mappings.json +106 -0
- package/templates/knowledge/audit-config.json +26 -0
- package/templates/knowledge/character-profiles.md +152 -0
- package/templates/knowledge/character-voices.md +137 -0
- package/templates/knowledge/locations.md +184 -0
- package/templates/knowledge/world-setting.md +121 -0
- package/templates/knowledge-base/README.md +285 -0
- package/templates/knowledge-base/character-archetypes/01-hero.md +233 -0
- package/templates/knowledge-base/character-archetypes/02-mentor.md +177 -0
- package/templates/knowledge-base/character-archetypes/03-shadow.md +221 -0
- package/templates/knowledge-base/character-archetypes/04-ally.md +178 -0
- package/templates/knowledge-base/character-archetypes/05-shapeshifter.md +177 -0
- package/templates/knowledge-base/character-archetypes/06-trickster.md +181 -0
- package/templates/knowledge-base/character-archetypes/07-threshold-guardian.md +177 -0
- package/templates/knowledge-base/character-archetypes/08-herald.md +180 -0
- package/templates/knowledge-base/character-archetypes/09-father.md +249 -0
- package/templates/knowledge-base/character-archetypes/10-mother.md +202 -0
- package/templates/knowledge-base/character-archetypes/11-child.md +183 -0
- package/templates/knowledge-base/character-archetypes/12-sage.md +202 -0
- package/templates/knowledge-base/character-archetypes/README.md +60 -0
- package/templates/knowledge-base/character-archetypes/application-guide.md +222 -0
- package/templates/knowledge-base/character-archetypes/archetype-combinations.md +242 -0
- package/templates/knowledge-base/character-archetypes/config.yaml +28 -0
- package/templates/knowledge-base/character-archetypes/examples-analysis.md +223 -0
- package/templates/knowledge-base/craft/character-arc.md +1153 -0
- package/templates/knowledge-base/craft/dialogue.md +1170 -0
- package/templates/knowledge-base/craft/pacing.md +1200 -0
- package/templates/knowledge-base/craft/scene-structure.md +1136 -0
- package/templates/knowledge-base/craft/show-not-tell.md +1012 -0
- package/templates/knowledge-base/emotional-beats/01-first-meeting.md +145 -0
- package/templates/knowledge-base/emotional-beats/02-bonding-moment.md +226 -0
- package/templates/knowledge-base/emotional-beats/03-declaration.md +284 -0
- package/templates/knowledge-base/emotional-beats/04-triumph.md +240 -0
- package/templates/knowledge-base/emotional-beats/05-reunion.md +396 -0
- package/templates/knowledge-base/emotional-beats/06-forgiveness.md +204 -0
- package/templates/knowledge-base/emotional-beats/07-betrayal.md +204 -0
- package/templates/knowledge-base/emotional-beats/08-loss.md +214 -0
- package/templates/knowledge-base/emotional-beats/09-rejection.md +254 -0
- package/templates/knowledge-base/emotional-beats/10-failure.md +244 -0
- package/templates/knowledge-base/emotional-beats/11-misunderstanding.md +205 -0
- package/templates/knowledge-base/emotional-beats/12-farewell.md +283 -0
- package/templates/knowledge-base/emotional-beats/13-revelation.md +242 -0
- package/templates/knowledge-base/emotional-beats/14-point-of-no-return.md +215 -0
- package/templates/knowledge-base/emotional-beats/15-dark-night.md +244 -0
- package/templates/knowledge-base/emotional-beats/16-sacrifice.md +246 -0
- package/templates/knowledge-base/emotional-beats/17-awakening.md +246 -0
- package/templates/knowledge-base/emotional-beats/18-confrontation.md +217 -0
- package/templates/knowledge-base/emotional-beats/19-bittersweet-goodbye.md +368 -0
- package/templates/knowledge-base/emotional-beats/20-moral-dilemma.md +248 -0
- package/templates/knowledge-base/emotional-beats/21-temptation.md +240 -0
- package/templates/knowledge-base/emotional-beats/22-redemption.md +210 -0
- package/templates/knowledge-base/emotional-beats/README.md +104 -0
- package/templates/knowledge-base/emotional-beats/beat-sequences.md +276 -0
- package/templates/knowledge-base/emotional-beats/config.yaml +30 -0
- package/templates/knowledge-base/emotional-beats/pacing-guide.md +390 -0
- package/templates/knowledge-base/genres/historical.md +1127 -0
- package/templates/knowledge-base/genres/mystery.md +1123 -0
- package/templates/knowledge-base/genres/revenge.md +846 -0
- package/templates/knowledge-base/genres/romance.md +948 -0
- package/templates/knowledge-base/genres/sci-fi.md +156 -0
- package/templates/knowledge-base/genres/thriller.md +166 -0
- package/templates/knowledge-base/genres/wuxia.md +143 -0
- package/templates/knowledge-base/references/README.md +96 -0
- package/templates/knowledge-base/references/china-1920s/culture.md +423 -0
- package/templates/knowledge-base/references/china-1920s/daily-life.md +616 -0
- package/templates/knowledge-base/references/china-1920s/overview.md +298 -0
- package/templates/knowledge-base/references/china-1920s/society.md +703 -0
- package/templates/knowledge-base/references/china-1920s/warlords.md +427 -0
- package/templates/knowledge-base/references/cultivation-world/daily-life.md +108 -0
- package/templates/knowledge-base/references/cultivation-world/overview.md +64 -0
- package/templates/knowledge-base/references/cultivation-world/power-system.md +108 -0
- package/templates/knowledge-base/references/cultivation-world/sects.md +104 -0
- package/templates/knowledge-base/references/cultivation-world/world-setting.md +108 -0
- package/templates/knowledge-base/references/modern-workplace/corporate.md +115 -0
- package/templates/knowledge-base/references/modern-workplace/daily-life.md +129 -0
- package/templates/knowledge-base/references/modern-workplace/overview.md +73 -0
- package/templates/knowledge-base/references/modern-workplace/relationships.md +107 -0
- package/templates/knowledge-base/references/modern-workplace/tech-industry.md +131 -0
- package/templates/knowledge-base/references/tang-dynasty/culture.md +135 -0
- package/templates/knowledge-base/references/tang-dynasty/daily-life.md +139 -0
- package/templates/knowledge-base/references/tang-dynasty/overview.md +76 -0
- package/templates/knowledge-base/references/tang-dynasty/politics.md +121 -0
- package/templates/knowledge-base/references/tang-dynasty/society.md +126 -0
- package/templates/knowledge-base/requirements/README.md +240 -0
- package/templates/knowledge-base/requirements/anti-ai-v3.md +46 -0
- package/templates/knowledge-base/requirements/anti-ai-v4.md +430 -0
- package/templates/knowledge-base/requirements/fast-paced.md +552 -0
- package/templates/knowledge-base/requirements/no-poison.md +60 -0
- package/templates/knowledge-base/requirements/romance-angst.md +102 -0
- package/templates/knowledge-base/requirements/romance-sweet.md +63 -0
- package/templates/knowledge-base/requirements/serious-literature.md +45 -0
- package/templates/knowledge-base/requirements/strong-emotion.md +60 -0
- package/templates/knowledge-base/styles/README.md +302 -0
- package/templates/knowledge-base/styles/ancient-style.md +579 -0
- package/templates/knowledge-base/styles/literary.md +439 -0
- package/templates/knowledge-base/styles/minimal.md +472 -0
- package/templates/knowledge-base/styles/natural-voice.md +930 -0
- package/templates/knowledge-base/styles/web-novel.md +525 -0
- package/templates/memory/constitution.md +140 -0
- package/templates/memory/personal-voice.md +113 -0
- package/templates/scripts/README.md +187 -0
- package/templates/scripts/bash/analyze-story.sh +170 -0
- package/templates/scripts/bash/check-consistency.sh +463 -0
- package/templates/scripts/bash/check-plot.sh +374 -0
- package/templates/scripts/bash/check-timeline.sh +346 -0
- package/templates/scripts/bash/check-world.sh +395 -0
- package/templates/scripts/bash/check-writing-state.sh +854 -0
- package/templates/scripts/bash/clarify-story.sh +117 -0
- package/templates/scripts/bash/common.sh +151 -0
- package/templates/scripts/bash/constitution.sh +114 -0
- package/templates/scripts/bash/generate-tasks.sh +65 -0
- package/templates/scripts/bash/init-tracking.sh +183 -0
- package/templates/scripts/bash/manage-relations.sh +174 -0
- package/templates/scripts/bash/plan-story.sh +100 -0
- package/templates/scripts/bash/specify-story.sh +93 -0
- package/templates/scripts/bash/tasks-story.sh +96 -0
- package/templates/scripts/bash/test-word-count.sh +182 -0
- package/templates/scripts/bash/tests/bench-preload-cache.sh +100 -0
- package/templates/scripts/bash/tests/run-all-benchmarks.sh +16 -0
- package/templates/scripts/bash/tests/test-cache-semantics.sh +199 -0
- package/templates/scripts/bash/tests/test-cross-platform.sh +35 -0
- package/templates/scripts/bash/tests/test-edge-cases-bash.sh +60 -0
- package/templates/scripts/bash/tests/test-phase1-bash.sh +28 -0
- package/templates/scripts/bash/tests/test-preload-cache.sh +123 -0
- package/templates/scripts/bash/tests/test-regex-precompile.sh +89 -0
- package/templates/scripts/bash/tests/test-regression-bash.sh +42 -0
- package/templates/scripts/bash/tests/test-task6-verification.sh +200 -0
- package/templates/scripts/bash/text-audit.sh +144 -0
- package/templates/scripts/bash/track-progress.sh +194 -0
- package/templates/scripts/powershell/analyze-story.ps1 +171 -0
- package/templates/scripts/powershell/check-analyze-stage.ps1 +110 -0
- package/templates/scripts/powershell/check-consistency.ps1 +138 -0
- package/templates/scripts/powershell/check-plot.ps1 +139 -0
- package/templates/scripts/powershell/check-timeline.ps1 +112 -0
- package/templates/scripts/powershell/check-writing-state.ps1 +490 -0
- package/templates/scripts/powershell/check-writing-state.ps1.backup +135 -0
- package/templates/scripts/powershell/clarify-story.ps1 +107 -0
- package/templates/scripts/powershell/common.ps1 +36 -0
- package/templates/scripts/powershell/constitution.ps1 +142 -0
- package/templates/scripts/powershell/generate-tasks.ps1 +75 -0
- package/templates/scripts/powershell/init-tracking.ps1 +98 -0
- package/templates/scripts/powershell/manage-relations.ps1 +134 -0
- package/templates/scripts/powershell/plan-story.ps1 +96 -0
- package/templates/scripts/powershell/specify-story.ps1 +82 -0
- package/templates/scripts/powershell/tests/bench-ps-cache.ps1 +80 -0
- package/templates/scripts/powershell/tests/test-cross-platform.ps1 +27 -0
- package/templates/scripts/powershell/tests/test-edge-cases-ps.ps1 +29 -0
- package/templates/scripts/powershell/tests/test-phase1-ps.ps1 +28 -0
- package/templates/scripts/powershell/tests/test-ps-cache.ps1 +73 -0
- package/templates/scripts/powershell/tests/test-regression-ps.ps1 +40 -0
- package/templates/scripts/powershell/text-audit.ps1 +100 -0
- package/templates/scripts/powershell/track-progress.ps1 +105 -0
- package/templates/skills/genre-knowledge/fantasy/SKILL.md +355 -0
- package/templates/skills/genre-knowledge/mystery/SKILL.md +337 -0
- package/templates/skills/genre-knowledge/romance/SKILL.md +228 -0
- package/templates/skills/genre-knowledge/sci-fi/SKILL.md +65 -0
- package/templates/skills/genre-knowledge/thriller/SKILL.md +95 -0
- package/templates/skills/quality-assurance/consistency-checker/SKILL.md +341 -0
- package/templates/skills/quality-assurance/continuity-tracker/SKILL.md +157 -0
- package/templates/skills/quality-assurance/forgotten-elements/SKILL.md +147 -0
- package/templates/skills/quality-assurance/getting-started/SKILL.md +224 -0
- package/templates/skills/quality-assurance/pacing-monitor/SKILL.md +143 -0
- package/templates/skills/quality-assurance/pov-validator/SKILL.md +135 -0
- package/templates/skills/quality-assurance/pre-write-checklist/SKILL.md +583 -0
- package/templates/skills/quality-assurance/requirement-detector/CONFLICT_RESOLUTION.md +119 -0
- package/templates/skills/quality-assurance/requirement-detector/EXAMPLES.md +146 -0
- package/templates/skills/quality-assurance/requirement-detector/KEYWORDS.md +160 -0
- package/templates/skills/quality-assurance/requirement-detector/SKILL.md +149 -0
- package/templates/skills/quality-assurance/setting-detector/SKILL.md +611 -0
- package/templates/skills/quality-assurance/style-detector/CONFLICT_RESOLUTION.md +126 -0
- package/templates/skills/quality-assurance/style-detector/EXAMPLES.md +206 -0
- package/templates/skills/quality-assurance/style-detector/KEYWORDS.md +207 -0
- package/templates/skills/quality-assurance/style-detector/SKILL.md +126 -0
- package/templates/skills/quality-assurance/workflow-guide/SKILL.md +381 -0
- package/templates/skills/writing-techniques/character-arc/SKILL.md +267 -0
- package/templates/skills/writing-techniques/dialogue-techniques/SKILL.md +366 -0
- package/templates/skills/writing-techniques/multi-thread-narrative/SKILL.md +553 -0
- package/templates/skills/writing-techniques/multi-thread-narrative/experts/thread-analyst.md +226 -0
- package/templates/skills/writing-techniques/pacing-control/SKILL.md +377 -0
- package/templates/skills/writing-techniques/reader-expectation/SKILL.md +578 -0
- package/templates/skills/writing-techniques/reader-expectation/experts/expectation-analyst.md +209 -0
- package/templates/skills/writing-techniques/revision-polish/SKILL.md +496 -0
- package/templates/skills/writing-techniques/revision-polish/experts/revision-editor.md +221 -0
- package/templates/skills/writing-techniques/scene-structure/SKILL.md +361 -0
- package/templates/skills/writing-techniques/style-learning/SKILL.md +436 -0
- package/templates/specification-example.md +146 -0
- package/templates/tracking/character-state.json +78 -0
- package/templates/tracking/plot-tracker.json +62 -0
- package/templates/tracking/relationships.json +70 -0
- package/templates/tracking/timeline.json +49 -0
- package/templates/tracking/tracking-log.md +110 -0
- package/templates/tracking/validation-rules.json +128 -0
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 翻译预览 - /translate-preview
|
|
3
|
+
description: 预览翻译效果,试译前 500 字,对比多种翻译风格
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 翻译预览
|
|
7
|
+
|
|
8
|
+
## 使用方法
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
/translate-preview [选项] [文件]
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### 基本用法
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
/translate-preview --to en # 预览当前章节
|
|
18
|
+
/translate-preview --to en chapter-01.md # 预览指定章节
|
|
19
|
+
/translate-preview --to en --compare-styles # 对比三种风格
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 选项
|
|
23
|
+
|
|
24
|
+
| 选项 | 说明 | 默认值 |
|
|
25
|
+
|------|------|--------|
|
|
26
|
+
| `--to <语言>` | 目标语言(必需) | - |
|
|
27
|
+
| `--from <语言>` | 源语言 | 自动检测 |
|
|
28
|
+
| `--compare-styles` | 对比三种翻译风格 | false |
|
|
29
|
+
| `--length <字数>` | 预览长度 | 500 |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 功能详解
|
|
34
|
+
|
|
35
|
+
### 1. 快速试译
|
|
36
|
+
|
|
37
|
+
取当前章节前 500 字试译,让用户确认风格满意度。
|
|
38
|
+
|
|
39
|
+
**示例:**
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
原文(前 500 字):
|
|
43
|
+
李明站在青云宗的山门前,心中百感交集。三年前,他还是一个普通的外门弟子,
|
|
44
|
+
每天做着最苦最累的杂活。如今,他已经是内门弟子,甚至得到了掌门的青睐。
|
|
45
|
+
|
|
46
|
+
他的心如刀绞,眼看着师父倒在血泊中。"师父!"他冲上前去,却被一股无形
|
|
47
|
+
的力量震飞。那人冷笑一声:"就凭你,也想救他?"
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
译文(Literary 风格):
|
|
52
|
+
Li Ming stood before the mountain gate of Azure Cloud Sect, his heart a
|
|
53
|
+
tumult of emotions. Three years ago, he had been nothing more than an
|
|
54
|
+
ordinary outer disciple, toiling day after day at the most menial tasks.
|
|
55
|
+
Now, he was an inner disciple, even earning the favor of the Sect Master.
|
|
56
|
+
|
|
57
|
+
His heart wrenched with agony as he watched his master collapse into a
|
|
58
|
+
pool of blood. "Master!" He rushed forward, only to be thrown back by an
|
|
59
|
+
invisible force. The man sneered coldly, "You think you can save him?"
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
✅ 术语应用:
|
|
64
|
+
- 李明 → Li Ming
|
|
65
|
+
- 青云宗 → Azure Cloud Sect
|
|
66
|
+
- 师父 → Master
|
|
67
|
+
|
|
68
|
+
📊 翻译统计:
|
|
69
|
+
- 原文:500 字
|
|
70
|
+
- 译文:412 词(-17.6%)
|
|
71
|
+
- 段落数:2 → 2(一致)
|
|
72
|
+
|
|
73
|
+
💡 建议:
|
|
74
|
+
- 翻译风格适合严肃文学
|
|
75
|
+
- 术语应用正确
|
|
76
|
+
- 可以开始正式翻译
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
### 2. 风格对比
|
|
82
|
+
|
|
83
|
+
同时展示三种翻译风格,帮助用户选择最适合的。
|
|
84
|
+
|
|
85
|
+
**示例:**
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
原文:
|
|
89
|
+
他的心如刀绞,眼看着师父倒在血泊中。
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
【Literary 风格】(文学性翻译)
|
|
94
|
+
His heart wrenched with agony as he watched his master collapse into a
|
|
95
|
+
pool of blood.
|
|
96
|
+
|
|
97
|
+
特点:
|
|
98
|
+
✓ 保持意境和情感
|
|
99
|
+
✓ 使用文学化表达(wrenched with agony)
|
|
100
|
+
✓ 适合严肃文学、文青向网文
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
【Casual 风格】(口语化翻译)
|
|
105
|
+
His heart ached like crazy, seeing his master fall in a pool of blood.
|
|
106
|
+
|
|
107
|
+
特点:
|
|
108
|
+
✓ 通俗易懂
|
|
109
|
+
✓ 使用口语化表达(ached like crazy)
|
|
110
|
+
✓ 适合爽文、轻小说
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
【Formal 风格】(正式翻译)
|
|
115
|
+
His heart was seized by profound anguish as he observed his master fall
|
|
116
|
+
into a pool of blood.
|
|
117
|
+
|
|
118
|
+
特点:
|
|
119
|
+
✓ 庄重典雅
|
|
120
|
+
✓ 使用正式表达(seized by profound anguish)
|
|
121
|
+
✓ 适合历史、武侠
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
推荐:Literary(最接近原文意境)
|
|
126
|
+
|
|
127
|
+
选择风格后,使用:
|
|
128
|
+
/translate --to en --style literary chapter-01.md
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
### 3. 术语预览
|
|
134
|
+
|
|
135
|
+
展示术语表在翻译中的应用效果。
|
|
136
|
+
|
|
137
|
+
**示例:**
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
原文中检测到的术语:
|
|
141
|
+
|
|
142
|
+
✅ 已定义(5 个):
|
|
143
|
+
- 李明 → Li Ming
|
|
144
|
+
- 青云宗 → Azure Cloud Sect
|
|
145
|
+
- 师父 → Master
|
|
146
|
+
- 内门弟子 → inner disciple
|
|
147
|
+
- 外门弟子 → outer disciple
|
|
148
|
+
|
|
149
|
+
⚠️ 未定义(3 个):
|
|
150
|
+
- 灵气(出现 2 次)
|
|
151
|
+
建议:/glossary add "概念:灵气|spiritual energy|霊気"
|
|
152
|
+
|
|
153
|
+
- 筑基期(出现 1 次)
|
|
154
|
+
建议:/glossary add "概念:筑基期|Foundation Establishment|築基期"
|
|
155
|
+
|
|
156
|
+
- 天灵根(出现 1 次)
|
|
157
|
+
建议:/glossary add "概念:天灵根|Heavenly Spirit Root|天霊根"
|
|
158
|
+
|
|
159
|
+
💡 建议:
|
|
160
|
+
先添加未定义术语,再进行正式翻译,确保术语一致性 100%
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 执行流程
|
|
166
|
+
|
|
167
|
+
### 当用户调用 /translate-preview 时
|
|
168
|
+
|
|
169
|
+
**Step 1: 验证参数**
|
|
170
|
+
```
|
|
171
|
+
检查 --to 参数是否提供(必需)
|
|
172
|
+
验证语言代码是否支持(zh/en/ja)
|
|
173
|
+
确定预览长度(默认 500 字)
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Step 2: 读取源文件**
|
|
177
|
+
```
|
|
178
|
+
如果指定文件 → 读取该文件
|
|
179
|
+
如果未指定 → 读取当前章节
|
|
180
|
+
提取前 N 字(默认 500)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Step 3: 加载术语表**
|
|
184
|
+
```
|
|
185
|
+
读取 .specify/translation/glossary.json
|
|
186
|
+
如果不存在 → 警告:"术语表未初始化,建议先运行 /glossary init"
|
|
187
|
+
扫描预览文本,标记术语
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Step 4: 执行翻译**
|
|
191
|
+
|
|
192
|
+
如果 `--compare-styles` 为 true:
|
|
193
|
+
```
|
|
194
|
+
并行翻译三种风格:
|
|
195
|
+
1. Literary 风格
|
|
196
|
+
2. Casual 风格
|
|
197
|
+
3. Formal 风格
|
|
198
|
+
|
|
199
|
+
对每种风格:
|
|
200
|
+
- 使用相同的术语表
|
|
201
|
+
- 应用不同的翻译策略
|
|
202
|
+
- 生成翻译结果
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
如果 `--compare-styles` 为 false:
|
|
206
|
+
```
|
|
207
|
+
使用默认 literary 风格翻译
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Step 5: 分析结果**
|
|
211
|
+
```
|
|
212
|
+
统计:
|
|
213
|
+
- 原文字数
|
|
214
|
+
- 译文词数
|
|
215
|
+
- 长度变化百分比
|
|
216
|
+
- 段落数对应
|
|
217
|
+
|
|
218
|
+
术语检查:
|
|
219
|
+
- 已定义术语列表
|
|
220
|
+
- 未定义术语列表
|
|
221
|
+
- 术语应用情况
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Step 6: 展示结果**
|
|
225
|
+
```
|
|
226
|
+
显示:
|
|
227
|
+
- 原文
|
|
228
|
+
- 译文(单个或三种风格对比)
|
|
229
|
+
- 术语应用情况
|
|
230
|
+
- 翻译统计
|
|
231
|
+
- 建议和下一步操作
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 翻译提示词
|
|
237
|
+
|
|
238
|
+
### Literary 风格
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
你是专业的文学翻译专家,精通{source_lang}到{target_lang}的文学翻译。
|
|
242
|
+
|
|
243
|
+
任务:将以下文本从{source_lang}翻译为{target_lang},使用文学性翻译风格。
|
|
244
|
+
|
|
245
|
+
翻译要求:
|
|
246
|
+
1. 保持原文的意境和情感
|
|
247
|
+
2. 使用文学化的表达方式
|
|
248
|
+
3. 保持叙述节奏和风格
|
|
249
|
+
4. 严格使用术语表中的译名
|
|
250
|
+
5. 适合严肃文学和文青向网文
|
|
251
|
+
|
|
252
|
+
术语表:
|
|
253
|
+
{glossary_list}
|
|
254
|
+
|
|
255
|
+
待翻译文本:
|
|
256
|
+
{text}
|
|
257
|
+
|
|
258
|
+
请提供文学性翻译。
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Casual 风格
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
你是专业的文学翻译专家,精通{source_lang}到{target_lang}的翻译。
|
|
265
|
+
|
|
266
|
+
任务:将以下文本从{source_lang}翻译为{target_lang},使用口语化翻译风格。
|
|
267
|
+
|
|
268
|
+
翻译要求:
|
|
269
|
+
1. 通俗易懂,贴近日常口语
|
|
270
|
+
2. 使用简单直接的表达
|
|
271
|
+
3. 保持轻松的阅读感
|
|
272
|
+
4. 严格使用术语表中的译名
|
|
273
|
+
5. 适合爽文和轻小说
|
|
274
|
+
|
|
275
|
+
术语表:
|
|
276
|
+
{glossary_list}
|
|
277
|
+
|
|
278
|
+
待翻译文本:
|
|
279
|
+
{text}
|
|
280
|
+
|
|
281
|
+
请提供口语化翻译。
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Formal 风格
|
|
285
|
+
|
|
286
|
+
```
|
|
287
|
+
你是专业的文学翻译专家,精通{source_lang}到{target_lang}的翻译。
|
|
288
|
+
|
|
289
|
+
任务:将以下文本从{source_lang}翻译为{target_lang},使用正式翻译风格。
|
|
290
|
+
|
|
291
|
+
翻译要求:
|
|
292
|
+
1. 庄重典雅,用词考究
|
|
293
|
+
2. 使用正式的书面表达
|
|
294
|
+
3. 保持文本的严肃性
|
|
295
|
+
4. 严格使用术语表中的译名
|
|
296
|
+
5. 适合历史小说和武侠
|
|
297
|
+
|
|
298
|
+
术语表:
|
|
299
|
+
{glossary_list}
|
|
300
|
+
|
|
301
|
+
待翻译文本:
|
|
302
|
+
{text}
|
|
303
|
+
|
|
304
|
+
请提供正式翻译。
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## 示例对话
|
|
310
|
+
|
|
311
|
+
### 示例 1:基本预览
|
|
312
|
+
|
|
313
|
+
```
|
|
314
|
+
用户:/translate-preview --to en
|
|
315
|
+
|
|
316
|
+
助手:
|
|
317
|
+
正在预览翻译效果...
|
|
318
|
+
|
|
319
|
+
原文(前 500 字):
|
|
320
|
+
李明站在青云宗的山门前,心中百感交集。三年前,他还是一个普通的
|
|
321
|
+
外门弟子,每天做着最苦最累的杂活...
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
译文(Literary 风格):
|
|
326
|
+
Li Ming stood before the mountain gate of Azure Cloud Sect, his heart
|
|
327
|
+
a tumult of emotions. Three years ago, he had been nothing more than
|
|
328
|
+
an ordinary outer disciple...
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
✅ 术语应用:3/3(100%)
|
|
333
|
+
- 李明 → Li Ming
|
|
334
|
+
- 青云宗 → Azure Cloud Sect
|
|
335
|
+
- 外门弟子 → outer disciple
|
|
336
|
+
|
|
337
|
+
📊 翻译统计:
|
|
338
|
+
- 原文:500 字
|
|
339
|
+
- 译文:412 词(-17.6%)
|
|
340
|
+
- 段落数:2 → 2(一致)
|
|
341
|
+
|
|
342
|
+
💡 建议:
|
|
343
|
+
翻译风格适合当前文本,可以开始正式翻译。
|
|
344
|
+
|
|
345
|
+
下一步:
|
|
346
|
+
/translate --to en chapter-01.md
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### 示例 2:风格对比
|
|
350
|
+
|
|
351
|
+
```
|
|
352
|
+
用户:/translate-preview --to en --compare-styles
|
|
353
|
+
|
|
354
|
+
助手:
|
|
355
|
+
正在对比三种翻译风格...
|
|
356
|
+
|
|
357
|
+
原文:
|
|
358
|
+
他的心如刀绞,眼看着师父倒在血泊中。
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
【Literary 风格】
|
|
363
|
+
His heart wrenched with agony as he watched his master collapse into
|
|
364
|
+
a pool of blood.
|
|
365
|
+
|
|
366
|
+
【Casual 风格】
|
|
367
|
+
His heart ached like crazy, seeing his master fall in a pool of blood.
|
|
368
|
+
|
|
369
|
+
【Formal 风格】
|
|
370
|
+
His heart was seized by profound anguish as he observed his master fall
|
|
371
|
+
into a pool of blood.
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
风格对比:
|
|
376
|
+
|
|
377
|
+
| 维度 | Literary | Casual | Formal |
|
|
378
|
+
|------|----------|--------|--------|
|
|
379
|
+
| 文学性 | ★★★★★ | ★★☆☆☆ | ★★★★☆ |
|
|
380
|
+
| 易读性 | ★★★★☆ | ★★★★★ | ★★★☆☆ |
|
|
381
|
+
| 正式度 | ★★★★☆ | ★★☆☆☆ | ★★★★★ |
|
|
382
|
+
|
|
383
|
+
推荐:Literary(最接近原文意境)
|
|
384
|
+
|
|
385
|
+
选择风格后使用:
|
|
386
|
+
/translate --to en --style literary chapter-01.md
|
|
387
|
+
/translate --to en --style casual chapter-01.md
|
|
388
|
+
/translate --to en --style formal chapter-01.md
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### 示例 3:术语未定义警告
|
|
392
|
+
|
|
393
|
+
```
|
|
394
|
+
用户:/translate-preview --to en
|
|
395
|
+
|
|
396
|
+
助手:
|
|
397
|
+
⚠️ 警告:术语表未初始化
|
|
398
|
+
|
|
399
|
+
建议先初始化术语表:
|
|
400
|
+
/glossary init
|
|
401
|
+
|
|
402
|
+
然后添加主要术语:
|
|
403
|
+
/glossary add "角色:李明|Li Ming"
|
|
404
|
+
/glossary add "地名:青云宗|Azure Cloud Sect"
|
|
405
|
+
|
|
406
|
+
是否继续预览(不使用术语表)?(y/n)
|
|
407
|
+
|
|
408
|
+
用户:y
|
|
409
|
+
|
|
410
|
+
助手:
|
|
411
|
+
正在预览翻译效果(未使用术语表)...
|
|
412
|
+
|
|
413
|
+
原文(前 500 字):
|
|
414
|
+
李明站在青云宗的山门前...
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
译文(Literary 风格):
|
|
419
|
+
Li Ming stood before the mountain gate of Qingyun Sect...
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
⚠️ 注意:
|
|
424
|
+
未使用术语表,译名可能不一致。
|
|
425
|
+
例如:"青云宗" 被翻译为 "Qingyun Sect",
|
|
426
|
+
但您可能希望使用 "Azure Cloud Sect"。
|
|
427
|
+
|
|
428
|
+
强烈建议:
|
|
429
|
+
1. 初始化术语表
|
|
430
|
+
2. 添加核心术语
|
|
431
|
+
3. 重新预览
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## 最佳实践
|
|
437
|
+
|
|
438
|
+
### 1. 预览时机
|
|
439
|
+
|
|
440
|
+
**推荐:** 在正式翻译前预览
|
|
441
|
+
|
|
442
|
+
```bash
|
|
443
|
+
# 第一次翻译前
|
|
444
|
+
/translate-preview --to en --compare-styles
|
|
445
|
+
|
|
446
|
+
# 选择风格后
|
|
447
|
+
/translate --to en --style literary --all
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
### 2. 预览长度
|
|
451
|
+
|
|
452
|
+
- **500 字:** 适合快速预览(默认)
|
|
453
|
+
- **1000 字:** 适合详细评估
|
|
454
|
+
- **2000 字:** 适合完整章节预览
|
|
455
|
+
|
|
456
|
+
```bash
|
|
457
|
+
/translate-preview --to en --length 1000
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
### 3. 风格选择指南
|
|
461
|
+
|
|
462
|
+
| 小说类型 | 推荐风格 | 理由 |
|
|
463
|
+
|---------|---------|------|
|
|
464
|
+
| 严肃文学 | Literary | 保持文学性和意境 |
|
|
465
|
+
| 都市爽文 | Casual | 轻松易读 |
|
|
466
|
+
| 历史武侠 | Formal | 庄重典雅 |
|
|
467
|
+
| 玄幻修仙 | Literary | 保持意境 |
|
|
468
|
+
| 轻小说 | Casual | 口语化 |
|
|
469
|
+
| 科幻 | Literary | 平衡专业性和可读性 |
|
|
470
|
+
|
|
471
|
+
### 4. 迭代优化
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
# 第一次预览
|
|
475
|
+
/translate-preview --to en --compare-styles
|
|
476
|
+
|
|
477
|
+
# 根据反馈调整术语表
|
|
478
|
+
/glossary add "概念:灵气|spiritual energy"
|
|
479
|
+
|
|
480
|
+
# 再次预览
|
|
481
|
+
/translate-preview --to en
|
|
482
|
+
|
|
483
|
+
# 满意后正式翻译
|
|
484
|
+
/translate --to en --all
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
---
|
|
488
|
+
|
|
489
|
+
## 常见问题
|
|
490
|
+
|
|
491
|
+
### Q: 预览和正式翻译有什么区别?
|
|
492
|
+
|
|
493
|
+
A: 预览只翻译前 500 字,用于快速评估风格。正式翻译会翻译完整章节,并生成翻译报告。
|
|
494
|
+
|
|
495
|
+
### Q: 可以预览多个章节吗?
|
|
496
|
+
|
|
497
|
+
A: 预览命令只支持单个章节。如果想评估多章节效果,建议先翻译 1-2 章,然后检查质量。
|
|
498
|
+
|
|
499
|
+
### Q: 风格对比需要多长时间?
|
|
500
|
+
|
|
501
|
+
A: 约 30-60 秒(需要翻译三次)。
|
|
502
|
+
|
|
503
|
+
### Q: 预览结果会保存吗?
|
|
504
|
+
|
|
505
|
+
A: 不会。预览仅用于评估,不会保存翻译结果。
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
## 技术实现细节
|
|
510
|
+
|
|
511
|
+
### 并行翻译
|
|
512
|
+
|
|
513
|
+
```
|
|
514
|
+
对比风格时,三种风格并行翻译:
|
|
515
|
+
|
|
516
|
+
Promise.all([
|
|
517
|
+
translateWithStyle(text, 'literary'),
|
|
518
|
+
translateWithStyle(text, 'casual'),
|
|
519
|
+
translateWithStyle(text, 'formal')
|
|
520
|
+
])
|
|
521
|
+
|
|
522
|
+
总时间 ≈ 单次翻译时间
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
### 缓存优化
|
|
526
|
+
|
|
527
|
+
```
|
|
528
|
+
术语表缓存:
|
|
529
|
+
- 首次读取后缓存
|
|
530
|
+
- 避免重复读取
|
|
531
|
+
|
|
532
|
+
翻译结果缓存:
|
|
533
|
+
- 相同文本 + 相同风格 = 使用缓存
|
|
534
|
+
- 缓存有效期:15 分钟
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
---
|
|
538
|
+
|
|
539
|
+
## 相关命令
|
|
540
|
+
|
|
541
|
+
- `/translate` - 正式翻译
|
|
542
|
+
- `/glossary` - 管理术语表
|
|
543
|
+
- `/analyze` - 分析翻译质量
|