Difference between revisions of "Template:LSLG"
Jump to navigation
Jump to search
(support for 3 character language codes) |
|||
Line 1: | Line 1: | ||
<includeonly>{{#vardefine:t| | <includeonly>{{#vardefine:t|{{#len:{{{1|}}}}}}}{{#vardefine:t|{{#expr:({{#var:t}} - {{#rpos:{{{1|}}}|/}}) = 4 and ({{#var:t}} > 3)}}}}{{#vardefine:lang|{{#ifexpr:{{#len:{{{3|}}}}} = 3|/{{{3|}}}|{{#ifexpr:({{#len:{{PAGENAMEE}}}} - {{#rpos:{{PAGENAMEE}}|/}}) = 4|{{#ifexpr:{{#var:t}}|{{#sub:{{{1|}}}|-4}}|{{#sub:{{PAGENAMEE}}|-4}}}}|/eng}}}}}}[[LSL_{{#ifexpr:{{#var:t}}|{{#sub:{{{1|}}}|0|-4}}|{{{1|}}}}}{{#ifeq:{{#var:lang}}|/eng||{{#var:lang}}}}|{{#ifexpr:({{#len:{{{1|}}}}} - {{#rpos:{{{1|}}}|/}}) = 4|{{#sub:{{{1|}}}|0|-4}}|{{{1}}}}}]]</includeonly><noinclude> | ||
<nowiki>{{LSLG|page|text|lang}}</nowiki> | <nowiki>{{LSLG|page|text|lang}}</nowiki><br/> | ||
If '''page''' has a 3 char language code it is stripped for the display if text is excluded.<br/> | If '''page''' has a 3 char language code it is stripped for the display if text is excluded.<br/> | ||
If the link is a page with a language code then that language code is used if '''page''' does not contain one unless '''lang''' is defined which overrides all others. | If the link is a page with a language code then that language code is used if '''page''' does not contain one unless '''lang''' is defined which overrides all others. | ||
</noinclude> | </noinclude> |
Revision as of 23:26, 13 February 2007
{{LSLG|page|text|lang}}
If page has a 3 char language code it is stripped for the display if text is excluded.
If the link is a page with a language code then that language code is used if page does not contain one unless lang is defined which overrides all others.