Template:CURRENTCONTENTLANGUAGE/doc
This is a documentation subpage for Template:CURRENTCONTENTLANGUAGE. It contains usage information, categories and other content that is not part of the original Template page. |
This template is used on approximately 8,000 pages. To avoid large-scale disruption and unnecessary server load, any changes to this template should first be tested in its /sandbox or /testcases subpages or in your own user subpage. The tested changes can then be added to this page in one single edit. Please consider discussing any changes on the talk page before implementing them. |
Usage
This template returns the "content language" of the current page; more precisely it checks if the current title ends with a language code, and if it is the case it returns this language code, else {{CONTENTLANGUAGE}} (the default content language; on this wiki: "en" for English).
Examples
- on "Bar/foo", this template returns "en";
- on "Bar/foo/hu", this template returns "hu".
(Note: there could be false positive: e.g. on "Foo/bar" it returns "bar" because "bar" is the language code for Bavarian; "foo" is not a language code; very small (2 or 3 letters) last words can be a problem as seen here.)
This template takes no argument, and acts as a magic word.
Alternative magic word
Since the creation of this template, the magic word {{PAGELANGUAGE}}
has been created and can be used instead of this template (see Phabricator:T59603).