Skip to content

Modifying AI Translation Prompt

Version 2.52 introduces a new method for AI translation: sending the complete SRT subtitle content for translation instead of just sending the subtitle text lines for line-by-line translation. This addresses the issue of mismatched line counts between the original content and the translated results.

This change in translation method necessitates different prompts. Previously, with line-by-line translation, the emphasis was on ensuring that the AI returned the same number of lines as the original. For example, if 10 lines of subtitle text were sent, the AI had to return 10 lines of translated text.

The new send complete subtitle translation method requires 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.

image.png

You can modify the prompt here if needed. Just modify the txt file without the -en suffix.

The default prompt content is as follows:

Please translate the original content in <source> into {lang} literally, and then output only the translated text, without adding any explanations or introductory words.

**Formatting Requirements:**
- Translate the original text line by line and generate the corresponding translated line, ensuring that each word in the original and translated lines corresponds to each other.
- The number of translated lines must match the number of original lines.

**Content Requirements:**
- The translation must be concise, avoiding 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 translated text, do not output the original text.

**Execution Details:**
- If a line of the original text is short, the line must 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, do not explain or answer the original content.

**Final Goal:**
- Provide high-quality translation results with a format that is completely consistent with the original text.

<source>[TEXT]</source>

Translated text:

Points to note when modifying:

  1. {lang} is the target language name and will be dynamically replaced based on the selected target language during software execution. Do not delete it.
  2. <source>[TEXT]</source> will also be dynamically replaced with the actual text content to be translated during software execution. Do not delete it. For example, after dynamic replacement, it may become <source>Today is a good day, the rain is so heavy that horses can't walk.</source>
  3. All other content can be modified, but it is essential to ensure that the AI directly returns the translated text without any prompts or introductory symbols. For example, the above sentence should directly return It's a good day for a rainstorm that doesn't have hooves., If this doesn't happen, it will cause an error like Translation result: It's a good day for a rainstorm that doesn't have hooves.

Translate by sending the Complete SRT subtitle.

This translation method sends the line number, timecode, and subtitle text in a valid SRT subtitle format, expecting the AI to return the translated content in the same valid SRT subtitle format.

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

image.png

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

Please translate the SRT subtitle format content in <source> into {lang}, and then output only the translated text, without adding any explanations or introductory words:

Note the following requirements:
1. **Only translate** the subtitle text content, do not translate the line numbers and timestamps of the subtitles.
2. **Must ensure** that the format of the translated text is a valid SRT subtitle.
3. **Ensure** that the number of translated subtitles is exactly the same as the number of 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 a situation where translation is not possible, return the original text content directly, without reporting an error or apologizing.

The following is the SRT subtitle content to be translated:

<source>[TEXT]</source>

Translated text:

When modifying, also note that: {lang} is the target language and cannot be deleted or modified. <source>[TEXT]</source> also cannot be modified or deleted. Other content can be modified, but it is essential to require the AI to directly return the translated text in the same valid SRT format as the original text, without adding any prompts.

Enable "Send Complete SRT Subtitle" Translation

Menu - Tools/Options - Advanced Options - Subtitle Translation Adjustments - Use Complete Subtitles when use AI translate -- check the box.

image.png

Modify Prompt in Settings Interface

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

image.png

Adding a Glossary

You can add your own glossary to each prompt, similar to the following:

**During the translation process, be sure to use** the glossary I provide to translate terms and 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