Mòideal:scripts/data/doc
< Mòideal:scripts | data
This is the documentation page for Mòideal:scripts/data
Related pages |
---|
(deasbaireachd⧼tpt-languages-separator⧽ ⧼tpt-languages-separator⧽eachdraidh⧼tpt-languages-separator⧽ceanglaichean⧼tpt-languages-separator⧽doc⧼tpt-languages-separator⧽bogsa-gainmhich⧼tpt-languages-separator⧽cùisean deuchainn)
This module is currently protected from editing. See the protection policy and protection log for more details. Please discuss any changes on the talk page; you may submit an edit request to ask an administrator to make an edit if it is uncontroversial or supported by consensus. You may also request that this page be unprotected. |
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
This page is not a sandbox. It should not be used for test editing. To experiment, please use the Wikipedia sandbox, your user sandbox, or the other sandboxes. |
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("Mòideal: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 Mòideal:script utilities.
Required values
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
otherNames
- 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 (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 (Example:"A-Za-z"
).