Module:zh-track
Appearance
- පහත දැක්වෙන උපදෙස්, Module:zh-track/documentation හි පිහිටා ඇත. Module:zh-track/documentation]]. [සංස්කරණය]
- ප්රයෝජනවත් සබැඳි: උප පිටු ලැයිස්තුව • සබැඳි • transclusions • testcases • sandbox
local export = {}
local match = mw.ustring.match
local split = mw.text.split
function export.track_data_module(page)
if not page then page = mw.title.getCurrentTitle().fullText end
if type(page) == 'table' then page = page.args[1] end
page_part = split(page, "/")
page_type = page_part[3]
page_param = page_part[3] == "ltc-pron" and "|mc=[1-9y]" or "|oc=[1-9y]"
page_char = page_part[4]
if not (mw.title.new(page_char) or {}).exists then
require('Module:debug').track('zh-track/' .. page_type .. '/character page not found')
return
end
local content = mw.title.new(page_char):getContent() or ""
if not match(content, "==Chinese==") then
if match(content, "==Mandarin==") then
require('Module:debug').track('zh-track/' .. page_type .. '/ununified character page')
else
require('Module:debug').track('zh-track/' .. page_type .. '/no Chinese section found')
end
elseif not match(content, "zh%-pron") then
if match(content, "zh%-see") then
require('Module:debug').track('zh-track/' .. page_type .. '/variant or simplified character')
else
require('Module:debug').track('zh-track/' .. page_type .. '/no character pronunciation')
end
elseif not match(content, page_param) then
require('Module:debug').track('zh-track/' .. page_type .. '/unused data module')
end
end
return export