Skip to content

Context Hints

The --context flag tells the LLM what you are translating. This helps it resolve ambiguous terms and choose appropriate terminology.

Terminal window
yaku --to en --context "Kubernetes documentation" -f guide.ja.md

yaku appends this to the system prompt:

Context: this text is about Kubernetes documentation. Use appropriate domain terminology.

Without context, the LLM guesses the domain from the text alone. This works for most translations, but some terms are ambiguous across domains:

Spanish termGeneral translationWith --context "networking"With --context "swimming"
piscinapoolresource poolswimming pool
puertoportnetwork portseaport
tablatablerouting tabletable
ramabranchbranch (git)tree branch
Terminal window
yaku --to en --context "PostgreSQL database administration" -f backup-guide.fr.md

The LLM uses database-specific terms: “transaction”, “index”, “query” — rather than their general-purpose equivalents.

Terminal window
yaku --to en --context "formal business email to a client" -f email-draft.ja.txt

The LLM adjusts formality level and tone for professional English communication.

Terminal window
yaku --to en --context "medical research paper, cardiology" -f abstract.zh-TW.md

The LLM uses standard medical terminology instead of colloquial equivalents.

Use --context for overall domain and a glossary for specific terms:

Terminal window
yaku --to en \
--context "Kubernetes documentation" \
--glossary k8s-terms.yaml \
-f guide.ja.md

The glossary locks down exact terms (e.g., “pod” → “Pod”), while --context guides the LLM on everything else.

In polish mode, --context adjusts tone and formality:

Terminal window
echo "El servidor se cayó otra vez ayer y necesitamos fixearlo" | \
yaku --mode polish --to es --context "incident report for engineering leadership"

Output:

El servidor experimentó una interrupción no planificada ayer y es necesario corregirlo.
  • Keep it short. One phrase is enough: "Kubernetes docs", "legal contract", "casual blog post".
  • Be specific. "PostgreSQL administration" is better than "database".
  • Use for tone control. Context like "formal email" or "casual chat" affects the writing style, not just terminology.