Languages
Supported languages
Section titled “Supported languages”yaku does not maintain a hardcoded language list. It passes the target language code to the LLM backend, which handles the actual translation. This means yaku supports every language that your chosen backend model can translate.
Common language codes (BCP 47 format):
| Code | Language | Code | Language |
|---|---|---|---|
en | English | ko | Korean |
zh-TW | Traditional Chinese | th | Thai |
zh-CN | Simplified Chinese | vi | Vietnamese |
ja | Japanese | fr | French |
de | German | es | Spanish |
pt | Portuguese | it | Italian |
ru | Russian | ar | Arabic |
Use the full BCP 47 code when a language has regional variants. For example, zh-TW (Traditional Chinese as used in Taiwan) vs zh-CN (Simplified Chinese as used in Mainland China).
Language code validation
Section titled “Language code validation”yaku validates --to and --from values against the BCP 47 standard. It normalizes case automatically (zh-tw → zh-TW) and rejects invalid codes with a helpful suggestion:
yaku --to japanese "Hello"# Error: unknown language "japanese". Did you mean "ja"?
yaku --to zh-tw "Hello"# Works — silently normalized to zh-TWIn the LLM prompt, yaku uses the display name alongside the code (e.g., “Translate to Japanese (ja)”) for clarity.
Target language (--to)
Section titled “Target language (--to)”Every translation needs a target language. Specify it with --to:
yaku --to en "Bonjour le monde"yaku --to en -f README.ja.mdDefault target language
Section titled “Default target language”Set a default to skip --to on every command:
yaku config set default-target enNow these are equivalent:
echo "Bonjour" | yaku --to enecho "Bonjour" | yaku # uses default-targetAn explicit --to always overrides the default:
echo "Bonjour" | yaku --to es # Spanish, not EnglishSource language (--from)
Section titled “Source language (--from)”By default, yaku lets the LLM auto-detect the source language. This works well for most text:
yaku --to en "これはテストです"# This is a testUse --from when you need explicit control:
yaku --from ja --to en "これはテストです"When to use --from:
- The text mixes multiple languages and auto-detection picks the wrong one.
- You need deterministic behavior in scripts or CI/CD pipelines.
- The text is very short (a few words) and the LLM guesses the wrong language.
Same-language hint
Section titled “Same-language hint”If --from and --to are the same language, yaku suggests using polish mode instead:
yaku --from en --to en "I want talk about the deploy issue"# Hint: source and target language are both en. Consider using --mode polish for language refinement.Translation quality tips
Section titled “Translation quality tips”- Use the hosted backend — The default backend uses refined, per-language prompts that produce higher-quality translations. See Hosted Service & Plans for details.
- Add context — Use
--contextto hint the domain. This helps the LLM pick the right terminology:Terminal window yaku --to en --context "medical documentation" -f report.zh-TW.md - Use a glossary — For consistent terminology across a project, create a glossary file.
- Use polish mode for editing — If you already have a draft in the target language,
--mode polishimproves it without re-translating:Terminal window yaku --mode polish --to en -f draft.md