Template:Lang subpage

From Gentoo Wiki
Jump to:navigation Jump to:search
Warning
This page has been nominated for deletion.

The given reason is: Obsolete. Use #translation: function where appropriate

If you disagree with its deletion, do not remove this notice; discuss your objections on the associated discussion page.

Administrators, please remember to check if anything links here and the page history before deleting.

This notice should remain for a minimum of 1 month after it was placed on the page. If discussion is still ongoing it should remain until a consensus is reached, at which time the page may be deleted or this notice may be removed. (However, if the page has only been edited by the user who nominated it for deletion and/or is in the nominator's user space, then a speedy deletion may be called for.)
[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.)