모듈:PD-US
보이기
위 설명은 모듈:PD-US/설명문서의 내용을 가져와 보여주고 있습니다. (편집 | 역사) 연습장 (생성 | 복제) 및 시험장 (생성) 문서에서 이 모듈을 실험할 수 있습니다. 이 모듈에 딸린 문서. |
--[=[
Implements [[Template:PD-US]]
]=]
require('strict')
local p = {} --p stands for package
local getArgs = require('Module:Arguments').getArgs
local PD = require('Module:PD')
function p._PD_US(args)
local deathyear = PD.getAuthorDeathYear({args[1], args['사망연도'], args.deathyear})
local pubyear = PD.getPublicationYear({args[2], args['공표연도'], args.pubyear})
local film = args['영화'] or args.film
local category = args['분류'] or args.category
local template = "PD-US"
-- Is this work after the cutoff date?
if pubyear and pubyear >= PD.PD_US_cutoff then
return PD.error_text(template .. " 틀은 " .. PD.PD_US_cutoff - 1 .. "년 후에 공표된 저작물에 사용할 수 없습니다.", template)
end
-- Should we use PD-old?
if deathyear and PD.currentyear - deathyear > 100 then
return require('Module:PD-old')._PD_old({['category'] = category})
end
local published_info
if pubyear then
published_info = PD.PD_US_cutoff .. "년 1월 1일 전인 " .. pubyear .. "년에"
else
published_info = PD.PD_US_cutoff .. "년 1월 1일 전에"
end
local text = PD.license_scope() .. " " .. published_info .. " 공표되었으므로, '''미국'''에서 '''[[위키문헌:퍼블릭 도메인|퍼블릭 도메인]]'''입니다." .. PD.shorter_term_text(deathyear, film)
return PD.license({
['image'] = PD.PD_image,
['image_r'] = PD.US_flag_image,
['text'] = text,
['category'] = category or PD.category_with_deathyear_floor("PD", deathyear) .. "-US"
})
end
function p.PD_US(frame)
return p._PD_US(getArgs(frame))
end
return p