Template:Language exist: Difference between revisions
Jump to navigation
Jump to search
List of all templates
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{#ifeq: {{Language suffix}} | {{{1}}} | |{{#ifexist: {{#switch: {{Language suffix}} | {{#ifeq: {{Language suffix}} | {{{1}}} | |{{#ifexist: {{#switch: {{Language suffix}} | ||
| cs| de | es | fr | it | nl | pl | pt-br | ru | sv | uk | zh = {{#titleparts: {{FULLPAGENAME}}| -1 }} | | cs| de | es | fr | it | ja | nl | pl | pt-br | ru | sv | uk | zh = {{#titleparts: {{FULLPAGENAME}}| -1 }} | ||
| #default = {{FULLPAGENAME}} | | #default = {{FULLPAGENAME}} | ||
}}/{{{1}}} | {{#ifeq: {{{2|}}} | yes | {{Flag|{{{1}}}|text=yes}} | {{Flag|{{{1}}}}} }} | }}/{{{1}}} | {{#ifeq: {{{2|}}} | yes | {{Flag|{{{1}}}|text=yes}} | {{Flag|{{{1}}}}} }} |
Revision as of 13:57, 19 October 2016
[View] [Edit] [Page history]
DocumentationShows a flag if a translated page with the given suffix exists, otherwise shows <span></span>
.
Further explanation
Input: Given language code, for example de
; en
for English
if on page with the given language code then
show nothing -- nothing = <span></span>
else
if <pagename without lang suffix>/<given lang code> exists then -- current page translated to given language
show flag
else
show nothing -- nothing = <span></span>
end
end