Template:Language exist: Difference between revisions
Jump to navigation
Jump to search
List of all templates
(Added Hungarian language support) |
(Added Vietnamese language support) |
||
Line 1: | Line 1: | ||
{{#ifeq: {{Get language code}} | {{{1}}} |<span></span>|{{#ifexist: {{#switch: {{Get language code}} | {{#ifeq: {{Get language code}} | {{{1}}} |<span></span>|{{#ifexist: {{#switch: {{Get language code}} | ||
| cs | da | de | es | fr | hu | it | ja | ko | ms | nl | pl | pt-br | ru | sv | tr | uk | zh = {{#titleparts: {{FULLPAGENAME}}| -1 }} | | cs | da | de | es | fr | hu | it | ja | ko | ms | nl | pl | pt-br | ru | sv | tr | uk | vi | zh = {{#titleparts: {{FULLPAGENAME}}| -1 }} | ||
| en = {{FULLPAGENAME}} | | en = {{FULLPAGENAME}} | ||
}}{{#ifeq: {{{1}}} | en ||/{{{1}}}}}|{{Flag|{{{1}}}}}|<span></span> | }}{{#ifeq: {{{1}}} | en ||/{{{1}}}}}|{{Flag|{{{1}}}}}|<span></span> |
Revision as of 20:35, 28 June 2018
[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