Custom Instructions
You can inject custom prompting instructions for the translation task. This can be used to insert additional instructions, glossary or other guidance to improve the overall translation quality.
Inline instructions
Section titled “Inline instructions”uses: pelikhan/action-continuous-translation@v0with: instructions: Use a casual tone.
Instructions from a file
Section titled “Instructions from a file”uses: pelikhan/action-continuous-translation@v0with: instructions_file: ./instructions.txt
Instructions in frontmatter
Section titled “Instructions in frontmatter”You can also specify translation instructions directly in the frontmatter of individual documents. This is useful when different documents require specific translation approaches.
---title: "My Document"translator: instructions: | Use formal tone and preserve all technical terms in English.---
# My Document Content
This document will be translated using the instructions specified in the frontmatter.
The translator
types are defined types.ts
.
It is removed from the frontmatter before the translation starts, so it does not affect the final output.
export interface TranslatorConfiguration { instructions?: string;}
export interface FrontmatterWithTranslator { translator?: TranslatorConfiguration;}
Priority Order
Section titled “Priority Order”Instructions are applied in the following priority order:
instructions
parameter (highest priority)instructions_file
parametertranslator.instructions
from document frontmatter (lowest priority)
If multiple methods are used, only the highest priority one will be applied.