Template:ux/documentation

This template is used to show usage examples (not quotations or collocations) following a definition line. It adds the page to the category " terms with usage examples", and serves as machine-readable content descriptor to facilitate automated processing, also marking the text language for the benefit of screen readers or other automated software.

For quotations, use or a more extensive quotation template. For collocations, use or. See WT:USEX for some general guidelines regarding usage examples.

Parameters

 * 1
 * The language code of the example to be shown, e.g.  for English; see WT:LANGLIST for the full list.


 * 2
 * The example to be shown. It should not contain wikilinks.


 * 3, translation or t
 * The English translation for examples on foreign entries.


 * tr or transliteration
 * The Latin transliteration for examples in non-Latin script.


 * sc
 * The script code, required for certain languages with multiple possible scripts; see List of scripts for the full list.


 * inline
 * If set to, auto-determines whether to display the entire usage example (including example, transliteration, translation, etc.) inline (on a single line) or multiline (using multiple lines, one each for the example, transliteration, translation, and other displayed values). The algorithm for doing this is currently quite basic. It simply counts the total number of displayed characters in the inline format (counting Asian-language, specifically CJK, characters twice), and if it is > 100, the multiline format is used, otherwise the inline format is used. If set to , , , , , or certain other similar values, the inline format is always used. Otherwise, the multiline format is always used. See also uxi, which always uses the inline format.


 * q, qN or qualifier, qualifierN
 * To include a qualifier for the example or quote. You can specify multiple qualifiers using q2=, q3=, etc.


 * footer
 * Additional information to include in a footer.


 * ref
 * To include a reference or link to an originating external site.


 * lit
 * A literal translation.


 * subst
 * Substitutions to be applied to handle irregular transliterations in certain languages (e.g. Russian, Yiddish, Hindi). If specified, should be one or more substitution expressions separated by commas. Each substitution expression is of the form  (  is also accepted), where   is the source text as found in the example, and   is the corresponding respelling in the source script (e.g. Cyrillic, Hebrew or Devanagari). The substitutions are applied in order and before transliteration. The idea is to phonetically respell words with irregular transliteration so that the transliteration comes out correctly, without the need to manually transliterate the entire example using tr. Multiple substitutions are separated by a comma with no space after it: FROM1//TO1,FROM2//TO2,FROM3//TO3. Note that   and   are actually Lua patterns (see WT:LUA). This means, for example, that a hyphen in the source text needs to be "escaped" by writing it as  . See below for an example of using this parameter. Other examples may be found in the documentation for  and.


 * noenum
 * To use in unnumbered sections (not following a definition). It may start the line following the definition or may be prefixed by " " for visual aesthetics.


 * nocat
 * Don't add categories.


 * sort
 * Sortkey. Add this only when the sortkey cannot be generated from the entry name.

Usage examples are normally preceded by " ", or by " " or " " to hide the usage example (normally used for direct quotes).

Example 1
On the page for : #: gives

Example 2
On the page for, using ref: #: