Template:Language exist/doc: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Created page with "Shows a flag if a translated page with the given suffix exists, otherwise shows <code><nowiki><span></span></nowiki></code>. === Further explanation === Input: Given languag...")
 
(category)
 
(2 intermediate revisions by one other user not shown)
Line 3: Line 3:
=== Further explanation ===
=== Further explanation ===


Input: Given language code (for example <code>de</code>)
Input: Given language code, for example <code>de</code>; <code>en</code> for English


<syntaxhighlight lang="lua">if on page with the given language code then
<syntaxhighlight lang="lua">if on page with the given language code then
Line 18: Line 18:


end</syntaxhighlight>
end</syntaxhighlight>
<noinclude>[[Category:Template documentation]]</noinclude>

Latest revision as of 12:12, 27 August 2023

Shows 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