Modifying AI Translation Prompt
Version 2.52 and later introduces a new method for AI translation: sending the complete SRT subtitle content for translation instead of just sending subtitle text lines for line-by-line translation. This addresses the issue of inconsistent numbers of lines between the original content and the translated result.
This change in translation method necessitates different prompts. Previously, with line-by-line translation, the focus was on restricting the AI to return the same number of lines as the original. For example, if 10 lines of subtitle text were sent, 10 lines of translated text were required in return.
The new method of sending complete subtitles emphasizes the need to restrict the AI to return a valid SRT subtitle format.
Therefore, two different prompts are needed.
Software Default: Line-by-Line Translation
The prompt for line-by-line translation is located in the software directory/videotrans/
directory, including ai302.txt
.
You can modify it here if needed. Just modify the txt file without -en
.
The default prompt content is as follows:
Please translate the original content in <source> into {lang} literally, and only output the translation, without adding any descriptions or introductory words.
**Format Requirements:**
- Translate the original text line by line and generate the corresponding translation for each line, ensuring that each word in the original line corresponds to a word in the translated line.
- If there are X lines of original text, X lines of translated text must be generated.
**Content Requirements:**
- The translation must be concise and avoid long sentences.
- If the original text cannot be translated, return it as is, without adding any prompts such as "meaningless statement" or "untranslatable."
- Only output the translation, not the original text.
**Execution Details:**
- If a line of original text is very short, it must still be retained after translation and must not be merged with the previous or next line.
- The translated characters corresponding to the line breaks in the original text must also be line breaks.
- Translate strictly according to the literal meaning, without interpreting or answering the original content.
**Final Goal:**
- Provide high-quality translation results with a format that is completely consistent with the original.
<source>[TEXT]</source>
Translation:
Note the following when modifying:
{lang}
is the target language name and will be dynamically replaced based on the selected target language during software operation. Do not delete it.<source>[TEXT]</source>
This will also dynamically replace[TEXT]
with the actual text content that needs to be translated during software operation. Do not delete it. For example, after dynamic replacement, it will become<source>Today is a good day, the rain is so heavy that there are no horse hooves.</source>
- All other elements can be modified, but it is essential to restrict the AI to return the translation directly, without any prompts or introductory symbols. For example, the above sentence needs to directly return
It's a good day for a rainstorm that doesn't have hooves.
If this occurs, it will cause an errorTranslation result: It's a good day for a rainstorm that doesn't have hooves.
Translating by Sending Complete SRT Subtitles
This translation method sends the line number, timestamp, and subtitle text in a valid SRT subtitle format and expects the AI to return a translated, valid SRT subtitle format.
The default prompt location is in the software directory/videotrans/prompts/srt
directory.
Similarly, only modify the txt file without -en
. The default prompt is as follows:
Please translate the SRT subtitle format content in <source> into {lang}, and only output the translation, without adding any descriptions or introductory words:
Note the following requirements:
1. **Only translate** the subtitle text content, not the line numbers and timestamps of the subtitles.
2. **Must ensure** that the translated version is in a valid SRT subtitle format.
3. **Ensure** that the number of translated subtitles is exactly the same as the original subtitles, with each subtitle corresponding to one in the original subtitles.
4. **Keep the timestamps as they are**, and only translate the subtitle text content.
5. If you encounter a situation where translation is not possible, return the original text content directly, without reporting errors or apologizing.
The following is the SRT subtitle content that needs to be translated:
<source>[TEXT]</source>
Translation:
Similarly, pay attention: {lang}
is the target language and cannot be deleted or modified. <source>[TEXT]</source>
also cannot be modified or deleted. Other elements can be modified, but it is essential to require the AI to directly return a valid SRT format translation that is the same as the original, without adding any prompts.
Enable "Send Complete SRT Subtitles" Translation Method
Menu - Tools/Options - Advanced Options - Subtitle Translation Adjustment - Send Complete Subtitles when using AI Translation - Select.
Modify Prompts in the Settings Interface
In addition to directly modifying the txt file, you can also modify the prompts in the translation settings, which will automatically modify the corresponding txt file based on the selected translation method.
Adding a Glossary
You can add your own glossary to each prompt, similar to the following:
**During the translation process, you must use** the glossary I provide to translate terms and maintain the consistency of terminology. The specific glossary is as follows:
* Transformer -> Transformer
* Token -> Token
* LLM/Large Language Model -> Large Language Model
* Generative AI -> Generative AI
* One Health -> One Health
* Radiomics -> Radiomics
* OHHLEP -> OHHLEP
* STEM -> STEM
* SHAPE -> SHAPE
* Single-cell transcriptomics -> Single-cell transcriptomics
* Spatial transcriptomics -> Spatial transcriptomics