Template:Sandbox: Difference between revisions

From OLPC
Jump to navigation Jump to search
(testing multi-lingual Translation template)
(testing a Graphics API template candidate?)
Line 8: Line 8:
[[Category:Template]]
[[Category:Template]]
</noinclude>
</noinclude>
<div id="{{{element_name}}}"/>
<div style="border-top:1px solid #888888; border-bottom:1px solid #888888; margin:0px;">
<div style="border:1px solid red; margin:0px; ">
{| width="100%" cellpadding="0" cellspacing="0" style="background-color:#3b9fca; color:white"
; <tt>{{{element_path}}}.{{{element_name}}}</tt> : {{{description}}}
|-
{| align="center"
| <!-- width=75% --> align=left | &nbsp;&nbsp;<font size="1">{{:Template:Translation/translation of/lang-{{{lang}}}}} '''[[{{{source}}}|{{{source_display|{{{source}}}}}}]]'''</font>

| <!-- width=25% --> align=right | <font size="1">'''<span class="plainlinks">[{{fullurl:{{{source}}}|oldid={{{version}}}}} {{{version_display|{{:Template:Translation/original/lang-{{{lang}}}}}}}}]</span>'''</font>&nbsp;&nbsp;
|- valign="top"
|-
! <tt>default</tt> || {{{STATE_NORMAL}}}
| align=left | &nbsp;&nbsp;{{:{{{source}}}/translations}}

| align=right | <font size="1">'''<span class="plainlinks">[{{fullurl:{{{source}}}|diff=current&amp;oldid={{{version}}}}} {{{diff_display|{{:Template:Translation/changes/lang-{{{lang}}}}}}}}]</span>'''</font>&nbsp;&nbsp;
|- valign="top"
|-
! <tt>focused</tt> || {{{STATE_SELECTED}}}

|- valign="top"
! <tt>pressed</tt> || {{{STATE_ACTIVE}}}

|- valign="top"
! <tt>hover</tt> || {{{STATE_PRELIGHT}}}

|- valign="top"
! <tt>inactive</tt> || {{{STATE_INSENSITIVE}}}

|}
|}
</div>
</div>
<noinclude>
<noinclude>


: <big>'''Testing multi-lingual template Template:Translation<strike></strike>'''</big>
: <big>'''Testing Graphics API template<strike></strike>'''</big>


== Usage ==
== Usage ==


<nowiki>{{</nowiki> Translation
<nowiki>{{</nowiki> Sandbox
| lang = &lt;-- 2/3 character language-code of the translation&mdash;ie: <tt>en, es, ...</tt> --&gt;
| element_path = &lt;-- the 'path' or 'qualification' of the elmente &mdash;ie: <tt>gtk, sugar.activity, sugar.graphics ...</tt> --&gt;
| source = &lt;-- Source page name&mdash;ie: "The OLPC Wiki" (sans quotes) --&gt;
| element_name = &lt;-- name of the component&mdash;ie: <tt>window, IconButton, ...</tt> --&gt;
| version = &lt;-- Version ID# of the edition being translated or last updated --&gt;
| description = &lt;-- full text describing the appropriate attributes or peculiarities of the element --&gt;
| ''source_display'' = &lt;-- OPTIONAL - display string to the source link above
| STATE_NORMAL = &lt;-- 'default' state considerations or peculiarities --&gt;
| STATE_SELECTED = &lt;-- 'focused' state considerations or peculiarities --&gt;
default = value of ''source'' --&gt;
| STATE_ACTIVE = &lt;-- 'pressed' state considerations or peculiarities --&gt;
| ''version_display'' = &lt;-- OPTIONAL - display string for the translated ''version'' link
default = "original" --&gt;
| STATE_PRELIGHT = &lt;-- 'hover' state considerations or peculiarities --&gt;
| STATE_INSENSITIVE = &lt;-- 'inactive' state considerations or peculiarities --&gt;
| ''diff_display'' = &lt;-- OPTIONAL - display string for the ''differences'' to current link
default = "diff" --&gt;
<nowiki>}}</nowiki>
<nowiki>}}</nowiki>

; NOTE : the ''version'' parameter is the number displayed in the ''source'' page in the <tt>[ID# xxxxx]</tt> of the language-navigation blue bar. Keeping this number updated to the LAST version you 'translated' or 'updated' will ease updating the page when following the <tt>diff</tt> link in your page, as it will show those changes in the original from your last update.


== Samples ==
== Samples ==


<nowiki>{{</nowiki> Translation | lang = es | source = The OLPC Wiki | version = 30534 <nowiki>}}</nowiki>
<nowiki>{{</nowiki> Sandbox
| element_path = sugar.graphics
{{ Sandbox | lang = es | source = The OLPC Wiki | version = 30534 }}
| element_name = IconButton
<nowiki>{{</nowiki> Translation | lang = es | source = The OLPC Wiki | version = 30534
| source_display = original
| description = * Support for SVG and png.
* Icons should be grey scale. But might be coloured with the XO colors (svg only)
| version_display = versión traducida
* Size of the button is 75 pixels, size of the icon canvas is 55 and suggested icon size is around 45.
| diff_display = últimos cambios <nowiki>}}</nowiki>
| STATE_NORMAL = &lt;-- 'default' state considerations or peculiarities --&gt;
{{ Sandbox | lang = es | source = The OLPC Wiki | version = 30534
| STATE_SELECTED = Rounded rectangle 61 pixels, 10 pixels of radius, stroked in white 2.25 points &lt;-- 'focused' state --&gt;
| source_display = original | version_display = versión traducida | diff_display = últimos cambios }}
| STATE_ACTIVE = Rounded rectangle 61 pixels, 10 pixels of radius, filled in selection grey &lt;-- 'pressed' state --&gt;

| STATE_PRELIGHT = Black &lt;-- 'hover' state --&gt;
| STATE_INSENSITIVE = Fallbacks if no inactive icon is specified.&lt;-- 'inactive' state --&gt;
<nowiki>}}</nowiki>
{{ Sandbox
| element_path = sugar.graphics
| element_name = IconButton
| description = * Support for SVG and png.
* Icons should be grey scale. But might be coloured with the XO colors (svg only)
* Size of the button is 75 pixels, size of the icon canvas is 55 and suggested icon size is around 45.
| STATE_NORMAL = &lt;-- 'default' state considerations or peculiarities --&gt;
| STATE_SELECTED = Rounded rectangle 61 pixels, 10 pixels of radius, stroked in white 2.25 points
| STATE_ACTIVE = Rounded rectangle 61 pixels, 10 pixels of radius, filled in selection grey
| STATE_PRELIGHT = Black
| STATE_INSENSITIVE = Fallbacks if no inactive icon is specified.}}
</noinclude>
</noinclude>

Revision as of 16:20, 27 April 2007

Many times you may want to just 'test' an idea for a template, I haven't found a sensible way of fully testing templates by themselves (as they will not get included in the edited version, but rather the saved version).

The idea of this Template:Sandbox is to have that, a simple testing zone that will not interfere with others and avoid leaving a trail of botched attempts.

Please leave this comment/text for others to read.
See Also http://meta.wikimedia.org/wiki/Help:Template
{{{element_path}}}.{{{element_name}}}
{{{description}}}
default {{{STATE_NORMAL}}}
focused {{{STATE_SELECTED}}}
pressed {{{STATE_ACTIVE}}}
hover {{{STATE_PRELIGHT}}}
inactive {{{STATE_INSENSITIVE}}}


Testing Graphics API template

Usage

{{ Sandbox
  | element_path       =  <-- the 'path' or 'qualification' of the elmente —ie: gtk, sugar.activity, sugar.graphics ... -->
  | element_name       =  <-- name of the component—ie: window, IconButton, ... -->
  | description        =  <-- full text describing the appropriate attributes or peculiarities of the element -->
  | STATE_NORMAL       =  <-- 'default' state considerations or peculiarities -->
  | STATE_SELECTED     =  <-- 'focused' state considerations or peculiarities -->
  | STATE_ACTIVE       =  <-- 'pressed' state considerations or peculiarities -->
  | STATE_PRELIGHT     =  <-- 'hover' state considerations or peculiarities -->
  | STATE_INSENSITIVE  =  <-- 'inactive' state considerations or peculiarities -->
}}

Samples

{{ Sandbox 
  | element_path       =  sugar.graphics
  | element_name       =  IconButton
  | description        =  * Support for SVG and png.
* Icons should be grey scale. But might be coloured with the XO colors (svg only) 
* Size of the button is 75 pixels, size of the icon canvas is 55 and suggested icon size is around 45.
  | STATE_NORMAL       =  <-- 'default' state considerations or peculiarities -->
  | STATE_SELECTED     =  Rounded rectangle 61 pixels, 10 pixels of radius, stroked in white 2.25 points <-- 'focused' state -->
  | STATE_ACTIVE       =  Rounded rectangle 61 pixels, 10 pixels of radius, filled in selection grey <-- 'pressed' state -->
  | STATE_PRELIGHT     =  Black <-- 'hover' state -->
  | STATE_INSENSITIVE  =  Fallbacks if no inactive icon is specified.<-- 'inactive' state -->
 }}
sugar.graphics.IconButton
* Support for SVG and png.
  • Icons should be grey scale. But might be coloured with the XO colors (svg only)
  • Size of the button is 75 pixels, size of the icon canvas is 55 and suggested icon size is around 45.
default <-- 'default' state considerations or peculiarities -->
focused Rounded rectangle 61 pixels, 10 pixels of radius, stroked in white 2.25 points
pressed Rounded rectangle 61 pixels, 10 pixels of radius, filled in selection grey
hover Black
inactive Fallbacks if no inactive icon is specified.