Skip to content

Modify AI Translation Prompt

Version 2.52 and later added a way to translate using AI by sending the complete SRT subtitle content, rather than the previous method of sending subtitle text lines line by line, to solve the problem of inconsistent line numbers between the original content and the translation result.

Obviously, different translation methods require different prompts. Previously, with line-by-line translation, the emphasis was on restricting the AI to return the same number of lines as the original text. For example, if 10 lines of subtitle text were sent, 10 lines of subtitle text must be returned.

The newly added complete subtitle sending translation method emphasizes that the AI must return a valid SRT subtitle format.

Therefore, two different prompts are needed.

Software Default Uses Line-by-Line Translation

The location of the line-by-line translation prompt is in the software directory/videotrans/ directory, including ai302.txt.

image.png

If necessary, this can be modified. Only modify the txt file without -en.

The default prompt content is as follows:

Translate the original content in <source> to {lang} literally, then output only the translation, without adding any explanations or prompts.

**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 and the translated line corresponds to each other.
- For every line of original text, there must be a corresponding line of translated text.

**Content Requirements:**
- The translation must be concise and avoid long sentences.
- If the original text cannot be translated, please return it as is, without adding any prompts such as "meaningless statement or untranslatable".
- Only output the translation, do not output the original text.

**Execution Details:**
- If a line of original text is very short, it should still be retained after translation, and should not be merged with the previous or next line.
- The translated characters corresponding to the characters at the line break of the original text must also be line-broken.
- Translate literally, do not explain or answer the original content.

**Final Goal:**
- Provide a high-quality translation result with a format exactly the same as the original text.

<source>[TEXT]</source>

Translation:

Modification Note:

  1. {lang} is the target language name, which will be dynamically replaced during software operation according to the selected target language. Do not delete it.
  2. <source>[TEXT]</source> This will also be dynamically replaced by the actual text 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 rainstorm is so heavy that there are no horses' hooves.</source>
  3. Others can be modified, but it is necessary to restrict the AI to return the translation directly, without any prompts or guides. For example, the above sentence needs to directly return It's a good day for a rainstorm that doesn't have hooves., If this happens, it will cause an error Translation result: It's a good day for a rainstorm that doesn't have hooves.

Translating Using the Complete SRT Subtitle Method

This translation method includes line numbers, timestamps, and subtitle text in a valid SRT subtitle format, and expects the AI to return the translated valid SRT subtitle format.

The default prompt location is in the software directory/videotrans/prompts/srt directory.

image.png

Similarly, only modify the txt file without -en. The default prompt is as follows:

Translate the SRT subtitle content in <source> to {lang}, then output only the translation, without adding any explanations or prompts:

Note the following requirements:
1. **Only translate** the subtitle text content, do not translate the line numbers and timestamps.
2. **Ensure** that the translated text format is a valid SRT subtitle.
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**, only translate the subtitle text content.
5. If you encounter an untranslatable situation, return the original text directly, do not report an error, do not apologize.

Here is the SRT subtitle content to be translated:

<source>[TEXT]</source>

Translation:

Modification Note: {lang} is the target language and cannot be deleted or modified. <source>[TEXT]</source> cannot be modified or deleted either. Others can be modified, but it is necessary to require the AI to directly return the same valid SRT format translation as the original text, without adding prompts.

Enabling "Send Complete SRT Subtitle" Translation

Menu - Tools/Options - Advanced Options - Subtitle Translation Adjustment - Send Complete Subtitle When Using AI Translation - Checked.

image.png

Modifying the Prompt in the Settings Interface

In addition to directly modifying the txt file, you can also modify the prompt in the translation settings. It will automatically modify the corresponding txt file according to the selected translation method.

image.png

Adding a Glossary

Each prompt can add its own glossary, similar to the following:

**During translation, be sure to use** the glossary I provided for term translation, maintaining term consistency. 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