Toggle menu
24.1K
670
183
158.5K
HausaDictionary.com | Hausa English Translations
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:context: Difference between revisions

Template page
*>Wenli
created standard context template
 
No edit summary
 
(27 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<noinclude>This template is used to create context labels, such as [[Template:countable]].
<includeonly>(<span style="color:green;">''{{{1|{{{label|}}}}}}''</span>)</includeonly><!--
</noinclude><includeonly><!--
-->{{#ifeq:{{NAMESPACE}}|Template|[[Category:Context labels|{{PAGENAME}}]]}}<noinclude>
if not in a sub call, open paren, content span
{{documentation}}
-->{{#if:{{{sub|}}}||<span class="ib-brac"><span class="qualifier-brac">(</span></span><span class="ib-content"><span class="qualifier-content">}}<!--
<!-- Categories, interwikis and TemplateData goes to the /doc subpage -->
if label, generate it
</noinclude>
-->{{#if:{{{label|}}}|{{{label}}}}}<!--
if special follows, generate it
-->{{#switch:{{{1|x}}}|,=<span class="ib-comma"><span class="qualifier-comma">,</span></span>&#32;|or=&#32;or&#32;|and=&#32;and&#32;|_=&#32;}}<!--
if something follows that is a special, recall on next parameter (ignore case of special on the end)
-->{{#if:{{{1|}}}| {{{{#switch:{{{1}}}|,|or|and|_=context {{#expr:{{{sub|0}}}+1}}|ns:0}}|sub={{#expr:{{{sub|0}}}+1}}|lang={{{lang|}}}|skey={{{skey|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}|{{{9|}}} }}<!--
default case(s) from switch, we have a template or string, generate comma if we had a label
-->{{#switch:{{{1}}}|,|or|and|_=|#default={{#if:{{{label|}}}|<span class="ib-comma"><span class="qualifier-comma">,</span></span>&#32;}}<!--
if template exists, call it, else call ourselves, avoid extra expansion by conditional on name
-->{{ {{#if:{{{1|}}}|{{#ifexist:Template:{{{1}}}|{{{1}}}|context {{#expr:{{{sub|0}}}+1}}}}|ns:0}} |label={{{1}}}
|sub={{#expr:{{{sub|0}}}+1}}|lang={{{lang|}}}|skey={{{skey|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}|{{{9|}}} }}<!--
-->}}}}<!-- end switch, if {1}
if not in sub, close content span, paren
-->{{#if:{{{sub||}}}||</span></span><span class="ib-brac"><span class="qualifier-brac">)</span></span>}}<!--
if in namespace 0, if topic category
-->{{#if:{{NAMESPACE}}||{{#if:{{{topcat|}}}|{{#if:{{{skey|}}}|
[[Category:{{#if:{{{lang|}}}|{{#ifeq:{{{lang}}}|en||{{{lang}}}:}}}}{{{topcat|}}}|{{{skey}}} {{PAGENAME}}]]|
[[Category:{{#if:{{{lang|}}}|{{#ifeq:{{{lang}}}|en||{{{lang}}}:}}}}{{{topcat|}}}]]}}}}<!--
if pos or pos-like cat
-->{{#if:{{{poscat|}}}|{{#if:{{{skey|}}}|
[[Category:{{{{#if:{{{poscat|}}}|language|ns:0}}|{{#if:{{{lang|}}}|{{{lang}}}|en}}}} {{{poscat|}}}|{{{skey}}} {{PAGENAME}}]]|
[[Category:{{{{#if:{{{poscat|}}}|language|ns:0}}|{{#if:{{{lang|}}}|{{{lang}}}|en}}}} {{{poscat|}}}]]}}}}<!--
regional templates
-->{{#if:{{{regcat|}}}|{{#if:{{{skey|}}}|
[[Category:{{{regcat}}} {{{{#if:{{{regcat|}}}|language|ns:0}}|{{#if:{{{lang|}}}|{{{lang}}}|en}}}}]]|
[[Category:{{{regcat}}} {{{{#if:{{{regcat|}}}|language|ns:0}}|{{#if:{{{lang|}}}|{{{lang}}}|en}}}}]]}}}} }}<!--
cat templates themselves
-->{{#ifeq:{{NAMESPACE}}|{{ns:template}}|
{{#if:{{{topcat|}}}|[[Category:{{{topcat}}}|&#32;]]}}<!--
-->{{#if:{{{poscat|}}}|[[Category:English {{{poscat}}}|&#32;]]}}<!--
-->{{#if:{{{regcat|}}}|[[Category:{{{regcat}}} {{{{#if:{{{regcat|}}}|language|ns:0}}|{{#if:{{{lang|}}}|{{{lang}}}|en}}}}|&#32;]]}}<!--
-->[[Category:Context labels|{{PAGENAME}}]]}}</includeonly>