Template:Xyzy/doc

Usage
Default script template

This is used when a script template is not provided to templates such as and. It will generate correct attributes and html/xml language tags. If the language is in a set of known languages for which scripts can reasonably be assumed (e.g. "he" language to "Hebr" script) it invokes the specific script template.

This is only to be used by other templates, never in entries; entries should use the correct script template directly if needed.

Parameters

 * (1) text to be tagged
 * lang= language code
 * face= one of [term, ital, head, bold] to set default attributes
 * xlang= not used as required for all script templates, so caller can avoid "lang=" when blank

The template attempts to handle various combinations of face and lang being specified or not and/or being blank.


 * if lang is blank, the template adds no tagging
 * if lang is missing, it adds tagging for face, if given
 * if lang is not known, it adds tagging for face, if given

There are failure cases, which calling templates should take care to avoid where possible:


 * if lang is missing, and face is invalid, it will generate blank lang tags (believed to be legal, but not desirable) Not exactly. In XHTML 1.0 Transitional (which we use), lang="" and xml:lang="" are both invalid, in that they violate the DTD (these attributes are of type NMTOKEN, which the XML 1.0 spec defines as (NameChar)+). However, XML 1.0 does define semantics for xml:lang="", saying basically that it explicitly overrides the xml:lang of an enclosing element, but without providing a new value. Those semantics actually apply pretty well for us: the enclosing context is in English, but the quoted word is likely not to be. The question is, are the semantics even relevant, given that it's not valid? —Ruakh TALK 18:52, 11 July 2009 (UTC)</dd></dl>
 * lang and face are partially mixed together, so things like and  have interesting effects (in this case,  and, respectively)
 * if lang is invalid, it will generate bad lang tags (not checked)

Examples
(see page source in your browser)


 * : Xyzy|字典|lang=ja
 * : Xyzy|字典|lang=ja
 * : Xyzy|字典|lang=ja
 * : Xyzy|字典|lang=ja
 * : Xyzy|字典|lang=ja
 * : Xyzy|字典|lang=ja

Bad examples: