Template:Native name/doc: Difference between revisions
meta>Sardanaphalus sandbox non-categorization |
meta>Sardanaphalus \sandbox, tc, headings |
||
Line 1: | Line 1: | ||
<noinclude>{{Documentation subpage}}</noinclude> | <noinclude>{{Documentation subpage}}</noinclude> | ||
<!----EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE----> | <!----EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE----> | ||
An inline formatting template, based on {{tl|lang}} and {{tl|ISO 639 name}}, for indicating the language in which a native name has been given. By default, the native name is displayed in italics, followed by the language's name in parentheses in a smaller font size. For example: | An inline formatting template, based on {{tl|lang}} and {{tl|ISO 639 name}}, for indicating the language in which a native name has been given. By default, the native name is displayed in italics, followed by the language's name in parentheses in a smaller font size. For example: | ||
: {{native name|de|Deutschland}} | : {{native name{{\sandbox}}|de|Deutschland}} | ||
The template's defaults can be overridden and the parentheses 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 and div|span]]'' tag, which web browsers and [[screen reader]]s can use to select an appropriate font, pronunciation, etc. | The template's defaults can be overridden and the parentheses 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 and div|span]]'' tag, which web browsers and [[screen reader]]s can use to select an appropriate font, pronunciation, etc. | ||
== | == Syntax == | ||
; Common | ; Common | ||
{{ | : {{tc|native name|''[[ISO 639]] language code''|''the native name''}} | ||
The code for the example at the start of this documentation would, therefore, be: | |||
: <code><nowiki>{{native name|de|Deutschland}}</nowiki></code> | : <code><nowiki>{{native name|de|Deutschland}}</nowiki></code> | ||
== Parameters == | |||
Required parameters shown in '''''bold italics'''''. | Required parameters shown in '''''bold italics'''''. | ||
Line 42: | Line 42: | ||
|- | |- | ||
| ''fontsize'' | | ''fontsize'' | ||
| Use to set a font-size for the language name in parentheses different from the default (85%). | | Use to set a font-size for the language name in parentheses different from the default<!-- (85%)-->. | ||
: <code><nowiki>|fontsize=80%</nowiki></code> | : <code><nowiki>|fontsize=80%</nowiki></code> | ||
|- | |- | ||
Line 48: | Line 48: | ||
| Set to anything (usually "yes") to suppress the appearance of the native language's name as a link. | | Set to anything (usually "yes") to suppress the appearance of the native language's name as a link. | ||
|} | |} | ||
; More complex examples | ; More complex examples | ||
Code and result for the same name "Deutschland" above but with ''italics'' and ''nbsp'' switched off, ''nolink'' switched on and a ''fontsize'' of 80%: | Code and result for the same name "Deutschland" above but with ''italics'' and ''nbsp'' switched off, ''nolink'' switched on and a ''fontsize'' of 80%: | ||
: <code><nowiki>{{native name|de|Deutschland|italics=off|nbsp=off|nolink=yes|fontsize=80%}}</nowiki></code> | : <code><nowiki>{{native name|de|Deutschland|italics=off|nbsp=off|nolink=yes|fontsize=80%}}</nowiki></code> | ||
: {{native name|de|Deutschland|italics=off|nbsp=off|nolink=yes|fontsize=80%}} | : {{native name{{\sandbox}}|de|Deutschland|italics=off|nbsp=off|nolink=yes|fontsize=80%}} | ||
Retaining no italics but suppressing the parentheses: | Retaining no italics but suppressing the parentheses: | ||
: <code><nowiki>{{native name|de|Deutschland|italics=off|paren=off}}</nowiki></code> | : <code><nowiki>{{native name|de|Deutschland|italics=off|paren=off}}</nowiki></code> | ||
: {{native name|de|Deutschland|italics=off|paren=off}} | : {{native name{{\sandbox}}|de|Deutschland|italics=off|paren=off}} | ||
This result is the same as if the {{tl|lang}} template had been used. | This result is the same as if the {{tl|lang}} template had been used. | ||
Line 66: | Line 67: | ||
| <pre> | | <pre> | ||
{{Infobox settlement | {{Infobox settlement | ||
|name = The Hague | | name = The Hague | ||
|native_name = {{native name|nl|Den Haag}} | | native_name = {{native name|nl|Den Haag}} | ||
}} | }} | ||
</pre> | </pre> | ||
|valign="middle"| | |valign="middle"| | ||
{{Infobox settlement | {{Infobox settlement | ||
|name = The Hague | | name = The Hague | ||
|native_name = {{native name|nl|Den Haag}} | | native_name = {{native name{{\sandbox}}|nl|Den Haag}} | ||
}} | }} | ||
|- | |- | ||
| <pre> | | <pre> | ||
{{Infobox country | {{Infobox country | ||
|conventional_long_name = French Republic | | conventional_long_name = French Republic | ||
|native_name = {{native name|fr|République française|paren=off}} | | native_name = {{native name|fr|République française|paren=off}} | ||
}} | }} | ||
</pre> | </pre> | ||
|valign="middle"| | |valign="middle"| | ||
{{Infobox country | {{Infobox country | ||
|conventional_long_name = French Republic | | conventional_long_name = French Republic | ||
|native_name = {{native name|fr|République française|paren=off}} | | native_name = {{native name{{\sandbox}}|fr|République française|paren=off}} | ||
}} | }} | ||
|} | |} | ||
Line 133: | Line 134: | ||
</pre> | </pre> | ||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | | |||
<includeonly> | |||
{{#ifeq:{{SUBPAGENAME}}|sandbox | | | |||
[[Category:Wikipedia formatting and function templates]] | [[Category:Wikipedia formatting and function templates]] | ||
[[bn:টেমপ্লেট:Native name]] | [[bn:টেমপ্লেট:Native name]] | ||
[[mk:Шаблон:Изворно име]] | [[mk:Шаблон:Изворно име]] | ||
}} | }}</includeonly> | ||
</includeonly> |
Revision as of 19:01, 12 September 2014
This is a documentation subpage for Template:Native name. It may contain usage information, categories and other content that is not part of the original template page. |
An inline formatting template, based on {{lang}} and {{ISO 639 name}}, for indicating the language in which a native name has been given. By default, the native name is displayed in italics, followed by the language's name in parentheses in a smaller font size. For example:
- Deutschland (German)
The template's defaults can be overridden and the parentheses 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.
Syntax
- Common
{{native name|ISO 639 language code|the native name}}
The code for the example at the start of this documentation would, therefore, 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.
|
paren (or icon) |
Set to "off" (or "no") to suppress the appearance of the native language's name in brackets after the native name.
|
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.
|
fontsize | Use to set a font-size for the language name in parentheses different from the default.
|
nolink | Set to anything (usually "yes") to suppress the appearance of the native language's name as a link. |
- More complex examples
Code and result 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%}}
- Deutschland (German)
Retaining no italics but suppressing the parentheses:
{{native name|de|Deutschland|italics=off|paren=off}}
- Deutschland
This result is the same as if the {{lang}} template had been used.
Other examples
Code | Result | |||
---|---|---|---|---|
{{Infobox settlement | name = The Hague | native_name = {{native name|nl|Den Haag}} }} |
Script error: No such module "Settlement short description".
| |||
{{Infobox country | conventional_long_name = French Republic | native_name = {{native name|fr|République française|paren=off}} }} |
|
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= <!-- -->{{#switch:{{{italics|{{{italic|}}}}}}|no|off= <!--[d]--> |{{#ifeq:{{{nbsp|}}}|no | <!--[e]--> | }}<!-- -->}}<!-- --><span class="languageicon" style="font-size:{{{fontsize|85%}}};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?)".