Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

text.translation

translate text between languages online; cached translations work offline

Example results generated on 2026-10-08. Ones using now, today or randomness will differ when you run them: press Run on any example to run it in your browser, after editing it if you like.

translate

# allow_network_access() first; cached translations work without it
# languages by code (es, de, zh-CN) or English name (spanish, german, chinese)
# from is auto-detected when left out

Functions

functiondescription
translate(text: str, to: str, from?: str)translate text into another language by code or English name; the source is detected when omitted

translate

translate(text: str, to: str, from?: str): translate text into another language by code or English name; the source is detected when omitted

"good morning".translate("es")
translate("Guten Morgen", "english", "german")

See also: allow_network_access