Difference between revisions of "Template:Translation switching"
(smaller footprint) |
GrampaSwood (talk | contribs) (Prevent adding the category if used on User space, since it is often used on there and thus requires being hidden each time) |
||
(19 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ ambox | style = border: 1px solid #0F5F85; background-color: #DEE8ED; | image = Globeicon.png | imagewidth = 36px | + | {{ ambox | type = notice | style = border: 1px solid #0F5F85; background-color: #DEE8ED; margin: 0.75em 10%; |
− | | contents = {{ambox/message | + | | image = Globeicon.png | imagewidth = 36px | contents = {{ambox/message |
| 2style = font-size: 95%; | | 2style = font-size: 95%; | ||
− | | 2 = This template uses [[Help: | + | | 2 = This template uses [[Help:Translation switching|translation switching]]. The correct language will be displayed automatically. |
| 3style = font-size: 90%; | | 3style = font-size: 90%; | ||
− | | 3 = Localized versions of this template (e.g. '' | + | | 3 = Localized versions of this template (e.g. ''{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{PAGENAME}}/ru'') are not necessary. Add your translations directly to this template by [{{fullurl:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{PAGENAME}}|action=edit}} editing it].{{#if:{{{2|}}}{{{note|}}} |
+ | | <br />'''Note''': {{{2|{{{note}}}}}} | ||
+ | }}<br />'''Supported languages for this template''': {{{1|none}}} ([{{fullurl:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{PAGENAME}}|action=edit}} add]) | ||
}} | }} | ||
− | }}<includeonly>[[Category:Templates that use translation switching|{{PAGENAME}}]]< | + | }}<includeonly>{{#ifeq:{{NAMESPACE}}|User||[[Category:Templates that use translation switching|{{PAGENAME}}]]}}<!-- |
− | + | // If no languages are listed, place the page in a category. If languages listed is "en", "none", etc, also add the category. | |
− | + | -->{{#if:{{{1|}}} | |
− | + | | {{#switch:{{lc:{{{1|}}}}} | |
+ | | blank | ||
+ | | en | ||
+ | | n/a | ||
+ | | none = {{#ifeq:{{NAMESPACE}}|Template|[[Category:Templates requiring translation|{{PAGENAME}}]]}} | ||
+ | | #default = <!-- NULL --> | ||
+ | }} | ||
+ | | [[Category:Templates requiring translation|{{PAGENAME}}]] | ||
+ | }}</includeonly><noinclude> | ||
+ | {{doc begin}} | ||
+ | This template is used to mark the pages of other templates that use '''[[Help:Translation switching|translation switching]]'''. Pages are automatically placed into the category [[:Category:Templates that use translation switching|Templates that use translation switching]] to find them later with ease. | ||
+ | === Usage === | ||
+ | Place {{tl|translation switching}} (or {{tl|ts}}) inside the {{code|<noinclude>}} tags and above the documentation template (either {{tl|doc begin}} or {{tl|template doc}}). | ||
+ | |||
+ | * Add the languages supported by the template as part of the first parameter: e.g. {{tlx|translation switching|ar, cs, fr, it, pt, ru}} | ||
+ | * If no languages are added, the template will display "none" and categorize the page into [[:Category:Templates requiring translation]]. | ||
+ | * Notes can be added also: {{tlx|translation switching|ar, cs, fr, it, pt, ru|Only one line requires translation.}} | ||
+ | |||
+ | === See also === | ||
+ | * [[Help:Translation switching]] | ||
+ | * [[Help:Language translation]] | ||
+ | |||
+ | [[Category:Language templates|Translation switching]] | ||
[[Category:Maintenance templates|Translation switching]] | [[Category:Maintenance templates|Translation switching]] | ||
</noinclude> | </noinclude> |
Latest revision as of 18:24, 17 September 2024
This template uses translation switching. The correct language will be displayed automatically. Localized versions of this template (e.g. Template:Translation switching/ru) are not necessary. Add your translations directly to this template by editing it. Supported languages for this template: none (add) |
Documentation for Translation switching
This template is used to mark the pages of other templates that use translation switching. Pages are automatically placed into the category Templates that use translation switching to find them later with ease.
Usage
Place {{translation switching}}
(or {{ts}}
) inside the <noinclude>
tags and above the documentation template (either {{doc begin}}
or {{template doc}}
).
- Add the languages supported by the template as part of the first parameter: e.g.
{{translation switching|ar, cs, fr, it, pt, ru}}
- If no languages are added, the template will display "none" and categorize the page into Category:Templates requiring translation.
- Notes can be added also:
{{translation switching|ar, cs, fr, it, pt, ru|Only one line requires translation.}}