TranslationOptions

TranslationOptions{opt1val1,opt2val2,}

is an option for Style and Cell that controls how code translations are displayed.

Details

  • The following suboptions can be specified:
  • "BaseStyle""Translation"style to use for rendering translations
    "ContentEnabled"Falsewhether translations are enabled for given content
    "Enabled"Truewhether translations are enabled
    "HighlightStyle""SelectedTranslation"style to use for rendering a translation that is highlighted
    "Language"Automatictarget language for translation
    "Margins"{{5,3},{8,4}}margins to apply around the translation
  • "BaseStyle" can take a style name or a list of style names and options, which it will use to determine properties of the rendered translations such as font, size, and color.
  • "HighlightStyle" applies style attributes that are layered on top of "BaseStyle" whenever the translation is highlighted. The translation may be highlighted by mousing over it or by placing the text cursor within the keyword to be translated.
  • "Enabled" determines whether the translations will be shown. "ContentEnabled" also determines whether translations will be shown. The "Input" style typically has "ContentEnabled"->Automatic set, which allows it to follow the notebook or global level settings of "Enabled".
  • "Language" determines which language to target for the translations. "Language"->Automatic indicates that the current value of the global Language option should be used.
  • "Margins"->{{left,right},{bottom,top}} determines the margins in points surrounding the translation themselves. top is the distance from the top of the translation to the bottom of the line being translated. bottom is the distance from the bottom of the translation to the leading space that precedes the next line. Translations next to one another may overlap; left indicates how much white space a translation creates to the left of its starting point, and right indicates how much white space a highlighted translation creates to the right of its ending point.

Examples

Basic Examples  (1)

Enable a Japanese translation on an output:

Wolfram Research (2015), TranslationOptions, Wolfram Language function, https://reference.wolfram.com/language/ref/TranslationOptions.html.

Text

Wolfram Research (2015), TranslationOptions, Wolfram Language function, https://reference.wolfram.com/language/ref/TranslationOptions.html.

CMS

Wolfram Language. 2015. "TranslationOptions." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TranslationOptions.html.

APA

Wolfram Language. (2015). TranslationOptions. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TranslationOptions.html

BibTeX

@misc{reference.wolfram_2024_translationoptions, author="Wolfram Research", title="{TranslationOptions}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/TranslationOptions.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_translationoptions, organization={Wolfram Research}, title={TranslationOptions}, year={2015}, url={https://reference.wolfram.com/language/ref/TranslationOptions.html}, note=[Accessed: 21-November-2024 ]}