Template:stroke order/documentation

Usage
Include a stroke order image for from the commons:Category:CJK stroke order project – displays as a float right image box, captioned “Stroke order”. This requires that the image actually exist.

Sample usage
Displays the static usual (traditional Chinese) stroke order for a 12-stroke character.

Displays the animated stroke order; note that strokes does not need to be specified, because all animations are in box of a fixed size, regardless of number of strokes.

Parameters

 * type= selects the type of image, bw, jbw, tbw (not animated), animate, janimate, tanimate (animated), cursive, alternative (unusual animations). Defaults to bw, the usual image used.
 * strokes= the number of strokes in the character (as actually drawn). This is generally the same as the sn (Stroke Number) parameter to, but can differ, if the latter is used for traditional stroke numbers. Notably 艸 (the grass radical) is traditionally 6 strokes, but today drawn as 3 or 4).

E.g.:
 * with no parameters, displays the (char)-bw.png image at a default size
 * with strokes= parameter, displays the image sized properly for the number of characters
 * this is the default case
 * with type=jbw and the strokes parameter, displays the Japanese stroke order (e.g., 生)
 * with type=tbw and the strokes parameter, displays the Taiwanese stroke order (e.g., 伐)
 * with type=gbw, displays Mainland China stroke order (e.g., 情)
 * with type=hbw, displays Hong Kong stroke order (e.g., 草)
 * with type=animate displays the stroke order as an animation (strokes= not needed)
 * See trouble-shooting, below, if displayed image is not animated.


 * with type=janimate displays the Japanese stroke order as an animation (strokes= not needed) (e.g., 生)
 * with type=tanimate displays the Taiwanese stroke order as an animation (strokes= not needed) (e.g., 方)
 * with type=hanimate displays the Hong Kong stroke order as an animation (strokes= not needed) (e.g., 龜)
 * with type=cursive displays an animated cursive stroke order (strokes= not needed) (e.g., 鬼)
 * with type=alternative displays an alternative stroke order (strokes= not needed) (e.g., 龜)

Also:
 * with no named parameters, and one un-named parameter, displays whatever it is in the box

Placement
Place at the top of the ==Translingual== section (under the heading). If there are multiple images (bw, jbw, animated), please include all – it is useful to have both a static image and an animated one.

The ordering of stroke order images and or  is not currently standardized – please place all at the top of ==Translingual==. Best layout is probably: on the following basis: A case can be made for placing zh-forms/ja-forms in the ===Alternative forms=== or ===Descendants=== or ===Related characters=== subsections, as appropriate, but this may be confusing and is not currently done.
 * bw
 * jbw
 * animate
 * tanimate
 * janimate
 * ja-forms/Han simplified forms
 * bw & jbw are wide, hence most disruptive to layout; placing them on top minimizes this interference.
 * bw before jbw, following chronology
 * animate following, to keep stroke orders together
 * ja-forms/Han simplified forms last, as they are least disruptive to layout

Currently red stroke orders (images where the stroke order is displayed using various shades of red) are not used on Wiktionary; if added, they may be included via an addition to the <tt>type</tt> parameter, and placed after the animated image, at the same size.

Trouble-shooting
If an animated image does not display as animated, but rather as a still image, fix via the following:
 * Go to the Wikimedia Commons page, and click “Purge” (a tab at the top)
 * Return to the Wiktionary page, and refresh the page, purging your local cache (in Firefox, this is Ctrl-Shift-R)

There have in the past been problems with GIF thumbnailing at Wikimedia Commons (GIF images are used for these animations, and the small image displayed on Wiktionary is a thumbnail of the original file), where GIF thumbnailing was either completely broken, or displayed only the first frame of an animated GIF. As of mid-2010, this is fixed, but many old, broken thumbnails remain (because they were not cleared out); all Chinese character animations are believed to be fixed (via purging), however. This can be fixed manually by purging the old thumbnail both from Wikimedia Commons, and from your local computer, via the steps above.
 * Explanation

For further information and current status, see Commons:Graphics village pump/GIF thread. One can check characters informally by viewing the category pages at commons:Category:Order.gif stroke order images; any static images require purging.

Unusual cases
Most cases can be handled systematically; for unusual cases, please manually code using.

Currently red stroke orders are not displayed on Wiktionary.

While in the vast majority of cases, the stroke order is the same across different standards, certain characters have differing stroke orders. For example, 戈 has two different stroke orders. See for discussion of other such cases. These can be coded using jbw, tbw, janimate, tanimate, etc.

All stroke orders are currently displayed in separate boxes; it may be useful – for compactness or to make visual comparison easier – to display multiple animations in a single box, such as modern + traditional stroke order.

An alternative drawing of a given character (e.g., when there are significant typographical differences) sometimes exists, and covered by. These are rare; see commons:Category:Aorder.gif stroke order images for examples, but note that currently, only 3 files (,, ; and 1 redirect, ) are actually alternatives.

Bot?
There is currently no bot that checks that all images that exist at Commons are included at Wiktionary (or that non-existence images are not linked to). Such a bot would certainly be appreciated!