项目通用翻译和术语指南
- 作者仓库星标 17,110
- 作者仓库 ZLMediaKit
- 领域
- 文档
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @ZLMediaKit · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
在翻译任何文本块之前,您必须明确地将自己定位到特定的技术领域。严禁直译中国行业俚语(黑话)。识别域:查看模块或配置部分(例如,`[rtp_proxy]`、`[http]`、`[general]`、`[hls]`)。设置心理词典:如果`[api]/[http]`:锚定标准 REST API 和 Web 服务器概念(例如,`Requests/Responses`、`CORS`、`Forwarded IPs`)。
法学硕士自然倾向于遵循源文本的语法结构。中文技术写作经常使用散乱的句子和解释性填充物。你必须积极打破这些模式。
重要:翻译时,如果您遇到这些中文概念,您必须使用准确的、首先提供的英文术语。不要混合或交替同义词。
在翻译代码文件(`.cpp`、`.h`)或配置(`.ini`)内的注释时,请应用以下硬约束: 双语保留:除非明确指示删除中文,否则始终保留原始中文注释。底部放置:将英文翻译放置在中文行或块的正下方。块均匀性:不要逐行翻译 (`ZH-EN-ZH-EN`)。如果中文注释是 3 行块,则将其输出为 3 行中文块,后跟 3 行英文块。
如果您被要求审阅或更新长文件中的翻译,您不能仅仅依靠被动阅读。您必须执行此工作流程: 主动扫描(正则表达式/搜索):在阅读文档之前,使用文件搜索工具主动扫描当前英文文本中的已知反模式(例如,搜索`Screen tearing`、`Merged write`、`Replies`、`Source station`)。立即修复它们。格式检查:扫描`ZH-EN-ZH-EN`交错并将其修复为块格式。
# 🤖 Systemic Translation & Terminology Instructions for AI Agents
This document is the absolute source of truth and **Standard Operating Procedure (SOP)** for translating Chinese comments, configurations, and documentation into English within this repository.
**ATTENTION AI AGENTS:** You are NOT merely translating words; you are executing a systematic algorithm to localize complex streaming media and networking concepts. Do not rely solely on "passive reading" or "translation memory." You MUST follow the rigid workflow outlined below.
---
## Phase 1: Contextual Anchoring (MANDATORY BEFORE TRANSLATION)
Before translating any block of text, you must explicitly anchor yourself to the specific technical domain. **Literal translation of Chinese industry slang (黑话) is strictly prohibited.**
1. **Identify the Domain:** Look at the module or configuration section (e.g., `[rtp_proxy]`, `[http]`, `[general]`, `[hls]`).
2. **Setup the Mental Lexicon:**
- If `[api]/[http]`: Anchor to standard REST API and Web server concepts (e.g., `Requests/Responses`, `CORS`, `Forwarded IPs`).
- If `Network I/O / [general]`: Anchor to socket programming and OS-level terms (e.g., `Write coalescing`, `Buffers`, `File handles`).
- If `Media Streaming (RTSP/RTMP/RTC)`: Anchor to multimedia transport concepts (e.g., `GOP`, `Payload`, `B-frames`, `Jitter`, `Visual artifacts`).
3. **Verification-Driven Translation:** If you encounter a Chinese term that sounds colloquial or metaphoric (e.g., “花屏” - flowered screen, “秒开” - open in seconds, “溯源” - trace back to origin), **DO NOT guess or translate literally**. Ask yourself: _"How do top-tier English open-source projects (FFmpeg, WebRTC, Nginx) refer to this specific technical phenomenon?"_
---
## Phase 2: Structural Translation & Anti-Pattern Detection
LLMs naturally tend to follow the grammatical structure of the source text. Chinese technical writing often uses sprawling sentences and explanatory fillers. You must actively break these patterns.
### 🚫 Rule 1: The "Action-Result" Paradigm
- **Trigger:** When the Chinese text says "设置为0关闭此特性" (Setting this to 0 disables this feature) or "打开此选项会导致..." (Turning this on causes...).
- **Execution:** Force your output to use the exact structure: `Setting this to [Value] disables [Feature] and allows [Consequence].` Do NOT translate explanatory filler like "This mechanism's logic dictates that...".
### 🚫 Rule 2: Sub-clause Elimination (No "Chinglish")
- **Trigger:** Long noun clusters or overly personified system descriptions (e.g., "服务器会认为这个流是断开的" - The server will think this stream is disconnected).
- **Execution:** Use direct, objective voice: `The stream is considered disconnected.` or `The system drops the stream.`
### 🚫 Rule 3: Clarifying Ambiguous Actions
- **Trigger:** The word `忽略` (Ignore/Skip) vs. `丢弃/放弃` (Abandon/Drop).
- **Execution:** Use `Ignore` or `Skip` for non-critical timeouts (e.g., waiting for a track to be ready). Reserve `Abandon`, `Drop` or `Disconnect` only for fatal errors or closed sockets.
### 🚫 Rule 4: Zero Information Loss & Causal Reconstruction
- **Trigger:** When condensing text for native flow, or translating complex caveats (e.g., parenthetical conditions, "而不是" / instead of, side-effects).
- **Execution:** You may reorganise syntax to sound professional, but you MUST NOT drop crucial qualifiers, modifiers, or side effects. If a Chinese config says "instead of returning X via hook", the English translation must explicitly mention "returning X". Information completeness supersedes structural brevity.
### 🚫 Rule 5: The Golden Balance (Zero Info Loss vs. Native Phrasing)
- **The Core Conflict:** You must achieve **Zero Information Loss** WITHOUT resorting to **Chinglish** or literal word-for-word translation.
- **What "Information" Means:** "Retaining information" means capturing 100% of the **technical causality**, **side-effects**, **prerequisites**, and **system boundaries** present in the Chinese text.
- **What "Information" DOES NOT Mean:** It does NOT mean preserving the Chinese grammatical structure, literal phrasing, or colloquialisms (啰嗦句子和字面用词).
- **Execution (The Top-Down Conceptual Approach):**
1. **Contextual Override:** Never translate a noun literally if the surrounding constraints (e.g., units like "seconds", prefixes, or the specific protocol) dictate a domain term. For example, if a setting is measured in "seconds", the Chinese word "大小" (size) MUST logically translate to `Duration` or `Interval`, **NEVER** `Size`.
2. **Conceptual Compression:** When faced with a sprawling, explanatory Chinese sentence, distill the _technical payload_ and express it using concise, standard industry jargon.
- _Anti-pattern (Literal/Chinglish):_ `After disabling the traditional authentication mode, you must first call the API to log in. Upon success, a cookie will be set, and all APIs can be accessed without restriction as long as the cookie is valid.`
- _Pro-pattern (Native/Jargon):_ `When disabled, users must first call /index/api/login. Upon success, a cookie auth token is set for subsequent requests.` (Using "subsequent requests" efficiently compresses the lengthy Chinese explanation).
3. **Technical Abstraction:** Recognize standard operations (e.g., "拉流再推流"). Do not translate the physical actions (`pulling and then pushing`); translate the abstract technical process (`re-publishing` or `re-encoding`).
### 🚫 Rule 6: Anti-Summarization (Strict Boolean & Causality Preservation)
- **Trigger:** When applying Conceptual Compression (Rule 5) to a text block containing conditionals or explanations.
- **The Core Conflict:** _Compression_ reduces word count by using jargon. _Summarization_ drops critical logic. **Summarization is strictly forbidden.**
- **Execution (The Boolean Mapping Rule):**
1. Treat Chinese comments like code blocks. Extract all `IF/THEN/ELSE` branches, prerequisites, and root causes before translating.
2. If the original text states a "success" path and a "failure" path, the English translation MUST explicitly state both paths. You cannot compress them into a single vague outcome.
3. If the original text states _why_ a feature exists (the exact cause or defect being prevented), the English translation MUST explicitly state that exact cause. You cannot compress it into generic "to improve performance" or "to prevent errors."
4. Perform a **Reverse Mapping Check**: After writing the English sentence, ask yourself—"If I reverse-compile this English back to Chinese, would any `IF` conditions or edge-case explanations be missing?" If yes, rewrite it completely to restore the dropped logic.
---
## Phase 3: The Hardcoded Terminology Dictionary
**CRITICAL:** When translating, if you encounter these Chinese concepts, you MUST use the exact, first provided English term. **Do not mix or alternate synonyms.**
### Network & Architecture
- 源站 -> `Origin server`
- 溯源 (拉流) -> `Origin pull`
- 推流代理 / 拉流代理 -> `Publishing proxies` / `Pulling proxies`
- 按需拉流 -> `On-demand stream pulling`
- 集群 -> `Cluster`
- 推流断开后的超时等待 -> `Grace period for publisher reconnection`
### Video & Playback Experience
- 秒开 / 极速秒开 -> `Instant playback (zero-delay startup)` (e.g., 级联秒开 -> `Instant playback for cascaded streams`)
- 花屏 -> `Visual artifacts (glitches)` _(NEVER use "Screen tearing", which is a hardware V-sync issue)_
- 卡顿 -> `Playback stuttering`
### System I/O & HTTP
- 合并写 -> `Write coalescing` _(NEVER use "Merged write")_
- 请求和回复 -> `Requests and Responses` _(Avoid "Replies")_
- 在代理后方获取真实IP -> `Extract the real client IP when behind a proxy (e.g., via X-Forwarded-For)`
### General Technical Terms
- 切片 -> `Segment` (e.g., HLS segment)
- 封装 / 打包 -> `Packaging`
- 负载 -> `Payload`
- 鉴权 -> `Authentication`
- 处理 / 应对 (故障) -> `Handle` or `Address`
---
## Phase 4: Strict Formatting Rules (CRITICAL)
When translating comments inside code files (`.cpp`, `.h`) or configs (`.ini`), apply these hard constraints:
1. **Bilingual Retention:** Unless explicitly instructed to delete Chinese, **ALWAYS retain the original Chinese comments**.
2. **Bottom Placement:** Place the English translation immediately **below** the Chinese line or block.
3. **Block Uniformity:** Do NOT translate line-by-line (`ZH-EN-ZH-EN`). If a Chinese comment is a 3-line block, output it as a 3-line Chinese block followed by a 3-line English block.
```cpp
/*
* 这里是第一行中文描述。
* 这里是第二行中文补充。
*/
/*
* This is the English translation of the first line.
* This is the English translation of the second line.
*/
```
---
## Phase 5: The Post-Translation Verification Workflow (DO NOT SKIP)
If you are asked to review or update translations in a long file, **you cannot rely solely on passive reading**. You MUST execute this workflow:
1. **Active Scan (Regex/Search):** Before reading the document, use file search tools to actively scan for known anti-patterns in the current English text (e.g., search for `Screen tearing`, `Merged write`, `Replies`, `Source station`). Fix them immediately.
2. **Format Review:** Scan for `ZH-EN-ZH-EN` interleaving and fix it to block format.
3. **Blind English Review:** After translating, hide the Chinese text from your mental context. Read _only_ your English output constraint: _Does this sound like a snippet from the official Nginx or WebRTC manuals? Is it concise (CBD: Clarity, Brevity, Directness)?_ If it sounds like a literal word-for-word translation, rewrite it natively.
按说明文件中的顺序排列。
第一阶段:语境锚定(翻译前必须执行)
第 2 阶段:结构翻译和反模式检测
🚫 规则 1:“行动-结果”范式
🚫 规则 2:子句消除(无“中式英语”)
🚫 规则 3:澄清不明确的行为
文件/命令 -> [rtp_proxy] · [http] · [general] · [hls] · [api]/[http] · Requests/Responses · CORS · Forwarded IPs
内容校验值 -> 10591d9676f7
当前原文的自动摘译,尚未人工审校。
🚫 规则 1:“行动-结果”范式
触发:当中文文本显示“设置为0关闭此功能”(设置为0禁用此功能)或“打开此选项会导致...”(打开此选项会导致...)时。执行:强制您的输出使用精确的结构:
Setting this to [Value] disables [Feature] and allows [Consequence].不要翻译解释性填充词,例如“此机制的逻辑表明......”。🚫 规则 2:子句消除(无“中式英语”)
触发因素:长名词簇或过度拟人化的系统描述(例如,“服务器会认为这个流是断开的” - 服务器会认为这个流已断开)。执行:使用直接、客观的声音:
The stream is considered disconnected.或The system drops the stream.🚫 规则 3:澄清不明确的行为
触发因素:单词
忽略(忽略/跳过)与丢弃/放弃(放弃/丢弃)。执行:使用Ignore或Skip进行非关键超时(例如,等待轨道准备好)。仅为致命错误或关闭的套接字保留Abandon、Drop或Disconnect。