Modul:scripts/data/doc
< Modul:scripts | data
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
szerkesztésEvery 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
szerkesztésotherNames
- A table of all the names that this script is known by, other than the canonical name.
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 (seefindBestScript
in Module:scripts) if a language has this script's code in itsscripts
table. character_category
- Used by Module:character info. If
false
, prevents{{character info}}
from adding acharacters
category, such as Category:Latin script characters. direction
- Describes the direction of writing. Most scripts are "ltr" (left-to-right) so they can be omitted. Some scripts are "rtl" (right-to-left) anyway. Very few scripts are "down" such as Mongolian and Phags-pa.
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/script cat. The system will only be displayed if there is only one category. See Category:Latin script for an example.