Module:languages/JSON
- පහත දැක්වෙන උපදෙස්, Module:languages/JSON/documentation හි පිහිටා ඇත. [සංස්කරණය]
- ප්රයෝජනවත් සබැඳි: root page • root page’s subpages • සබැඳි • transclusions • testcases • sandbox
Converts language data to JSON.
The data can be fetched using an expand templates API call, e.g. [1]
local export = {}
function export.getByCode(frame)
local args = frame.args
local langcode = args[1] or error("Language code has not been specified. Please pass parameter 1 to the module invocation.")
local lang = require("Module:languages").getByCode(langcode) or error("Language code not found")
return lang:toJSON()
end
return export