Difference between revisions of "Template:Link language/Notes"
m (1 revision imported) |
m (1 revision imported) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | '''<nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki>''' is a template usually used to indicate to readers that an external link is in a {{#ifeq:{{ | + | __NOEDITSECTION__ |
+ | {{lowercase title}} | ||
+ | <!--NOTE: This template is used as documentation for multiple language icon templates in Category:Language icon templates--> | ||
+ | |||
+ | '''<nowiki>{{</nowiki>{{lcfirst:{{BASEPAGENAME}}}}<nowiki>}}</nowiki>''' is a template usually used to indicate to readers that an external link is in a {{ | ||
+ | #ifeq: {{str rightc|{{BASEPAGENAME}}|4}} | icon | ||
+ | | foreign language ({{#invoke:Lang|name_from_code|{{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}}|link=yes}}{{ | ||
+ | #if: {{{cat-lang|}}} | ||
+ | |  or [[{{{cat-lang}}} language|{{{cat-lang}}}]] | ||
+ | }}); | ||
+ | | foreign language; | ||
+ | }} no parameters are needed. | ||
It should generally be placed after the external link, although this is not set in stone. For more information, see [[Wikipedia:Manual of Style (links)#Non-English-language sites|the Manual of Style]]. | It should generally be placed after the external link, although this is not set in stone. For more information, see [[Wikipedia:Manual of Style (links)#Non-English-language sites|the Manual of Style]]. | ||
− | The template uses the {{ | + | The template uses the {{tlxb|Link language|{{ |
+ | #ifeq: {{str rightc|{{BASEPAGENAME}}|4}} | icon | ||
+ | | {{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}} | ||
+ | | xx | ||
+ | }}}} format, but is shortened by simply having the name <code><nowiki>{{</nowiki>{{ | ||
+ | #ifeq: {{str rightc|{{BASEPAGENAME}}|4}} | icon | ||
+ | | {{lcfirst:{{BASEPAGENAME}}}} | ||
+ | | xx icon | ||
+ | }}<nowiki>}}</nowiki></code>, where <code>{{ | ||
+ | #ifeq: {{str rightc|{{BASEPAGENAME}}|4}} | icon | ||
+ | | {{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}} | ||
+ | | xx | ||
+ | }}</code> represents the {{ | ||
+ | #ifeq:{{str len|{{str crop|{{BASEPAGENAME}}|5}}}}|2 | ||
+ | | [[ISO 639-1]] | ||
+ | }}{{ | ||
+ | #ifeq:{{str len|{{str crop|{{BASEPAGENAME}}|5}}}}|3 | ||
+ | | [[ISO 639-2]] or [[ISO 639-3]] | ||
+ | }} language code. Please be aware that [[language code]]s do not always coincide with<!-- /are not always the same as --> [[country code]]s (see the list of [[ISO 3166-1]] codes). | ||
− | For citations, the | + | For citations, use the {{para|language}} parameter of the various citation templates: {{tlx|cite web}}, {{tlx|cite news}}, {{tlx|cite journal}}, etc. |
− | [[:Category:Language icon templates]] contains a full list of the templates that can be used.{{#if:{{{addendum|}}}|<div id="addendum">{{{addendum}}}</div>}} | + | [[:Category:Language icon templates]] contains a full list of the templates that can be used. |
+ | {{#if: {{{addendum|}}} | ||
+ | | <div id="addendum"> | ||
+ | {{{addendum}}}<!-- start on new line in case text starts with ==Heading== --> | ||
+ | </div> | ||
+ | }} | ||
+ | ==User-defined CSS== | ||
+ | Logged in users can change the appearance of the template's output using [[CSS]] with the <code>languageicon</code> class. For example, edit [[Special:MyPage/common.css]] and add {{code|lang=css|span.languageicon { font-weight: bold; }<nowiki />}}. That would result in {{tld|{{ | ||
+ | #ifeq: {{str rightc|{{BASEPAGENAME}}|4}} | icon | ||
+ | | {{lcfirst:{{BASEPAGENAME}}}} | ||
+ | | fr icon | ||
+ | }}}} being displayed as <span style="font-weight: bold;">(in {{#invoke:Lang|name_from_code|{{ | ||
+ | #ifeq: {{str rightc|{{BASEPAGENAME}}|4}} | icon | ||
+ | | {{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}} | ||
+ | | fr | ||
+ | }}}})</span> instead of (in {{#invoke:Lang|name_from_code|{{ | ||
+ | #ifeq: {{str rightc|{{BASEPAGENAME}}|4}} | icon | ||
+ | | {{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}} | ||
+ | | fr | ||
+ | }}}}). | ||
+ | {{#ifexist: Category:Articles with {{ | ||
+ | #if: {{{cat-lang|}}} | ||
+ | | {{{cat-lang}}} | ||
+ | | {{#invoke:Lang|name_from_code|{{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}}}} | ||
+ | }}-language external links | ||
+ | | | ||
+ | ==Category added to articles== | ||
+ | Articles using '''<nowiki>{{</nowiki>{{lcfirst:{{BASEPAGENAME}}}}<nowiki>}}</nowiki>''' are automatically added | ||
+ | to {{clc|Articles with {{ | ||
+ | #if: {{{cat-lang|}}} | ||
+ | | {{{cat-lang}}} | ||
+ | | {{#invoke:Lang|name_from_code|{{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}}}} | ||
+ | }}-language external links}}. | ||
+ | }} | ||
+ | ==Supporting templates== | ||
+ | * {{tl|Link language}} | ||
==See also== | ==See also== | ||
− | + | {{#ifexist: Template:Lang-{{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}} | |
− | {{ | + | | |
− | *{{tl|Lang}}, and its opposite, {{tl|Language with name/for}}<noinclude> | + | * {{tl|Lang-{{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}}}} |
− | + | }} | |
− | {{Documentation}} | + | * {{tl|Lang}}, and its opposite, {{tl|Language with name/for}} |
− | <!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES | + | * [[List of ISO 639-1 codes]], [[List of ISO 639-2 codes]], and [[List of ISO 639-3 codes]] |
+ | {{#ifeq: {{str len|{{str crop|{{BASEPAGENAME}}|5}}}} | 2 | ||
+ | | | ||
+ | == External links == | ||
+ | * {{cite web |url=http://www.loc.gov/standards/iso639-2/php/langcodes_name.php?iso_639_1={{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}} |title=ISO 639-1 identifier: {{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}} |website=Library of Congress}} | ||
+ | }}{{ | ||
+ | #ifeq: {{str len|{{str crop|{{BASEPAGENAME}}|5}}}} | 3 | ||
+ | | | ||
+ | == External links == | ||
+ | * {{cite web |url=http://www-01.sil.org/iso639-3/documentation.asp?id={{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}} |title=ISO 639-3 identifier: {{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}} |website=SIL International}} | ||
+ | }}<includeonly>{{When on basepage| | ||
+ | <!-- Categories added to templates which transclude this documentation file --> | ||
+ | [[Category:Language icon templates|{{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}}}}]]{{ | ||
+ | #ifexist: ISO 639:{{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}} | ||
+ | | <!-- no action if language code has an ISO 639 redirect --> | ||
+ | | [[Category:Language icon templates with other than ISO 639]] | ||
+ | }}{{ | ||
+ | #switch: {{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}} | ||
+ | <!-- reserved ISO 639 codes, not used for a specific country --> | ||
+ | | mis | mul | und | zxx = [[Category:Language icon templates with other than ISO 639]] | ||
+ | }}{{ | ||
+ | #if: {{Str len|{{BASEPAGENAME}}}} = 8 <!-- minus 5 for " icon" leaves 3 for character code --> | ||
+ | | {{ | ||
+ | #switch: {{lcfirst:{{str left|{{BASEPAGENAME}}|2}}}} | ||
+ | <!-- reserved ISO 639 codes, qaa - qtz are for local use --> | ||
+ | | qa | qb | qc | qd | qe | qf | qg | qh | qi | qj | qk | ql | qm | qn | qo | qp | qq | qr | qs | ||
+ | | qt = [[Category:Language icon templates with other than ISO 639]] | ||
+ | }} | ||
+ | }}{{ | ||
+ | #ifexist: Category:Articles with {{#invoke:Lang|name_from_code|{{lcfirst:{{str crop|{{BASEPAGENAME}}|5}}}}}}-language external links | ||
+ | | [[Category:Templates that add a tracking category]] | ||
+ | }} | ||
+ | }}</includeonly><noinclude> | ||
+ | {{Documentation}}<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES TO THE /doc SUBPAGE, THANKS --> | ||
</noinclude> | </noinclude> |
Latest revision as of 02:08, 8 August 2019
{{link language}} is a template usually used to indicate to readers that an external link is in a foreign language; no parameters are needed.
It should generally be placed after the external link, although this is not set in stone. For more information, see the Manual of Style.
The template uses the {{Link language|xx}}
format, but is shortened by simply having the name {{xx icon}}
, where xx
represents the language code. Please be aware that language codes do not always coincide with country codes (see the list of ISO 3166-1 codes).
For citations, use the |language=
parameter of the various citation templates: {{cite web}}
, {{cite news}}
, {{cite journal}}
, etc.
Category:Language icon templates contains a full list of the templates that can be used.
User-defined CSS
Logged in users can change the appearance of the template's output using CSS with the languageicon
class. For example, edit Special:MyPage/common.css and add <syntaxhighlight lang="css" class="" id="" style="" inline="1">span.languageicon { font-weight: bold; }</syntaxhighlight>. That would result in {{fr icon}}
being displayed as (in French) instead of (in French).
Supporting templates
- {{Link language}}
See also
- {{Lang}}, and its opposite, {{Language with name/for}}
- List of ISO 639-1 codes, List of ISO 639-2 codes, and List of ISO 639-3 codes
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |