Template:CURRENTCONTENTLANGUAGE/doc: Difference between revisions
Appearance
data_>ديفيد عادل وهبة خليل 2 m Reverted edits by 187.241.81.228 (talk) to last revision by ديفيد عادل وهبة خليل 2 |
m 1 revision imported |
(No difference)
| |
Latest revision as of 00:26, 25 September 2022
{{#ifeq: doc | doc
|
{{
#ifeq: show | show | Template:Ombox }}{{ #if: | | {{#ifexist:Template:CURRENTCONTENTLANGUAGE|[[Category:{{ #switch: Template | Template = Template | Module = Module | User = User | #default = Template }} documentation pages]]|}} }}
| }}
Usage
[edit source]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
[edit source]- 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. If such a magic word is created in MediaWiki (see bugzilla:57603), this template could be deleted.