Skip to content

Modify AI Translation Prompt

After version v2.52, a new method of using AI translation has been added: sending complete srt subtitle content for translation, instead of just sending subtitle text lines line by line translation as before, to solve the problem of inconsistent numbers of lines between the original content and the translation result.

Obviously, different translation methods inevitably require different prompts. The previous line by line translation focused on restricting 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 translated text must also be returned.

The newly added sending complete subtitle translation method focuses on restricting AI to return a valid srt subtitle format.

Therefore, two different prompts are required.

The Software Defaults to the Line-by-Line Translation Method

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

image.png

If necessary, you can modify it here, just modify the txt without -en.

The default prompt content is as follows:

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

**Format Requirements:**
- Translate the original text line by line, and generate the corresponding translated text for each line, ensuring that each word in the original line and the translated line corresponds to each other.
- For as many lines of original text, as many lines of translated text must be generated.

**Content Requirements:**
- The translation must be concise and short, avoiding long sentences.
- If the original text cannot be translated, please return it as is, and do not add any prompts such as "meaningless sentences or untranslatable".
- Only output the translated text, 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 text characters corresponding to the line breaks in the original text must also have line breaks.
- Strictly translate 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:

Pay attention when modifying:

  1. {lang} is the target language name, which will be dynamically replaced according to the selected target language during software operation, please do not delete it
  2. <source>[TEXT]</source> This is also dynamically replacing [TEXT] with the actual text content that needs to be translated during software operation, and is prohibited from being deleted. For example, after dynamic replacement, it will become <source>Today is a good day, the rainstorm has no hooves</source>
  3. Other items can be modified, but it is necessary to restrict AI to directly return the translated text, without any prompts or guiding symbols. For example, the above sentence needs to directly return It's a good day for a rainstorm that doesn't have hooves., if the following occurs, it will cause an error The translation result is as follows: It's a good day for a rainstorm that doesn't have hooves.

Send Complete srt Subtitle Method Translation

This translation method will send the line number, time line, and subtitle text in a valid srt subtitle format, and expects AI to return the translated valid srt subtitle format

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

image.png

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

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

Note the following requirements:
1. **Only translate** the subtitle text content, do not translate the line number and timestamp of the subtitle.
2. **Must ensure** that the translated text format is a valid srt subtitle.
3. **Ensure** that the number of translated subtitles is completely consistent with the original subtitles, and each subtitle corresponds to one in the original subtitles.
4. **Keep the timestamp as is**, only translate the text content of the screen.
5. If you encounter a situation where you cannot translate, directly return the original text content, do not report an error, and do not apologize.

The following is the srt subtitle content that needs to be translated:

<source>[TEXT]</source>

Translated text:

Pay attention to the modification as well: {lang} is the target language and cannot be deleted or modified. <source>[TEXT]</source> cannot be modified or deleted either, other items can be modified, but it is necessary to require AI to directly return a valid srt format translation that is the same as the original text, and no prompts can be added.

Enable the "Send Complete srt Subtitle" Translation Method

Menu - Tools/Options -- Advanced Options -- Subtitle Translation Adjustment -- Use AI to translate when sending complete subtitles -- select.

image.png

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 according to the selected translation method.

image.png

Add a Glossary

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

**In the translation process, be sure to use** the glossary I provide for the translation of terms, and maintain the 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