Module:Script

local p = {}

local utilsArg = require("Module:UtilsArg") local utilsMarkup = require("Module:UtilsMarkup") local utilsTable = require("Module:UtilsTable")

local data = require("Module:Script/Data")

function p.Main(frame) local frameArgs = utilsTable.clone(frame:getParent.args) if frameArgs[2] then frameArgs[2] = string.upper(frameArgs[2]) end local args, err = utilsArg.parse(frameArgs, p.Templates.Script) local errCategories = err and utilsMarkup.categories(err.categories) or "" return p.transliterate(args) .. errCategories end

function p.transliterate(args) local scriptId = args.scriptId local chars = args.text return "TODO" end

p.Schemas = { Data = { type = "map", required = true, desc = "Key value pairs defining in-game scripts, where the key corresponds to the  parameter of Template:Script.", keys = { type = "string", },		values = { type = "record", properties = { {					name = "fileFormat", type = "string", required = true, desc = "The file format for the script characters.", },				{					name = "defaultSize", type = "number", desc = "If unspecified, the default size will be the size of the character's file.", },				{					name = "charset", type = "array", required = true, items = { type = "string" }, desc = "An array of all the source characters defined for the script.", },			},		},	}, }

p.Templates = { Script = { wip = true, purpose = "Transliterates in-game scripts from their source language (Japanese or English).", format = "inline", params = { [1] = {				name = "scriptId", type = "string", required = true, enum = utilsTable.merge({}, utilsTable.keys(data), { 					reference = "Module:Script/Data" 				}), desc = " Identifier for the language script. The various forms of Hylian are named after the first game in which they were released. ", },			[2] = {				name = "text", type = "string", required = true, enumDependsOn = "scriptId", enum = function(scriptId) local chars = utilsTable.concat(data[scriptId] and data[scriptId].charset or {}, " ", "", "\n", "\t") return utilsTable.merge({}, chars, {						reference = "Module:Script/Data" 					}) end, split = "", desc = " The text to transliterate into an in-game language. Only characters which are defined for the script are allowed, as well as the whitespace, which is ignored. Newlines are respected, however. ", },		},		examples = { {"Gerudo", "The quick brown fox jumps over the lazy dog"}, {"Hylian OoT", [[ ハミミホンフトメ

センリトリユウカワカ

レンソツ

リヨウユウイノウ

ケイフオノレコロモタカシ

アサオンナミユキ

メクミヒケセイ ]]},			{"Hylian TWW", "ァィゥェォッャュョ. 、「」！？１２３４５６７８９０"}, {"Hylian TP", "The quick brown fox jumps over the lazy dog"}, {"Hylian SS", "The quick brown fox jumps over the lazy dog"}, {"Hylian ALBW", "The quick brown fox jumps over the lazy dog"}, {"Lorulean", "The quick brown fox jumps over the lazy dog"}, {				desc = "Invalid characters are ignored and simply passed on as-is.", args = {"Hylian TWW", "This won't work because TWW Hylian is based on katakana."}, },			{				args = {"Hylian TWW", "formatting won't work either"}, },			{				desc = " is required", args = {}, },			{				args = {""}, },			{				desc = " can be empty, but it cannot be undefined.", args = {"Hylian ALBW", ""}, },			{				args = {"Hylian ALBW"}, },		},	}, }

return p