Template:Lang-x/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Trappist the monk
m (not sandbox;)
m (156 revisions imported)
 
(20 intermediate revisions by 10 users not shown)
Line 1: Line 1:
__NOEDITSECTION__{{Documentation subpage|multiple templates located in [[:Category:Lang-x templates]]}}
__NOEDITSECTION__{{Documentation subpage|multiple templates located in [[:Category:Lang-x templates]]}}
{{COinS safe|n}}
{{COinS safe|n}}
{{No subst}}
{{#if:{{#invoke:Lang/documentor tool|uses_module|template={{ROOTPAGENAME}}}}|{{lua|Module:lang}}}}
{{#if:{{#invoke:Lang/documentor tool|uses_module|template={{ROOTPAGENAME}}}}|{{lua|Module:lang}}}}
<!--NOTE: This template is also used as documentation for multiple Language-x templates in Category:Language icon templates-->
<!--NOTE: This template is also used as documentation for multiple Language-x templates in Category:Language icon templates-->
Line 6: Line 7:
== Usage ==
== Usage ==
{{#invoke:Lang/documentor tool|lang_xx_settings|template={{ROOTPAGENAME}}}}
{{#invoke:Lang/documentor tool|lang_xx_settings|template={{ROOTPAGENAME}}}}
Template {{Tlf|'''{{lcfirst:{{BASEPAGENAME}}}}'''|nolink=yes}} indicates to readers the original form of a term or phrase in {{#if:{{#invoke:Lang/documentor tool|uses_module|template={{ROOTPAGENAME}}}}|[[{{#invoke:String|replace|{{#invoke:Lang|name_from_code|{{#invoke:String|sub|{{ROOTPAGENAME}}|6}}}}|(.+) languages|%1||false}} language]]|
The language template {{Tlf|'''{{lcfirst:{{BASEPAGENAME}}}}'''|nolink=yes}} identifies {{#ifeq:{{FULLPAGENAME}}|Template:Lang-x/doc|foreign language|{{#invoke:Lang|name_from_tag|link=yes|{{#invoke:String|sub|{{ROOTPAGENAME}}|6}}}}}} text. The term or phrase is the only mandatory parameter. The text is formatted according to recommendations in {{section link|Wikipedia:Manual of Style/Text formatting#Foreign terms}}; italics for languages that use the [[Latin alphabet]]<!-- Not the same thing as Romance languages and Latinate languages-->, normal for others.
{{#ifeq:{{FULLPAGENAME}}|Template:Lang-x/doc|a foreign|[[{{ISO 639 name {{lcfirst:{{Str right|{{BASEPAGENAME}}|5}}}}}} language|{{ISO 639 name {{lcfirst:{{Str right|{{BASEPAGENAME}}|5}}}}}}]]}} language}}. The term or phrase is the only mandatory parameter. The text is formatted according to recommendations in [[Wikipedia:Manual of Style/Text formatting#Foreign terms]] (italics for Latin-script languages, regular for others).


The template should generally be placed after the English translation of the foreign term or phrase.
The template should generally be placed after the English translation of the foreign term or phrase.
Line 13: Line 13:
The parameter <!--Not implemented in all templates yet! {{Para|link|no}} (or {{Para|links|no}})--> {{Para|links|no}} prevents the language name from being linked.
The parameter <!--Not implemented in all templates yet! {{Para|link|no}} (or {{Para|links|no}})--> {{Para|links|no}} prevents the language name from being linked.


The parameter {{Para|translit}} enables a transliteration (of the original text with the Latin alphabet) to be given. The templates that have this param are [https://en.wikipedia.org/w/index.php?title=Special:WhatLinksHere/Template:Language_with_name_and_transliteration&namespace=10&limit=500&hidelinks=1 listed here]. (This parameter is not supported by <code>lang-{{var|x}}</code> templates for languages that are already written in Latin script.)
The parameter {{Para|translit}} allows for a [[Romanization]] to be identified. The templates that have this parameter are <span class="plainlinks">[//en.wikipedia.org/w/index.php?title=Special:WhatLinksHere/Template:Language_with_name_and_transliteration&namespace=10&limit=500&hidelinks=1 listed here]</span>. (This parameter is not supported by <code>lang-{{var|x}}</code> templates for languages that are already written in Latin script.)


The parameter {{Para|lit}} enables a literal translation (in English) to be given. It [[Template talk:Language with name#Suggestion: An optional literal translation|is being rolled out]] to these templates and so may be available for {{Tlf|{{lcfirst:{{BASEPAGENAME}}}}|nolink=yes}}.
The parameter {{Para|lit}} enables a literal translation (in English) to be given. It [[Template talk:Language with name#Suggestion: An optional literal translation|is being rolled out]] to these templates and so may be available for {{Tlf|{{lcfirst:{{BASEPAGENAME}}}}|nolink=yes}}.
Line 20: Line 20:
{{#lst:Template:Lang-x/doc/parameters|lang_xx_parameters}}
{{#lst:Template:Lang-x/doc/parameters|lang_xx_parameters}}
}}
}}
== Examples ==
== Examples ==
The following examples show translations from German.
The following examples show translations from German.
Line 42: Line 43:
|}}<!-- /tracking-category -->
|}}<!-- /tracking-category -->
|}}<!-- /category OR tracking-category -->
|}}<!-- /category OR tracking-category -->
== Supporting templates ==
{{#if:{{#invoke:Lang/documentor tool|uses_module|template={{ROOTPAGENAME}}}}||
* One of the following: {{Tl|Language with name}}, {{Tl|Language with name2}}, {{Tl|Language with name and transliteration}}, or {{Tl|Language family with name}}
== Supporting templates ==<!-- render 'Supporting template' section only for those {{tld|lang-??}} templates that do not use [[Module:lang]] -->
* {{Tl|Lang}} – used by the templates listed above
This template may use one of the following templates:
* {{Tl|ISO 639 name}} and {{Tl|Category handler}} – used by {{Tlf|Lang}} to add a category
* {{Tl|Language with name}}
{{#ifexist:Template:ISO 639 name {{Str right|{{BASEPAGENAME}}|5}}|
* {{Tl|Language with name2}}
* {{Tl|ISO 639 name {{Str right|{{BASEPAGENAME}}|5}}}} – used by {{Tlf|Lang}}, via {{Tlf|ISO 639 name}}, to add articles to {{Clc|Articles containing {{ISO 639 name {{Str right|{{BASEPAGENAME}}|5}}}}-language text}}
* {{Tl|Language with name and transliteration}}
* {{Tl|Language family with name}}
All of the above use {{Tl|Lang}}
}}
}}
== TemplateData ==
== TemplateData ==
{{TemplateData header}}
{{TemplateData header}}
Line 63: Line 65:
"links": {
"links": {
"label": "Display link",
"label": "Display link",
"description": "Set to no to disable the link to the article's language.",
"description": "Set to 'no' to disable the link to the article's language.",
"type": "boolean"
"type": "boolean"
},
},
"lit": {
"lit": {
"label": "Literal translation",
"label": "Literal translation",
"description": "The literal translation of the foreign text"
"description": "The literal translation of the foreign text.",
"type": "string"
},
},
"translit": {
"translit": {
"label": "Transliteration",
"label": "Transliteration",
"description": "The transliteration of the foreign text, for languages that do not use the Latin alphabet. This field is ignored for languages that do use the Latin alphabet",
"description": "The transliteration of the foreign text, for languages that do not use the Latin alphabet. This field is ignored for languages that do use the Latin alphabet.",
"type": "string"
"type": "string"
},
"label": {
"label": "Language label",
"description": "If 'none', suppresses language link and label. Other options may be available depending on the language.",
"example": "none",
"type": "line"
}
}
},
},
"description": "Indicates to readers the original form of a term or phrase in a foreign language."
"description": "Indicates to readers the original form of a term or phrase in a foreign language.",
"paramOrder": [
"1",
"links",
"lit",
"translit",
"label"
]
}
}
</templatedata>
</templatedata>
Line 83: Line 99:
* {{Tl|Lang}}
* {{Tl|Lang}}
* {{Tl|Language with name/for}}
* {{Tl|Language with name/for}}
* {{Tl|Link language}}
* [[List of ISO 639-1 codes]] (language codes)
* {{Tl|{{#ifeq:0
|{{#ifexist:ISO 639:{{#ifeq:0|{{#ifexist:ISO 639:{{#ifeq:0|{{#ifexist:ISO 639:{{#ifeq:0|{{#ifexist:ISO 639:{{#ifeq:0|{{#ifexist:ISO 639:{{#ifeq:0|{{#ifexist:ISO 639:{{#ifeq:0|{{#ifexist:ISO 639:{{#ifeq:0|{{#ifexist:ISO 639:{{#ifeq:0|{{#ifexist:ISO 639:{{Str right|{{BASEPAGENAME}}|5}}|0|1}}
|{{Str right|{{BASEPAGENAME}}|5}}
|{{Str crop|{{Str right|{{BASEPAGENAME}}|5}}|1}}}}|0|1}}
|{{Str right|{{BASEPAGENAME}}|5}}
|{{Str crop|{{Str right|{{BASEPAGENAME}}|5}}|2}}}}|0|1}}
|{{Str right|{{BASEPAGENAME}}|5}}
|{{Str crop|{{Str right|{{BASEPAGENAME}}|5}}|3}}}}|0|1}}
|{{Str right|{{BASEPAGENAME}}|5}}
|{{Str crop|{{Str right|{{BASEPAGENAME}}|5}}|4}}}}|0|1}}
|{{Str right|{{BASEPAGENAME}}|5}}
|{{Str crop|{{Str right|{{BASEPAGENAME}}|5}}|5}}}}|0|1}}
|{{Str right|{{BASEPAGENAME}}|5}}
|{{Str crop|{{Str right|{{BASEPAGENAME}}|5}}|6}}}}|0|1}}
|{{Str right|{{BASEPAGENAME}}|5}}
|{{Str crop|{{Str right|{{BASEPAGENAME}}|5}}|7}}}}|0|1}}
|{{Str right|{{BASEPAGENAME}}|5}}
|{{Str crop|{{Str right|{{BASEPAGENAME}}|5}}|8}}}}|0|1}}
|{{Str right|{{BASEPAGENAME}}|5}}
|{{Str crop|{{Str right|{{BASEPAGENAME}}|5}}|9}}
}} icon}}


<includeonly>
<includeonly>{{Sandbox other||
<!-- CATEGORIES (which are not already covered in the individual lang-x templates) HERE, THANKS -->
<!-- CATEGORIES (which are not already covered in the individual lang-x templates) HERE, THANKS -->
{{#ifeq:0
{{#ifeq:0
|{{#ifexist:ISO 639:{{Str right|{{BASEPAGENAME}}|5}}|0|1}}
|{{#ifexist:ISO 639:{{Str right|{{BASEPAGENAME}}|5}}|0|1}}
|[[Category:Lang-x templates]]
|[[Category:Lang-x templates|{{#invoke:String|match|{{FULLPAGENAME}}|Template:Lang%-([a-z%-]+)$|nomatch=}}]]
|{{#if:{{#invoke:Lang/documentor tool|uses_module|template={{ROOTPAGENAME}}}}|[[Category:Lang-x templates]]|[[Category:Lang-x templates with other than ISO 639]]}}
|{{#if:{{#invoke:Lang/documentor tool|uses_module|template={{ROOTPAGENAME}}}}|[[Category:Lang-x templates|{{#invoke:String|match|{{FULLPAGENAME}}|Template:Lang%-([a-z%-]+)$|nomatch=}}]]|[[Category:Lang-x templates with other than ISO 639]]}}
}}
}}
</includeonly>
}}</includeonly>  
<noinclude>[[Category:Documentation shared content templates]]</noinclude>
<noinclude>[[Category:Documentation shared content templates]]</noinclude>

Latest revision as of 04:42, 3 September 2020

Usage

Lua error in Module:Lang/documentor_tool at line 29: attempt to index local 'content' (a nil value). The language template {{lang-x}} identifies foreign language text. The term or phrase is the only mandatory parameter. The text is formatted according to recommendations in Wikipedia:Manual of Style/Text formatting § Foreign terms; italics for languages that use the Latin alphabet, normal for others.

The template should generally be placed after the English translation of the foreign term or phrase.

The parameter |links=no prevents the language name from being linked.

The parameter |translit= allows for a Romanization to be identified. The templates that have this parameter are listed here. (This parameter is not supported by lang-x templates for languages that are already written in Latin script.)

The parameter |lit= enables a literal translation (in English) to be given. It is being rolled out to these templates and so may be available for {{lang-x}}.

Parameters

{{#lst:Template:Lang-x/doc/parameters|lang_xx_parameters}}

Examples

The following examples show translations from German.

Edit

  • Weimar is located in the federal state of Thuringia ({{lang-de|Thüringen}}).
  • The Seafarers of Catan ({{lang-de|Die Seefahrer von Catan}}) is an expansion of the board game The Settlers of Catan.
  • Albert the Bear ({{lang-de|Albrecht der Bär|links=no}})
  • All Quiet on the Western Front ({{lang-de|Im Westen nichts Neues|lit=In the West Nothing New}}) is a novel by Erich Maria Remarque.

Resulting text

  • Weimar is located in the federal state of Thuringia (German: Thüringen).
  • The Seafarers of Catan (German: Die Seefahrer von Catan) is an expansion of the board game The Settlers of Catan.
  • Albert the Bear (German: Albrecht der Bär)
  • All Quiet on the Western Front (German: Im Westen nichts Neues, lit.'In the West Nothing New') is a novel by Erich Maria Remarque.


TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for this template in articles based on this TemplateData.

TemplateData for Lang-x

Indicates to readers the original form of a term or phrase in a foreign language.

Template parameters

ParameterDescriptionTypeStatus
Text1

The foreign text to display.

Stringrequired
Display linklinks

Set to 'no' to disable the link to the article's language.

Booleanoptional
Literal translationlit

The literal translation of the foreign text.

Stringoptional
Transliterationtranslit

The transliteration of the foreign text, for languages that do not use the Latin alphabet. This field is ignored for languages that do use the Latin alphabet.

Stringoptional
Language labellabel

If 'none', suppresses language link and label. Other options may be available depending on the language.

Example
none
Lineoptional

See also