|
|
Line 4: |
Line 4: |
| '''Default script template''' | | '''Default script template''' |
|
| |
|
| This is used when a script template is not provided to templates such as {{temp|term}} and {{temp|t}}. 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 used when a script template is not provided to templates such as <nowiki>{{temp|term}}</nowiki> and <nowiki>{{temp|t}}</nowiki>. 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. | | This is ''only to be used by other templates'', never in entries; entries should use the correct script template directly if needed. |
Line 24: |
Line 24: |
|
| |
|
| * if lang is missing, and face is invalid, it will generate blank lang tags (believed to be legal, but not desirable) <dl><dd style="background-color:#DDFFE7;color:#006622">Not exactly. In XHTML 1.0 Transitional (which we use), <tt>lang=""</tt> and <tt>xml:lang=""</tt> are both invalid, in that they violate [http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Transitional the DTD] (these attributes are of type <tt>NMTOKEN</tt>, which the XML 1.0 spec defines as <tt>(NameChar)+</tt>). However, XML 1.0 does define semantics for <tt>xml:lang=""</tt>, saying basically that it explicitly overrides the <tt>xml:lang</tt> of an enclosing element, but without providing a new value.<sup >[http://www.w3.org/TR/REC-xml/#sec-lang-tag ]</sup> 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? —[[User: Ruakh |Ruakh]]<sub ><small ><i >[[User talk: Ruakh |TALK]]</i ></small ></sub > 18:52, 11 July 2009 (UTC)</dd></dl> | | * if lang is missing, and face is invalid, it will generate blank lang tags (believed to be legal, but not desirable) <dl><dd style="background-color:#DDFFE7;color:#006622">Not exactly. In XHTML 1.0 Transitional (which we use), <tt>lang=""</tt> and <tt>xml:lang=""</tt> are both invalid, in that they violate [http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Transitional the DTD] (these attributes are of type <tt>NMTOKEN</tt>, which the XML 1.0 spec defines as <tt>(NameChar)+</tt>). However, XML 1.0 does define semantics for <tt>xml:lang=""</tt>, saying basically that it explicitly overrides the <tt>xml:lang</tt> of an enclosing element, but without providing a new value.<sup >[http://www.w3.org/TR/REC-xml/#sec-lang-tag ]</sup> 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? —[[User: Ruakh |Ruakh]]<sub ><small ><i >[[User talk: Ruakh |TALK]]</i ></small ></sub > 18:52, 11 July 2009 (UTC)</dd></dl> |
| * lang and face are partially mixed together, so things like {{temp|Xyzy|foo|lang=term}} and {{temp|Xyzy|foo|face=he}} have interesting effects (in this case, {{Xyzy|foo|lang=term}} and {{Xyzy|foo|face=he}}, respectively) | | * lang and face are partially mixed together, so things like <nowiki>{{temp|Xyzy|foo|lang=term}}</nowiki> and <nowiki>{{temp|Xyzy|foo|face=he}}</nowiki> have interesting effects (in this case, <nowiki>{{Xyzy|foo|lang=term}}</nowiki> and <nowiki>{{Xyzy|foo|face=he}}</nowiki>, respectively) |
| * if lang is invalid, it will generate bad lang tags (not checked) | | * if lang is invalid, it will generate bad lang tags (not checked) |
|
| |
|
Line 36: |
Line 36: |
| * <code><nowiki>{{Xyzy|字典|lang=cmn}}</nowiki></code>: {{Xyzy|字典|lang=cmn}} | | * <code><nowiki>{{Xyzy|字典|lang=cmn}}</nowiki></code>: {{Xyzy|字典|lang=cmn}} |
| * <code><nowiki> Xyzy|字典|lang=ja </nowiki></code>: Xyzy|字典|lang=ja | | * <code><nowiki> Xyzy|字典|lang=ja </nowiki></code>: Xyzy|字典|lang=ja |
| * <code><nowiki>{{Xyzy|พจนานุกรม|lang=th|face=head}}</nowiki></code>: {{Xyzy|พจนานุกรม|lang=th|face=head}} | | * <code><nowiki>{{Xyzy|พจนานุกรม|lang=th|face=head}}</nowiki></code>: <nowiki>{{Xyzy|พจนานุกรม|lang=th|face=head}}</nowiki> |
|
| |
|
| Bad examples: | | Bad examples: |
Line 50: |
Line 50: |
| ! script | | ! script |
| |- | | |- |
| | ar || {{ar}} || Arab | | | ar || <nowiki>{{ar}}</nowiki> || Arab |
| |- | | |- |
| |fa || {{fa}} || fa-Arab | | |fa || <nowiki>{{fa}}</nowiki> || fa-Arab |
| |- | | |- |
| |ur || {{ur}} || ur-Arab | | |ur || <nowiki>{{ur}}</nowiki> || ur-Arab |
| |- | | |- |
| |hy || {{hy}} || Armn | | |hy || <nowiki>{{hy}}</nowiki> || Armn |
| |- | | |- |
| |xcl || {{xcl}} || Armn | | |xcl || <nowiki>{{xcl}}</nowiki> || Armn |
| |- | | |- |
| |be || {{be}} || Cyrl | | |be || <nowiki>{{be}}</nowiki> || Cyrl |
| |- | | |- |
| |bg || {{bg}} || Cyrl | | |bg || <nowiki>{{bg}}</nowiki> || Cyrl |
| |- | | |- |
| |mk || mk || Cyrl | | |mk || mk || Cyrl |
| |- | | |- |
| |ru || {{ru}} || Cyrl | | |ru || <nowiki>{{ru}}</nowiki> || Cyrl |
| |- | | |- |
| |uk || {{uk}} || Cyrl | | |uk || <nowiki>{{uk}}</nowiki> || Cyrl |
| |- | | |- |
| |cu || {{cu}} || Cyrs | | |cu || <nowiki>{{cu}}</nowiki> || Cyrs |
| |- | | |- |
| |sa || {{sa}} || Deva | | |sa || <nowiki>{{sa}}</nowiki> || Deva |
| |- | | |- |
| |hi || {{hi}} || Deva | | |hi || <nowiki>{{hi}}</nowiki> || Deva |
| |- | | |- |
| |got || {{got}} || Goth | | |got || <nowiki>{{got}}</nowiki> || Goth |
| |- | | |- |
| |el || {{el}} || Grek | | |el || <nowiki>{{el}}</nowiki> || Grek |
| |- | | |- |
| |grc || {{grc}} || polytonic | | |grc || <nowiki>{{grc}}</nowiki> || polytonic |
| |- | | |- |
| |he || {{he}} || Hebr | | |he || <nowiki>{{he}}</nowiki> || Hebr |
| |- | | |- |
| |yi || {{yi}} || Hebr | | |yi || <nowiki>{{yi}}</nowiki> || Hebr |
| |- | | |- |
| |arc || {{arc}} || Hebr | | |arc || <nowiki>{{arc}}</nowiki> || Hebr |
| |- | | |- |
| |ja || ja || Jpan | | |ja || ja || Jpan |
| |- | | |- |
| |ko || {{ko}} || Kore | | |ko || <nowiki>{{ko}}</nowiki> || Kore |
| |- | | |- |
| |ta || {{ta}} || Taml | | |ta || <nowiki>{{ta}}</nowiki> || Taml |
| |- | | |- |
| |te || {{te}} || Telu | | |te || <nowiki>{{te}}</nowiki> || Telu |
| |- | | |- |
| |th || {{th}} || Thai | | |th || <nowiki>{{th}}</nowiki> || Thai |
| |} | | |} |
|
| |
|
| ===Notes=== | | ===Notes=== |
|
| |
|
| The name comes from the magic word "[[xyzzy]]" from [[w:Adventure (computer game)|Adventure]]. It is made to look like an ISO script name, but one very unlikely to be assigned. | | 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. | | 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. |
Line 107: |
Line 107: |
| ===Tests=== | | ===Tests=== |
|
| |
|
| * <code><nowiki>{{t new|fr|foo}}</nowiki></code>: {{t new|fr|foo}} | | * <code><nowiki>{{t new|fr|foo}}</nowiki></code>: <nowiki>{{t new|fr|foo}}</nowiki> |
| * <code><nowiki>{{t new|th|พจนานุกรม}}</nowiki></code>: {{t new|th|พจนานุกรม}} | | * <code><nowiki>{{t new|th|พจนานุกรม}}</nowiki></code>: <nowiki>{{t new|th|พจนานุกรม}}</nowiki> |
|
| |
|
| <includeonly> | | <includeonly> |