Internationalisation
Bundled Plugins API
script
Provides the set of ISO 15924 language scripts. The return value can be iterated as a list, or you can find a specific language by either its four-character code (alpha4), three-character numeric code (numeric3), local name, or English name.
For example:
1
local script = require("cp.i18n.script")
2
print(script[1]) -- table for "Adlam" script
3
print(script.Hani) -- table for "Han" script (matches `alpha4`)
4
print(script["500"]) -- same table for "Han" (matches `numeric3`)
5
print(script["Han (Hanzi, Kanji, Hanja)"]) -- same table for "Han" (matches `name`)
6
print(script.Han) -- same table for "Han" (matches `pva`).
Copied!
This will return a table containing the following:
  • alpha4 - The 4-character script code (eg. "Hani", "Arab").
  • date - The YYYY-MM-DD date the script was added.
  • name - The name in English (eg. "Arabic", "Afaka").
  • numeric3 - The 3-character language code (eg. "500", "050").
  • pva - The Property Value Alias. Not available on all scripts.
Note: This data was adapted from wooorm's code under an MIT license.

API Overview

API Documentation

Last modified 1mo ago
Export as PDF
Copy link