Difference between revisions of "Template:Babel/doc"

From blackwiki
Jump to navigation Jump to search
imported>MarnetteD
 
(17 intermediate revisions by 7 users not shown)
Line 3: Line 3:
 
{{nosubst}}
 
{{nosubst}}
 
{{Lua|Module:Babel}}
 
{{Lua|Module:Babel}}
{{Interwikitmp-grp|commons=Babel|mw=Babel|meta=Babel|ws=Babel|wbk=Babel|wkt=Babel|wn=Babel|wqt=Babel|species=Babel|wvy=Babel}}
+
{{High-use}}
  
{{tl|Babel}} is for showing the languages that you know, as well as the operating system, keyboard layout, web browser, desktop environment, and text editor that you are most comfortable with.  Details of how to use it for its original purpose -- showing the languages that you know -- are at [[Wikipedia:Babel]].
+
{{tl|Babel}} is for showing the languages that you know, as well as the operating system, keyboard layout, web browser, desktop environment, and text editor that you are most comfortable with.  Details of how to use it for its original purpose—showing the languages that you know—are at [[Wikipedia:Babel]].
  
=== Usage ===
+
== Usage ==
 
{{tlx|Babel|{{var|<box1>}}|{{var|<box2>}}|{{var|<box3>}}...}}
 
{{tlx|Babel|{{var|<box1>}}|{{var|<box2>}}|{{var|<box3>}}...}}
  
Parameters can be added using the <code><nowiki>{{!}}</nowiki></code> trick.
+
Parameters can be added using the <code><nowiki>{{!}}</nowiki></code> and {{tlx|{{=}}}} tricks:
  
The Babel box prefixes its arguments with "User ", so it will work with the User: namespace. For example, this would include the {{temt|User:Urhixidur/Userboxes/Asteroid}} user box:
+
{|
 +
|-
 +
|
 +
<code><nowiki>{{Babel|</nowiki>[[Template:User 0RR|0RR]]<nowiki>{{!}}border-c{{=}}red}}</nowiki></code> {{big|➜}}
 +
|
 +
{{Babel|0RR{{!}}border-c{{=}}red}}
 +
|}
  
{{tlx|Babel|{{var|<box1>}}|{{var|<box2>}}|:Urhixidur/Userboxes/Asteroid|{{var|<box 4>}}|...}}
+
The Babel box prefixes its arguments with "User ", so it will work with the User: namespace:
  
=== Custom styling ===
+
{|
To customize the appearance you can add the optional parameters header=''HEADER'' (default: [[Wikipedia:Babel]]), footer=''FOOTER'' (default: [[:Category:Wikipedians by language|Search user languages]]), bordercolor=''BORDERCOLOR'' (default: #99B3FF), color=''COLOR'' (default: white), textcolor=''TEXTCOLOR'' (default: black), left=''Left margin'' (default: 1), bottom=''Bottom margin'' (default: 0.5), solid=''Solid border width'' (default: 1), width=''Box width'' (default: 248), and/or extra-css=<any other formatting>. Call the '!' userbox to start a new column after that point or the '-' userbox to insert a blank row. You may also use '|align=left' to display the babel box on the left side of the screen rather than the default right.
+
|-
 +
|
 +
<code><nowiki>{{Babel|</nowiki>[[User:UBX/Userboxes/Thank Button|:UBX/Userboxes/Thank Button]]<nowiki>}}</nowiki></code> {{big|➜}}
 +
|
 +
{{Babel|:UBX/Userboxes/Thank Button}}
 +
|}
  
Example: <code><nowiki>{{Babel|align=left|color=yellow|en|fr-3|de-4|!|tl-1|ru-2|:UBX/1337|nocat=true}}</nowiki></code> produces:
+
== Custom styling ==
 +
To customize the appearance you can add the optional parameters
  
{{Babel|align=left|color=yellow|en|fr-3|de-4|!|tl-1|ru-2|:UBX/1337|nocat=true}}
+
; {{para|align|right}}: to display the babel box on the left side of the screen rather than the default right
{{-}}
+
; {{para|header|<var>header</var>}}: change header, default is [[Wikipedia:Babel]]
 +
; {{para|footer|<var>footer</var>}}: change wiki markup for footer, default is <code><nowiki>[[:Category:Wikipedians by language|Search user languages]]</nowiki></code> (which appears as [[:Category:Wikipedians by language|Search user languages]])
 +
; {{para|bordercolor|<var>color</var>}}: color of the border, default is #99B3FF
 +
; {{para|color|<var>color</var>}}: background color, default is white
 +
; {{para|textcolor|<var>color</var>}}: text color, default is black
 +
; {{para|left|<var>pixels</var>}}: left margin in pixels, default is 1
 +
; {{para|bottom|<var>pixels</var>}}: bottom margin in pixels, default is 0.5
 +
; {{para|solid|<var>pixels</var>}}: solid border width, default is 1
 +
; {{para|width|<var>pixels</var>}}: width of the box, default is 248
 +
; {{para|extra-css|<var>css-code</var>}}: any other custom formatting
  
=== Use on other wikis ===
+
===Columns and separators===
The page you are now reading is <noinclude>the '''/doc''' subpage for</noinclude> the actual Babel template.  If you click "edit this page", you will see a bunch of computer code that makes the Babel boxes work. What you're now reading is just documentation for that code, transcluded inside "&lt;noinclude&gt;" tags so it doesn't interfere with the computer code.
+
* Use <code>!</code> to start a new column after that point
 +
* Use [[Template:User -|<code>-</code>]] to insert a blank row
 +
* Use [[Template:User head|<code>head</code>]] to insert a header; use [[Template:User head-m|<code>head-m</code>]] to insert a header without text
 +
* Use [[Template:User line|<code>line</code>]] to insert a horizontal ruler separator
  
In order to have Babel boxes on another Wikimedia project, just copy this page to that project. Click "view source" and copy all the contents, including the computer code. Create a page called "Template:Babel" on the other Wikimedia project and put the content into it.
+
Example: <code><nowiki>{{Babel|align=left|header=Userboxes|color=yellow|head|en|tl-1|ru-2|line|pas|:UBX/1337|!|head{{!}}Other|1RR|help desk|-|line|happy|wikipedia/WikiFairy|nocat=yes}}</nowiki></code> produces:
 +
 
 +
{{Babel|align=left|header=Userboxes|color=yellow|head|en|tl-1|ru-2|line|pas|:UBX/1337|!|head{{!}}Other|1RR|help desk|-|line|happy|wikipedia/WikiFairy|nocat=yes}}
 +
{{clear}}
 +
 
 +
== Use on other wikis ==
 +
The page you are now reading is <noinclude>the '''/doc''' subpage for</noinclude> the actual Babel template. If you click "edit this page", you will see invocation of [[WP:Lua|Lua]] [[Module:Babel]] that makes the Babel boxes work. What you're now reading is just documentation for that code, transcluded inside "&lt;noinclude&gt;" tags so it doesn't interfere with the computer code.
 +
 
 +
In order to have Babel boxes on another Wikimedia project, you need both template and the module. Click "view source" and copy all the contents, including the computer code. Create a page called "Template:Babel" on the other Wikimedia project and put the content into it. Do the same for the module.
  
 
You also need to copy over a bunch of files with names like "Template:User en", "Template:User en-1", "Template:User fr", etc. etc.  Once you've done that, users can put e.g. "<nowiki>{{Babel|en-1|fr}}</nowiki>" on their user page and the Babel boxes will be displayed.
 
You also need to copy over a bunch of files with names like "Template:User en", "Template:User en-1", "Template:User fr", etc. etc.  Once you've done that, users can put e.g. "<nowiki>{{Babel|en-1|fr}}</nowiki>" on their user page and the Babel boxes will be displayed.
  
===See also===
+
==See also==
 
* [[mw:Extension:Babel]]
 
* [[mw:Extension:Babel]]
  

Latest revision as of 02:56, 17 May 2020

{{Babel}} is for showing the languages that you know, as well as the operating system, keyboard layout, web browser, desktop environment, and text editor that you are most comfortable with. Details of how to use it for its original purpose—showing the languages that you know—are at Wikipedia:Babel.

Usage

{{Babel|<box1>|<box2>|<box3>...}}

Parameters can be added using the {{!}} and {{=}} tricks:

{{Babel|0RR{{!}}border-c{{=}}red}}

Wikipedia:Babel
Template:User 0RR
Search user languages

The Babel box prefixes its arguments with "User ", so it will work with the User: namespace:

{{Babel|:UBX/Userboxes/Thank Button}}

Wikipedia:Babel
User:UBX/Userboxes/Thank Button
Search user languages

Custom styling

To customize the appearance you can add the optional parameters

|align=right
to display the babel box on the left side of the screen rather than the default right
|header=header
change header, default is Wikipedia:Babel
|footer=footer
change wiki markup for footer, default is [[:Category:Wikipedians by language|Search user languages]] (which appears as Search user languages)
|bordercolor=color
color of the border, default is #99B3FF
|color=color
background color, default is white
|textcolor=color
text color, default is black
|left=pixels
left margin in pixels, default is 1
|bottom=pixels
bottom margin in pixels, default is 0.5
|solid=pixels
solid border width, default is 1
|width=pixels
width of the box, default is 248
|extra-css=css-code
any other custom formatting

Columns and separators

  • Use ! to start a new column after that point
  • Use - to insert a blank row
  • Use head to insert a header; use head-m to insert a header without text
  • Use line to insert a horizontal ruler separator

Example: {{Babel|align=left|header=Userboxes|color=yellow|head|en|tl-1|ru-2|line|pas|:UBX/1337|!|head{{!}}Other|1RR|help desk|-|line|happy|wikipedia/WikiFairy|nocat=yes}} produces:

Userboxes
Template:User headTemplate:User enTemplate:User tl-1Template:User ru-2Template:User lineTemplate:User pasUser:UBX/1337Template:User headTemplate:User 1RRTemplate:User help deskTemplate:User -Template:User lineTemplate:User happyTemplate:User wikipedia/WikiFairy
Search user languages

Use on other wikis

The page you are now reading is the /doc subpage for the actual Babel template. If you click "edit this page", you will see invocation of Lua Module:Babel that makes the Babel boxes work. What you're now reading is just documentation for that code, transcluded inside "<noinclude>" tags so it doesn't interfere with the computer code.

In order to have Babel boxes on another Wikimedia project, you need both template and the module. Click "view source" and copy all the contents, including the computer code. Create a page called "Template:Babel" on the other Wikimedia project and put the content into it. Do the same for the module.

You also need to copy over a bunch of files with names like "Template:User en", "Template:User en-1", "Template:User fr", etc. etc. Once you've done that, users can put e.g. "{{Babel|en-1|fr}}" on their user page and the Babel boxes will be displayed.

See also