Module:PD-EdictGov

From Wikisource
Jump to navigation Jump to search

--[=[
Implements [[Template:PD-EdictGov]] and related templates
]=]

local p = {} --p stands for package

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

local EdictGov_text = " in the '''[[w:public domain|public domain]] in the U.S.''' because " .. PD.license_grammar({"it is an [[wikipedia:Edict of government|edict of a government]]", "they are [[wikipedia:Edict of government|edicts of a government]]"}) .. ", local or foreign. See [https://www.copyright.gov/comp3/ § 313.6(C)(2) of the Compendium II: Copyright Office Practices]. Such documents include "legislative enactments, judicial decisions, administrative rulings, public ordinances, or similar types of official legal materials" as well as "any translation prepared by a government employee acting within the course of his or her official duties.""

function p._PD_EdictGov(args)
	local text = PD.license_scope() .. EdictGov_text .. "\n\nThese do '''not''' include works of the Organization of American States, United Nations, or any of the UN specialized agencies. See Compendium III § 313.6(C)(2) and 17 U.S.C. 104(b)(5)."
	local warning = "A non-American governmental edict may still be copyrighted outside the U.S. Similar to {{[[Template:PD-in-USGov|PD-in-USGov]]}}, the above U.S. Copyright Office Practice does not prevent U.S. states or localities from holding copyright abroad, depending on foreign copyright laws and regulations."
	return PD.license({
		['image'] = PD.PD_image,
		['image_r'] = PD.US_flag_image,
		['text'] = text,
		['warning'] = warning,
		['category'] = args.category or "PD-EdictGov"
	})
end

function p.PD_EdictGov(frame)
	return p._PD_EdictGov(getArgs(frame))
end

function p._PD_ParticularGov(args)
	local text
	local image_r
	local warning
	local category
	
	local template = args.template
	if template == "PD-INGov" then
		text = table.concat({
			PD.license_scope() .. " the work of Government of India. Section 52(1)(q) of the [[Indian copyright law#CHAPTER XI : INFRINGEMENT OF COPYRIGHT|Indian Copyright Act, 1957]] allows for the reproduction or publication of",
			"* any matter which has been published in any Official Gazette except an Act of a Legislature;",
			"* any Act of a Legislature subject to the condition that such Act is reproduced or published together with any commentary thereon or any other original matter;",
			"* the report of any committee, commission, council, board or other like body appointed by the government if such report has been laid on the Table of the Legislature, unless the reproduction or publication of such report is prohibited by the government;",
			"* any judgement or order of a court, Tribunal or other judicial authority, unless the reproduction or publication of such judgement or order is prohibited by the court, the Tribunal or other judicial authority, as the case may be.",
			"The decision of the Supreme Court of India in "[[Eastern Book Company & Ors vs D.B. Modak & Anr]]" on 12 December, 2007 interpreted this section of the Act as making the material '''[[:w:public domain|public domain]]'''."
		}, "\n")
		image_r = "Emblem of India.svg"
	elseif template == "Legislation-CAGov" then
		image_r = "Flag of Canada.svg"
		text = PD.license_scope() .. " reproduced under the terms of the [[Reproduction of Federal Law Order]] for enactments of the Government of Canada. " .. PD.license_grammar({"This document is", "These documents are"}) .. " not an official version, and not endorsed by the Government of Canada."
		warning = "Canadian legislation is under '''[[w:Crown copyright|Crown Copyright]]''' pursuant to [https://laws-lois.justice.gc.ca/eng/acts/C-42/section-12.html Section 12 of the Copyright Act] for 50 years after the year of first publication. That section and the lack of modern case law make it unclear whether these documents remain protected by ''perpetual'' [[w:Royal Prerogative|Crown rights and privileges]] after that term ends."
	elseif template == "PD-DEGov" then
		image_r = "Coat of arms of Germany.svg"
		text = PD.license_scope() .. " in the '''[[w:Public domain|public domain]]''' according to [[w:Germany|German]] copyright law because " .. PD.license_grammar({"it is","they are"}) .. " part of a statute, ordinance, official decree or judgment ([[:de:Amtliches Werk|official work]]) issued by a German federal or state authority or court ([https://www.gesetze-im-internet.de/urhg/__5.html § 5] Abs.1 [[:de:Gesetz über Urheberrecht und verwandte Schutzrechte|UrhG]])."
		warning = "Third-party translations are not covered by this licence."
	elseif template == "PD-ILGov" then
		image_r = "Coat of arms of Israel.svg"
		text = PD.license_scope() .. " from Israel and " .. PD.license_grammar({"is", "are"}) .. " in the '''[[w:Public domain|public domain]]''' because " .. PD.license_grammar({"it is a work that is", "they are works that are"}) .. " not subject to copyright under Section 6 of the Israeli Copyright Law.\n\n"
		text = text .. mw.getCurrentFrame():expandTemplate {
			['title'] = 'blockquote',
			['args'] = {
				"6. Official Publications\n\nNotwithstanding the provisions of Section 4, there will be no copyright pertaining to laws, regulations, Knesset publications or judicial decisions of a court or of a governmental agency that has adjudicative powers under the law."
			}
		}
	elseif template == "PD-NamibiaGov" then
		text = PD.license_scope() .. " in the '''[[w:public domain|public domain]]''' because " .. PD.license_grammar({"it was", "they were"}) .. " created and first published in [[w:Namibia|Namibia]] and is is a work of a legislative, administrative or legal nature, or an official translation thereof.\n\nAccording to the [https://wwwisis.unam.na/copyright/default.htm Copyright and Neighbouring Rights Protection Act, 1994], Section 15 part (8), "''No copyright shall subsist in the official text of any work of a legislative, administrative or legal nature, or an official translation thereof.''""
		image_r = "Coat of arms of Namibia.svg"
	elseif template == "PD-VenezuelaGov" then
		text = PD.license_scope() .. " in the '''[[w:public domain|public domain]]''' because " .. PD.license_grammar({"it is a work", "they are works"}) .. " of the Venezuelan government and according to the [https://www.wipo.int/wipolex/en/text.jsp?file_id=130135 "Law on Copyright", August 14, 1993], Part 1, Chapter 1, Section 1-4, "The texts of laws, decrees, official regulations, public treaties, judicial decisions and other official acts shall not be protected by this Law.""
		image_r = "Coat of arms of Venezuela.svg"
	elseif template == "PD-CaliforniaGov" then
		image_r = "Seal of California.svg"
		text = PD.license_scope() .. " the work of a [[w:California|State of California]] employee, taken or made during the course of that person's official duties, and " .. PD.license_grammar({"is", "are"}) .. " consequently in the [[w:public domain|public domain]] due to the [https://www.leginfo.ca.gov/cgi-bin/displaycode?section=gov&group=06001-07000&file=6250-6270 California Public Records Act]."
	elseif template == "PD-CambodiaGovDoc" then
		image_r = "Royal arms of Cambodia.svg"
		text = PD.license_scope() .. " in the '''[[w:Public domain|public domain]]''' because " .. PD.license_grammar({"it is a work", "they are works"}) .. " of the Royal Government of Cambodia (see [https://www.wipo.int/wipolex/en/text.jsp?file_id=223117#LinkTarget_296 Article 10 under Section 1: Works] of the [[Law on Copyright and Related Rights of Cambodia]]).\n----\nAccording to Article 10 of the Law on Copyright and Related Rights of Cambodia, the following works are not eligible for copyright:\n* Constitution, Law, Royal Decree, Sub-Decree, and other Regulations.\n* Proclamation (Prakas), decision, certificate, other instructed circulars issued by state organizations.\n* Court decision or other court warrants.\n* Translation of those materials mentioned in the preceding paragraphs (a), (b), and (c) of this article.\n* Idea, formality, method of operation, concept, principle, discovery or mere data, even if expressed, described, explained or embodied in any work."
	elseif template == "PD-DenmarkGov" then
		image_r = 'Coat of Arms of Denmark.svg'
		text = PD.license_scope() .. " in the '''[[w:public domain|public domain]]''' because " .. PD.license_grammar({"it is", "they are"}) .. " a part of a decision or a statement by an authority or a public body of Denmark. Danish copyright law specifies that no copyright exists in such material (''[https://www.retsinformation.dk/forms/R0710.aspx?id=164796 § 9]'')."
	elseif template == "PD-IcelandGov" then
		image_r = 'Flag of Iceland.svg'
		text = PD.license_scope() .. " in the '''[[w:public domain|public domain]]''' in Iceland because acts, regulations, administrative provisions, court rulings and similar official documents are not subject to copyright according to Icelandic copyright law, nor are official translations of such documents.\n\nThis is according to [https://www.althingi.is/lagas/140a/1972073.html article 9] ([https://eng.menntamalaraduneyti.is/Acts/nr/4413 English]) in the Icelandic [[:is:Íslensk höfundalög|Höfundalög]]."
	elseif template == "PD-Egypt-official" then
		image_r = 'Coat of arms of Egypt (Official).svg'
		category = 'PD-EgyptGov'
		text = PD.license_scope() .. " " .. mw.getCurrentFrame():expandTemplate {
			['title'] = 'u',
			['args'] = {
				"'''not an object of copyright'''"
			}
		} .. " in [[w:Egypt|Egypt]] because " .. PD.license_grammar({"it is an official document", "they are official documents"}) .. ".  Regardless of their source or target language, all official documents are ineligible for protection in Egypt, including laws, regulations, resolutions and decisions, international conventions, court decisions, award of arbitrators and decisions of administrative committees having judicial competence. (Article 141 of [[:File:Egyptian Intellectual Property Law 82 of 2002 (English).pdf|Intellectual Property Law 82 of 2002]])"
	elseif template then
		return PD.error_text("[[Module:PD-EdictGov]] error: " .. template .. " is not a template supported by _PD_ParticularGov.", nil)
	else
		return PD.error_text("[[Module:PD-EdictGov]] error: _PD_ParticularGov requires a template to be specified.", nil)
	end
	
	return PD.license({
		['image'] = PD.PD_image,
		['image_r'] = image_r,
		['text'] = text .. "\n----\n" .. PD.license_scope() .. " also" .. EdictGov_text,
		['category'] = args.category or category or template,
		['warning'] = warning
	})
end

function p.PD_ParticularGov(frame)
	return p._PD_ParticularGov(getArgs(frame))
end

return p