Skip to content

Modify AI Translation Prompt

After version v2.52, a new method has been added for AI translation: sending the complete SRT subtitle content for translation, instead of the previous method of sending subtitle text line by line. This resolves the issue of mismatched line counts between the original content and the translation results.

Clearly, different translation methods require different prompts. The previous line-by-line translation method emphasized 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 send complete subtitle translation method emphasizes restricting the AI to return valid SRT subtitle format.

Therefore, two different prompts are needed.

The Software Defaults to Line-by-Line Translation

The prompt for line-by-line translation is located in the software directory/videotrans/prompts/text folder, including ai302.txt.

If needed, you can modify it here. Only modify the TXT files without the -en suffix (the -en.txt files are used when the software interface is in English).

The default prompt content is as follows:

Please translate the original text in <source> literally into {lang}, then output only the translation without any explanations or guiding 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 and translated lines corresponds.
- The number of translated lines must exactly match the number of original lines.

**Content Requirements:**
- Translations must be concise and brief, avoiding long sentences.
- If the original text cannot be translated, return it as is without adding any prompts such as "meaningless statement" or "untranslatable."
- Output only the translation; do not include the original text.

**Execution Details:**
- If a line of the original text is very short, it must still be retained as a separate line after translation and should not be merged with the previous or next line.
- Line breaks in the original text must correspond to line breaks in the translated text.
- Translate strictly according to the literal meaning; do not explain or respond to the original content.

**Final Goal:**
- Provide a high-quality translation result with a format identical to the original.

<source>[TEXT]</source>

Translation:

When modifying, note:

  1. {lang} is the target language name and will be dynamically replaced during software operation based on the selected target language. Do not delete it.
  2. <source>[TEXT]</source> will also be dynamically replaced during software operation, with [TEXT] replaced by the actual text to be translated. Do not delete or modify it. For example, after dynamic replacement, it may become <source>Today is a good day, with heavy rain falling without horse hooves.</source>.
  3. Other parts can be modified, but it is essential to restrict the AI to return only the translation directly, without any prompts or guiding words. For example, for the above sentence, it should directly return It's a good day for a rainstorm that doesn't have hooves. If something like Translation result: It's a good day for a rainstorm that doesn't have hooves. appears, it will cause an error.

Send Complete SRT Subtitle for Translation

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

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

image.png

Similarly, only modify the TXT files without the -en suffix. The default prompt is as follows:

Please translate the SRT subtitle content in <source> into {lang}, then output only the translation without any explanations or guiding words:

Note the following requirements:
1. **Only translate** the subtitle text content; do not translate the line numbers or timestamps.
2. **Ensure** the translated output is in a valid SRT subtitle format.
3. **Ensure** the number of translated subtitles exactly matches the number of original subtitles, with each translated subtitle corresponding to one in the original.
4. **Keep the timestamps unchanged**; translate only the subtitle text content.
5. If translation is not possible, return the original text content directly without errors or apologies.

Here is the SRT subtitle content to be translated:

<source>[TEXT]</source>

Translation:

When modifying, note: {lang} is the target language and must not be deleted or modified. <source>[TEXT]</source> must also not be deleted or modified. Other parts can be modified, but ensure the AI directly returns the translated content in the same valid SRT format as the original, without any additional prompts.

Enable "Send Complete SRT Subtitle" Translation

Go to Menu > Tools/Options > Advanced Options > Subtitle Translation Adjustment > Use AI Translation to Send Complete Subtitles > Check the box.

image.png

Add a Glossary

You can add your own glossary to any type of prompt, similar to the following:

**During translation, ensure the use of** the glossary I provide for translating terms to maintain 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