Usuário:Willscrlt/meta/lang


This template combines features of commons:Template:Description and commons:Template:Internationalization icon along with some original ideas, to create a single template that identifies blocks of text by language. Its creator uses it to help readers quickly locate their native language on pages with multiple translations. This is one of several internationalized templates that Will has created or is currently developing.

Parameters

editar
  • {{1}} or lang=   — Wikicode for the language and name of the CSS formating class (optional, default is "en" for English)
  • {{2}} or show=   — Display style options (optional, default is "0")
    • 0   — CSS markup only (if text is not empty; if empty no output at all)
    • 1   — ISO 639 icon and CSS (if text is not empty)
    • 2   — ISO 639 icon, language name, and CSS (if text is not empty)
    • 3   — language name and CSS (if text is not empty)
  • {{3}} or text=   — The description text to be marked with CSS (optional, default is empty)
  • inline=   — Anything but an empty string, forces inline display rather than block (optional, default is empty string)
  • ext=   — Extension text shown after the language name before colon (optional, default is empty)
  • html=   — Standard code for lang tag in HTML (optional, default is same as lang)
  • icon=   — The language code for the ISO 639 icon to use (optional, default is same as html)
  • name=   — Title for tooltip (optional, default is empty)

Examples

editar
Example 1 - Show style #2
{{User:Willscrlt/meta/lang|en|2|This is English.}}
  English: This is English.
Example 2 - Same as example 1, but using parameter names
{{User:Willscrlt/meta/lang|lang=en|show=2|text=This is English.}}
  English: This is English.
Example 3 - Showing two languages in default mode
{{User:Willscrlt/meta/lang|lang=en|show=2|text=This is English.}} {{User:Willscrlt/meta/lang|
lang=es|show=2|text=Esto es español.}}
  English: This is English.
  español: Esto es español.
Example 4 - Showing two languages with "inline=y" mode
{{User:Willscrlt/meta/lang|lang=en|show=2|text=This is English.|inline=y}} {{User:Willscrlt/meta/lang|
lang=es|show=2|text=Esto es español.|inline=y}}

  English: This is English.   español: Esto es español.

Example 5 - Show style #0
{{User:Willscrlt/meta/lang|en|0|This is English.}}
This is English.
Example 6 - Show style #1
{{User:Willscrlt/meta/lang|en|1|This is English.}}
  This is English.
Example 7 - Show style #3
{{User:Willscrlt/meta/lang|en|3|This is English.}}
English: This is English.
Example 8 - With a tooltip
{{User:Willscrlt/meta/lang|en|2|This is English.|name=This is the tooltip.}}
  English: This is English.
Example 9 - Simple English requires "html=en" (and setting the language to "simple")
{{User:Willscrlt/meta/lang|simple|html=en|2|This is Simple English.}}
  Simple English: This is Simple English.
Example 10 - Traditional Chinese requires "html=zh-Hant" and "icon=zh"
{{User:Willscrlt/meta/lang|zh|html=zh-Hant|icon=zh|2|这是传统中文。}}
  中文: 这是传统中文。

Version information

editar

v1.4.0 (08:25, 12 April 2009 (UTC)) — Check meta for the most current version.

This template is used on multiple WikiMedia Foundation Projects. Unless it is horribly broken and causing major disruptions, please do not edit this template. The master template is located at m:User:Willscrlt/meta/lang and is manually distributed to other projects by its creator, Willscrlt (Talk).

If you find this template useful, please use it. Be aware that I may change its features or functionality in the future. If you want a stable version, make a copy for yourself (but you will not get any bug fixes I might make). If you think this template would be useful for the entire Project to use, please fork it into the main Template namespace (Predefinição) and give me credit (attribution information).


{{ #switch: {{CONTENTLANGUAGE}}.{{ns:Project}} | en.Wikipedia | fr.Wikipédia | it.Wikipedia =   <!-- @@@ Wiki requested supression of automatic user categories --> | #default = <!-- Generate automatic user categories for all other sites --> {{ #ifexist:{{ns:Category}}:{{ns:Template}}s by {{ns:User}}:Willscrlt | [[{{ns:Category}}:{{ns:Template}}s by {{ns:User}}:Willscrlt|{{ucfirst:{{SUBPAGENAME}}}}]] | [[{{ns:Category}}:{{ns:User}}:Willscrlt|{{ucfirst:{{SUBPAGENAME}}}}]] }} }}