Template:Uselangflags: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(Completed multipage workaround)
Line 12: Line 12:


--><includeonly><onlyinclude>{{#if:{{{1|}}}{{{title|}}}|{{DISPLAYTITLE:{{{title|{{{1|}}}}}}}}}}{{#if:{{{no-right-align|}}}||<div style="display:flex; gap:4px; width:calc(100% + 4px); pointer-events: none; position:absolute; z-index:100; top:calc(-{{#ifeq:{{ROOTPAGENAME}}|{{PAGENAME}}|17|26}}px - 0px); left:-4px"><div style="pointer-events: none; margin-left: auto"><div style="height:19px; background-color:#262626; border:1px solid #65635F; border-bottom:0; border-radius:3px 3px 0 0; pointer-events: all;">}}<!--
--><includeonly><onlyinclude>{{#if:{{{1|}}}{{{title|}}}|{{DISPLAYTITLE:{{{title|{{{1|}}}}}}}}}}{{#if:{{{no-right-align|}}}||<div style="display:flex; gap:4px; width:calc(100% + 4px); pointer-events: none; position:absolute; z-index:100; top:calc(-{{#ifeq:{{ROOTPAGENAME}}|{{PAGENAME}}|17|26}}px - 0px); left:-4px"><div style="pointer-events: none; margin-left: auto"><div style="height:19px; background-color:#262626; border:1px solid #65635F; border-bottom:0; border-radius:3px 3px 0 0; pointer-events: all;">}}<!--


     Flags
     Flags
Line 71: Line 70:




  - Multipage workaround -
- Multipage workaround -
 


-->{{#if:{{{multipageworkaround|}}}|<!--
-->{{#if:{{{multipageworkaround|}}}|</div></div>{{#if:{{{altEditButton|}}}||<div style="pointer-events:all; {{#if:{{{margin-right|}}}|margin-right:{{{margin-right}}}}}">
-->{{#if:{{{altEditButton|}}}||<div style="pointer-events:all; {{#if:{{{margin-right|}}}|margin-right:{{{margin-right}}}}}">
<center class="mw-customtoggle-editbutton" style="height:19px; background-color:#262626; border:1px solid #65635F; border-bottom:{{#if:{{{noborder|}}}|1|0}}; border-radius:{{#if:{{{noborder|}}}|3px|3px 3px 0 0}}"><span style="display:flex; justify-content:center; width:20px; height:100%"><div style="position: relative; top:-1px;">[[File:Icon-edit.png|link={{#ifexist:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|{{fullurl:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|action=edit}}|{{fullurl:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|action=edit&preload={{urlencode:{{#ifexist:{{FULLPAGENAME}}/en|{{FULLPAGENAME}}/en|Template:MultiPage/preload}}}}}}}}|14px|{{int:edit}}|{{#ifexist:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|{{fullurl:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|action=edit}}|{{fullurl:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|action=edit&preload={{urlencode:{{#ifexist:{{FULLPAGENAME}}/en|{{FULLPAGENAME}}/en|Template:MultiPage/preload}}}}}}}}}}|14px|{{int:edit}}]]</div></span></center>
<div class="mw-customtoggle-editbutton" style="height:19px; background-color:#262626; border:1px solid #65635F; border-bottom:{{#if:{{{noborder|}}}|1|0}}; border-radius:{{#if:{{{noborder|}}}|3px|3px 3px 0 0}}"><span style="display:flex; justify-content:center; width:20px; height:100%"><div style="position: relative; top:-1px;">[[File:Icon-edit.png|link={{#ifexist:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|{{fullurl:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|action=edit}}|{{fullurl:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|action=edit&preload={{urlencode:{{#ifexist:{{FULLPAGENAME}}/en|{{FULLPAGENAME}}/en|Template:MultiPage/preload}}}}}}}}|14px|{{int:edit}}|{{#ifexist:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|{{fullurl:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|action=edit}}|{{fullurl:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|action=edit&preload={{urlencode:{{#ifexist:{{FULLPAGENAME}}/en|{{FULLPAGENAME}}/en|Template:MultiPage/preload}}}}}}}}}}|14px|{{int:edit}}]]</div></span></div>
</div>}}<!--
</div>}}<!--


Line 81: Line 80:


--><div style="pointer-events:all; {{#if:{{{margin-right|}}}|margin-right:{{{margin-right}}}}}">
--><div style="pointer-events:all; {{#if:{{{margin-right|}}}|margin-right:{{{margin-right}}}}}">
<div class="mw-customtoggle-editaction" style="height:19px; background-color:#262626; border:1px solid #65635F; border-bottom:{{#if:{{{noborder|}}}|1|0}}; border-radius:{{#if:{{{noborder|}}}|3px|3px 3px 0 0}}"><!--
<center class="mw-customtoggle-editaction" style="height:19px; background-color:#262626; border:1px solid #65635F; border-bottom:{{#if:{{{noborder|}}}|1|0}}; border-radius:{{#if:{{{noborder|}}}|3px|3px 3px 0 0}}"><!--
--><span class=plainlinks style="display:flex; justify-content:center; width:20px; height:100%; font-size:10px" title="{{int:actions}}"><div style="position: relative; top:-3.5px; color:rgb(255,255,255);">'''…'''</div></span>
--><span class=plainlinks style="display:flex; justify-content:center; width:20px; height:100%; font-size:10px" title="{{int:actions}}"><div style="position: relative; top:-3.5px; color:rgb(255,255,255);">'''…'''</div></span>
</div>
</center>
<div class="mw-collapsible mw-collapsed plainlinks" id="mw-customcollapsible-editaction" style="display:none; overflow:hidden; background:#404040; border:1px solid rgba(255,255,255,.1); border-radius:4px; box-shadow:0 10px 20px rgb(0,0,0,.3); user-select:none; position:absolute; z-index:1001; {{text-dir|ltr=right|rtl=left}}:calc(0px + {{{margin-right|0px}}}); top:26px">
<div class="mw-collapsible mw-collapsed plainlinks" id="mw-customcollapsible-editaction" style="display:none; overflow:hidden; background:#404040; border:1px solid rgba(255,255,255,.1); border-radius:4px; box-shadow:0 10px 20px rgb(0,0,0,.3); user-select:none; position:absolute; z-index:1001; {{text-dir|ltr=right|rtl=left}}:calc(0px + {{{margin-right|0px}}}); top:26px">
<div style="overflow-y:auto; max-height:200px; padding:2px 6px">
<div style="overflow-y:auto; max-height:200px; padding:2px 6px">
Line 90: Line 89:
}}
}}
<div style="display:flex; align-items:center; margin-bottom:3px">[[File:Icon-history.png|18px|link={{fullurl:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|action=history}}|{{int:history}}]]&nbsp;[{{fullurl:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|action=history}} <span style="color: white;">{{ucfirst:{{int:history}}}}]</div>
<div style="display:flex; align-items:center; margin-bottom:3px">[[File:Icon-history.png|18px|link={{fullurl:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|action=history}}|{{int:history}}]]&nbsp;[{{fullurl:{{FULLPAGENAME}}{{uselang|pref=/|default-none={{{no-en-subpage|}}}}}|action=history}} <span style="color: white;">{{ucfirst:{{int:history}}}}]</div>
<div style="display:flex; align-items:center; margin-bottom:3px">[[File:Icon-deblur.png|18px|link={{fullurl:{{FULLPAGENAME}}|action=purge}}|{{ucfirst:{{int:confirm-purge-title}}}}]]&nbsp;[{{fullurl:{{FULLPAGENAME}}|action=purge}} <span style="color: white;">{{ucfirst:{{int:confirm-purge-title}}}}</span>]</div>|}}<!--
<div style="display:flex; align-items:center; margin-bottom:3px">[[File:Icon-deblur.png|18px|link={{fullurl:{{FULLPAGENAME}}|action=purge}}|{{ucfirst:{{int:confirm-purge-title}}}}]]&nbsp;[{{fullurl:{{FULLPAGENAME}}|action=purge}} <span style="color: white;">{{ucfirst:{{int:confirm-purge-title}}}}</span>]</div></div>|}}<!--


-->{{#if:{{{no-right-align|}}}||</div></div></div>}}{{#if:{{{category-en|}}}|[[Category:English]]}}</onlyinclude></includeonly>
-->{{#if:{{{no-right-align|}}}||</div></div></div>}}{{#if:{{{category-en|}}}|[[Category:English]]}}</onlyinclude></includeonly>

Revision as of 09:14, 15 September 2023

English (en)Català (ca)Čeština (cs)Deutsch (de)Esperanto (eo)Español (es)Eesti (et)Français (fr)Magyar (hu)Ελληνικά (el)Italiano (it)Nederlands (nl)Norsk (no)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Українська (uk)Svenska (sv)Türkçe (tr)日本語 (ja)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)한국어 (ko)Ქართული (ka)עברית (he)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
View
Page history

Usage

This template is used to switch the uselang parameter (the language of the UI) quickly to support multiple languages on one page. Mostly useful for previews of templates in Template namespace.

Parameters

  • {{{<lang code>}}} - Optional: Specify the lang code to 1 to show the flag of the language. Only work without {{{all-lang}}}. (e.g.|en=1) (hover over flags in the example section to see the lang codes)
  • {{{all-lang}}} - Optional: Show all the flags of the languages.
  • {{{no-right-align}}} - Optional: Make the template to be non-right-align style if it's non-zero.
  • {{{category-en}}} - Optional: Add the page into the Category:English.
  • {{{title}}}, {{{1}}} - Optional: The title of the page.

Examples

{{Uselangflags|all-lang=1|no-right-align=1}}
English (en)Català (ca)Čeština (cs)Deutsch (de)Esperanto (eo)Español (es)Eesti (et)Français (fr)Magyar (hu)Ελληνικά (el)Italiano (it)Nederlands (nl)Norsk (no)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Українська (uk)Svenska (sv)Türkçe (tr)日本語 (ja)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)한국어 (ko)Ქართული (ka)עברית (he)

{{Uselangflags|en=1|no-right-align=1}}
English (en)

{{Uselangflags|en=1|ca=1|de=1|zh=1|no-right-align=1}}
English (en)Català (ca)Deutsch (de)中文 (zh)