首页
随机
登录
设置
关于二次元百科
免责声明
二次元百科
搜索
查看“︁Module:Nihongo”︁的源代码
←
Module:Nihongo
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
require('Module:No globals') local getArgs = require('Module:Arguments').getArgs local yesno = require('Module:Yesno') local function ja(text) return '<span lang="ja" xml:lang="ja">-{' .. text ..'}-</span>' end local function romaji(text) return '<span lang="ja-Latn" xml:lang="ja-Latn" title="平文式罗马字">-{' .. text .. '}-</span>' end local function label(args, label, content) if yesno(args.lead) then return label .. ':' .. content end return content end local p = {} function p.main(frame) local args = getArgs(frame, {frameOnly = true}) return p._main(args) end function p._main(args) local bracketArr, temp = {} if args[1] then if args[2] then table.insert(bracketArr, label(args, '[[日语]]', ja(args[2]))) end if args['romaji'] then table.insert(bracketArr, label(args, '[[平文式罗马字|罗马字]]', romaji(args['romaji']))) end if args[3] then table.insert(bracketArr, args[3]) end if args[4] then table.insert(bracketArr, args[4]) end if #bracketArr > 0 then temp = '(' .. table.concat(bracketArr, ',') .. ')' end if args[5] then temp = temp and (temp .. ' ' .. args[5]) or (' ' .. args[5]) end if temp then return string.format('%s<span style="font-weight: normal;">%s</span>', args[1], temp) end return args[1] end if args['romaji'] then if args[2] then table.insert(bracketArr, label(args, '[[日语]]', ja(args[2]))) end if args[3] then table.insert(bracketArr, args[3]) end if args[4] then table.insert(bracketArr, args[4]) end if #bracketArr > 0 then temp = '(' .. table.concat(bracketArr, ',') .. ')' end if args[5] then temp = temp and (temp .. ' ' .. args[5]) or (' ' .. args[5]) end if temp then return string.format('%s<span style="font-weight: normal;">%s</span>', romaji(args.romaji), temp) end return romaji(args.romaji) end if args[3] then if args[2] then table.insert(bracketArr, label(args, '[[日语]]', ja(args[2]))) end if args[4] then table.insert(bracketArr, args[4]) end if #bracketArr > 0 then temp = '(' .. table.concat(bracketArr, ',') .. ')' end if args[5] then temp = temp and (temp .. ' ' .. args[5]) or (' ' .. args[5]) end if temp then return string.format('%s<span style="font-weight: normal;">%s</span>', args[3], temp) end return args[3] end if args[2] then if args[4] then temp = '(' .. args[4] .. ')' end if args[5] then temp = temp and (temp .. ' ' .. args[5]) or (' ' .. args[5]) end if temp then return string.format('%s<span style="font-weight: normal;">%s</span>', ja(args[2]), temp) end return ja(args[2]) end if args[4] then if args[5] then return args[4] .. '<span style="font-weight: normal;"> ' .. args[5] .. '</span>' end return args[4] end if args[5] then return args[5] end return '' end return p
返回
Module:Nihongo
。