Module:scripts/data/documentation

Documentation for Module:scripts/data. [edit]
This page contains usage information, categories, interwiki links and other content describing the module.

This module contains definitions and metadata for all script codes on Wiktionary. See Wiktionary:Scripts for more information.

This module must not be imported using require. Instead, it is imported like this:

local m_scripts = mw.loadData("Module:scripts")

This ensures that the data is only loaded once per page, rather than once for every module invocation like normal.

To access this data from templates, use Module:script utilities.

See Module:data consistency check to check for errors in this data module.

Required values

edit

Every entry in the table must contain the following properties:

canonicalName
The "canonical" name of the script. This is the name that is used in Wiktionary entries and category names.

Optional values

edit
aliases
A list of aliases/synonyms for the script, other than the canonical name.
varieties
A table of script varieties that are subsumed under the script. This should not in general include those varieties for which separate script codes have been assigned. If a given variety has several names, they can all be listed by including a sublist in the overall list, where the first element is the canonical name that you want the variety to be known by, and the remainder are aliases. For example, the Arabic script entry lists the following under varieties:
	{"Jawi", {"Nastaliq", "Nastaleeq"}}

Here, the Nastaliq variety has an alias "Nastaleeq" specified, while the Jawi variety has no aliases listed. Note that, as here (where Jawi is a particular Arabic script for writing the Malay language while Nastaliq is a calligraphic hand commonly used to write Kashmiri and Urdu), varieties at different levels of specificity can be given in the same list.

otherNames (deprecated)
A table of all non-canonical names that this scripts is known by, including both synonyms and varieties. This should not be used in new scripts, and existing scripts should have the entries in this list moved into either aliases or varieties.
characters
A Lua character class that matches on any character that belongs to this script. The character classes are the same as those in Lua search/replace patterns, but without the surrounding [ ] (these are implicitly added). They also resemble those found in regular expressions.
In its simplest form, the character class can just be a list of all the characters in the script (for example, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"). But it's easier to describe using character ranges, especially when the script contains many dozens or even hundreds of different characters. Character ranges are given with only the first and last character, and separated by a hyphen -. The set then implicitly includes all characters whose Unicode codepoints are in between the two given characters (for example, "A-Za-z"). This character set is used for automatic script recognition (see findBestScript in Module:scripts) if a language has this script's code in its scripts table.
character_category
Used by Module:character info. If false, prevents {{character info}} from adding a characters category, such as Category:Latin script characters.
direction
Describes the text direction. The default value is "ltr" (horizontal left-to-right), so this can be omitted. Horizontal right-to-left scripts should have "rtl", while vertical scripts should have "vertical-ltr" (vertical left-to-right) or "vertical-rtl" (vertical right-to-left).
systems
The categories of writing system to which the script belongs. See Module:writing_systems/data for a list of supported values. At the moment, this is only used by Module:category_tree/poscatboiler/data/scripts. The system will only be displayed if there is only one category. See Category:Latin script for an example.