Template:CURRENTCONTENTLANGUAGE: Difference between revisions

small generalization
m (ortho)
(small generalization)
Line 1:
<includeonly>{{#ifeq:{{#language:{{SUBPAGENAME}}}}|{{lc:{{SUBPAGENAME}}}}|en{{CONTENTLANGUAGE}}|{{SUBPAGENAME}}}}</includeonly><noinclude>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 &#123;{CONTENTLANGUAGE}} (the default content language; on this wiki: "en{{CONTENTLANGUAGE}}" for English{{#language:{{CONTENTLANGUAGE}}|en}}).
 
Examples:
* on "Bar/foo", this template returns "en{{CONTENTLANGUAGE}}";
* on "Bar/foo/hu", this template returns "hu".
(Note: 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.)
0

edits