Skip to content

Modifying AI Translation Prompts

Version v2.52 introduces a new method for AI translation: sending the complete SRT subtitle content for translation instead of the previous method of sending subtitle text lines for line-by-line translation. This addresses the issue of discrepancies in the number of lines between the original content and the translated output.

This change in translation method necessitates 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, for example, sending 10 lines of subtitle text and requiring 10 lines of translated text in return.

The new method of sending the complete subtitle focuses on restricting the AI to return a valid SRT subtitle format.

Therefore, two different prompts are required.

The software defaults to line-by-line translation

The prompts for line-by-line translation are located in the software directory/videotrans/ directory, including ai302.txt.

image.png

You can modify these prompts here, only modifying the txt files 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 translation, without adding any explanations or introductory words.

**Formatting 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 each word in the translated line.
- The number of translated lines must equal the number of original lines.

**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, do not output 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 have line breaks.
- Translate strictly according to the literal meaning, do not explain or answer the content of the original text.

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

<source>[TEXT]</source>

Translation:

When modifying, note:

  1. {lang} is the name of the target language and will be dynamically replaced based on the selected target language during software operation. Do not delete it.
  2. <source>[TEXT]</source> This will also be dynamically replaced with the actual text content 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 horseshoes.</source>
  3. Other parts can be modified, but it is essential to restrict the AI to directly return the translation without any prompts or guide characters. For example, the above sentence needs to directly return It's a good day for a rainstorm that doesn't have hooves.. If it appears like this, it will cause an error like Translation result: It's a good day for a rainstorm that doesn't have hooves.

Translation using the "Send Complete SRT Subtitle" method

This translation method sends the line numbers, timecodes, 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.

image.png

Similarly, only modify the txt files 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 translation, 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 translated text 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**, only translate the subtitle text content.
5. If you encounter a situation where you cannot translate, return the original text content directly, do not report an error, and do not apologize.

The following is the SRT subtitle content to be translated:

<source>[TEXT]</source>

Translation:

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

Enable "Send Complete SRT Subtitle" translation

Menu - Tools/Options - Advanced Options - Subtitle Translation Adjustment - Send complete subtitles when using AI translation - Select.

image.png

Modify Prompts in the Settings Interface

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

image.png

Add 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 for the translation of terms, maintaining consistency of terms. 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