Template:Native name/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>CsDix
m ISO 639 name
meta>CsDix
Line 53: Line 53:
: {{native name|de|Deutschland|italics=off|nbsp=off|nolink=yes|fontsize=80%}}
: {{native name|de|Deutschland|italics=off|nbsp=off|nolink=yes|fontsize=80%}}


== More examples ==
== Older examples ==
 
{{pre|{{((}}Infobox settlement<br />
&nbsp;{{!}}name{{=}}The Hague<br />
&nbsp;{{!}}native_name{{=}}'''{{((}}native name{{!}}nl{{!}}Den Haag{{))}}'''<br />
{{))}}}}
 
results in
 
<table class="infobox geography vcard" style="width:23em; text-align:left; float:left; clear:both;">
<tr>
<th colspan="2" style="width:100%; text-align:center; font-size:1.25em; white-space:nowrap"><span class="fn org">The Hague</span><br />
<span class="nickname">{{native name|nl|Den Haag}}</span></th>
</tr>
</table>
 
<p style="clear:both">while</p>
 
{{Pre|{{((}}Infobox settlement<br />
&nbsp;{{!}}name{{=}}French Republic<br />
&nbsp;{{!}}native_name{{=}}'''{{((}}native name{{!}}fr{{!}}République française{{!}}icon{{=}}no{{))}}'''<br />
{{))}}}}
 
results in
 
<table class="infobox geography vcard" style="width: 22em; font-size: 88%; float: left; clear: both;">
<tr class="adr">
<th colspan="3" align="center" class="mergedtoprow" style="line-height:1.2em; padding:0.25em 0.33em 0.33em; font-size:1.25em;"><span class="fn org country-name">French Republic</span>
<div style="padding-top:0.25em;">{{native name|fr|République française|icon=no}}</div>
</th>
</tr>
</table>
 
<p style="clear:both">&nbsp;</p>


{| class="wikitable"
! Code !! Result
|-
| <pre>
{{Infobox settlement
|name = The Hague
|native_name = {{native name|nl|DenHaag}}
}}
</pre>
|valign="middle"|
{{Infobox settlement
|name = The Hague
|native_name = {{native name|nl|DenHaag}}
}}
|-
| <pre>
{{Infobox settlement
|name = French Republic
|native_name = {{native name|fr|République française|paren=off}}
}}
</pre>
|valign="middle"|
{{Infobox settlement
|name = French Republic
|native_name = {{native name|fr|République française|paren=off}}
}}
|}
===Note===
===Note===
When the ''paren'' or ''icon'' and ''italics'' or ''italic'' parameters are set to "off" (or "no"), this template is equivalent to the {{tl|lang}} template.
When the ''paren'' (or ''icon'') and ''italics'' (or ''italic'') parameters are set to "off" (or "no"), this template is equivalent to the {{tl|lang}} template.


== Annotated code ==
== Annotated code ==

Revision as of 02:35, 2 December 2012

Convenience template, based on {{lang}} and {{ISO 639 name}}, to indicate the language of a place's native name. The language is appended as a parenthesis, inTemplate:Spaced ndashby current defaultsTemplate:Spaced ndashitalics and a slightly smaller size:

Deutschland  (German)

The template's defaults can be overridden and the parenthesis even excluded, in which case there may be no visible changes to the text where it's used. It still, however, identifies the native name as a linguistic element using the HTML span tag, which web browsers and screen readers can use to select an appropriate font, pronunciation, etc.

Usage

Syntax

Common
{{native name|ISO 639 language code|the native name}}

So, the code for the example at the top of this page would be {{native name|de|Deutschland}}.

Parameters

Required parameters shown in bold italics.

Parameter name Description and example/s
[first unnamed] The ISO 639 code for the native language. French, for instance, is "fr"; Spanish is "es"; Arabic is "ar"; etc.
[second unnamed] The native name, in the native language (with accents, etc).
italics
or italic
Set to "off" (or "no") to disable displaying the native name in italics.
|italics=off
paren
or icon
Set to "off" (or "no") to suppress the appearance of the native language's name in barackets after the native name.
|paren=off
nbsp Set to "no" to suppress the addition of a second space between the native name and the native language's name in brackets.
Generally works in tandem with the italics or italic and/or paren or icon switches, as the automatic addition of the second space prevents the native name in italics from appearing to lean into the following bracket.
|nbsp=no
fontsize Use to set a font-size for the language name in brackets that differs from the default.
|fontsize=80%
nolink Set to anything (usually "yes") to suppress the appearance of the native language's name as a link.
More complex

Code for the same name "Deutschland" above but with italics and nbsp switched off, nolink switched on and a fontsize of 80%:

{{native name|de|Deutschland|italics=off|nbsp=off|nolink=yes|fontsize=80%}}

Result:

Deutschland (German)

Older examples

Code Result
{{Infobox settlement
|name = The Hague
|native_name = {{native name|nl|DenHaag}}
}}
Script error: No such module "Settlement short description".
The Hague

DenHaag  (Dutch)
{{Infobox settlement
|name = French Republic
|native_name = {{native name|fr|République française|paren=off}}
}}
Script error: No such module "Settlement short description".
French Republic

République française

Note

When the paren (or icon) and italics (or italic) parameters are set to "off" (or "no"), this template is equivalent to the {{lang}} template.

Annotated code

                              width 80 characters
--------------------------------------------------------------------------------

{{lang |{{{1}}}                                                       <!--[a]-->
 |<!---->{{#switch:{{{italics|{{{italic|}}}}}}|no|off=|''}}<!--
      -->{{{2}}}<!--                                                  <!--[b]-->
      -->{{#switch:{{{italics|{{{italic|}}}}}}|no|off=|''}}
}}<!--
-->{{#switch:{{{paren|{{{icon|}}}}}}|no|off=                          <!--[c]-->
    |#default=&nbsp;<!--
     -->{{#switch:{{{italics|{{{italic|}}}}}}|no|off=                 <!--[d]-->
         |{{#ifeq:{{{nbsp|}}}|no |                                    <!--[e]-->
           |&nbsp;}}<!--
       -->}}<!--
     --><span class="languageicon"
              style="font-size:{{{fontsize|90%}}};font-weight:normal;"><!--
       -->{{#if:{{{nolink|}}} |({{ISO 639 name|{{{1}}}}})             <!--[f]-->
           |{{#ifexist:Template:ISO 639 name {{{1}}}                  <!--[g]-->
              |([[{{ISO 639 name|{{{1}}}}} language|{{ISO 639 name|{{{1}}}}}]])
              |(language?)<!--                                        <!--[h]-->
          -->}}<!--
       -->}}<!--
     --></span><!--
-->}}


--------------------------------------------------------------------------------
Legend
[a] {{{1}}} = ISO 639 language code.
[b] {{{2}}} = the foreign-language placename. Displayed in italics unless
                                                italics or italic = off (or no).
[c] If paren (or icon) = off (or no), omit linked language name (in brackets).
[d] If placename in italics,
[e] then, unless nbsp=no, add an extra space after it (to stop italics leaning
                                             into the parenthesis that follows).
[f] If nolink set, display unlinked language name,
[g] else if a link for this language name exists, display it as
             "[[(name) language|(name)]]" (e.g. "([[French language|French]])"),
[h] else return the error query "(language?)".