Template:Internationalization template doc

From NC Commons
Jump to navigation Jump to search
Error: This page is not currently protected. Please request protection or remove the protection template.

Lua error in Module:Autotranslate at line 77: No fallback page found for autotranslate (base=Documentation subpage, lang=en).__EXPECTED_UNCONNECTED_PAGE__

Adds "
English:
" in front of the text written in Template:Language. Also adds machine-readable tags identifying the text as being written in Template:Language.

The template automatically sets the following categories:

Usage

{{En |1= }}

Template parameters

ParameterDescriptionDefaultStatus
1textText to be displayed. Please prepend "1=" to the text, otherwise any free "=" characters in the text will break the template.(missing text)required
inlineinlineOptional boolean flag, false by default. When set to "true" (or "1", "t", "yes", "y", "on", etc. ), forces the template to be displayed inline, so that it does not break the current paragraph (that makes possible to put several descriptions side by side on a single line). Set to "false" (or "0", "f", "no", "n", "off", etc. ) or omit or leave blank, and each language will be in a separate line.emptyoptional
Template data
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

Adds "English" in front of the text written in [[:Template:Language]]. Also adds machine-readable tags identifying the text as being written in [[:Template:Language]].

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
text1

Text to be displayed.

Default
<span class="error">(missing text)</span>
Stringrequired
inlineinline

Optional boolean flag, false by default. When set to "true" (or "1", "t", "yes", "y", "on", etc. ), forces the template to be displayed inline, so that it does not break the current paragraph (that makes possible to put several descriptions side by side on a single line). Set to "false" (or "0", "f", "no", "n", "off", etc. ) or omit or leave blank, and each language will be in a separate line.

Lineoptional

Additional information

The template is intended to be used in the following namespaces: all namespaces

The template is intended to be used by the following user groups: all users

Relies on:

Parameter #1

  • Existing "1=" shall not be removed, even if it is not necessary, see Special:Diff/592488152#removing_1=.
  • when no free "="-sign occurs in the text the "1=" is obsolete. Not-free equal signs (inside of template transclusions) don't count.
  • without the "1=" but with one or more equal signs, no parameter #1 can be detected, and the error "parameter #1 is empty" is categorized.
  • As another error, a superflous pipe "|" character converts it to the contrary:
  • while e.g. {{en | some text | }} will be understood,
  • {{en |1=some text | }} causes the same error "parameter #1 is empty".

Required or necessary

When a parameter is required the template documentation expresses it with a line in the table, which left column shows the parameter name, then a textual description for the parameter value, and right the code (in this case) "required".

  • A named parameter needs to be specified by name=, which may as well be an alias,
  • a positional parameter is specified either by its position or by the positional number (e.g. 1=, 2=, 3=...). With other words: the parameter value is required, the parameter name (= the number) is optional; it cannot be required and not even suggested but it becomes necessary (another thing than the un/requiredness in the sense of template documentation!) when (and only when) the parameter value string contains a "free equal sign" (an equal sign outside of another template).
    The positional number is also necessary when positional parameters are specified outside of their positional order, e.g. |2= |1= |3=

Example

{{En|Abcdefghijklmnopqrstuwxyz}}

renders as:

English: Abcdefghijklmnopqrstuwxyz

⧼Seealso⧽

Localization

This template is not intended to be localized.

It relies on {{#language:...}} parser function for localization.

Other multi-lingual templates

Template:I18n templates