Template:Braille cell/doc


 * Basic usage, inline: &rarr;
 * Images: &rarr;
 * All parameters:

By default the braille language is English braille (grade 2), and any abstract form ("dots-136").

Usage overview
code1, 2, 3, ..., 20. Letter definitions to be translated to a braille cell (case insensitive, A=a).

lang for the braille language. Four braille languages are recognised: English (grade 2), French, Japanese and Korean braille. English (grade 2) braille is default so doesn't have to be entered, the other languages should be defined (e.g. lang=Japanese).

type. Type of braille cell to be shown: 6-dot cell image, 8-dot cell image, in-line text character 6, 6dot, 8, 8dot, image, text. The default is text (inline font character). For Japanese and Korean braille script, entering type=Korean produces illustrative colored braille cells (see Korean braille). These two types are default for their languages.

size. Width size of the image (in px) of font-size of the inline text (like %, em, px). Add the unit to the number (e.g. size=20px for 6dot/8dot images, and 10px, 2em, 150% for fontsize).

caption. A descriptive caption (mouse hover text) for a braille character is added. It can be shortened to the simple definition (caption= (&lt;blank>), and be hidden (caption=no).

background or bg. Sets the background color. For type=text only. Default is #f4f4f4. Examples:
 * &rarr;
 * &rarr;
 * &rarr;

Input values
Possible input: plain text and various braille cell definitions (see below). Up to 20 cells can be indicated in a single call to the template, each dot pattern separated with a pipe character "|". Skipping a code is read as a blank cell (e.g. {{code|1= {{braille cell|A||b|o|o|k }} introduces a blank cell after "A"). All defined input values will output a single Braille cell.

Acceptable input values to produce braille cells are of the following types:

Letters
Simple English letters - capital or lower case: "A", "c", "X", "W", "z", etc. Valid for 6-dot, 8-dot, text, and Japanese type cells.

Accented French letters - capital or lower case: "È", "Ö", "å", etc.

Double letters and words - capital or lower case: "st", "SH", "for", "Th", "ing", etc.

Japanese letters - Katakana, hiragana, and Japanese diacritics (e.g. "dakuten", "chōon", "-Y-", etc.) are valid input for 6-dot, 8-dot, text, and Japanese cell types, with Romaji valid for Japanese cells only.

Korean letters - The are valid input for 6-dot, 8-dot, text, and Korean cell types, with Revised Romanization (X- for initial, -X for final consonants) valid for Korean cells only.

Other characters
Numbers - prefixed with a number sign: "#0" (="J"), "#7" (="G"), etc.

Punctuation - signs or names: "exclamation", ".", "openquote", "bracket", etc.

Other symbols - "null" or blank", "accent" or "`", "contraction" or "contr2", "capital", "decimal", "contr3" or "space" (dots 4+5), "correction", "cursive" or "contr1", "number" or "#".

Notes - For the question mark "?" in French, use lang=French. Otherwise it will produce (default) the English braille. The French "space" is the third English Braille contraction prefix, while English Braille space is "blank" or "null", and French "cursive" is the first English Braille contractions prefix.

Braille cell definitions (dot numbering)
Four options can be used in this Braille cell template to produce a cell, and all are case-insensitive (A=a). Note that this cell definition is unrelated to any language (no "A" assigned).
 * &rarr;

A braille cell is defined by naming the raised dots. In 6-dot notation there are 64 combinations, in 8-dot notation this number is 256 (including all 6-dot cells). Such a definition is independent of the braille language (there is no connection with a letter A; this is for the Braille language to add).

Using the cell numbering shown here, one can simple mention the raised dots: say dots-1234 for. The numeric order can be in raising numeric order ("123456"), or in row-by-row order ("142536"), so the same cell is uniquely identified by 1234 or by 1423.

Another identification is the Unicode character, ⠏, that is. The block has a mapping from raised dots to character id in the range U+28xx.

Inversely, a cell can be defined by its Unicode character id: U+280F defines cell with raised dots-1234.

Special options
Two input codes are available to produce special, non-braille output.

Cell numbering overview
dot numbers returns the overview of dot numbers 1–8. It can only be type=image:
 * &rarr;

Whitespace
null or whitespace produces a true space, not the blank braille cell:
 * &rarr;

lang

 * lang= English, French, Japanese, Korean braille. English and generic is default.

Japanese and Korean braille
Japanese braille and Korean braille have setting options from an earlier version of this template. They can be declared using type =Japanese. Doing so returns colored braillecells for clarification. In general, the language should be entered lang =Japanese. The parameter type then is available as default (colored cells) or enforcing 6dot black/white cells for Japanese or Korean.

type

 * type=6dot, 8dot, image, text. Default: text (as a character fromt the font). When dot 7 or 8 is used, always the 8-dot image is shown, any 6-dot setting is overruled.

size

 * When text, size=150% or 3em or 40px (Default: 100%, so regular font size).
 * When image, in px: size=20px

background
Can be set for text output (not for image output).
 * &rarr;
 * &rarr;
 * &rarr; (shortcut)
 * &rarr;

caption
The cell has a caption (mouse hover text), based on the input.

Possible errors
Possible errors that are catched:
 * Input is not recognised as a braille code:
 * &rarr;


 * More than 20 (braille) characters are requested:
 * &rarr;

Article pages with a red error message also are listed in Category:Unsupported braille input.


 * Numbers and dot number: Input "#2" is for the cell meaning decimal number two, input "2" produces the dot number 2 cell:
 * &rarr;.

This mistake is not caught or noted. The intention of the editor (input is dot-number or decimal number) cannot be deduced.

Examples
6-dot cell, basic letter input: -

Japanese multi-cell: -

Korean multi-cell: -

8-dot cell, basic letter input: -

Unicode text character, large size, basic letter input: -

6-dot cell, small size, title text: -

6-dot, dot order input: -

bottom dots, numeric order input: -

Technical details
The parameter name "dot-id" is used to define a braille cell. It is the numbering of the raised dots, like 136 for. The sequence is climbing: 12345678, as is used in the Unicode character name: "Braille pattern dots-136".
 * Braille cell: separates numbered parameters into individual calls to /main.
 * Braille cell/main: calls /main2. Converts a single input code plus named parameters into appropriate braille cell id ("dot-id") and input code. Contains the list with non-English code translations (other languages).
 * Braille cell/main2: Calls /core. Prepares input texts and codes, using the now determined cell id. Checks for and shows error message.
 * Braille cell/core: Produces the actual cell output (text or image) using the settings.
 * braille cell/main2singlecell
 * braille cell/lang2lang-id

Input is evaluated and processed using these lists:
 * Braille cell/english&cell2dot-id: analyse input code against default list (English and generic)
 * Braille cell/dot-id2character: cell id into text character (Unicode)
 * Braille cell/dot-id2unicode-id: cell id into textual Unicode definition, pattern U+28xx
 * Braille cell/dot-id2filename: cell id into a specific filename (6dot, Japanese, Korean)
 * Braille cell/dot-id2filename-8dot: cell id into a default 8-dot filename

Error tracking category:
 * Category:Unsupported braille input: tracks transclusions with invalid input.
 * T:braille/subs
 * '''Template:braille cell - sbx
 * Category:Unsupported braille input
 * Template talk:braille cell

Other related

 * Commons: Category: Braille letters (6 dots)
 * Commons: Category: Braille letters (8 dots)
 * File:Pictograms-nps-accessibility-braille.svg
 * File:Braille8dotCellNumbering.svg