Ŝablono:Internationalization template doc
El Komunejo
(→Documentation: documented that localcat= requires fully linked cat and sortkey (with example)) |
(add 1= syntax when translation parameter contains a link, either wikilink or html link; otherwise users get baffled by blank result) |
||
Linio 5: | Linio 5: | ||
== Usage == | == Usage == | ||
* <nowiki>{{</nowiki><includeonly>{{lc:{{PAGENAME}}}}</includeonly><noinclude>en</noinclude>|''{{language|<includeonly>{{lc:{{PAGENAME}}}}</includeonly><noinclude>en</noinclude>}} translation''}} | * <nowiki>{{</nowiki><includeonly>{{lc:{{PAGENAME}}}}</includeonly><noinclude>en</noinclude>|''{{language|<includeonly>{{lc:{{PAGENAME}}}}</includeonly><noinclude>en</noinclude>}} translation''}} | ||
+ | * <nowiki>{{</nowiki><includeonly>{{lc:{{PAGENAME}}}}</includeonly><noinclude>en</noinclude>|1=''{{language|<includeonly>{{lc:{{PAGENAME}}}}</includeonly><noinclude>en</noinclude>}} translation with links''}} | ||
* <nowiki>{{</nowiki><includeonly>{{lc:{{PAGENAME}}}}</includeonly><noinclude>en</noinclude>|''{{language|<includeonly>{{lc:{{PAGENAME}}}}</includeonly><noinclude>en</noinclude>}} translation''|inline=yes}} | * <nowiki>{{</nowiki><includeonly>{{lc:{{PAGENAME}}}}</includeonly><noinclude>en</noinclude>|''{{language|<includeonly>{{lc:{{PAGENAME}}}}</includeonly><noinclude>en</noinclude>}} translation''|inline=yes}} | ||
- | Result: {{{{lc:<includeonly>{{PAGENAME}}</includeonly><noinclude>en</noinclude>}}|{{language|{{lc:{{PAGENAME}}}}}} translation}} or {{{{lc:<includeonly>{{PAGENAME}}</includeonly><noinclude>en</noinclude>}}|{{language|{{lc:{{PAGENAME}}}}}} translation|inline=yes}}. | + | Result: {{{{lc:<includeonly>{{PAGENAME}}</includeonly><noinclude>en</noinclude>}}|{{language|{{lc:{{PAGENAME}}}}}} translation}} or {{{{lc:<includeonly>{{PAGENAME}}</includeonly><noinclude>en</noinclude>}}|{{language|{{lc:{{PAGENAME}}}}}} translation with links}} or {{{{lc:<includeonly>{{PAGENAME}}</includeonly><noinclude>en</noinclude>}}|{{language|{{lc:{{PAGENAME}}}}}} translation|inline=yes}}. |
See also: [[Commons:Multilinguality]].<!-- | See also: [[Commons:Multilinguality]].<!-- |
Kiel registrite je 16:52, 23. Nov 2008
Enhavo |
Usage
- {{en|English translation}}
- {{en|1=English translation with links}}
- {{en|English translation|inline=yes}}
Result:
or
or English: internationalization template doc translation.
See also: Commons:Multilinguality.
Documentation
The above is what this template creates if the name of this page was Template:En. When transcluded, {{PAGENAME}} is used to generate the name of the language either by using {{#language:}} or a language specific template like the English one {{language}}. It's a quick way to add documentation to Ŝablono:C, specifically the language ones like {{es}} and {{de}} that use {{description}}. If a translation exists in the local language, this will be placed before the English version. See {{fr}} for an example.
Only the English and the local language's documentation (if exists) show up default. Up to 8 other translations can be added (these will be in the order specified underneath the local and English translations. For example: {{internationalization template doc|de|es|fr|ja|...}}
Add the following immediately after the template; do not start a new line:
<noinclude>{{internationalization template doc}}</noinclude>
This will also categorize the template into Category:Language templates and Category:Commons-ISO_code if it exists. The latter can be changed or removed using localcat=
followed by one or more completely linked category, sortkey included, such as:
<noinclude>{{internationalization template doc|localcat=[[Category:Foo|{{PAGENAME}}]][[Category:Bar|{{PAGENAME}}]]}}</noinclude>
Adding translations
There's not much to translate here. Just copy and paste the following, translate the English parts, and save. It will create a template loop, but that's ok since they'll work right when called by this template (they shouldn't be used or viewed directly). There's no /lang page to edit. The 'inline
' must stay the same, the "yes" can be whatever.
== Usage == * <nowiki>{{</nowiki>{{lc:{{PAGENAME}}}}|''{{#language:{{lc:{{PAGENAME}}}}}} translation''}} * <nowiki>{{</nowiki>{{lc:{{PAGENAME}}}}|''{{#language:{{lc:{{PAGENAME}}}}}} translation''|inline=yes}} Result: {{{{lc:{{PAGENAME}}}}|{{#language:{{lc:{{PAGENAME}}}}}} translation}} or {{{{lc:{{PAGENAME}}}}|{{#language:{{lc:{{PAGENAME}}}}}} translation|inline=yes}}. See also: [[Commons:Multilinguality]].<noinclude> [[Category:Template documentation|{{PAGENAME}}]] </noinclude>
- Current translation subpages:
Internationalization template doc/ |
See also
- Ŝablono:Mwl2 - Returns the local language name of a ISO language code.
- {{language}} - Returns the English language name of a ISO language code.