본문으로 이동

모듈:PD-1996

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

{{PD-1996}}과 아래 틀을 생성합니다.

require('strict')

--[=[
Implements [[Template:PD-1996]] and country-specific derivatives thereof
]=]

local p = {} --p stands for package

local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local PD = require('Module:PD')
local country_data = require('Module:PD-1996/data')
local Hangul = require('Module:Hangul')

local function PD_1996_condition(args)
	if not args then
		args = {}
	end
	local home_country = args['나라'] or args.home_country or "자국"
	local uraa_date = args['URAA날짜'] or args.uraa_date or "대부분의 국가에서 1996년 1월 1일"
	local text = " 아래 3개의 사항을 '''모두''' 만족하기 때문에 '''미국'''에서 '''[[위키문헌:퍼블릭 도메인|퍼블릭 도메인]]'''입니다.\n#미국 밖에서 처음 공표되었으며(그리고 30일 이내에 미국에서 공표되지 않았습니다),\n#1989년 3월 1일 전에 저작권 공고 없이 처음 공표되었거나, 1964년 전에 공표된 저작권 갱신을 받지 않은 저작물이거나, 저작물의 저작권법이 적용되는 국가가 미국과 [[:파일:U.S. Copyright Office circular 38a.pdf|저작권 조약]]을 체결하기 전의 저작물입니다.\n#[[w:우루과이 라운드|우루과이 라운드]] 날짜(" .. uraa_date .. ")를 기준으로 " .. home_country .. "에서 퍼블릭 도메인이었습니다."
	return text
end

function p._PD_1996(args)
	local film = args['영화'] or args.film
	local anon = yesno(args['무명']) or yesno(args.anon) or false
	local deathyear
	local pubyear
	if anon then
		deathyear = nil
		pubyear = PD.getPublicationYear({args[1], args['공표연도'], args.pubyear})
	else
		deathyear = PD.getAuthorDeathYear({args[1], args['사망연도'], args.deathyear})
		pubyear = PD.getPublicationYear({args[2], args['공표연도'], args.pubyear})
	end
	
	local basecat
	local category
	local text
	if anon then
		basecat = "PD-anon"
		category = args['분류'] or args.category or "PD-1996"
		text = "무명 또는 이명으로 공표된 " .. PD.license_scope() .. " " .. PD_1996_condition()
		if pubyear then
			text = text .. " 이 저작물은 무명이나 이명으로 공표된 저작물의 [[w:저작권 보호 기간|저작권 보호 기간]]이 '''공표 후 " .. PD.currentyear - pubyear - 1 .. "년 이하'''인 국가와 지역에서 '''[[위키문헌:퍼블릭 도메인|퍼블릭 도메인]]'''입니다."
		end
	else
		basecat = "PD"
		category = args['분류'] or args.category or "PD-1996"
		text = PD.license_scope() .. PD_1996_condition()
	end
	text = text .. PD.shorter_term_text(deathyear, film)
	
	-- Should we use a different license?
	if pubyear and pubyear < PD.PD_US_cutoff then
		if anon then
			return require('Module:PD-anon-US')._PD_anon_US({['pubyear'] = pubyear, ['category'] = args['분류'] or args.category})
		else
			return require('Module:PD-US')._PD_US({['deathyear'] = deathyear, ['category'] = args['분류'] or args.category})
		end
	elseif pubyear and pubyear > 1988 then
		return PD.error_text(basecat .. "-1996 틀은 1989년 후에 공표된 저작물에 사용할 수 없습니다.", basecat .. "-1996")
	else
		return PD.license({
			['image'] = PD.PD_image,
			['text'] = text,
			['category'] = category
		})
	end
end

function p.PD_1996(frame)
	return p._PD_1996(getArgs(frame))
end

-- Country-specific templates

local function info_text(args)
	local author_text
	if args.deathyear or args.rehabyear then
		author_text = "이 저자는 "
		if args.gpw then
			author_text = "대조국전쟁에 참여한 " .. author_text 
		end
		if args.deathyear then
			author_text = author_text .. "'''" .. args.deathyear .. "년'''에 사망"
			if args.rehabyear then
				author_text = author_text .. "하였으며,"
			end
		end
		if args.rehabyear then
			if not (args.deathyear and args.deathyear > args.rehabyear) then
				author_text = author_text .. " 사후 "
			end
			author_text = author_text .. "'''" .. args.rehabyear .. "년'''에 복권되었습니다"
		end
		if args.deathyear and not args.rehabyear then
			author_text = author_text .. "했습니다."
		else
			author_text = author_text .. "."
		end
	elseif args.anon then
		author_text = PD.license_scope() .. " 무명이나 이명의 이유로 저자를 알 수 없습니다.."
	end
	
	local work_text
	if args.posthumous or args.pubyear or args.creationyear then
		work_text = PD.license_scope({past = true})
		if args.creationyear then
			work_text = work_text .. " '''" .. args.creationyear .. "년'''에 제작"
		end
		if args.posthumous or args.pubyear then
			if args.creationyear then
				work_text = work_text .. "되었으며, "
			end
			if args.posthumous and not (args.deathyear and args.pubyear and args.deathyear > args.pubyear) then
				work_text = work_text .. "사후 "
			end
			if args.pubyear then
				work_text = work_text .. "'''" .. args.pubyear .. "'''년에"
			end
			work_text = work_text .. " 공표"
		end
		work_text = work_text .. "되었습니다."
	end
	
	if author_text and work_text then
		return author_text .. " " .. work_text
	elseif author_text or work_text then
		return (author_text or "") .. (work_text or "")
	else
		return nil
	end
end

function p._PD_1996_also(args)
	args.deathyear = PD.getAuthorDeathYear({args[1], args['사망연도'], args.deathyear})
	args.pubyear = PD.getPublicationYear({args[2], args['공표연도'], args.pubyear})
	args.rehabyear = tonumber(args['복권연도'] or args.rehabyear)
	args.creationyear = tonumber(args['제작연도'] or args.creationyear)
	args.posthumous = yesno(args['사후']) or yesno(args.posthumous) or false
	args.anon = yesno(args['무명']) or yesno(args.anon) or false
	args.gpw = yesno(args['대조국전쟁']) or yesno(args.gpw) or false
	
	local country = args['나라'] or args.country
	
	-- Is the country specified?
	if not country then
		return PD.error_text("[[모듈:PD-1996]] 오류: 나라가 지정되지 않았습니다.", nil)
	end
	
	local template
--	if country == "India" or country == "South Africa" or country == "South Africa speech" then
--		template = "PD " .. country
--	else
		template = "PD-" .. country
--	end

	-- Do we have data for the country?
	if not country_data[country] then
		return PD.error_text("[[모듈:PD-1996]] 오류: 지원되지 않는 나라입니다(" .. country .. ").", nil)
	end
	
	-- Should we use a different license?
	if args.pubyear and args.pubyear < PD.PD_US_cutoff then
		return require('Module:PD-US')._PD_US({['deathyear'] = args.deathyear, ['category'] = args.category})
	elseif args.pubyear and args.pubyear > 1988 then
		return PD.error_text(template .. " 틀은 1989년 후에 공표된 저작물에 사용할 수 없습니다.", template)
	end
	
	-- Is the license inappropriate?
	local country_error_text
	if country_data[country]['error_text'] then
		country_error_text = country_data[country]['error_text'](args)
	end
	if country_error_text then
		return PD.error_text(country_error_text, template)
	end
	
	-- text
	local country_josa = Hangul._josa(country, '가')

	local text = country_data[country]['text'] .. "\n----\n또한 " .. PD.license_scope() .. PD_1996_condition({['home_country'] = country, ['uraa_date'] = country_data[country]['uraa_date']}) .. " 이는 " .. country_josa .. " " .. country_data[country]['berne_year'] .. "년에 [[w:베른 협약|베른 협약]]에 가입한 것과, [[:en:United States Code/Title 17/Chapter 1/Section 104A|17 USC 104A]]의 결정적 기일인 1996년 1월 1일에 따른 결과입니다."
	local deathyear = PD.getAuthorDeathYear({args[1], args['사망연도'], args.deathyear})
	local film = args['영화'] or args.film
	text = table.concat({text, country_data[country]['uraa_text'], info_text(args)}, "\n\n") .. PD.shorter_term_text(deathyear, film)
	
	return PD.license({
		['image'] = PD.PD_image,
		['image_r'] = country_data[country]['image_r'],
		['text'] = text,
		['category'] = args['분류'] or args.category or template,
		['warning'] = country_data[country]['warning']
	})
end

function p.PD_1996_also(frame)
	return p._PD_1996_also(getArgs(frame))
end

return p