This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Template:Lang subpage

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
[edit

Documentation

Note
This page is a template. It contains some standardized, often used text, which can be transcluded inside other pages.

As this template is widely used in our wiki, it may be protected in which case only staff members can change it. Use the discussion page to propose enhancements or fixes, or to voice your opinion.

Use this template to extract the language code of subpages. If transcluded on a translated page, the template returns the language code of the subpage (e.g. de for a /de subpage) or defaults to en otherwise.

Usage

Add this code to the page text:

{{Lang subpage}}

Parameters

lang (optional)
Specify a language code. Useful for testing and documentation purposes.
page (optional)
Specify a page title. Useful for testing and documentation purposes.

Examples

See also the template's testcases:

No parameter
Wiki code {{Lang subpage}}

Main version en
Sandbox version en
Parameter: page
Wiki code {{Lang subpage|page=LongTitle}} {{Lang subpage|page=LongTitle/en}} {{Lang subpage|page=LongTitle/de}} {{Lang subpage|page=LongTitle/Longer/de}} {{Lang subpage|page=dd}}

Main version en

en
de
de
en

Sandbox version en

en
de
de
en

Trimmed test
Wiki code ___{{Lang subpage}}___

Main version ___en___
Sandbox version ___en___
Note
As this template is used in generating URLs, no spacing is allowed.
Note
The above documentation is transcluded from Template:Lang subpage/doc. (edit | history)
Editors can experiment in this template's sandbox (edit) and testcases (edit) pages.
Please add categories and interwikis to the /doc subpage. (See the subpages of this template.)