본문으로 이동

모듈:PD-US-notice

위키문헌, 우리 모두의 도서관.
모듈 설명문서[보기] [편집] [역사] [새로 고침]

아래 틀을 생성합니다.

--[=[
Implements PD-US-[no/defective]-notice templates
]=]

require('strict')

local p = {} --p stands for package

local getArgs = require('Module:Arguments').getArgs
local PD = require('Module:PD')

local function notice_basic_text(post_1977, no_notice, deathyear)
	local published_floor
	local published_ceiling
	local published_suffix
	if post_1977 then
		published_floor = 1978 .. "년"
		published_ceiling = "1989년 3월 1일"
		published_suffix = "[[:en:United States Code/Title 17/Chapter 1/Section 101#publication|법적으로 공표]]되었고, 그리고 이후 5년 이내에 미국 저작권청의 [https://cocatalog.loc.gov 저작권 등록]이 이루어지지 않았기 때문에"
	else
		published_floor = PD.PD_US_cutoff .. "년"
		published_ceiling = 1977 .. "년"
		published_suffix = "[[:en:United States Code/Title 17/Chapter 1/Section 101#publication|법적으로 공표]]되었기 때문에"
	end
	
	local text = PD.license_scope() .. " " .. published_floor .. "에서 " .. published_ceiling .. " 사이에 미국(또는 [[:en:United States Headquarters Agreement|미국 본부 협정]] 제7조에 따라 뉴욕의 유엔 본부)에서 "

	if no_notice then
		text = text .. "저작권 고지 없이 " .. published_suffix .. " '''미국'''에서 '''[[위키문헌:퍼블릭 도메인|퍼블릭 도메인]]'''입니다."
	else
		text = text .. "'''결함 있는''' 상태의 저작권 고지와 함께 " .. published_suffix .. " '''미국'''에서 '''[[위키문헌:퍼블릭 도메인|퍼블릭 도메인]]'''입니다. 이 저작물에 포함된 저작권 고지에는 다음과 같은 결함이 하나 이상 존재합니다." 
		local defects = {
			'\n* 고지에 저작권 기호 ©, 단어 "Copyright", 또는 약어 "Copr."가 포함되지 않은 경우',
			'\n* 고지가 실제 최초 공표일로부터 1년 이상이 지난 경우',
			'\n* 고지에 명시된 요구자가 없거나, 실제 저작권자가 명시되지 않은 경우',
			'\n* 고지를 읽을 수 없거나 가려져 있는 경우',
			'\n* 저작물이 인쇄된 문학, 음악, 또는 연극 작품으로서 저작권 고지에 연도가 포함되지 않은 경우'
		}
		text = text .. table.concat(defects) .. "\n결함 있는 고지라 할지라도 약어로 된 이름 등 오류가 중요하지 않아 위반자를 오도할 우려가 없는 경우에는 저작권이 무효화되지 않습니다."
	end

	return text
end

function p._PD_US_notice(args)
	local deathyear = PD.getAuthorDeathYear({args[1], args['사망연도'], args.deathyear})
	local pubyear = PD.getPublicationYear({args[2], args['공표연도'], args.pubyear})
	local pubmonth = tonumber(args[3]) or tonumber(args['공표월']) or tonumber(args.pubmonth)
	local pubday = tonumber(args[4]) or tonumber(args['공표일']) or tonumber(args.pubday)
	
	local template = args.template
	local no_notice = template == "PD-US-no-notice" or template == "PD-US-no-notice-post-1977"
	local post_1977 = template == "PD-US-no-notice-post-1977" or template == "PD-US-defective notice-post-1977"
	local film = args['영화'] or args.film
	
	-- Is this template appropriate?
	local use_PD_US = (not post_1977 and 1977 < PD.PD_US_cutoff) or (pubyear and pubyear < PD.PD_US_cutoff)
	
	local template_does_not_apply = false
	if pubyear and post_1977 then
		template_does_not_apply = pubyear <= 1977 or pubyear > 1989 or (pubyear == 1989 and pubmonth and pubmonth > 3) or (pubyear == 1989 and pubmonth == 3 and pubday and pubday > 1)
	elseif pubyear then
		template_does_not_apply = pubyear > 1977
	end
	
	if use_PD_US then
		return require('Module:PD-US')._PD_US({['deathyear'] = deathyear, ['category'] = args.category})
	elseif template_does_not_apply then
		if post_1977 then
			return PD.error_text(template .. " 틀은 1978년부터 1989년 3월 1일 사이에 공표된 저작물에만 사용할 수 있습니다.", template)
		else
			return PD.error_text(template .. " 틀은 1978년 전에 공표된 저작물에만 사용할 수 있습니다.", template)
		end
	end
	
	return PD.license({
		['image'] = PD.PD_image,
		['image_r'] = PD.US_flag_image,
		['text'] = notice_basic_text(post_1977, no_notice, deathyear) .. PD.shorter_term_text(deathyear, film),
		['category'] = args['분류'] or args.category or template
	})
end

function p.PD_US_notice(frame)
	return p._PD_US_notice(getArgs(frame))
end

return p