Template:Lang subpage/doc

From Gentoo Wiki
Jump to:navigation Jump to:search
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.