Template:Pagelang: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
Created page with "{{#ifeq: {{SUBPAGENAME}} | {{BASEPAGENAME}} | en | {{SUBPAGENAME}} }}<noinclude> Get the language code of the current page from its title. e.g. Ways to Give/sv result is..."
imported>Verdy p
m strip indentation whitespaces (template heavily used) to save 15-25 milliseconds per invokation (12-15ms used now), reducing it (in transclusions) to only 11 preprocessor nodes visited, 4 levels, 32 bytes expanded, 2-3 bytes tidied, no costly functions
Line 1: Line 1:
{{#ifeq:{{#titleparts:{{PAGENAME}}||-1}}|{{#titleparts:{{PAGENAME}}|1}}||{{#ifeq:{{#titleparts:{{PAGENAME}}||-1}}|{{lc:{{PAGENAME:{{#titleparts:{{PAGENAME}}||-1}}}}}}|{{#ifeq:{{#titleparts:{{PAGENAME}}||-1}}|{{urlencode:{{#titleparts:{{PAGENAME}}||-1}}}}|{{#ifeq:{{lc:{{#titleparts:{{PAGENAME}}||-1}}}}|{{ucfirst:{{lc:{{#titleparts:{{PAGENAME}}||-1}}}}}}||{{#switch:{{#titleparts:{{PAGENAME}}||-1}}|doc|layout|sandbox|testcases=|#default={{#titleparts:{{PAGENAME}}||-1}}}}}}}}}}}}<noinclude>{{Documentation}}</noinclude>
{{#ifeq: {{SUBPAGENAME}} | {{BASEPAGENAME}} | en | {{SUBPAGENAME}} }}<noinclude>

Get the language code of the current page from its title. e.g. [[Ways to Give/sv]] result is <tt>sv</tt>, [[Ways to Give]] result is <tt>en</tt>
</noinclude>

Revision as of 22:59, 27 May 2014

[edit] [⧼code-rev-purge-link⧽] Template documentation

Get the language of the current page

The above documentation is transcluded from Template:Pagelang/doc. (edit | history)
Editors can experiment in this template's sandbox (create) and testcases (create) pages.
Please add categories and interwikis to the /doc subpage. Subpages of this template.