Template:XyzyEdit This Page

From FamilySearch Wiki

{{{1}}}
[view] [edit] [history] [purge] Documentation icon Template documentation

Contents

Usage

Default script template

This is used when a script template is not provided to templates such as Template:Temp and Template:Temp. 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.[1] 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? —RuakhTALK 18:52, 11 July 2009 (UTC)
  • lang and face are partially mixed together, so things like Template:Temp and Template:Temp have interesting effects (in this case, <>foo</> and {{|1=foo|face=he|lang={{{lang}}}}}, respectively)
  • if lang is invalid, it will generate bad lang tags (not checked)

Examples

(see page source in your browser)

  • {{Xyzy|foo}}: foo
  • {{Xyzy|foo|face=bold}}: foo
  • {{Xyzy|foo|face=ital}}: foo
  • {{Xyzy|foo|face=term}}: foo
  • {{Xyzy|字典|lang=cmn}}: 字典
  • {{Xyzy|字典|lang=ja}}: Template:Jpan
  • {{Xyzy|พจนานุกรม|lang=th|face=head}}: Template:Thai

Bad examples:

  • {{Xyzy|foo|face=bogus}}: foo
  • {{Xyzy|foo|lang=xx-zz}}: foo

Languages

code language script
ar Template:Ar Arab
fa Template:Fa fa-Arab
ur Template:Ur ur-Arab
hy Template:Hy Armn
xcl Template:Xcl Armn
be Template:Be Cyrl
bg Template:Bg Cyrl
mk Template:Mk Cyrl
ru Template:Ru Cyrl
uk Template:Uk Cyrl
cu Template:Cu Cyrs
sa Template:Sa Deva
hi Template:Hi Deva
got Template:Got Goth
el Template:El Grek
grc Template:Grc polytonic
he Template:He Hebr
yi Template:Yi Hebr
arc Template:Arc Hebr
ja Template:Ja Jpan
ko Template:Ko Kore
ta Template:Ta Taml
te Template:Te Telu
th Template:Th Thai

Notes

The name comes from the magic word "xyzzy" from Adventure. It is made to look like an ISO script name, but one very unlikely to be assigned.

It may be very tempting to add languages and scripts, but it should be avoided! Each one adds overhead to many calls on a large majority of the wikt pages, and the benefits for languages beyond what is already there are minimal. Any such change must be very carefully considered.

Tests

  • This page was last modified on 2 January 2011, at 18:47.
  • This page has been accessed 192 times.