Module:Author3

La bibliothèque libre.
Sauter à la navigation Sauter à la recherche
Documentation du module [voir] [modifier] [purger]
La documentation de ce module Scribunto écrit en Lua est incluse depuis sa sous-page de documentation.
ATTENTION, LES DONNEES DE CETTE PAGE DE TEST SONT FAUSSES ET FANTAISISTES ! ! !
  • Ce module formate une En-tête pour les pages d'auteurs.
  • Cette version de module central permet les tests avant une utilisation normale.
  • Header page for authors pages. Version for tests before normal use.

Documentations[modifier]

The Phabricator task T20180527 "Begin to use central modules", invite you to cooperate about the transfert of know-how.
During this phase Lua-coders can dialogate in Discussion Central modules reference manual.

Modèle:Auteur2Tpt mode doc[modifier]

{{#invoke:Auteur2Tpt|doc|dockey=activity_support_central_modules_title}} Erreur Lua dans package.lua à la ligne 80 : module 'Module:Centralizer-s-fr' not found.

Modèle:Auteur2Tpt mode read[modifier]

{{#invoke:Auteur2Tpt|read|itemid=Q535}} Erreur Lua dans package.lua à la ligne 80 : module 'Module:Centralizer-s-fr' not found.

Modèle:Auteur2Tpt mode edit[modifier]

{{#invoke:Auteur2Tpt|edit|contentlang=en|userlang=es|itemid=Q535}} Erreur Lua dans package.lua à la ligne 80 : module 'Module:Centralizer-s-fr' not found.

Modèle:Auteur2Tpt mode tests[modifier]

{{#invoke:Auteur2Tpt|tests|contentlang=es|userlang=en|itemid=Q535}} Erreur Lua dans package.lua à la ligne 80 : module 'Module:Centralizer-s-fr' not found.

local p = {} -- The main Module:Author (version Module:Author3) form a header of authors pages in wikisource.
--	See documentations:
--	MediaWiki:Scribunto/Central modules reference manual
--	MediaWiki:Scribunto/Central modules

p.version = { -- Modules dependencies. Dependencias del módulo. Dépendances du module.
	versionName = "Author3", versionNumber = "1.0.0(180626:13:25)", versionDate = "2018-06-26T13:25:00",
	-- UTC version structure :	 main.fonction.task(yymmdd:hh:mm)
	mainDescription = "Begin to use", functionDescription = "try Module.Author3", taskDescription = "update for the last Module.Author3 version",
	sought = " Author3 ; Centralizer ", -- sought submodules versions
	known = " Author3 ; Author4 * Centralizer ; Centralizer-s-fr ", --  * MathRoman ; MathRoman2 from Centralizer
}

p.ModuleNS = mw.site.namespaces.Module.name .. ":"
local Interprojet = require( p.ModuleNS .. "Interprojet" )
local Centralizer = require(p.ModuleNS .. "Centralizer-s-fr") -- Module:ControlArgs control arguments, mixes translations and manage modules versions.

function p.module_name_time_ISO(frame)
	local frame = frame or modes.frame -- Where CA is the versions manager.
	local name = frame:getTitle()
	-- For this and all other modules: Expensive for other modules if they are not already required.
	local time = frame:preprocess( "{{REVISIONTIMESTAMP:" .. name .. "}}" )
	local ISO = mw.getContentLanguage():formatDate('c', time )
	return name, time, ISO
--	name=Module:Author3, time=20151207172835, ISO=2015-12-07T17:28:35+00:00
end

local annotations = {}
annotations["lastname"] = "fn" -- familyname
annotations["firstname"] = "n"
annotations["description"] = "label"
annotations["birthyear"] = "bday"
annotations["deathyear"] = "dday"

local microformat = function(data)
	if data ~= " cette instruction desactive microformat pour debug. " then return "" end
	local text = {}
	local style = "display:none; speak:none;"
	for n,v in pairs(data) do
		local class = annotations[n]
		local datum = mw.text.tag({name="span", contents=v, params={id=n,class=class}})
		table.insert(text, datum)
	end
	return mw.text.tag({name="div", contents=table.concat(text), params={id="ws-data", class="vcard ws-noexport", style=style}})
end -- local microformat = function(data)

------------------------------------------------------------
-- Interface from the module to the template
-- Interface du module pour le modèle
------------------------------------------------------------

p.constants = p.constants or { -- Default values
	author_categorise_death_for_n_years = 100,	-- Categorize the year of death from 100 years after death
	author_writing_after_birth = 20,	-- Normal begin of writing of an author after birth
	author_writing_before_death = 5,	-- Normal end of writing of an author before death
	author_lifetime_limit = 120,		-- Normal lifetime limit of an author
	author_mean_lifetime = 85,			-- Normal lifetime limit of an author
	author_lifetime_limit = 120,		-- Normal lifetime limit of an author
	author_mean_lifetime = 85,			-- Normal mean lifetime of an author
}
-- Normal limit if writing time lifetime of an author
p.constants.author_writing_time_limit = p.constants.author_lifetime_limit - p.constants.author_writing_after_birth - p.constants.author_writing_before_death

-- Translation in i18n tables. Tables de traductions i18n.
p.i18n = {}
p.i18n.en = { -- English translations of arguments, categories and messages :
	-- To translate, carefully respect the spaces in these parts: %1 = <b>%2</b>
	author_authorities_selector		= "5, VIAF, BNF, SUDOC, ISNI, LCCN, ARC, WORLDCAT, NLA, PND, GKD", -- wiki_selectors
	author_rights_values				= "none,no,ONU,no,cn,50,us,70,mpf", -- wiki_selectors
	author_region_values				= 'other,china,india,century', -- wiki_selectors
	author_distinctions_selector		= '2,nobel,price,president,deputy', -- wiki_selectors
	author_functions_selector			= '2,president', -- ,deputy', -- wiki_selectors
	author_occupations_selector		= '2,biographer', -- ,politician', -- wiki_selectors
	author_author_sex_values					= 'male,female', -- wiki_selectors
	author_life_constants_of_module	= "Life constants in this module:",
	author_categorise_death_for_n_years= "Categorize the year of death for <b>%1 years</b>.",
	author_writing_after_birth	= "An author start writing <b>%1 years</b> after birth.",
	author_writing_before_death = "An author writes until <b>1% years</b> before his death.",
	author_lifetime_limit		= "The maximum lifetime is <b>%1 years</b>.",
	author_mean_lifetime		= "The mean lifetime is <b>%1 years</b>.",
	--
	-- to debug for arg 1, arg 2 :
	[1]							= "1",
	["1"]						= "1",
	["1_descr"]					= "Argument of position 1.",
	[2]							= "2",
	["2"]						= "2",
	["2_descr"]					= "Argument of position 2.",
	-- Configuration arguments
	mode						= "mode",
	mode_descr					= "Module operation mode.",
	allversions					= "allversions",
	allversions_descr			= "All versions of sub-modules.",
	selectversions				= "selectversions",
	selectversions_descr		= "Selection of the versions of the submodules.",
	userlang					= "userlang",
	userlang_descr				= "Select the user language from argument.",
	wikilang					= "wikilang",
	wikilang_descr				= "Select the wiki language from argument.",

	-- Names and descriptions of arguments
	author_needed_to_verify			= "(required, to be checked)",
	author_list_needed_arguments		= "List of needed arguments:",
	author_list_all_other_arguments	= "List of other arguments:",
	author_list_all_authorities		= "List of bases of authorities:",
	author_list_all_system_arguments	= "List of system arguments:",
	entityid					= 'id',
	entityid_descr				= "Identifier of Wikidata data, such as <code>Q535</code> for Victor Hugo.",
	entityid2					= 'entityid',
	entityid2_descr				= "Identifier of Wikidata data, such as <code>Q535</code> for Victor Hugo.",
	title						= 'title',
	title_descr					= "Page title, automatic.",
	label						= 'label',
	label_descr					= "Part of the title of the page, automatic.",
	sitelink					= 'sitelink',
	sitelink_descr				= "Part of the title of the page, automatic.",
	namespace					= 'espace',
	namespace_descr				= "Name of the space where is the page, automatic.",
	category					= 'Category',
	category_descr				= "Name of the space Category.",
	doc1key						= 'doc1key',
	doc1key_descr				= 'Identifier of the documentation to produce in mode doc1.',
--	commonscat					= 'commonscat',
--	commonscat_descr			= 'commonscat',

	-- ModuleAuthor template arguments
	familyname					= 'lastname',
	familyname_descr			= "Family name. Helps to correct the sort key category.",
	firstname					= 'firstnames',
	firstname_descr				= "First names. Helps to correct the sort key category.",
	firstname2					= 'firstnames',
	firstname2_descr			= "First names. Helps to correct the sort key category.",
	galliname					= 'galliname',
	galliname_descr				= "Special partial name for Gallica autority of author.",
	initial						= 'initial',
	initial_descr				= "Initial to correct the category of author.",
	pseudonym					= 'pseudonym',
	pseudonym_descr				= 'Pseudonym of the author.',
	sex							= 'sex',
	sex_descr					= "Sex of the author.",
	sortkey						= 'sortkey',
	sortkey_descr				= "Sort key for the original author-initial.",
	sortkey2					= 'sortkey',
	sortkey2_descr				= "Sort key for the category Author-initial.",
	sortkey_txt					= 'sortkey_txt',
	sortkey_txt_descr			= 'Display of sortkey, automatic.',
	sortkey_txt_descr			= 'Visualización de clave de ordenación, automática.',
	sortkey_txt_descr			= 'Affichage de clef de tri, automatique.',
	sortkey_test				= 'sortkey_test',
	sortkey_test_descr			= 'Display of sortkey, automatic.',
	sortkey_test_descr			= 'Visualización de clave de ordenación, automática.',
	sortkey_test_descr			= 'Affichage de clef de tri, automatique.',
	image						= 'image',
	image_descr					= "Image of the author.",
	birthyear					= 'birthyear',
	birthyear_descr				= "Year of birth.",
	birth						= 'birth',
	birth_descr					= "Year of birth.",
	birthcentury				= 'birthcentury',
	birthcentury_descr			= "The author's birth century.",
--	birthuncertain				= 'birthuncertain',
	precededby					= "preceded by",
	precededby_descr			= "Preceded in his function by...",
	preceded_by					= ", successor to %1",

	region						= 'region', -- argument with verified multiple values
	region_descr				= 'Region to determine the ancient periods.',
	year_epoch					= 'epoch',
	year_epoch_descr			= 'Year to determine an epoch or a century.',
	deathyear					= 'deathyear',
	deathyear_descr				= "Year of death.",
	death						= 'death',
	death_descr					= "Year of death.",
	deathcentury				= 'deathcentury',
	deathcentury_descr			= "Century of the author's death.",
--	deathuncertain				= 'deathuncertain',
	description					= 'description',
	description_descr			= "Author's description, to clarify whether the automatic description does not fit.",
	--
	author_multi_selector_description	= "Multiple selectors for description: %1",
	authorities_arg				= 'authorities',
	authorities_arg_descr		= "Selection of authors authorities.",
	distinctions				= 'distinctions',
	distinctions_descr			= "Distinctions awarded to author.",
	functions					= 'functions',
	functions_descr				= "Important functions exercised by the author.",
	occupations					= 'occupations',
	occupations_descr			= "Author occupations.",
	--
	genre						= 'genre',
	genre_descr					= "Literary genre of the author.",
	language					= 'language',
	language_descr				= 'Native language of the author.',
	languages					= 'languages',
	languages_descr				= 'Other languages of the author.',
--	nationality					= 'nationality',
	prize						= 'prize',
	prize_descr					= "Excellence Award given to the author.",
	wikipedia					= 'wikipedia',
	wikipedia_descr				= 'Title of the page in wikipedia.',
	wikiquote					= 'wikiquote',
	wikiquote_descr				= 'Title of the page in wikiquote.',
	commons						= 'commons',
	commons_descr				= 'Title of the page in commons.',
	indexpages					= 'indexpages',
	indexpages_descr			= 'indexpages in Wikisource.',
	--
	-- Copyrights for author
	rights						= 'rights', -- argument with verified multiple values
	rights_descr				= "Necessary copyrights type: 70,50,mpf,non.",
	author_rights_limit_txt			= 'rights=%1',
	author_err_undefined_rights		= 'Copyrights for the author are not defined.',
	rights_values_box_ONU		= "DP-ONU-Author",
	rights_values_cat_ONU		= "Author in public domain in ONU",
	rights_values_txt_ONU		= "[[File:Flag of the United Nations.svg|left|48px|link=]]&nbsp;[[Image:PD-icon.svg|40px|lien=Modèle:DP-ONU/info]]Some works of the author may be in accordance with [[w:en:Public domain | Public domain]] to [[w:en:Copyright in the ONU | ONU]], but subject to copyright in some countries, especially in Europe. Downloads are done under [[w:en:Wikipedia:FAQ/Copyright#What is copyright?|your responsibility]].",
	rights_values_box_70		= "DP-EU-Author",
	rights_values_cat_70		= "Author in public domain in USA",
	rights_values_txt_70		= "[[File:Info icon 001.svg|left|48px|link=]]Some works of the author may be in the [[w:en:Public domain | Public domain]] to [[w:en:Copyright in the United States | US]], but subject to copyright in some countries, especially in Europe. Downloads are done under [[w:en:Wikipedia:FAQ/Copyright#What is copyright?|your responsibility]].",
	rights_values_box_50		= "DP-CN-Author",
	rights_values_cat_50		= "Author in public domain in Canada",
	rights_values_txt_50		= "[[File:Info icon 001.svg|left|48px|link=]]Works by this author may be in the [[w:en:Public domain | Public domain]] to [[w:en:Copyright to Canada | Canada]], but subject to copyright in some countries, including in Europe and in [[w:en:Copyright in the United States | US]]. Downloads are done under [[w:en:Wikipedia:FAQ/Copyright#What is copyright?|your responsibility]].",
	rights_values_box_mpf		= "Death for France",
	rights_values_cat_mpf		= "Author death for France",
	rights_values_txt_mpf		= "[[File:Info icon 001.svg|left|48px|link=]] This author is declared « [[w:en:Death to France | Death to France]] » by the French government. Consequently, his copyrights are extended by 30 years, and his works are not in the public domain in France. Downloads are done under [[w:en:Wikipedia:FAQ/Copyright#What is copyright?|your responsibility]].",
	rights_values_box_none		= "DP-Public-Author",
	rights_values_cat_none		= "Author in public domain",
	rights_values_txt_none		= "[[Image:PD-icon.svg|64px|Public domain]] This author has renounced its rights ('' copyright '') or his rights have expired. His works are part of the [[w:en:Public domain | public domain]] and are freely distributable and / or modified. Downloads are done under [[w:en:Wikipedia:FAQ/Copyright#What is copyright?|your responsibility]].",
	rights_values_cat_unknown	= "Unknown author rights",
	rights_values_box_unknown	= "Unknown author rights",
	rights_values_txt_unknown	= "[[File:Info icon 001.svg|left|48px|link=]] The copyrights of the author are not defined. His works are perhaps still under copyright in some countries, particularly in Europe and in [[w:en:Copyright in the United States | US]].	Downloads are done under [[w:en:Wikipedia:FAQ/Copyright#What is copyright?|your responsibility]].",
	author_new_public_rights_authors	= "Recent public domain authors",
	--
	-- Scans and Authorities
	author_scans_text			= 'Scans and authorities',
	author_Notices				= 'Authorities',
	entityid					= 'entityid',
	entityid2					= 'id',
	ARC							= 'ARC',
	ARC_descr					= 'Authority: Internet Archive.',
	ARCgeo						= 'ARCgeo',
	ARCgeo_descr				= 'Authority: Internet Archive.',
	ARCid						= 'ARCid',
	ARCid_descr					= 'Authority: Internet Archive.',
	ARCitem						= 'ARCitem',
	ARCitem_descr				= 'Authority: Internet Archive.',
	ARCorg						= 'ARCorg',
	ARCorg_descr				= 'Authority: Internet Archive.',
	ARCsub						= 'ARCsub',
	ARCsub_descr				= 'Authority: Internet Archive.',
	ARCHIVE						= 'ARCHIVE',
	ARCHIVE_descr				= 'Authority: Internet Archive.',
	ARCHIVEbook					= 'ARCHIVEbook',
	ARCHIVEbook_descr			= 'Authority: Internet Archive.',
	BNF							= 'BNF',
	BNF_descr					= 'Authority: Bibliothèque nationale de France.',
	BNFbook						= 'BNFbook',
	BNFbook_descr				= 'Authority: Bibliothèque nationale de France.',
	CANTIC						= 'CANTIC',
	CANTIC_descr				= 'Authority: Name and Title Authority File of Catalonia.',
	DNB							= 'DNB',
	DNB_descr					= 'Authority: German National Library.',
	--
	GKD							= 'GKD',
	GKD_descr					= 'Authority: Integrated Authority File.',
	GKD_V1						= 'GKD_V1',
	GKD_V1_descr				= 'Authority: Integrated Authority File.',
	GND							= 'GND',
	GND_descr					= 'Authority: Integrated Authority File.',
	--
	IA							= 'IA',
	IA_descr					= 'Authority: Internet Archive.',
	IBL							= 'IBL',
	IBL_descr					= 'Authority: Inquiry-based learning.',
	IBLid						= 'IBLid',
	IBLid_descr					= 'Authority: Inquiry-based learning.',
	IBLbook						= 'IBLbook',
	IBLbook_descr				= 'Authority: Inquiry-based learning.',
	IMDb						= 'IMDb',
	IMDb_descr					= 'Authority: Internet Movie Database.',
	ISBN						= 'ISBN',
	ISBN_descr					= 'Authority: International Standard Book Number.',
	ISFDB						= 'ISFDB',
	ISFDB_descr					= 'Authority: Internet Speculative Fiction Database.',
	ISFDBid						= 'ISFDBid',
	ISFDBid_descr				= 'Authority: Internet Speculative Fiction Database.',
	ISFDBpub					= 'ISFDBpub',
	ISFDBpub_descr				= 'Authority: Internet Speculative Fiction Database.',
	ISFDBtitle					= 'ISFDBtitle',
	ISFDBtitle_descr			= 'Authority: Internet Speculative Fiction Database.',
	ISNI						= 'ISNI',
	ISNI_descr					= 'Authority: International Standard Name Identifier.',
	LCCN						= 'LCCN',
	LCCN_descr					= 'Authority: Library of Congress Control Number.',
	LCCNid						= 'LCCNid',
	LCCNid_descr				= 'Authority: Library of Congress Control Number.',
	--
	NDL							= 'NDL',
	NDL_descr					= 'Authority: Neue deutsche literatur.',
	NKC							= 'NKC',
	NKC_descr					= 'Authority: National Library of the Czech Republic.',
	NLA							= 'NLA',
	NLA_descr					= 'Authority: National Language Promotion Department of Pakistan.',
	OCLC						= 'OCLC',
	OCLC_descr					= 'Authority: Online Computer Library Center.',
	OL							= 'OL',
	OL_descr					= 'Authority: Open Library.',
	OLbook						= 'OLbook',
	OLbook_descr				= 'Authority: Open Library.',
	--
	PND							= 'PND',
	PND_descr					= 'Authority: Personennamendatei.',
	QITEM						= 'QITEM',
	QITEM_descr					= 'Wikidata : Data identifier.',
	SELIBR						= 'SELIBR',
	SELIBR_descr				= 'Authority: National Library of Sweden.', --	Bibliothèque royale (Suède)
	SUDOC						= 'SUDOC',
	SUDOC_descr					= 'Authority: Système universitaire de documentation.',
	SWD							= 'SWD',
	SWD_descr					= 'Authority: Schlagwortnormdatei.',
	ULAN						= 'ULAN',
	ULAN_descr					= 'Authority: Union List of Artist Names.',
	VIAF						= 'VIAF',
	VIAF_descr					= "Authority: Virtual International Authority File.",
	WORLDCAT					= 'Worldcat',
	WORLDCAT_descr				= "Authority: WorldCat.",
	WORLDCATbook				= 'WORLDCATbook',
	WORLDCATbook_descr			= "Authority: WorldCat.",
	WORLDCATch					= 'WORLDCATch',
	WORLDCATch_descr			= "Authority: WorldCat.",
	WORLDCATid					= 'WORLDCATid',
	WORLDCATid_descr			= "Authority: WorldCat.",
	--
	-- Categories and Various messages
	-- To translate, carefully respect the spaces and these parts: %1 = <b>%2</b>
	author_authors_authors				= "Authors",
	author_authors_initial				= "Authors-%1",
	author_authors_initial_txt			= "Authors&nbsp;%1",
	author_authors_initiale_pop			= "Authors with initial %1",
	author_box_links_indexpages			= "Facsimile",
	author_box_links_biography			= "Biography",
	author_box_links_wikiquote			= "Quotes",
	author_box_links_commons			= "Media",
	author_entityid_txt					= "Datas", -- Structured datas
	author_authors_birthyear			= 'Born in %1',
	author_authors_deathyear			= 'Death in %1',
	author_authors_birth_century		= "Born in %1..",
	author_authors_death_century		= "Death in %1..",
	author_list_limit_levelmaxi			= "Structure limit levelmaxi=%1",
	author_list_limit_maxn				= "Structure limit maxn=%1",
	author_limit_birth_death_cat		= 'Limit the years of categories "Births in" and "Death in".',
	author_female_authors_cat			= "Women authors",
	author_male_authors_cat				= "Men authors",
	author_group_languages_cat			= "Authors %1", -- writing in
	author_epoch_china_antiquity_cat	= "Author of Chinese antiquity",
	author_epoch_china_springs_cat		= "Author of Springs and Autumns",
	author_epoch_china_empires_cat		= "Author of Chinese empires",
--	author_epoch_indian_indus_cat		= "Author of Indus civilisation",
--	author_epoch_indian_muslim_cat		= "Author of Indo-Muslim period",
	author_epoch_indian_antiquity_cat	= "Author of Indian antiquity",
	author_epoch_indian_classic_cat		= "Author of classic Indian period",
	author_epoch_indian_middle_age_cat	= "Author of classic Indian Middle Age",
	author_epoch_antiquity_cat			= "Author of antiquity",
	author_epoch_middle_age_cat			= "Author of Middle Ages",
	author_epoch_middle_age_cat			= "Author in the %1th century",
	author_epoch_author_century_BCE_cat	= "Author in the %1th century B.C.",
	author_epoch_middle_age_cat_1		= "Author in the %1st century‎",
	author_epoch_author_century_BCE_cat_1 = "Author in the %1st century B.C.",
	-- BCE = Before Common Era = «BC». AEC = Antes de la Era Común = «a. C.». AEC = Avant l'ère commune = «av. J.-C.»
	author_century_CE					= "%1<sup>th</sup> century",
	author_century_BCE					= "%1<sup>th</sup> century B.C.",
	author_century_CE_1					= "%1<sup>st</sup> century",
	author_century_BCE_1				= "%1<sup>st</sup> century B.C.",
	author_year_BCE						= "%1 B.C.",
	--
	-- To translate, carefully respect the spaces and these parts: %1 = <b>%2</b>
	-- Error messages and categories
	-- These messages should also include those of module(s) called.
	author_all_versions_text			= "Versions warning: <b>%1</b>, list: %2, normal: %3.",
	author_err_one_number_argument		= "Error: In parameter <b>%1</b>, enter a single number between -5000 and now.",
	author_err_assist_user_param		= "User support for checking the settings:",
	author_err_module_error				= "Module error",
	author_err_auto_val_unknown			= "Internal Error: Unknown automatic argument: %1 = <b>%2</b>.",
	author_err_no_known_arguments		= "Module without known arguments table.",
	author_err_unknown_auto_arg			= "Internal Error: Unknown automatic argument : %1 = <b>%2</b>.",
	author_err_args_values				= "Abnormal value of the argument <b>%1 = %2</b> (%3)",
	author_msg_delete_docbox			= "This documentation/support must be removed before recording.<br/>Remove all modes to return to normal mode.",
	author_msg_automatic_argument		= "Verify the automatic argument <b>%1</b>.",
	author_tools_auto_val_warning_msg	= "Verify the automatic argument: %1 = <b>%2</b>.",
	--
	author_err_vague_year				= "Uncertain year.",
	author_err_death_before_birth		= "Error: death <b>%1</b> is before birth <b>%2</b>.",
	author_err_death_before_birth_cat	= "Author death is before birth.",
	author_err_life_too_long			= "Life is too long from %1 to %2.",
	author_err_life_too_long_cat		= "Life of author is too long",
	--
	author_date_to_part_format			= " dd yyyy mmmm",
	author_date_to_part_call_err		= "Internal Error: Abnormal calling arguments in date <b>%1</b>, <b>%2</b>.",
	author_date_to_part_call_cat		= "Module with internal error",
	author_date_to_part_err_not_found	= "Internal Error: No part found in date <b>%1</b>, <b>%2</b>.",
	--
	author_err_vague_epoch				= "Uncertain times.",
	author_err_unknown_epoch_cat		= "Unknown epoch",
	author_err_year_in_roman_number		= "Ambiguity: the year <b>%1</b> is in roman numerals. Do you want define a century ?",
	author_err_roman2int				= "Error in roman number in argument %1 = <b>%2</b> ; %3 %4. ",
	author_err_notices_properties		= "Internal Error: An authority record is undefined : %1.",
	author_err_notices_properties_cat	= "Internal Error: One or more authority record is undefined.",
	author_err_author_without_authority	= "Error: Author without authority",
	author_without_authority_cat		= "Authors without authority",
	author_err_deprecated_authority		= "This base of authority, %1, is old and should be avoided.",
	--
	author_docbox_namespace_valid		= "Help Mod-ule Project Template",
	author_docbox_namespace_stop		= "Aut-eur Ma-in Page",
	author_docbox_namespace_error		= "Auteur Main Page",
	author_docbox_namespace_error_cat	= "Module with usage error",
	author_docbox_namespace_error_err	= "<b>Return to normal mode</b> before you save the page, by removing all modes, because the documentation panel is prohibited in the space <b>%1:'''.",
	--
	-- These messages are used to CA = ControlArgs module and are copied here.
	c									= 'c',
	c_descr								= 'Options to add with mode options.',
	options								= 'options',
	options_descr						= 'Options to add with mode options.',
	author_err_error_list_header		= "User support about parameters:",
	author_list_limit_levelmaxi			= "Error: parameter <b>%1</b> is unknown in this template. Check the name or flag this gap.",
	author_list_limit_levelmaxi			= "Error: the known argument <b>%1</b> is it the one you need ?",
	author_list_limit_levelmaxi			= "Error: the value of the argument <b>%1</b> is already defined. Choose only one value of a single synonym.",
	author_err_need_value				= "Error: This argument is required but absent : <b>%1</b>. Should define it.",
	author_err_none_value				= "Error: No argument has been defined.",
	author_err_too_unnamed_arguments	= "Error: Too many unnamed arguments ( <b>%1</b> ).",
	author_list_limit_levelmaxi			= "Internal Error: Notify the developer that the internal argument <b>%1</b> is unknown in the records.",
	author_err_notice_link				= "Error: bad notice for <b>%1</b>.",
	author_err_notice_link_cat			= "Module with bad notice",
	author_list_limit_levelmaxi			= "List limit levelmaxi=%1",
	author_list_limit_max_n				= "List limit max_n=%1",
	author_err_module_miss_i18n_cat		= "Module missing i18n translation",
	--
	-- These texts are used to title some tests.
	author_list_wiki_selectors_title		= "List of this wiki selectors:",
	author_list_all_categories_title		= "List of all eventual categories of this wiki:",
	author_list_all_errors_title			= "List all detectable errors of this wiki:",
	author_selected_autorities_title		= "List of selected authorities",
	author_multiple_values_tests_title		= "Test of multiple values arguments",
	author_authorities_notices_test_title	= "Test all authorities notices",
	author_authorities_notices_test_deprec	= "Test all know authority notices, some are deprecated (in grey)",
	author_authorities_select_test_title	= "Selecting Wikidata authorities",
	authorities_select_test_header			= "Argument from Wikidata, Selector, Arguments from template, Selected arguments",
	author_multiple_selection_test_title	= "Multiple selection test",
	author_multiple_selection_test_header	= "Options,Selector,To select,Selected",
	author_multiple_selection_test_select	= "2,nobel,president,deputy,price",
	author_firstname_familyname_test_title	= "Test of name, first name and sort key",
	author_firstname_familyname_test_header= "Title received, Label received, Firstname received, Familyname received, Initiale received, Final initial, Final sortkey, test details",
	author_options_from_mode_title			= "Test options from mode",
	author_copyright_box_test_title			= "Test of copyrights info boxes",
	author_copyright_box_header				= "Copyrights type, User language, Wiki language",
	author_rights_test_title				= "Test of authors copyrights",
	author_rights_test_header				= "birthyear, deathyear, rightype, rightuse, copyright box, start of rights. category and error",
	author_unique_century_life_test_title	= "Single century of an author",
	author_year_to_epoch_test_title			= "Centuries and epochs from years",
	author_century_to_epoch_test_title		= "Centuries according from Centuries",
	author_events_epochs_test_title			= "Events and epochs",
	author_events_epochs_test_header		= "Region, Birth, Death, Epoch, Automatic Century, Categories and Errors",
	author_events_epochs_test_header_sub	= "Normal lifetime, Epochs in India, Abnormal lifetime, Very long lifetime, Other cases: no epoch, Other cases: year or century roman number",
	author_roman_to_digital_test_title		= "Test from roman to digital numbers",
	author_digital_to_roman_test_title		= "Test from digital to roman numbers",
} -- p.i18n.en
p.i18n.es = { -- Traducciones al español de los argumentos, categorías y mensajes:
	-- Para traducir, respetar cuidadosamente los espacios y las siguientes partes: %1 = <b>%2</b>
	-- wiki_selectors
	author_authorities_selector		= "5, VIAF, BNF, SUDOC, ISNI, LCCN, ARC, WORLDCAT, NLA, PND, GKD", -- wiki_selectors
	author_rights_values				= "none,nada,ONU,nada,cn,50,us,70,mpf", -- wiki_selectors
	author_region_values				= 'otros,china,india,siglo', -- wiki_selectors
	author_distinctions_selector		= '2,nobel,precio,presidente,diputado', -- wiki_selectors
	author_functions_selector			= '2,presidente', -- ,diputado', -- wiki_selectors
	author_occupations_selector		= '2,biógrafo', -- ,política', -- wiki_selectors
	author_author_sex_values					= 'hombre,mujer', -- wiki_selectors
	author_life_constants_of_module	= "Constantes de la vida en este módulo:",
	author_categorise_death_for_n_years= "Clasificar año de la muerte de <b>%1 años</b>",
	author_writing_after_birth	= "Un autor comienza a escribir <b>%1 años</b> después del nacimiento.",
	author_writing_before_death = "Un autor escrito de hasta <b>1% años</b> anterior a su muerte.",
	author_lifetime_limit		= "El tiempo de vida máximo es <b>%1 años</b>.",
	author_mean_lifetime		= "El tiempo de vida medio es <b>%1 years</b>.",
	--
	-- to debug for arg 1, arg 2 :
	[1]							= "1",
	["1"]						= "1",
	["1_descr"]					= "Argumento de posición 1.",
	[2]							= "2",
	["2"]						= "2",
	["2_descr"]					= "Argumento de posición 2.",
	-- Argumentos de configuración
	mode						= "modo",
	mode_descr					= "Modo de operación del módulo.",
	allversions					= "allversions",
	allversions_descr			= "Todas las versiones de submódulos.",
	selectversions				= "selectversions",
	selectversions_descr		= "Selección de versiones de submódulos.",
	userlang					= "userlang",
	userlang_descr				= "Seleccionar el idioma del usuario de argumento.",
	wikilang					= "wikilang",
	wikilang_descr				= "Seleccionar el idioma del wiki de argumento.",
	--
	-- Nombres y descripciones de los argumentos
	author_needed_to_verify			= "(obligatorio, se debe comprobar)",
	author_list_needed_arguments		= "Lista de argumentos necesarios:",
	author_list_all_other_arguments	= "Lista de otros argumentos:",
	author_list_all_authorities		= "Lista de bases de las autoridades:",
	author_list_all_system_arguments	= "Lista de argumentos del sistema:",
	entityid					= 'id',
	entityid_descr				= "Nombre de los datos Wikidata, como <code>Q535</code> para Victor Hugo.",
	entityid2					= 'entityid',
	entityid2_descr				= "Nombre de los datos Wikidata, como <code>Q535</code> para Victor Hugo.",
	title						= 'title',
	title_descr					= "Título de la página, automático.",
	label						= 'label',
	label_descr					= "Parte del título de la página, automática.",
	sitelink					= 'sitelink',
	sitelink_descr				= "Parte del título de la página, automática.",
	namespace					= 'espace',
	namespace_descr				= "Nombre del espacio donde la página, automático.",
	category					= 'Categoría',
	category_descr				= "Nombre del espacio Categoría.",
	doc1key						= 'doc1key',
	doc1key_descr				= 'Identificación de la documentación para producir en modo doc1.',
--	commonscat					= 'commonscat',
--	commonscat_descr			= 'commonscat',
	--
	-- ModuleAuthor argumentos de plantilla
	familyname					= 'nombre',
	familyname_descr			= "Nombre. Ayuda a corregir la clave de ordenación de la categoría.",
	firstname					= 'primeros',
	firstname_descr				= "Primeros. Ayuda a corregir la clave de ordenación de la categoría.",
	firstname2					= 'primeros',
	firstname2_descr			= "Primeros, Ayuda a corregir la clave de ordenación de la categoría.",
	galliname					= 'apellidoGalli',
	galliname_descr				= "Nombre parcial Especial para Gallica autoridad del autor.",
	initial						= 'inicial',
	initial_descr				= "Inicial para corregir la categoría del autor.",
	pseudonym					= 'apodo',
	pseudonym_descr				= 'Seudónimo del autor.',
	title						= 'titulo',
	title_descr					= "Título de la página, automático.",
	sex							= 'sexo',
	sex_descr					= "Sexo del autor.",
	sortkey						= 'clave',
	sortkey_descr				= "Ordenar clave para la clase de derechos de autor inicial.",
	sortkey2					= 'clave',
	sortkey2_descr				= "Ordenar clave para la categoría de Autor-inicial.",
	sortkey_txt					= 'sortkey_txt',
	sortkey_txt_descr			= 'Visualización de clave de ordenación, automática.',
	sortkey_test				= 'sortkey_test',
	sortkey_test_descr			= 'Visualización de clave de ordenación, automática.',
	image						= 'imagen',
	image_descr					= "Imagen del autor.",
	birthyear					= 'anoNacimiento',
	birthyear_descr				= "Año de nacimiento.",
	birth						= 'nacimiento',
	birth_descr					= "Año de nacimiento.",
	birthcentury				= 'sigloNacimiento',
	birthcentury_descr			= "Siglo del nacimiento del autor.",
--	birthuncertain				= 'nacimientoIncierto',
	precededby					= "precedido por",
	precededby_descr			= "Precedido en su función por...",
	preceded_by					= ", era el sucesor de %1",
	region						= 'region',
	region_descr				= 'Región para determinar los tiempos antiguos.',
	year_epoch					= 'epoca', -- año época
	year_epoch_descr			= 'Año para determinar un tiempo o un siglo.',
	deathyear					= 'anoMuerte',
	deathyear_descr				= "Año de la muerte.",
	death						= 'muerte',
	death_descr					= "Año de la muerte.",
	deathcentury				= 'sigloMuerte',
	deathcentury_descr			= "Siglo de la muerte del autor.",
--	deathuncertain				= 'muerteIncierto',
	description					= 'descripcion',
	description_descr			= "Descripción del autor, para aclarar si la descripción automática no encaja.",
	author_multi_selector_description	= "Selectores múltiple para la descripción: %1",
	authorities_arg				= 'registros',
	authorities_arg_descr		= "Selección de las autoridades de los autores.",
	distinctions				= 'distincións',
	distinctions_descr			= "Honores otorgados al autor.",
	functions					= 'funcións',
	functions_descr				= "Las funciones importantes realizadas por el autor.",
	occupations					= 'ocupacións',
	occupations_descr			= "Las ocupacións del autor.",
	genre						= 'tipo',
	genre_descr					= "Género literario de le autor.",
	language					= 'lengua',
	language_descr				= "Lengua materna del autor.",
	languages					= 'lenguas',
	languages_descr				= 'Otros idiomas del autor.',
--	nationality					= 'pais',
	prize						= 'premio',
	prize_descr					= "Premio de Excelencia dado al autor.",
	wikipedia					= 'wikipedia',
	wikipedia_descr				= 'Título de la página en wikipedia.',
	wikiquote					= 'wikiquote',
	wikiquote_descr				= 'Título de la página en wikiquote.',
	commons						= 'commons',
	commons_descr				= 'Título de la página en commons.',
	indexpages					= 'indexpages',
	indexpages_descr			= 'indexpages en Wikisource.',
	-- Derechos de Autor
	rights						= 'derechos',
	rights_descr				= "Tipo de derechos de autor necesario: 70,50,mpf,non.",
	author_rights_limit_txt			= 'derechos=%1',
	author_err_undefined_rights		= 'Los derechos de autor no están definidos.',
	rights_values_box_ONU		= "DP-ONU-Author",
	rights_values_cat_ONU		= "Autores en el dominio público en ONU",
	rights_values_txt_ONU		= "[[File:Flag of the United Nations.svg|left|48px|link=]]&nbsp;[[Image:PD-icon.svg|40px|lien=Modèle:DP-ONU/info]]Algunas obras del autor pueden estar en acuerdo con [[w:es:Dominio público (ONU) | licencia específica de la ONU]] a [[w:es: Derechos de Autor en los ONU | ONU]], pero sujeto a derechos de autor en algunos países, especialmente en Europa. La descarga se realiza bajo [[w:es:Ayuda:Preguntas frecuentes/Derechos de autor|su propia responsabilidad]].",
	rights_values_box_70		= "DP-USA-Autore",
	rights_values_cat_70		= "Autores en el dominio público en USA",
	rights_values_txt_70		= "[[File:Info icon 001.svg|left|48px|link=]]&nbsp;[[Image:PD-icon.svg|40px|lien=Modèle:DP-ONU/info]]Algunas obras del autor pueden estar en la [[w:es:Dominio público (IP) | Dominio público]] a [[w:es: Derechos de Autor en los Estados Unidos | Estados Unidos]], pero sujeto a derechos de autor en algunos países, especialmente en Europa. La descarga se realiza bajo [[w:es:Ayuda:Preguntas frecuentes/Derechos de autor|su propia responsabilidad]].",
	rights_values_box_50		= "DP-CN-Autore",
	rights_values_cat_50		= "Autore en el dominio público en Canada",
	rights_values_txt_50		= "[[File:Info icon 001.svg|left|48px|link=]]Obras de este autor pueden estar en la [[w:es:Dominio público (IP) | Dominio público]] a [[w:es:Copyright a Canadá | Canadá]], pero sujeto a derechos de autor en algunos países, incluyendo en Europa y en el [[w: Derechos de Autor en los Estados Unidos | Estados Unidos]]. La descarga se realiza bajo [[w:es:Ayuda:Preguntas frecuentes/Derechos de autor|su propia responsabilidad]].",
--	Ayuda:Preguntas frecuentes/Derechos de autor#Dominio público
	rights_values_box_mpf		= "Muerte hacia Francia",
	rights_values_cat_mpf		= "Autore muerte hacia Francia", -- Modèle:Auteur Mort pour la France
	rights_values_txt_mpf		= '[[File:Info icon 001.svg|left|48px|link=]]Este autor es declaró « [[w:es:Muerte hacia Francia | hacia Francia hacia Francia]] » por el gobierno francés. En consecuencia, su derecho de autor se extiende por 30 años, y sus obras están en el dominio público en Francia. La descarga se realiza bajo [[w:es:Ayuda:Preguntas frecuentes/Derechos de autor|su propia responsabilidad]].',
	rights_values_box_none		= "DP-Public-Autore",
	rights_values_cat_none		= "Autore en el dominio público", -- Modèle:Domaine public Auteur
	rights_values_txt_none		= "[[Image:PD-icon.svg|64px|Domaine public]] Este autor ha renunciado a sus derechos ('' copyright '') o sus derechos han expirado. Sus obras forman parte del [[w:en:dominio público en la legislación de propiedad intelectual | dominio público]] y son de libre disposición y / o modificado. La descarga se realiza bajo [[w:es:Ayuda:Preguntas frecuentes/Derechos de autor|su propia responsabilidad]].",
	rights_values_cat_unknown	= "Derechos de autor desconocido",
	rights_values_box_unknown	= "Derechos de autor desconocido",
	rights_values_txt_unknown	= '[[File:Info icon 001.svg|left|48px|link=]] Los derechos de autor no están definidos. Sus obras son quizás todavía bajo copyright en algunos países, especialmente en Europa y en el [[w:es: Derechos de Autor en los Estados Unidos | Estados Unidos]]. La descarga se realiza bajo [[w:es:Ayuda:Preguntas frecuentes/Derechos de autor|su propia responsabilidad]].',
	author_new_public_rights_authors	= "Recientes autores de dominio público",
	-- Scans y Autoridades
	author_scans_text			= 'Escanea y autoridades',
	author_Notices				= 'Avisos',
	ARC							= 'ARC',
	ARC_descr					= 'Autoridad: Internet Archive.',
	ARCgeo						= 'ARCgeo',
	ARCgeo_descr				= 'Autoridad: Internet Archive.',
	ARCid						= 'ARCid',
	ARCid_descr					= 'Autoridad: Internet Archive.',
	ARCitem						= 'ARCitem',
	ARCitem_descr				= 'Autoridad: Internet Archive.',
	ARCorg						= 'ARCorg',
	ARCorg_descr				= 'Autoridad: Internet Archive.',
	ARCsub						= 'ARCsub',
	ARCsub_descr				= 'Autoridad: Internet Archive.',
	ARCHIVE						= 'ARCHIVE',
	ARCHIVE_descr				= 'Autoridad: Internet Archive.',
	ARCHIVEbook					= 'ARCHIVEbook',
	ARCHIVEbook_descr			= 'Autoridad: Internet Archive.',
	BNF							= 'BNF',
	BNF_descr					= 'Autoridad: Biblioteca Nacional de Francia.',
	BNFbook						= 'BNFbook',
	BNFbook_descr				= 'Autoridad: Biblioteca Nacional de Francia.',
	CANTIC						= 'CANTIC',
	CANTIC_descr				= 'Autoridad: Catálogo de autoridades de nombres y títulos de Cataluña.',
	DNB							= 'DNB',
	DNB_descr					= 'Autoridad: Biblioteca Nacional de Alemania.',
	GKD							= 'GKD',
	GKD_descr					= 'Autoridad: Gemeinsame Normdatei.',
	GKD_V1						= 'GKD_V1',
	GKD_V1_descr				= 'Autoridad: Gemeinsame Normdatei.',
	GND							= 'GND',
	GND_descr					= 'Autoridad: Gemeinsame Normdatei.',
	IA							= 'IA',
	IA_descr					= 'Autoridad: Internet Archive.',
	IBL							= 'IBL',
	IBL_descr					= 'Autoridad: Enseñanza reflexiva.',
	IBLid						= 'IBLid',
	IBLid_descr					= 'Autoridad: Enseñanza reflexiva.',
	IBLbook						= 'IBLbook',
	IBLbook_descr				= 'Autoridad: Enseñanza reflexiva.',
	IMDb						= 'IMDb',
	IMDb_descr					= 'Autoridad: Internet Movie Database.',
	ISBN						= 'ISBN',
	ISBN_descr					= 'Autoridad: International Standard Book Number.',
	ISFDB						= 'ISFDB',
	ISFDB_descr					= 'Autoridad: Internet Speculative Fiction Database.',
	ISFDBid						= 'ISFDBid',
	ISFDBid_descr				= 'Autoridad: Internet Speculative Fiction Database.',
	ISFDBpub					= 'ISFDBpub',
	ISFDBpub_descr				= 'Autoridad: Internet Speculative Fiction Database.',
	ISFDBtitle					= 'ISFDBtitle',
	ISFDBtitle_descr			= 'Autoridad: Internet Speculative Fiction Database.',
	ISNI						= 'ISNI',
	ISNI_descr					= 'Autoridad: International Standard Name Identifier.',
	LCCN						= 'LCCN',
	LCCN_descr					= 'Autoridad: Library of Congress Control Number.',
	LCCNid						= 'LCCNid',
	LCCNid_descr				= 'Autoridad: Library of Congress Control Number.',
	NDL							= 'NDL',
	NDL_descr					= 'Autoridad: Neue deutsche literatur.',
	NKC							= 'NKC',
	NKC_descr					= 'Autoridad: National Library of the Czech Republic.',
	NLA							= 'NLA',
	NLA_descr					= 'Autoridad: National Language Promotion Department of Pakistan.',
	OCLC						= 'OCLC',
	OCLC_descr					= 'Autoridad: Online Computer Library Center.',
	OL							= 'OL',
	OL_descr					= 'Autoridad: Open Library.',
	OLbook						= 'OLbook',
	OLbook_descr				= 'Autoridad: Open Library.',
	PND							= 'PND',
	PND_descr					= 'Autoridad: Personennamendatei.',
	QITEM						= 'QITEM',
	QITEM_descr					= 'Wikidata : Identificador de datos.',
	SELIBR						= 'SELIBR',
	SELIBR_descr				= 'Autoridad: National Library of Sweden.', --	Bibliothèque royale (Suède)
	SUDOC						= 'SUDOC',
	SUDOC_descr					= 'Autoridad: Système universitaire de documentation.',
	SWD							= 'SWD',
	SWD_descr					= 'Autoridad: Schlagwortnormdatei.',
	ULAN						= 'ULAN',
	ULAN_descr					= 'Autoridad: Union List of Artist Names.',
	VIAF						= 'VIAF',
	VIAF_descr					= "Autoridad: Fichero de Autoridades Virtual Internacional.",
	WORLDCAT					= 'Worldcat',
	WORLDCAT_descr				= "Autoridad: WorldCat.",
	WORLDCATbook				= 'WORLDCATbook',
	WORLDCATbook_descr			= "Autoridad: WorldCat.",
	WORLDCATch					= 'WORLDCATch',
	WORLDCATch_descr			= "Autoridad: WorldCat.",
	WORLDCATid					= 'WORLDCATid',
	WORLDCATid_descr			= "Autoridad: WorldCat.",
	--
	-- Para traducir, respetar cuidadosamente los espacios y las siguientes partes: %1 = <b>%2</b>
	-- Categorías y Varios mensajes
	-- Estos mensajes deben incluir también los de módulo(s) llamado.
	author_authors_authors				= "Autores",
	author_authors_initial				= "Autores-%1",
	author_authors_initial_txt			= "Autores&nbsp;%1",
	author_authors_initiale_pop			= "Autores con inicial %1",
	author_box_links_indexpages			= "Facsímil",
	author_box_links_biography			= "Biografía",
	author_box_links_wikiquote			= "Quotes",
	author_box_links_commons			= "Media",
	author_entityid_txt					= "Datos", -- Estructurado datos
	author_authors_birthyear			= 'Nacido en el año %1',
	author_authors_deathyear			= 'Muerte en %1',
	author_authors_birth_century		= "Nacido en el año %1..",
	author_authors_death_century		= "Muerte en %1..",
	author_list_limit_levelmaxi			= "Limite de la estructura levelmaxi=%1",
	author_list_limit_maxn				= "Limite de la estructura maxn=%1",
	author_limit_birth_death_cat		= 'Limite los años de las categorías "Nacimientos en" y "Muerte en".',
	author_female_authors_cat			= "Mujeres autores",
	author_male_authors_cat				= "Men autores",
	author_group_languages_cat			= "Autores %1", -- que escriben en
	author_epoch_china_antiquity_cat	= "Autor de la antigüedad china",
	author_epoch_china_springs_cat		= "Autor de Primaveras y Otoños",
	author_epoch_china_empires_cat		= "Autor de los Imperios chinos",
--	author_epoch_indian_indus_cat		= "Autor de la civilización del Indo",
--	author_epoch_indian_muslim_cat		= "Autor de el período indo-musulmán",
	author_epoch_indian_antiquity_cat	= "Autor de la antigüedad india",
	author_epoch_indian_classic_cat	= "Autor del período clásico de la India",
	author_epoch_indian_middle_age_cat = "Autor de la Edad Media de la India",
	author_epoch_antiquity_cat			= "Autor de la antigüedad",
	author_epoch_middle_age_cat		= "Autor de la Edad Media",
	author_epoch_middle_age_cat		= "Autor de el siglo del día 1%",
	author_epoch_author_century_BCE_cat		= "Autor de el siglo a. C. día 1%",
	author_epoch_middle_age_cat_1		= "Autor de el siglo del día 1%‎a", -- categories do not support exponants
	author_epoch_author_century_BCE_cat_1		= "Autor de el siglo a. C. día 1%a", -- categories do not support exponants
	-- BCE = Before Common Era = «BC». AEC = Antes de la Era Común = «a. C.». AEC = Avant l'ère commune = «av. J.-C.»
	author_century_CE					= "%1 siglo",
	author_century_BCE					= "%1 siglo a. C.",
	author_century_CE_1				= "%1<sup>a</sup> siglo",
	author_century_BCE_1				= "%1<sup>a</sup> siglo a. C.",
	author_year_BCE					= "%1 a. C.",
	--
	-- Para traducir, respetar cuidadosamente los espacios y las siguientes partes: %1 = <b>%2</b>
	-- Los mensajes de error y categorías
	-- Estos mensajes deben incluir también los de módulo(s) llamado.
	author_all_versions_text			= "Versiones aviso: <b>%1</b>, lista: 2%, normal: 3%.",
	author_err_one_number_argument		= "Error: En el parámetro <b>%1</b>, ingrese un número único entre -5000 y ahora.",
	author_err_assist_user_param		= "Apoyo a los usuarios para comprobar los ajustes:",
	author_err_module_error				= "Module error",
	author_err_auto_val_unknown			= "Error interno: Argumento desconocido automático: %1 = <b>%2</b>.",
	author_err_no_known_arguments		= "Módulo sin argumentos tabla conocida.",
	author_err_unknown_auto_arg			= "Error interno: Argumento desconocido automático : %1 = <b>%2</b>.",
	author_err_args_values				= "Valor anormal del argumento <b>%1 = %2</b> (%3)",
	author_msg_delete_docbox			= "Esta documentación/apoyo debe ser removido antes de grabar.<br/>Retire todos los modos para volver al modo normal.",
	author_msg_automatic_argument		= "Verificar el argumento automático <b>%1</b>.",
	author_tools_auto_val_warning_msg	= "Verifique el argumento automático: %1 = <b>%2</b>.",
	--
	author_err_vague_year				= "Año incierto.",
	author_err_death_before_birth		= "Error: muerte <b>%1</b> antes del nacimiento <b>%2</b>.",
	author_err_death_before_birth_cat	= "Autor muerte antes del nacimiento.",
	author_err_life_too_long			= "La vida es demasiado largo de %1 a %2.",
	author_err_life_too_long_cat		= "Vida del autor es demasiado largo",
	author_date_to_part_format			= " dd mmmm yyyy",
	author_date_to_part_call_err		= "Error interno: Argumentos de llamadas anormales en la fecha <b>%1</b>, <b>%2</b>.",
	author_date_to_part_call_cat		= "Módulo con error interno",
	author_date_to_part_err_not_found	= "Error interno: No parte encontrado en la fecha <b>%1</b>, <b>%2</b>.",
	author_err_vague_epoch				= "Épocas inciertas.",
	author_err_unknown_epoch_cat		= "Desconocido período",
	author_err_year_in_roman_number		= "Ambigüedad: el año <b>%1</b> es en números romanos ¿Qué quieres definir un siglo?",
	author_err_roman2int				= "Error en el número romano en el argumento %1 = <b>%2</b> ; %3 %4. ",
	author_err_notices_properties		= "Error interno: Un registro de autoridad no está definido: %1.",
	author_err_notices_properties_cat	= "Error interno: Uno o más registro de autoridad no está definido.",
	author_err_author_without_authority	= "Error: Autore sin registros de autoridad",
	author_without_authority_cat		= "Autores sin registros de autoridad",
	author_err_deprecated_authority		= "Esta base de autoridad, %1, es viejo y debe ser evitado.",
	author_docbox_namespace_valid		= "Help Mod-ule Project Template",
	author_docbox_namespace_stop		= "Aut-eur Ma-in Page",
	author_docbox_namespace_error		= "Auteur Main Page",
	author_docbox_namespace_error_cat	= "Módulo con error del uso",
	author_docbox_namespace_error_err	= "<b>Volver a modo normal</b> antes de guardar la página, al eliminar todos los modos, porque el panel de la documentación está prohibida en el espacio <b>%1:'''.",
	--
	-- Estos mensajes se utilizan para módulo Centralizer, y se copian aquí.
	c									= 'c',
	c_descr							= 'Opciones para agregar con opciones de modo.',
	options								= 'options',
	options_descr						= 'Opciones para agregar con opciones de modo.',
	author_err_error_list_header		= "Asistencia en los parámetros del modelo en:",
	author_list_limit_levelmaxi			= "Error: El parámetro <b>%1</b> es desconocido en este modelo. Compruebe el nombre o marca esta brecha.",
	author_list_limit_levelmaxi			= "Error: la <b>%1</b> argumento conocido es el que necesita?",
	author_list_limit_levelmaxi			= "Error: el valor del argumento <b>%1</b> ya se ha definido. Elegir sólo un valor de un solo sinónimo.",
	author_err_need_value				= "Error: Este argumento es necesario pero ausente : <b>%1</b>. Debe definir.",
	author_err_none_value				= "Error: Ningún argumento ha sido definido.",
	author_err_too_unnamed_arguments	= "Error: Demasiados argumentos sin nombre ( <b>%1</b> ).",
	author_list_limit_levelmaxi			= "Error interno: Notificar al promotor que el argumento interno <b>%1</b> es desconocida en los registros.",
	author_err_notice_link				= "Error: mala nota por <b>%1</b>.",
	author_err_notice_link_cat			= "Módulo con mala nota",
	author_list_limit_levelmaxi			= "Límite de la lista levelmaxi=%1",
	author_list_limit_max_n				= "Límite de la lista max_n=%1",
	author_err_module_miss_i18n_cat		= "Módulo faltante traducción i18n",
	--
	-- Estos textos se utilizan para titular algunas pruebas.
	author_list_wiki_selectors_title		= "Lista de las selectores de este wiki:",
	author_list_all_categories_title		= "Lista de todas las posibles categorías de esta wiki:",
	author_list_all_errors_title			= "Lista de todos los errores detectables de este wiki:",
	author_selected_autorities_title		= "Lista de autoridades seleccionados",
	author_multiple_values_tests_title		= "Prueba de múltiples valores argumentos",
	author_authorities_notices_test_title	= "Prueba todas las autoridades avisos",
	author_authorities_notices_test_deprec	= "Pruebe todos sabemos avisos de autoridad, algunos están en desuso (en gris)",
	author_authorities_select_test_title	= "Selección autoridades Wikidata",
	authorities_select_test_header			= "Argumentos de Wikidata, Selector, Argumentos de modelo, Argumentos seleccionados",
	author_multiple_selection_test_title	= "Prueba de selección múltiple",
	author_multiple_selection_test_header	= "Opciones,Selector,Para seleccionar,Seleccionadas",
	author_multiple_selection_test_select	= "2,nobel,presidente,diputado,precio",
	author_firstname_familyname_test_title	= "Prueba de nombre, apellido y clave de ordenación",
	author_firstname_familyname_test_header= "Título recibida, Etiqueta recibida, Apellido recibido, Nombre recibido, Initiale recibida, Initiale final, clave de ordenación final, detalle de prueba",
	author_options_from_mode_title			= "Prueba de opciones de modo",
	author_copyright_box_test_title			= "Prueba de cajas de detalles de copyright",
	author_copyright_box_header				= "Tipo de derechos de autor, Idioma del usuario, Idioma del wiki",
	author_rights_test_title				= "Prueba de los derechos de copyright de los autores",
	author_rights_test_header				= "año de nacimiento, año de la muerte, tipo de derecha, derecha utilizado, modelo de los derechos de autor, plantilla de derechos. categoría y error",
	author_unique_century_life_test_title	= "Siglo único del autor",
	author_year_to_epoch_test_title			= "siglos y épocas de año",
	author_century_to_epoch_test_title		= "Siglos según de siglos",
	author_events_epochs_test_title			= "Eventos y épocas",
	author_events_epochs_test_header		= "Región, Nacimiento, Muerte, Tiempo, Siglo automático, Categorías y Errores",
	author_events_epochs_test_header_sub	= "Esperanza de vida normal, Épocas de la India, Esperanza de vida anormal, muy larga esperanza de vida, Otros casos: no hay tiempo, Otros casos: número romano del siglo o año",
	author_roman_to_digital_test_title		= "Prueba de números romanos a números decimales",
	author_digital_to_roman_test_title		= "Prueba de números decimales a números romanos",
} -- p.i18n.es
p.i18n.fr = { -- Traductions en francais des arguments, catégories et messages :
	-- Pour traduire, respecter soigneusement les espaces et ces parties : %1 = <b>%2</b>
	-- wiki_selectors -- wiki_selectors
	author_authorities_selector		= "5, VIAF, BNF, SUDOC, ISNI, LCCN, ARC, WORLDCAT, NLA, PND, GKD", -- wiki_selectors
	author_rights_values				= "none,non,ONU,non,cn,50,us,70,mpf", -- wiki_selectors
	author_region_values				= "autre,chine,inde,siècle", -- wiki_selectors
	author_distinctions_selector		= '2,nobel,président,député,prix', -- wiki_selectors
	author_functions_selector			= '2,président', -- ,député', -- wiki_selectors
	author_occupations_selector		= '2,biographe', -- ,politique', -- wiki_selectors
	author_author_sex_values					= 'homme,femme', -- wiki_selectors
	author_life_constants_of_module	= "Constantes de durée de vie dans ce module:",
	author_categorise_death_for_n_years= "Catégoriser l'année de décès depuis <b>%1 ans</b>.",
	author_writing_after_birth	= "Un auteur commence à écrire <b>%1 ans</b> après sa naissance.",
	author_writing_before_death = "Un auteur écrit jusqu'à <b>%1 ans</b> avant sa mort.",
	author_lifetime_limit		= "La durée de vie maximale est de <b>%1 ans</b>.",
	author_mean_lifetime		= "La durée de vie moyenne est de <b>%1 years</b>.",
	-- to debug for arg 1, arg 2 :
	[1]							= "1",
	["1"]						= "1",
	["1_descr"]					= "Argument de position 1.",
	[2]							= "2",
	["2"]						= "2",
	["2_descr"]					= "Argument de position 2.",
	-- Arguments de configuration
	mode						= "mode",
	mode_descr					= "Mode de fonctionnement du module.",
	allversions					= "allversions",
	allversions_descr			= "Toutes les versions des sous-modules.",
	selectversions				= "selectversions",
	selectversions_descr		= "Sélection des versions des sous-modules.",
	userlang					= "userlang",
	userlang_descr				= "Sélectionnez la langue de l'utilisateur à partir de l'argument.",
	wikilang					= "wikilang",
	wikilang_descr				= "Sélectionnez la langue du wiki à partir de l'argument.",
	-- Noms et descriptions des arguments
	author_needed_to_verify			= "(obligatoire, à vérifier)",
	author_list_needed_arguments		= "Liste des arguments nécessaires :",
	author_list_all_other_arguments	= "Liste des autres arguments :",
	author_list_all_authorities		= "Liste des bases d'autorités :",
	author_list_all_system_arguments	= "Liste des arguments du système :",
	entityid					= 'id',
	entityid_descr				= "Identifiant des données de wikidata, comme <code>Q535</code> pour Victor Hugo.",
	entityid2					= 'entityid',
	entityid2_descr				= "Identifiant des données de wikidata, comme <code>Q535</code> pour Victor Hugo.",
	title						= 'title',
	title_descr					= "Titre de la page, automatique.",
	label						= 'label',
	label_descr					= "Partie du titre de la page, automatique.",
	sitelink					= 'sitelink',
	sitelink_descr				= "Partie du titre de la page, automatique.",
	namespace					= 'espace',
	namespace_descr				= "Nom de l'espace où est la page, automatique.",
	category					= 'Catégorie',
	category_descr				= "Nom de l'espace Catégorie.",
	doc1key						= 'doc1key',
	doc1key_descr				= 'Identifiant de la documentation à produire en mode doc1.',
--	commonscat					= 'commonscat',
--	commonscat_descr			= 'commonscat',
	-- ModuleAuthor arguments du modèle
	familyname					= 'nom',
	familyname_descr			= "Nom. Aide à corriger la clé de tri de la catégorie.",
	firstname					= 'prénoms',
	firstname_descr				= "Prénoms. Aide à corriger la clé de tri de la catégorie.",
	firstname2					= 'prenoms',
	firstname2_descr			= "Prénoms. Aide à corriger la clé de tri de la catégorie.",
	galliname					= 'prenomGalli',
	galliname_descr				= "Nom partiel spécial de l'autorité d'auteur Gallica.",
	initial						= 'initiale',
	initial_descr				= "Initiale pour corriger la catégorie d'auteur.",
	pseudonym					= 'pseudo',
	pseudonym_descr				= "Pseudonyme de l'auteur.",
	title						= 'titre',
	title_descr					= "Titre de la page, automatique.",
	sex							= 'sexe',
	sex_descr					= "Sexe de l'auteur.",
	sortkey						= 'clé',
	sortkey_descr				= "Clé de tri pour la catégorie d'auteur-initiale.",
	sortkey2					= 'cle',
	sortkey2_descr				= "Clé de tri pour la catégorie d'Auteur-initiale.",
	sortkey_txt					= 'sortkey_txt',
	sortkey_txt_descr			= 'Affichage de clef de tri, automatique.',
	sortkey_test				= 'sortkey_test',
	sortkey_test_descr			= 'Affichage de clef de tri, automatique.',
	image						= 'image',
	image_descr					= "Image de l'auteur.",
	birthyear					= 'anneeNaissance',
	birthyear_descr				= "Année de naissance",
	birth						= 'naissance',
	birth_descr					= "Année de naissance",
	birthcentury				= 'siecleNaissance',
	birthcentury_descr			= "Siecle de naissance de l'auteur.",
--	birthuncertain				= 'incertitudeNaissance',
	precededby					= "précédé par",
	precededby_descr			= "Précédé dans sa fonction par...",
	preceded_by					= ", a succédé à  %1",
	region						= 'région',
	region_descr				= 'Région pour déterminer les époques anciennes.',
	year_epoch					= 'époque',
	year_epoch_descr			= 'Année pour déterminer une époque ou un siècle.',
	deathyear					= 'anneeDeces',
	deathyear_descr				= "Année de décès",
	death						= 'décès',
	death_descr					= "Année de décès",
	deathcentury				= 'siecleDeces',
	deathcentury_descr			= "Siècle de décès de l'auteur.",
--	deathuncertain				= 'incertitudeDeces',
	description					= 'description',
	description_descr			= "Description de l'auteur, à préciser si la description automatique ne convient pas",
	author_multi_selector_description	= "Sélecteurs multiples pour description : %1",
	authorities_arg				= 'autorités',
	authorities_arg_descr		= "Sélection d'autorités d'auteurs.",
	distinctions				= 'distinctions',
	distinctions_descr			= "Distinctions décernées à l'auteur.",
	functions					= 'fonctions',
	functions_descr				= "Fonctions importantes exercées par l'auteur.",
	occupations					= 'métiers',
	occupations_descr			= "Professions de l'auteur.",
	genre						= 'genre',
	genre_descr					= "Genre littéraire de l'auteur.",
	language					= 'langue',
	language_descr				= "Langue maternelle de l'auteur.",
	languages					= 'langues',
	languages_descr				= "Autres langues de l'auteur.",
--	nationality					= 'pays',
	prize						= 'prix',
	prize_descr					= "Prix d’excellence accordé à l'auteur.",
	wikipedia					= 'wikipedia',
	wikipedia_descr				= 'Titre de la page dans wikipedia.',
	wikiquote					= 'wikiquote',
	wikiquote_descr				= 'Titre de la page dans wikiquote.',
	commons						= 'commons',
	commons_descr				= 'Titre de la page dans commons.',
	indexpages					= 'indexpages',
	indexpages_descr			= 'indexpages dans Wikisource.',
	-- Droits d'auteur
	rights						= 'droits',
	rights_descr				= "Type de droits d'auteur nécessaire parmi : 70,50,mpf,non.",
	author_rights_limit_txt			= 'droits=%1',
	author_err_undefined_rights		= "Les droits de l'auteur ne sont pas définis.",
	rights_values_box_ONU		= "DP-ONU-Auteur",
	rights_values_cat_ONU		= "Auteurs dans le domaine public aux États-Unis",
	rights_values_txt_ONU		= "[[File:Info icon 001.svg|left|48px|link=]]&nbsp;[[Image:PD-icon.svg|40px|lien=Modèle:DP-ONU/info]]Certaines œuvres de cet auteur peuvent être dans le [[wikisource:fr:Domaine public (propriété intellectuelle)|domaine public]] selon la [[wikisource:fr:Copyright aux États-Unis|licence spécifique de l'ONU]], mais encore soumises aux droits d’auteur dans certains pays, notamment en Europe. Les téléchargements sont faits sous [[wikisource:fr:Aide:Droit d'auteur|votre responsabilité]].",
	rights_values_box_70		= "DP-EU-Auteur",
	rights_values_cat_70		= "Auteurs dans le domaine public aux États-Unis",
	rights_values_txt_70		= "[[File:Info icon 001.svg|left|48px|link=]]Certaines œuvres de cet auteur peuvent être dans le [[wikisource:fr:Domaine public (propriété intellectuelle)|domaine public]] aux [[wikisource:fr:Copyright aux États-Unis|États-Unis]], mais encore soumises aux droits d’auteur dans certains pays, notamment en Europe. Les téléchargements sont faits sous [[wikisource:fr:Aide:Droit d'auteur|votre responsabilité]].",
	rights_values_box_50		= "DP-CN-Auteur",
	rights_values_cat_50		= "Auteurs dans le domaine public au Canada",
	rights_values_txt_50		= "[[File:Info icon 001.svg|left|48px|link=]]Les œuvres de cet auteur peuvent être dans le [[w:Domaine public (propriété intellectuelle)|domaine public]] au [[w:Copyright aux Canada|Canada]], mais encore soumises aux droits d’auteur dans certains pays, notamment en Europe et aux [[w:Copyright aux États-Unis|États-Unis]]. Les téléchargements sont faits sous [[wikisource:fr:Aide:Droit d'auteur|votre responsabilité]].",
	rights_values_box_mpf		= "Mort pour la France",
	rights_values_cat_mpf		= "Auteurs morts pour la France‎", -- Modèle:Auteur Mort pour la France
	rights_values_txt_mpf		= "[[File:Info icon 001.svg|left|48px|link=]]Cet auteur est déclaré « [[wikisource:fr:Mort pour la France|Mort pour la France]] » par le gouvernement français. En conséquence, ses droits d’auteur sont prolongés de 30 ans, et ses œuvres ne sont pas dans le domaine public en France. Les téléchargements sont faits sous [[wikisource:fr:Aide:Droit d'auteur|votre responsabilité]].",
	rights_values_box_none		= "DP-Public-Auteur",
	rights_values_cat_none		= "Auteurs dans le domaine public", -- Modèle:Domaine public Auteur
	rights_values_txt_none		= "[[Image:PD-icon.svg|64px|Domaine public]] Cet auteur a renoncé à ses droits (''copyright''), ou ses droits ont expiré. Ses œuvres font partie du [[w:Domaine public, en droit de la propriété intellectuelle|domaine public]] et sont donc librement diffusable et/ou modifiable. Les téléchargements sont faits sous [[wikisource:fr:Aide:Droit d'auteur|votre responsabilité]].",
	rights_values_cat_unknown	= "Droits d'auteur inconnus",
	rights_values_box_unknown	= "Droits d'auteur inconnus",
	rights_values_txt_unknown	= "[[File:Info icon 001.svg|left|48px|link=]] Les droits d’auteur de cet auteur ne sont pas définis. Ses œuvres sont peut-être encore soumises aux droits d’auteur dans certains pays, notamment en Europe ou aux [[wikisource:fr:Copyright aux États-Unis|États-Unis]]. Les téléchargements sont faits sous [[wikisource:fr:Aide:Droit d'auteur|votre responsabilité]].",
	author_new_public_rights_authors	= "Auteurs récents en domaine public",
	-- Scans et Autorités
	author_scans_text			= 'Scans et Autorités',
	author_Notices				= 'Autorités', -- search BNF
	ARC							= 'ARC',
	ARC_descr					= 'Autorité : Internet Archive.',
	ARCgeo						= 'ARCgeo',
	ARCgeo_descr				= 'Autorité : Internet Archive.',
	ARCid						= 'ARCid',
	ARCid_descr					= 'Autorité : Internet Archive.',
	ARCitem						= 'ARCitem',
	ARCitem_descr				= 'Autorité : Internet Archive.',
	ARCorg						= 'ARCorg',
	ARCorg_descr				= 'Autorité : Internet Archive.',
	ARCsub						= 'ARCsub',
	ARCsub_descr				= 'Autorité : Internet Archive.',
	ARCHIVE						= 'ARCHIVE',
	ARCHIVE_descr				= 'Autorité : Internet Archive.',
	ARCHIVEbook					= 'ARCHIVEbook',
	ARCHIVEbook_descr			= 'Autorité : Internet Archive.',
	BNF							= 'BNF',
	BNF_descr					= 'Autorité : Bibliothèque nationale de France.',
	BNFbook						= 'BNFbook',
	BNFbook_descr				= 'Autorité : Bibliothèque nationale de France.',
	CANTIC						= 'CANTIC',
	CANTIC_descr				= "Autorité: Catalogue d'autorités des noms et des titres de la Catalogne.",
	DNB							= 'DNB',
	DNB_descr					= 'Autorité : Bibliothèque nationale allemande.',
	GKD							= 'GKD',
	GKD_descr					= 'Autorité : Gemeinsame Normdatei.',
	GKD_V1						= 'GKD_V1',
	GKD_V1_descr				= 'Autorité : Gemeinsame Normdatei.',
	GND							= 'GND',
	GND_descr					= 'Autorité : Gemeinsame Normdatei.',
	IA							= 'IA',
	IA_descr					= 'Autorité : Internet Archive.',
	IBL							= 'IBL',
	IBL_descr					= 'Autorité : Inquiry-based learning.',
	IBLid						= 'IBLid',
	IBLid_descr					= 'Autorité : Inquiry-based learning.',
	IBLbook						= 'IBLbook',
	IBLbook_descr				= 'Autorité : Inquiry-based learning.',
	IMDb						= 'IMDb',
	IMDb_descr					= 'Autorité : Internet Movie Database.',
	ISBN						= 'ISBN',
	ISBN_descr					= 'Autorité : International Standard Book Number.',
	ISFDB						= 'ISFDB',
	ISFDB_descr					= 'Autorité : Internet Speculative Fiction Database.',
	ISFDBid						= 'ISFDBid',
	ISFDBid_descr				= 'Autorité : Internet Speculative Fiction Database.',
	ISFDBpub					= 'ISFDBpub',
	ISFDBpub_descr				= 'Autorité : Internet Speculative Fiction Database.',
	ISFDBtitle					= 'ISFDBtitle',
	ISFDBtitle_descr			= 'Autorité : Internet Speculative Fiction Database.',
	ISNI						= 'ISNI',
	ISNI_descr					= 'Autoridad: International Standard Name Identifier.',
	LCCN						= 'LCCN',
	LCCN_descr					= 'Autorité : Numéro de contrôle de la Bibliothèque du Congrès.',
	LCCNid						= 'LCCNid',
	LCCNid_descr				= 'Autorité : Numéro de contrôle de la Bibliothèque du Congrès.',
	NDL							= 'NDL',
	NDL_descr					= 'Autorité : Neue deutsche literatur.',
	NKC							= 'NKC',
	NKC_descr					= 'Autorité : National Library of the Czech Republic.',
	NLA							= 'NLA',
	NLA_descr					= 'Autorité : National Language Promotion Department of Pakistan.',
	OCLC						= 'OCLC',
	OCLC_descr					= 'Autorité : Online Computer Library Center.',
	OL							= 'OL',
	OL_descr					= 'Autorité : Open Library.',
	OLbook						= 'OLbook',
	OLbook_descr				= 'Autorité : Open Library.',
	PND							= 'PND',
	PND_descr					= 'Autorité : Personennamendatei.',
	QITEM						= 'QITEM',
	QITEM_descr					= 'Wikidata : Identifiant de données.',
	SELIBR						= 'SELIBR',
	SELIBR_descr				= 'Autorité : Bibliothèque royale de Suède.', -- National Library of Sweden'
	SUDOC						= 'SUDOC',
	SUDOC_descr					= 'Autorité : Système universitaire de documentation.',
	SWD							= 'SWD',
	SWD_descr					= 'Autorité : Schlagwortnormdatei.',
	ULAN						= 'ULAN',
	ULAN_descr					= 'Autorité : Union List of Artist Names.',
	VIAF						= 'VIAF',
	VIAF_descr					= "Autorité : Fichier d'autorité international virtuel.",
	WORLDCAT					= 'Worldcat',
	WORLDCAT_descr				= "Autorité : WorldCat.",
	WORLDCATbook				= 'WORLDCATbook',
	WORLDCATbook_descr			= "Autorité : WorldCat.",
	WORLDCATch					= 'WORLDCATch',
	WORLDCATch_descr			= "Autorité : WorldCat.",
	WORLDCATid					= 'WORLDCATid',
	WORLDCATid_descr			= "Autorité : WorldCat.",
	--
	-- Pour traduire, respecter soigneusement les espaces et ces parties : %1 = <b>%2</b>
	-- Catégories et Messages divers
	-- Ces messages doivent aussi intégrer ceux du (ou des) module(s) appelé(s).
	author_authors_authors				= "Auteurs",
	author_authors_initial				= "Auteurs-%1",
	author_authors_initial_txt			= "Auteurs %1",
	author_authors_initiale_pop			= "Auteurs à initiale %1",
	author_box_links_indexpages			= "Fac-similés",
	author_box_links_biography			= "Biographie",
	author_box_links_wikiquote			= "Citations",
	author_box_links_commons			= "Médias",
	author_entityid_txt					= "Données", -- Données structurées
	author_authors_birthyear			= 'Naissance en %1',
	author_authors_deathyear			= 'Décès en %1',
	author_authors_birth_century		= "Naissance en %1..",
	author_authors_death_century		= "Décès en %1..",
	author_list_limit_levelmaxi			= "Limite de la structure levelmaxi=%1",
	author_list_limit_maxn				= "Limite de la structure maxn=%1",
	author_limit_birth_death_cat		= 'Limite les années des catégories "Naissance en" et "Décès en".',
	author_female_authors_cat			= "Femmes auteurs",
	author_male_authors_cat				= "Men authors",
	author_group_languages_cat			= "Auteurs %1", -- écrivant en
	author_epoch_china_antiquity_cat	= "Auteurs de l'antiquité chinoise",
	author_epoch_china_springs_cat		= "Auteurs des Printemps et Automnes",
	author_epoch_china_empires_cat		= "Auteurs des Empires chinois",
--	author_epoch_indian_indus_cat		= "Auteurs de la civilisation de l'Indus",
--	author_epoch_indian_muslim_cat		= "Auteurs de la période indo-musulmane",
	author_epoch_indian_antiquity_cat	= "Auteurs de l'antiquité indienne",
	author_epoch_indian_classic_cat	= "Auteurs de la période classique indienne",
	author_epoch_indian_middle_age_cat = "Auteurs du moyen-âge indien",
	author_epoch_antiquity_cat			= "Auteurs de l’Antiquité",
	author_epoch_middle_age_cat		= "Auteurs du Moyen Âge",
	author_epoch_middle_age_cat		= "Auteurs du %1e siècle‎", -- <sup>ème</sup> forbiden in category
	author_epoch_author_century_BCE_cat		= "Auteurs du %1e siècle av. J.-C.",
	author_epoch_middle_age_cat_1		= "Auteurs du %1er siècle‎", -- categories do not support exponants
	author_epoch_author_century_BCE_cat_1		= "Auteurs du %1er siècle av. J.-C.", -- categories do not support exponants
	-- BCE = Before Common Era = «BC». AEC = Antes de la Era Común = «a. C.». AEC = Avant l'ère commune = «av. J.-C.»
	author_century_CE					= "%1<sup>ème</sup> siècle",
	author_century_BCE					= "%1<sup>ème</sup> siècle av. J.-C.",
	author_century_CE_1				= "%1<sup>er</sup> siècle",
	author_century_BCE_1				= "%1<sup>er</sup> siècle av. J.-C.",
	author_year_BCE					= "%1 av. J.-C.",
	--
	-- Pour traduire, respecter soigneusement les espaces et ces parties : %1 = <b>%2</b>
	-- Messages d'erreurs et catégories
	-- Ces messages doivent aussi intégrer ceux du (ou des) module(s) appelé(s).
	author_all_versions_text			= "Versions avertissement: <b>%1</b>, liste: %2, normal: %3.",
	author_err_one_number_argument		= "Erreur : Dans le paramètre <b>%1</b>, entrer un seul nombre entre -5000 et maintenant.",
	author_err_assist_user_param		= "Assistance à l'utilisateur pour la vérification des paramètres :",
	author_err_module_error				= "Module avec erreur",
	author_err_auto_val_unknown			= "Erreur interne: Argument automatique inconnu : %1 = <b>%2</b>.",
	author_err_no_known_arguments		= "Module sans table d'arguments connus.",
	author_err_unknown_auto_arg			= "Erreur interne : Argument automatique inconnu : %1 = <b>%2</b>.",
	author_err_args_values				= "Valeur anormale de l'argument <b>%1 = %2</b> (%3)",
	author_msg_delete_docbox			= "Cette documentation/assistance doit être supprimée avant d'enregistrer.<br/>Supprimez tous les modes pour revenir en mode normal.",
	author_msg_automatic_argument		= "Vérifiez l'argument automatique <b>%1</b>.",
	author_tools_auto_val_warning_msg	= "Vérifiez l'argument automatique : %1 = <b>%2</b>.",
	--
	author_err_vague_year				= "Année incertaine.",
	author_err_death_before_birth		= "Erreur : le décès <b>%1</b> est avant la naissance <b>%2</b>.",
	author_err_death_before_birth_cat	= "Erreur : le décès est avant la naissance.",
	author_err_life_too_long			= "Durée de vie trop longue de %1 à %2.",
	author_err_life_too_long_cat		= "Durée de vie de l'auteur trop longue",
	author_err_module_miss_i18n_cat		= "Module avec erreur interne",
	author_date_to_part_format			= " dd mmmm yyyy",
	author_date_to_part_call_err		= "Erreur interne : argument d'appel anormal dans la date <b>%1</b>, <b>%2</b>.",
	author_date_to_part_call_cat		= "Module avec erreur interne",
	author_date_to_part_err_not_found	= "Erreur interne : Partie non trouvée dans la date <b>%1</b>, <b>%2</b>.",
	author_err_vague_epoch				= "Époque incertaine.",
	author_err_unknown_epoch_cat		= "Époque inconnue",
	author_err_year_in_roman_number		= "Ambigüité : l'année <b>%1</b> est en nombres romains. Voulez-vous définir un siècle ?",
	author_err_roman2int				= "Erreur de nombre romain dans l'argument %1 = <b>%2</b> ; %3 %4. ",
	author_err_notices_properties		= "Erreur interne: Une notice d'autorité n'est pas définie : %1.",
	author_err_notices_properties_cat	= "Module avec erreur interne",
	author_err_author_without_authority	= "Erreur : Auteur sans notices d’autorité",
	author_without_authority_cat		= "Auteurs sans notices d’Autorité",
	author_err_deprecated_authority		= "Cette base d'autorité, %1, est ancienne et à éviter.",
	author_docbox_namespace_valid		= "Help Mod-ule Project Template",
	author_docbox_namespace_stop		= "Aut-eur Ma-in Page",
	author_docbox_namespace_error		= "Auteur Main Page",
	author_docbox_namespace_error_cat	= "Module avec erreur d'utilisation",
	author_docbox_namespace_error_err	= "<b>Revenez en mode normal</b> avant de sauver la page, en supprimant tous les modes, car le panneau de documentation est interdit dans l'espace <b>%1:'''.",
	--
	-- Ces messages servent au module Centralizer, et sont copiés ici.
	c									= 'c',
	c_descr							= 'Options à ajouter aux options de mode.',
	options								= 'options',
	options_descr						= 'Options à ajouter aux options de mode.',
	author_err_error_list_header		= "Assistance sur les paramètres de ce modèle :",
	author_list_limit_levelmaxi			= "Erreur : Le paramètre <b>%1</b> est inconnu dans ce modèle. Vérifier ce nom ou signaler ce manque.",
	author_list_limit_levelmaxi			= "Erreur: L'argument connu <b>%1</b> est-il celui que vous voulez ?",
	author_list_limit_levelmaxi			= "Erreur : La valeur de l'argument <b>%1</b> est déjà définie. Choisir une seule valeur d'un seul synonyme.",
	author_err_need_value				= "Erreur : Cet argument est nécessaire mais absent : <b>%1</b>. Il faut le définir.",
	author_err_none_value				= "Erreur : Aucun argument n'a été défini.",
	author_err_too_unnamed_arguments	= "Erreur : Trop de paramètres non nommés ( <b>%1</b> ).",
	author_list_limit_levelmaxi			= "Erreur interne : Signalez au developpeur que l'argument interne <b>%1</b> est inconnu dans les autorités.",
	author_err_notice_link				= "Erreur : mauvaise notice pour <b>%1</b>.",
	author_err_notice_link_cat			= "Module avec erreur interne",
	author_list_limit_levelmaxi			= "Limite de liste levelmaxi=%1",
	author_list_limit_max_n				= "Limite de liste max_n=%1",
	author_err_module_miss_i18n_cat		= "Module manquant de traduction i18n",

	-- Ces textes servent à titrer des tests et entêtes de tables.
	author_list_wiki_selectors_title		= "Liste des sélecteurs de ce wiki :",
	author_list_all_categories_title		= "Liste de toutes les catégories éventuelles de ce wiki :",
	author_list_all_errors_title			= "Liste de toutes les erreurs détectables de ce wiki :",
	author_selected_autorities_title		= "Liste des autorités sélectionnées",
	author_multiple_values_tests_title		= "Test des arguments à valeurs multiples",
	author_authorities_notices_test_title	= "Tester toutes les notices d'autorités",
	author_authorities_notices_test_deprec	= "Tester toutes les notices d'autorités, certaines sont obsolètes (en gris)",
	author_authorities_select_test_title	= "Sélection des autorités de wikidata",
	authorities_select_test_header			= "Arguments de Wikidata,Sélecteur,Arguments du modèle,Arguments sélectionnés",
	author_multiple_selection_test_title	= "Test de sélection multiple",
	author_multiple_selection_test_header	= "Options,Sélecteur,À sélectionner,Sélectionnés",
	author_multiple_selection_test_select	= "2,nobel,président,député,prix",
	author_firstname_familyname_test_title	= "Test de nom, prénom et clé de tri",
	author_firstname_familyname_test_header	= "Titre reçu, Label reçu, Prénom reçu, Nom reçu, Initiale reçue, Initiale finale, sortkey final, détails du test",
	author_options_from_mode_title			= "Test des options de mode",
	author_copyright_box_test_title			= "Test de boîtes d'informations de copyright",
	author_copyright_box_header				= "Type de droits d'auteur, Langue de l'utilisateur, Langue du Wiki",
	author_rights_test_title				= "Test des droits de copyright d'auteurs",
	author_rights_test_header				= "année de naissance, année de décès, type de droit, droit utilisé, modèle de droit d'auteur, début de copyright. catégorie et erreur",
	author_unique_century_life_test_title	= "Siècle unique d'un auteur",
	author_year_to_epoch_test_title			= "Siècles et époques selon les années",
	author_century_to_epoch_test_title		= "Siècles et époques selon les siècles",
	author_events_epochs_test_title			= "Événements et époques",
	author_events_epochs_test_header		= "Région, Naissance, Décès, Époque, Siècle automatique, Catégories et erreurs",
	author_events_epochs_test_header_sub	= "Durée de vie normale, Époques en Inde, Durée de vie anormale, Durée de vie très longue, Autres cas : pas d'époque, Autres cas : année ou siècle en nombre romain",
	author_roman_to_digital_test_title		= "Test des nombres romains en nombres décimaux",
	author_digital_to_roman_test_title		= "Test des nombres décimaux en nombres romains",
} -- p.i18n.fr

------------------------------------------------------------
-- i18n end
------------------------------------------------------------

------------------------------------------------------------
-- object table start
------------------------------------------------------------
-- Special arguments to modify the fonctions and outputs of this module.
-- Argumentos spéciaux vierta modificadoras le fonctionnement et les salidas de módulo ce.
-- Arguments spéciaux pour modifier le fonctionnement et les sorties de ce module.

p.args_known = {
	-- Arguments in order without names, with their keyword for use as other arguments.
	-- Arguments dans l'ordre, non nommés, avec leur keyword pour traitement comme les autres arguments.
--	[1]					= { ["typ"] = "config",	["need"] = 0,	["keyword"] = "mode", ["syn"] = 2},
	
	-- Special arguments to modify the fonctions and outputs of this module.
	-- Arguments speciaux pour modifier le fonctionnement et les sorties de ce module.
	["category"]		= { ["typ"] = "ctr",	["need"] = 0,	["keyword"] = "category"},
	["debug"]			= { ["typ"] = "opt",	["need"] = 0,	["keyword"] = "debug"},
	["c"]				= { ["typ"] = "config",	["need"] = 0,	["keyword"] = "c"},
	["dockey"]			= { ["typ"] = "config",	["need"] = 0,	["keyword"] = "dockey", }, -- dockey docitem args_known = { i18n.vi
	["docitem"]			= { ["typ"] = "config",	["need"] = 0,	["keyword"] = "docitem", }, -- dockey docitem args_known = { i18n.vi
	["mode"]			= { ["typ"] = "config",	["need"] = 0,	["keyword"] = "mode"},
	["options"]			= { ["typ"] = "config",	["need"] = 0,	["keyword"] = "options"},
	["knownversions"]	= { ["typ"] = "config",	["need"] = 0,	["keyword"] = "knownversions"},
	["soughtversions"]	= { ["typ"] = "config",	["need"] = 0,	["keyword"] = "soughtversions"},
	-- The userlang argument permits at an administrator in his own langage (errors, warnings, catégories, tests) to help a wiki in any language.
	-- El userlang argumento permisos en administrador en su propia langage (errores, advertencias, categorías, pruebas) para ayudar a un wiki en cualquier idioma.
	-- L'argument userlang permet à un administrateur dans son propre langage (erreurs, warnings, catégories, tests) d'aider un wiki dans n'importe quelle langue.
	["contentlang"]		= { ["typ"] = "config",	["need"] = 0,	["keyword"] = "contentlang"},
	["pagelang"]		= { ["typ"] = "config",	["need"] = 0,	["keyword"] = "pagelang"},
	["userlang"]		= { ["typ"] = "config",	["need"] = 0,	["keyword"] = "userlang"},

	-- All arguments have a keyword identical to the registration name, except synonyms.
	-- Tous les arguments ont un keyword identique au nom d'enregistrement, sauf les synonymes.
	["birthyear"]		= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "birthyear",	["prop"] = "P569", ["format"] = "year", },
	["country"]			= { ["typ"] = "dat",	["need"] = 0,	["keyword"] = "country",	["prop"] = "P27", },
	["countryRANK"]		= { ["typ"] = "dat",	["need"] = 0,	["keyword"] = "country",	["prop"] = "P27", ["RANK"] = "RANK_NORMAL", },
	["deathyear"]		= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "deathyear",	["prop"] = "P570", ["format"] = "year", },
	["description"]		= { ["typ"] = "dat",	["need"] = 2,	["keyword"]	= "description",["prop"] = "description", },
	["firstname"]		= { ["typ"] = "dat",	["need"] = 0,	["keyword"] = "firstname",	["prop"] = "P735", },
	["firstname2"]		= { ["typ"] = "dat",	["need"] = 0,	["keyword"] = "firstname",	["prop"] = "P735", ["syn"] = 2, },
	["genre"]			= { ["typ"] = "dat",	["need"] = 0, ["keyword"] = "genre", },
	["image"]			= { ["typ"] = "dat",	["need"] = 2,	["image"]	= "description",["prop"] = "P18", },
	["initial"]			= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "initial",	["prop"] = "P735", },
	["itemid"]			= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "QITEM",		["prop"] = "Q16222597", ["syn"] = 2, },
	["label"]			= { ["typ"] = "dat",	["need"] = 0,	["keyword"] = "label" ,		["prop"] = "label", },
	["labelbylang"]		= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "labelbylang",["prop"] = "labelbylang", },
	["labelcontent"]	= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "labelcontent",["prop"] = "labelcontent", },
	["labelpage"]		= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "labelpage",	["prop"] = "labelpage", },
	["labeluser"]		= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "labeluser",	["prop"] = "labeluser", },
	["lastname"]		= { ["typ"] = "dat",	["need"] = 0,	["keyword"] = "lastname",	["prop"] = "P734", },
	["lastname2"]		= { ["typ"] = "dat",	["need"] = 0,	["keyword"] = "lastname",	["prop"] = "P734", ["syn"] = 2, },
	["personlang"]		= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "personlang",	["prop"] = "P1412", },
	["region"]			= { ["typ"] = "dat",	["need"] = 0,	["keyword"] = "region",
		["arg_values"] = "author_region_values", ["key_values"] = "other;china;india;century" }, -- wiki_selectors
	["rights"]			= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "rights",
		["arg_values"] = "author_rights_values", ["key_values"] = "no;none;ONU;none;cn;50;us;70;mpf", -- wiki_selectors
		["delay_values"] = "0;0;0;0;50;50;70;70;95", ["arg_uses"] = "none;none;none;none;cn;cn;us;us;mpf" }, -- wiki_selectors
	["QITEM"]			= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "QITEM",		["prop"] = "QITEM", },
	["title"]			= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "label",		["prop"] = "P735", ["syn"] = 2, },
	["sex"]				= {["keyword"] = "sex", ["typ"] = "dat",	["need"] = 0, ["prop"] = "P21",
		["arg_values"] = "author_author_sex_values",	  ["key_values"] = "male;femelle", }, -- wiki_selectors
	["sitelink"]		= { ["typ"] = "dat",	["need"] = 0,	["keyword"] = "sitelink",	["prop"] = "sitelink", },
	["uri"]				= { ["typ"] = "dat",	["need"] = 2,	["keyword"] = "uri",		["prop"] = "uri", },
	--
	-- All arguments have a keyword parameter identical to the registration name, except synonyms.
	-- Todos los argumentos tienen un parámetro keyword idéntica a la denominación registrada, a menos sinónimos.
	-- Tous les arguments ont un paramètre keyword identique au nom d'enregistrement, sauf les synonymes.
	--
	-- Typical for Module:Author
	["birth"]			= { ["typ"] = "dat", ["need"] = 0,["keyword"] = "birthyear", ["prop"] = "P569", ["format"] = "year", ["syn"] = 2, },
	["birthcentury"]	= { ["typ"] = "dat", ["need"] = 0,["keyword"] = "birthcentury", },
--	birthuncertain["label"]	= {["keyword"] = "birthuncertain", ["typ"] = "dat", ["need"] = 0, },
	["death"]			= { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "deathyear",["prop"] = "P570", ["format"] = "year", ["syn"] = 2, },
	["deathcentury"]	= { ["typ"] = "dat", ["need"] = 0,["keyword"] = "deathcentury", },
--	["deathuncertain"]	= { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "deathuncertain",},
	["distinctions"]	= { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "distinctions",},
	["functions"]		= { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "functions",["prop"] = "P39", },
	["galliname"]		= { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "galliname",},
	["precededby"]		= { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "precededby",["prop"] = "P155", }, -- P155 = précédé par = Frederik de Klerk
	["pseudonym"]		= { ["typ"] = "ctr", ["need"] = 0, ["keyword"] = "pseudonym",},
	["region"]			= { ["typ"] = "dat", ["need"] = 0,["keyword"] = "region",
		["arg_values"] = "author_region_values", key_values = "other,china,india,century" }, -- wiki_selectors
	["sortkey"]			= { ["typ"] = "dat", ["need"] = 2, ["keyword"] = "sortkey",},
	["sortkey2"]		= { ["typ"] = "dat", ["need"] = 2, ["keyword"] = "sortkey",["syn"] = 2, },
	["sortkey_test"]	= { ["typ"] = "sys", ["need"] = 0, ["keyword"] = "sortkey_test",},
	["sortkey_txt"]		= { ["typ"] = "sys", ["need"] = 0, ["keyword"] = "sortkey_txt",},
	["year_epoch"]		= { ["typ"] = "dat", ["need"] = 0, ["keyword"] = "year_epoch",},
	
	--	distinctions["label"]	= {eyword = "distinctions", ["typ"] = "dat", ["need"] = 0, ["prop"] = "P166", },
	--	functions["label"]	= 	{["keyword"] = "functions", ["typ"] = "dat", ["need"] = 0, ["prop"] = "P39", },
	--	occupations["label"]	= {["keyword"] = "occupations", ["typ"] = "dat", ["need"] = 0, ["prop"] = "P106", },
	["language"]		= {["keyword"] = "language", ["typ"] = "dat", ["need"] = 0, ["prop"] = "P103", }, -- native language
	["languages"]		= {["keyword"] = "languages", ["typ"] = "dat", ["need"] = 0, ["prop"] = "P1412", }, -- other languages
--	["nationality"]		= {["keyword"] = "nationality", ["typ"] = "dat", ["need"] = 0, ["prop"] = "P27", }, -- country of citizenship
	["prize"]			= {["keyword"] = "prize", ["typ"] = "dat", ["need"] = 0, },
	["wikipedia"]		= {["keyword"] = "wikipedia", ["typ"] = "dat", ["need"] = 0, },
	["wikiquote"]		= {["keyword"] = "wikiquote", ["typ"] = "dat", ["need"] = 0, },
	["commons"]			= {["keyword"] = "commons", ["typ"] = "dat", ["need"] = 0, },
	["authorities_arg"]	= {["keyword"] = "authorities", ["typ"] = "dat", ["need"] = 0, },
	["indexpages"]		= {["keyword"] = "indexpages", ["typ"] = "dat", ["need"] = 0, }, -- IndexPages
	["doc1key"]			= {["keyword"] = "doc1key" , ["typ"] = "dat", ["need"] = 0, },
	["entityid"]		= {["keyword"] = "entityid" , ["typ"] = "dat", ["need"] = 0, ["prop"] = "entityid"},
	["entityid2"]		= {["keyword"] = "entityid" , ["typ"] = "dat", ["need"] = 0, ["prop"] = "entityid", ["syn"] = 2, },
	["rights"]			= {["keyword"] = "rights", ["typ"] = "dat", ["need"] = 2,
		["arg_values"] = "author_rights_values", key_values = "no,none,ONU,none,cn,50,us,70,mpf", -- wiki_selectors
		["delay_values"] = "0,0,0,0,50,50,70,70,95", arg_uses = "none,none,none,none,cn,cn,us,us,mpf" }, -- wiki_selectors
--	["commonscat"]		= {["keyword"] = "commonscat", ["typ"] = "sys", ["need"] = 0, },
	["namespace"]		= {["keyword"] = "namespace", ["typ"] = "sys", ["need"] = 0, },
	["category"]		= {["keyword"] = "category", ["typ"] = "sys", ["need"] = 0, },
	--
	------------------------------------------------------------
	-- Table des autorités de notoriétés pour auteurs livres et autres
	------------------------------------------------------------
	-- The arguments for authority records are treated separately
	-- Les arguments pour les notices d'autorités sont traités à part
	--
--	Module:Autorité -- indentifiants plus supportés, isDepreciated = true, deprecated = 1,
--	or parentArgs.ARC ARCid ARCitem ARCHIVE ARCorg ARCsub ARCgeo IBL IBLid IBLbook ISBN
--	ISFDB ISFDBid ISFDBtitle ISFDBpub LCCNid LCCNbook LT OCLC OCLC OL WORLDCATID ~= nil

	-- autorities selector defined by argument, see author_authorities_selector
	["authorities_arg"]	= {["keyword"] = "authorities_arg", ["typ"] = "dat", ["need"] = 0, },
	--	https://en.wikipedia.org/wiki/List_of_national_and_state_libraries

	["ARC"]				= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "ARC", base_base = "ARC", base_id = "ARC", not_type = "Author",
		base_test = "7097752", -- Nelson Mandela
		base_name = "National Archives and Records Administration",
		not_link = "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_1", },

	["ARCgeo"]			= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "ARC", base_base = "ARC", base_id = "ARCgeo", not_type = "Geo",
		base_test = "7097752", -- Nelson Mandela
		base_name = "National Archives and Records Administration",
		not_link = "http://arcweb.archives.gov/arc/action/ExecuteRelatedGeographicalSearch?id=REF_1", },

	["ARCid"]			= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "ARCid", base_base = "ARC", base_id = "ARCid", not_type = "Author",
		base_test = "R457-J-44", -- ARCid = "R457-J-44"
		base_name = "National Archives and Records Administration",
		not_link = "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_1", },

	["ARCitem"]			= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "ARCitem", base_base = "ARC", base_id = "ARCitem", not_type = "Book",
		base_test = "7097752", -- Nelson Mandela OK
		base_name = "National Archives and Records Administration",
		not_link = "http://arcweb.archives.gov/arc/action/ExternalIdSearch?id=REF_1", },

	["ARCorg"]			= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "ARCorg", base_base = "ARC", base_id = "ARCorg", not_type = "Org",
		base_test = "7097752", -- Nelson Mandela
		base_name = "National Archives and Records Administration",
		not_link = "http://arcweb.archives.gov/arc/action/ExecuteRelatedOrganizationSearch?id=REF_1", },

	["ARCsub"]			= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "ARCsub", base_base = "ARC", base_id = "ARCsub", not_type = "Subject",
		base_test = "7097752", -- Nelson Mandela
		base_name = "National Archives and Records Administration",
		not_link = "http://arcweb.archives.gov/arc/action/ExecuteRelatedTopicalSubjectsSearch?id=REF_1", },

	["ARCHIVE"]			= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "ARCHIVE", base_base = "ARC", base_id = "ARCHIVE", not_type = "Author",
		base_test = "1234",
		base_name = "National Archives and Records Administration",
		not_link = "http://www.archive.org/details/REF_1", },

	["ARCHIVEbook"]		= {typ = "not", ["need"] = 0,
		keyword = "ARCHIVEbook", base_base = "ARC", base_id = "ARCHIVEbook", not_type = "Book",
		base_test = "lesmisrable03hugouoft", -- Les misérables (Volume 3) - Hugo, Victor, 1802-1885 OK
		base_name = "National Archives and Records Administration",
		not_link = "http://archive.org/details/REF_1", },

	["CANTIC"]			= {typ = "not", ["need"] = 0,
		keyword = "CANTIC", ["prop"] = "P1273", base_base = "CANTIC", base_id = "CANTIC", not_type = "Author",
		base_test = "12972/259446", -- pape Víctor III, 1027-1087
		base_name = "CANTIC", -- Catálogo de autoridades de nombres y títulos de Cataluña
		not_link = "http://cantic.bnc.cat/registres/marc/20692/1/REF_1", },
		-- http://cantic.bnc.cat/registres/fitxa/20692/1/12972/259446

	["CiNii"]			= {typ = "not", ["need"] = 0,
		keyword = "CiNii", ["prop"] = "P1687", base_base = "CiNii", base_id = "CiNii", not_type = "Author",
		base_test = "9000009556470", -- CiNii = ID: 9000009556470 = KIKUYAMA Sakae
		base_name = "Scholarly and Academic Information Navigator", -- Q10726338
		not_link = "http://ci.nii.ac.jp/nrid/REF_1", },

	["DNB"]				= {typ = "not", ["need"] = 0,
		keyword = "DNB", base_base = "DNB", base_id = "DNB", not_type = "Author",
		base_test = "3684200072", -- , DNB = "3684200072"
		base_name = "Bibliothèque nationale allemande", -- Deutsche National Bibliothek
		not_link = "http://d-nb.info/gnd/REF_1", },

	["GKD"]				= {typ = "not", ["need"] = 0,
		keyword = "GKD", base_base = "GKD", base_id = "GKD", not_type = "Author",
		base_test = "71yhjey852", -- , GKD = "71yhjey852"
		base_name = "Bibliothèque nationale allemande",
		not_link = "http://d-nb.info/gnd/REF_1", },

	["GKD_V1"]		 	= {typ = "not", ["need"] = 0,
		keyword = "GKD_V1", base_base = "GKD", base_id = "GKD-V1", not_type = "Author",
		base_test = "71yhjey852",
		base_name = "Bibliothèque nationale allemande",
		not_link = "http://d-nb.info/gnd/REF_1", },

	["GND"]				= {typ = "not", ["need"] = 0,
		keyword = "GND", ["prop"] = "P227", base_base = "GND", base_id = "GND", not_type = "Author",
		base_test = "118573624", -- Tite-Live
		base_name = "GND",
		not_link = "http://d-nb.info/gnd/REF_1", },

	["IA"]				= {typ = "not", ["need"] = 0,
		keyword = "IA", base_base = "IA", base_id = "IA", not_type = "Author",
		base_test = "1234",
		base_name = "Internet Archive",
		not_link = "http://www.archive.org/REF_1", },

	["IBL"]				= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "IBL", base_base = "IBL", base_id = "IBL", not_type = "Author",
		base_test = "1234",
		base_name = "Internet Book List", -- Pas de page fr, en redirige vers Base de données bibliographiques
		not_link = "http://www.iblist.com/authorREF_1.html", },

	["IBLbook"]			= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "IBLbook", base_base = "IBL", base_id = "IBLbook", not_type = "Book",
		base_test = "1234",
		base_name = "Internet Book List", -- Pas de page fr, en redirige vers Base de données bibliographiques
		not_link = "http://www.iblist.com/bookREF_1.html", },

	["IBLid"]			= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "IBLid", base_base = "IBL", base_id = "IBLid", not_type = "Author",
		base_test = "37581257954", -- , IBLid = "37581257954"
		base_name = "Internet Book List", -- Pas de page fr, en redirige vers Base de données bibliographiques
		not_link = "http://www.iblist.com/authorREF_1.html", },

	["IMDb"]			= {typ = "not", ["need"] = 0,
		keyword = "IMDb", base_base = "IMDb", base_id = "IMDb", not_type = "Author",
		base_test = "0002776", -- Johnny Hallyday
		base_name = "Internet Movie Data base",
		not_link = "http://www.imdb.com/name/nmREF_1/", },

	["ISBN"]			= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "ISBN", base_base = "ISBN", base_id = "ISBN", not_type = "Book",
		base_test = "2-7073-0549-9", -- L'apartheid, de Nelson Mandela
		base_name = "International Standard Book Number", },

	["ISFDB"]			= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "ISFDB", base_base = "ISFDB", base_id = "ISFDB", not_type = "Author",
		base_test = "1234",
		base_name = "Internet Speculative Fiction Database",
		not_link = "http://www.isfdb.org/cgi-bin/ea.cgi?REF_1", },

	["ISFDBid"]			= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "ISFDBid", base_base = "ISFDB", base_id = "ISFDBid", not_type = "Author",
		base_test = "1234",
		base_name = "Internet Speculative Fiction Database",
		not_link = "http://www.isfdb.org/cgi-bin/ea.cgi?REF_1", },

	["ISFDBpub"]		= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "ISFDBpub", base_base = "ISFDB", base_id = "ISFDBpub", not_type = "Book",
		base_test = "1234",
		base_name = "Internet Speculative Fiction Database",
		not_link = "http://www.isfdb.org/cgi-bin/pl.cgi?REF_1", },

	["ISFDBtitle"]		= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "ISFDBtitle", base_base = "ISFDB", base_id = "ISFDBtitle", not_type = "Book",
		base_test = "1234",
		base_name = "Internet Speculative Fiction Database",
		not_link = "http://www.isfdb.org/cgi-bin/title.cgi?REF_1", },

	["ISNI"]			= {typ = "not", ["need"] = 0,
		keyword = "ISNI", ["prop"] = "P213", base_base = "ISNI", base_id = "ISNI", not_type = "Author",
		base_test = "0000 0001 2144 7715",
		base_name = "International Standard Name Identifier",
		not_link = "http://isni-url.oclc.nl/isni/REF_1", },
--		not_link = "http://isni.oclc.nl/DB=1.2/SET=10/TTL=1/CMD?ACT=SRCHA&IKT=8006&SRT=&TRM=REF_1", },
--		http://isni-url.oclc.nl/isni/0000000122834055

	["LCCN"]			= {typ = "not", ["need"] = 0,
		keyword = "LCCN", ["prop"] = "P244", base_base = "LCCN", base_id = "LCCN", not_type = "Author",
		base_test = "n82212654", -- LCCN = n82212654 = Johnny Hallyday
		base_name = "Numéro de contrôle de la Bibliothèque du Congrès",
		not_link = "http://id.loc.gov/authorities/names/REF_1" },

	["NDL"]				= {typ = "not", ["need"] = 0,
		keyword = "NDL", base_base = "NDL", base_id = "NDL", not_type = "Author",
		base_name = "Neue deutsche literatur",
		keyword = "NDL", ["prop"] = "P349", },

	["NKC"]				= {typ = "not", ["need"] = 0,
		keyword = "NKC", base_base = "NKC", base_id = "NKC", not_type = "Author",
		base_name = "National Library of the Czech Republic",
		keyword = "NKC", ["prop"] = "P691", },

	["NLA"]				= {typ = "not", ["need"] = 0,
		keyword = "NLA", base_base = "NLA", base_id = "NLA", not_type = "Author",
		base_test = "35096649", -- NLA = 35096649 = Alain Fournier
		base_name = "Online Computer Library Center", -- National Language Promotion Department of Pakistan, Urdu is the national language of Pakistan
		not_link ="http://www.worldcat.org/oclc/REF_1", },

	["OCLC"]			= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "OCLC", base_base = "OCLC", base_id = "OCLC", not_type = "Author",
		base_test = "1234",
		base_name = "Online Computer Library Center",
		not_link ="http://www.worldcat.org/oclc/REF_1", },

	["OL"]				= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "OL", base_base = "OL", base_id = "OL", not_type = "Author",
		base_test = "1234",
		base_name = "Open Library",
		not_link ="http://www.worldcat.org/oclc/REF_1", },

	["OLbook"]			= {typ = "not", ["need"] = 0,
		keyword = "OLbook", base_base = "OL", base_id = "OLbook", not_type = "Book",
		base_test = "2707305499", -- L'apartheid, de Nelson Mandela
		base_name = "Open Library",
		not_link ="http://openlibrary.org/search?wtitle=&wauthor=&wtopic=&wisbn=REF_1&wpublisher=&wdescription=&ftokens=&_save=Chercher", },

	["PND"]				= {typ = "not", ["need"] = 0,
		keyword = "PND", base_base = "PND", base_id = "PND", not_type = "Author",
		base_test = "11850133X", -- PND = 11850133X = Alain Fournier
		base_name = "Personennamendatei",
		not_link ="http://d-nb.info/gnd/REF_1", },

	["SELIBR"]			= 	{typ = "not", ["need"] = 0,
		keyword = "SELIBR", base_base = "SELIBR", base_id = "SELIBR", not_type = "Author",
		base_test = "74042",
		base_name = "Bibliothèque royale (Suède)", -- "National Library of Sweden" "Personennamendatei",
		not_link ="http://libris.kb.se/auth/REF_1", },

	["SUDOC"]			= {typ = "not", ["need"] = 0,
		keyword = "SUDOC", base_base = "SUDOC", base_id = "SUDOC", not_type = "Author",
		base_test = "1234",
		base_name = "Système universitaire de documentation",
		not_link ="http://www.idref.fr/REF_1", },

	["SWD"]				= {typ = "not", ["need"] = 0,
		keyword = "SWD", base_base = "SWD", base_id = "SWD", not_type = "Author",
		base_test = "1234", -- debug text : de : Subject Headings Authority File, base allemande nom anglais
		base_name = "Schlagwortnormdatei",
		not_link ="http://d-nb.info/gnd/REF_1", },

	["ULAN"]			= {typ = "not", ["need"] = 0,
		keyword = "ULAN", base_base = "ULAN", base_id = "ULAN", not_type = "Author",
		base_test = "500198443",
		base_name = "Union List of Artist Names",
		not_link ="http://www.getty.edu/vow/ULANFullDisplay?find=&role=&nation=&subjectid=REF_1", },

	["VIAF"]			= {typ = "not", ["need"] = 0,
		keyword = "VIAF", ["prop"] = "P214", base_base = "VIAF", base_id = "VIAF", not_type = "Author",
		base_test = "34452139", -- VIAF = 34452139 = Alain Fournier -- VIAF = 7396281 = Arthur Rimbaud
		base_name = "Fichier d'autorité international virtuel",
		not_link ="http://viaf.org/viaf/REF_1", },

	["WORLDCAT"]		= 	{typ = "not", ["need"] = 0,
		keyword = "WORLDCAT", base_base = "WORLDCAT", base_id = "WORLDCAT", not_type = "",
		base_test = "35096649", --	Happy Gilmore OK
		base_name = "WorldCat", -- = http://www.worldcat.org/identities/lccn-n50-23101
		not_link ="http://www.worldcat.org/search?qt=worldcat_org_all&q=REF_1", },
		-- https://www.worldcat.org/identities/lccn-n79-015690/	   Livy = Tite-Live

	["WORLDCATbook"]	= {typ = "not", ["need"] = 0,
		keyword = "WORLDCATbook", base_base = "WORLDCAT", base_id = "WORLDCATbook", not_type = "Book",
		base_test = "2707305499", -- L'apartheid, de Nelson Mandela
		base_name = "WorldCat",
		not_link ="http://worldcat.org/search?q=REF_1&qt=owc_search", },

	["WORLDCATch"]		= {typ = "not", ["need"] = 0,
		keyword = "WORLDCATch", base_base = "WORLDCAT",base_id = "WORLDCATch", not_type = "",
		base_test = "35096649", -- William J. Clinton OK
		base_name = "WorldCat",
		not_link ="http://www.worldcat.org/search?q=REF_1&qt=owc_search", },

	["WORLDCATid"]		= {typ = "not", ["need"] = 0, deprecated = 1,
		keyword = "WORLDCATid", base_base = "WORLDCAT", base_id = "WORLDCATid", not_type = "Author",
		base_test = "lccn-n50-23101", -- Alain-Fournier 1886-1914 OK
		base_name = "WorldCat",
		not_link ="http://www.worldcat.org/identities/REF_1", },

} -- p.args_known

function p.list_all_args(t, args_known) -- list_all_args_title = List of all arguments
	local t = t or "<br>* <b>List_all_args :</b> "
	if type(args_known) ~= "table" then args_known = modes.args_known end
	local descr, description = "", ""
	local args = mw.clone(args_known)
	local arglst = {}
	for key, elem in pairs(args) do
		elem.key = tostring(key)
		descr = key .. "_descr" -- key for description of an argument
		elem.description = langs.user_translations[descr] or "**missing translation**"
		elem.user_lang_key = langs.user_translations[elem.key] or "**missing translation**"
		elem.user_lang_keyword = langs.user_translations[elem.keyword] or "**missing translation**"
		table.insert(arglst, elem)
	end -- insert in the arguments their own key
	table.sort(arglst, function (a, b) return (a.user_lang_key < b.user_lang_key) end ) -- alphabetic sort of translated arguments
	local gr_sys, gr_need, gr_other, gr_authority = {}, {}, {}, {}
	for i, elem in ipairs(arglst) do -- group arguments in some groups
		if elem.need == 1 or elem.need == 2 then table.insert(gr_need, elem)
		elseif elem.typ == "sys" then table.insert(gr_sys, elem)
		elseif elem.base_base then table.insert(gr_authority, elem)
		else table.insert(gr_other, elem) end
	end
	local needed = modes.smallCapsStyle(viewers.form9user("author_needed_to_verify"))
	local function list_group( group, needed )
		needed = needed or ""
		local t = ""
		for key, elem in pairs(group) do
			if elem.syn
			then t = t .. "<br>* <b>" .. tostring(elem.user_lang_key) .. "</b> => <b>" .. elem.user_lang_keyword .. "</b> : " .. needed .. " " .. tostring(elem.description) -- .. elem.lev_arg_txt
			else t = t .. "<br>* <b>" .. tostring(elem.user_lang_key) .. "</b> : " .. needed .. " " .. tostring(elem.description) end
		end
		return t
	end
	t = t .. "<br><br>* <b>" .. viewers.form9user("author_list_needed_arguments") .. "</b> " .. list_group( gr_need, needed )
	t = t .. "<br><br>* <b>" .. viewers.form9user("author_list_all_other_arguments") .. "</b> " .. list_group( gr_other )
	t = t .. "<br><br>* <b>" .. viewers.form9user("author_list_all_authorities") .. "</b> " .. list_group( gr_authority )
	t = t .. "<br><br>* <b>" .. viewers.form9user("author_list_all_system_arguments") .. "</b> " .. list_group( gr_sys )
	return t
end -- function p.list_all_args(t, args_known) -- list_all_args_title

function p.list_all_args_main(t, args_known) -- tools_list_all_args_title = List of all arguments for main
	local t = t or "<br>* <b>List_all_args :</b> "
	if type(args_known) ~= "table" then args_known = modes.args_known end
	local descr, description = "", ""
	local args = mw.clone(args_known)
	local arglst = {}
	for key, elem in pairs(args) do
		elem.key = tostring(key)
		descr = key .. "_descr" -- key for description of an argument
		elem.description = langs.user_translations[descr] or "**missing translation**"
		elem.user_lang_key = langs.user_translations[elem.key] or "**missing translation**"
		elem.user_lang_keyword = langs.user_translations[elem.keyword] or "**missing translation**"
		table.insert(arglst, elem)
	end -- insert in the arguments their own key
	table.sort(arglst, function (a, b) return (a.user_lang_key < b.user_lang_key) end ) -- alphabetic sort of translated arguments
	local gr_sys, gr_config, gr_need, gr_other, gr_authority = {}, {}, {}, {}, {}
	for i, elem in ipairs(arglst) do -- group arguments in some groups
		if elem.need == 1 or elem.need == 2 then table.insert(gr_need, elem)
		elseif elem.typ == "sys" then table.insert(gr_sys, elem)
		elseif elem.typ == "config" then table.insert(gr_config, elem)
		elseif elem.base_base then table.insert(gr_authority, elem)
		else table.insert(gr_other, elem) end
	end
	local needed = modes.smallCapsStyle(viewers.form9user("tools_needed_to_verify"))
	local function list_group( group, needed )
		needed = needed or ""
		local t = ""
		for key, elem in pairs(group or {}) do
			if elem.syn
			then t = t .. "<br>* <b>" .. tostring(elem.user_lang_key) .. "</b> => <b>" .. elem.user_lang_keyword .. "</b> : " .. needed .. " " .. tostring(elem.description) -- .. elem.lev_arg_txt
			else t = t .. "<br>* <b>" .. tostring(elem.user_lang_key) .. "</b> : " .. needed .. " " .. tostring(elem.description) end
		end
		return t
	end
	t = t .. "<br><br>* <b>" .. viewers.form9user("tools_list_needed_args") .. "</b> " .. list_group( gr_need, needed )
	t = t .. "<br><br>* <b>" .. viewers.form9user("tools_list_all_other_args") .. "</b> " .. list_group( gr_other )
	t = t .. "<br><br>* <b>" .. viewers.form9user("author_list_all_authorities") .. "</b> " .. list_group( gr_authority )
	t = t .. "<br><br>* <b>" .. viewers.form9user("list_all_config_arguments") .. "</b> " .. list_group( gr_config )
	t = t .. "<br><br>* <b>" .. viewers.form9user("author_list_all_system_arguments") .. "</b> " .. list_group( gr_sys )
	return t
end -- function p.list_all_args_main(t, args_known) -- tools_list_all_args_title for main

------------------------------------------------------------
-- Manage options. Administrar opciones. Gérer les options.
------------------------------------------------------------

-- local catView = "" -- = ":" to display a category to document it rather than truly categorize

--	Options de maîtrise du fonctionnement de ce module
modes.invoke_options = " " -- options normales venant du modèle, normal options from template
--	options= en es fr params docview docmin docmax docdef docapres docline
--	local modes.mode_options = " " -- pas d'options de debug du module par edit
modes.mode_options = " " -- options de debug du module par edit
	-- " unitest debug erron params docview no-box nocat docmin docmax docnotice docdef docline notices track "

datas.args_wikidata = nil -- Table of the first complete import from wikidata
modes.args_selected = nil -- Table of imported arguments from wikidata after any selection
p.max_nearest_argument = 3 -- Limit of differences of arguments proposed to the user

------------------------------------------------------------
-- Petites fonctions utilitaires. Miscellaneous functions
------------------------------------------------------------

local function isDef(x) -- x is defined. x est défini
	return (type(x) == "string") and (x ~= "") and (x ~= " ") and (x ~= "nil")
end -- function isDef(x)

function wordstotable(txt, opt) -- convertit un texte en table de mots
	local t = ""
	local tab = {}
	local function inserer(ti)
		if ti ~= "" then table.insert(tab, ti.."") end
	end
	local xyz = string.gsub( txt, "(%S*%-*%S*)", inserer ) -- "(%w*%-*%'*%w*)", "(%S*%-*%S*)"
	for key, val in pairs(tab) do -- Pour tous les mots
		t = t .. " ( " .. tostring(key) .. " = " .. tostring(val) .. " ) "
	end
	t = "\n* wordstotable txt = " .. tostring(xyz) .. " " .. t
	return tab, t, opt
end -- function p.wordstotable(txt, opt)

------------------------------------------------------------
-- Données de wikidata par mw.wikibase
------------------------------------------------------------
-- {{authority control|TYP=p|GND=118620126|LCCN=n/50/66831|NDL=01229737|VIAF=95160848}}
-- http://www.mediawiki.org/wiki/Extension:WikibaseClient/Lua
-- https://www.wikidata.org/wiki/Wikidata:List_of_properties/all
-- https://www.wikidata.org/wiki/Wikidata:List_of_properties/Person
-- https://www.wikidata.org/wiki/Wikidata:List_of_properties/Works/fr
-- http://www.wikidata.org/wiki/Wikidata:Project_chat#Getting_a_subset_of_claims_for_an_entity
-- The prop=claims API query retrieves ALL the claims stored for an entity.
-- {{Autorité}}
------------------------------------------------------------

------------------------------------------------------------
-- Manage and generate autority notices and scans
-- Gérer et générer les notices d'autorité et les scans
------------------------------------------------------------

function p.subst_string(input, find, replace)
	local L = string.len(find)
	local res = ""
	--	if (type(L) ~= "number") or (L == 0) then return "" end
	if L == 0 then return "" end
	local i = string.find(input, find)
	if i and (i > 0) then
		res = string.sub(input, 1, i-1) .. replace .. string.sub(input, i+L, -1)
	else return input end
	return res
end -- function p.subst_string(input, find, replace)

function p.split_by_char(input, split)
	if type(input) ~= "string" then return end
	if type(split) ~= "string" then return end
	local i, j, k, char, str, tbl = 0, 0, 0, "", "", {}
	local len = string.len(input)
	for i = 1, len do -- pour tous les caracteres de input
		char = string.sub(input, i, i)
		if char == split then -- a chaque coupure, stocker une partie en table
			k = k+1
			table.insert(tbl, str) -- tostring(k).."-"..
			j = 0
			str = ""
		else
			j = j+1
			str = str .. char
		end
	end
	k = k+1
	table.insert(tbl, str) -- tostring(k).."-"..
	return tbl
end -- function p.split_by_char(input, split)

function p.split_by_char_test()
	local t = "\n* Test '''split_by_char''' : "
	local test = { "debut", "un/deux", "1/23/4567", "abc//def", "/start/next/stop/", "fin", }
	local max = table.maxn(test)
	for N, str in ipairs( test) do
		tbl = p.split_by_char(str, "/")
		t = t .. viewers.ta(str, table.concat(tbl, " , "))
	end -- tostring(N).."*"..refN
	return t
end -- function p.split_by_char_test()

function p.str_subst(txt, find, repl) -- in txt, replace find by repl
	-- Replace string.gsub( because :
	-- Erreur Lua dans Module:Author invalid capture index, in res = string.gsub(res, "REF_1", tostring(v1) )
	txt = tostring(txt)
	local i = string.find(txt, find)
	if i and (i > 1) then
		txt = string.sub(txt, 1, i-1) .. tostring(repl) .. string.sub(txt, i + string.len(find), -1)
	end
	return txt
end -- function p.str_subst(txt, find, repl)

function p.str_REF(wt_ref, v1, v2, v3)
	-- replace REF_1 to REF_3 by v1 to v3 in the translation of wt_ref, else in wt_ref
	wt_ref = tostring(wt_ref)
	local res = ""
	if langs.content_translations and langs.content_translations[wt_ref]
		then res = langs.content_translations[wt_ref] -- Utiliser wt_ref comme la reference d'un texte à traduire.
		else res = wt_ref end -- Avant init de langs.content_translations utiliser wt_ref comme le texte lui-même
	if type(res) ~= "string" then res = wt_ref end -- Sinon utiliser wt_ref comme le texte lui-même.
	if v1 then res = p.str_subst(res, "REF_1", tostring(v1) ) end
	if v2 then res = p.str_subst(res, "REF_2", tostring(v2) ) end
	if v3 then res = p.str_subst(res, "REF_3", tostring(v3) ) end
	return res
end -- function p.str_REF(wt_ref, v1, v2, v3)

-- Select authorities depending on the user language
function p.authorities_select(author_authorities_selector, args_wikidata, args_template, args_import, args_known)
	--	local args_selected, selected_autorities, authorities_from_args, x = p.authorities_select(author_authorities_selector, args_wikidata, args_template, args_import, args_known)
	-- The authorities notices selector come from the call, else from the "authorities" template argument, else from the user language or from the wiki language author_authorities_selector.
	if type(args_wikidata) ~= "table" then args_wikidata = datas.args_wikidata end
	if type(args_wikidata) ~= "table" then args_wikidata = {} end
	if type(args_import) ~= "table" then args_import = modes.args_import or modes.args_final end
	if type(args_known) ~= "table" then args_known = modes.args_known or p.args_known end
	if type(args_template) ~= "table" then
		args_template = {}
		for key, argm in pairs(args_known) do
			if type(argm) == "table" and (argm.src == "args") then
				args_template[key] = args_import[key]
			end
		end
	end
	author_authorities_selector = author_authorities_selector or modes.args_import.authorities_arg
	or langs.content_translations.author_authorities_selector or "6, VIAF, BNF, SUDOC, LCCN, ISNI, WORDCAT, NLA, PND, GKD, ARC" -- wiki_selectors
	local authorities_from_data = {} -- selected autorities from wikidata
	local authorities_from_args = {} -- selected authority arguments defined by the template.
	local other_from_data = {} -- selected others from wikidata
	local other_from_args = {} -- Select arguments other than authorities.
	local selected_autorities = {} -- selected authorities.
	--
	for key, argm in pairs(args_known) do
		if type(argm) == "table" and (argm.typ == "not") then
			if (argm.src == "args")
			then authorities_from_args[key] = args_template[key]
			else authorities_from_data[key] = args_wikidata[key] end
		else
			if (argm.src == "args")
			then other_from_args[key] = args_template[key]
			else other_from_data[key] = args_wikidata[key] end
		end
	end
	local k, Nsel, N, maxi, pos = 0, 0, 1, 999, nil
	local selectors = mw.text.split(author_authorities_selector, ",", true)
	local reject_wikidata = false
	for i, authority in ipairs(selectors) do -- select authorities only following selectors
		if Nsel >= maxi then break end
		authority = mw.text.trim(authority)
		N = tonumber(authority)
		if authority == "+" then -- select all authorities from wikidata
			if type(args_known) == "table" and type(args_wikidata) == "table" then
				for key, val in pairs(args_wikidata) do
					if args_known[key] and (args_known[key].typ == "not") then
						Nsel = Nsel + 1
						selected_autorities[key] = val
					end
				end
			end
		elseif authority == "-" then -- minus sign rejects all
			reject_wikidata = true
		elseif N and N < 1 then -- minus sign rejects all
			reject_wikidata = true
		elseif N and (string.sub(authority, 1, 1) == "+") then -- select +N more authorities in nexts authorities
			maxi = Nsel + N
		elseif N then -- select N maximum total authorities with next authorities
			maxi = N
		else -- select real authorities from selectors and wikidata ( not - or + or +N or N )
			if args_wikidata[authority] then
				selected_autorities[authority] = args_wikidata[authority]
				Nsel = Nsel + 1
			end
		end
	end
	-- reject all authorities arguments from wikidata, if one authority = "-".
	if reject_wikidata then selected_autorities = {} end
	local args_selected = {} -- mw.clone(authorities_from_data) -- arguments cleaned, without rejected autorities
	for key, val in pairs(other_from_data) do args_selected[key] = val end -- args_import arguments without any authorities.
	for key, val in pairs(args_template) do args_selected[key] = val end -- args_import arguments without any authorities.
	for key, val in pairs(selected_autorities) do args_selected[key] = val end -- args_selected with selected authorities.
--	notices authorities_select always if modes.args_import.src == "arg" also in test1 select
	return args_selected, selected_autorities, authorities_from_args, t
--	modes.args_import, modes.args_selected, t = p.authorities_select()
end -- function p.authorities_select(author_authorities_selector, args_wikidata, args_import, args_known)

function p.authorities_select_test1(t, author_authorities_selector, args_wikidata, args_template, args_known)
--	local args_selected = mw.clone(authorities_from_args) -- selected autorities arguments, plus ...
--	function p.authorities_select(author_authorities_selector, args_wikidata, args_template, args_import, args_known)
	if type(args_wikidata) ~= "table" then args_wikidata = datas.args_wikidata end
	if type(args_wikidata) ~= "table" then args_wikidata = {} end
	if type(args_import) ~= "table" then args_import = modes.args_import end
	if type(args_known) ~= "table" then args_known = modes.args_known end
	if type(args_template) ~= "table" then
		args_template = {}
		for key, argm in pairs(args_known) do
			if type(argm) == "table" and (argm.src == "args") then
				args_template[key] = args_import[key]
			end
		end
	end
	author_authorities_selector = author_authorities_selector or modes.args_import.authorities_arg
	or langs.content_translations.author_authorities_selector or "6, VIAF, BNF, SUDOC, LCCN, ISNI, WORDCAT, NLA, PND, GKD, ARC" -- wiki_selectors
	local args_selected, selected_autorities, authorities_from_args, x = p.authorities_select(author_authorities_selector, args_wikidata, args_template)
	local wd, ta, ts, cln = " ", " ", " ", " "
	for key, val in pairs(args_wikidata) do wd = wd .. " " .. key .. ", " end
	for key, val in pairs(args_template) do ta = ta .. " " .. key .. ", " end
	for key, val in pairs(selected_autorities) do ts = ts .. " " .. key .. ", " end
	for key, val in pairs(args_selected) do cln = cln .. " " .. key .. ", " end
	t = (t or "") .. viewers.table_row() .. viewers.table_dat(wd) .. viewers.table_dat(author_authorities_selector) .. viewers.table_dat(ta) .. viewers.table_dat(cln)
--	It easy replaces: table_head, table_row, table_col, table_dat and table_end.
	return t, args_selected, selected_autorities, authorities_from_args
end -- function p.authorities_select_test1(t, author_authorities_selector, args_wikidata, args_template)

function p.list_selected_authorities(t)
	local wd = modes.tab_fields(datas.args_wikidata)
	local ta = modes.tab_fields(p.args_template)
	local ts = modes.tab_fields(p.selected_autorities)
	local cln = modes.tab_fields(modes.args_selected)
	t = "\n* " .. (t or " '''Selected authorities: Autorités sélectionnées''' : ")
	t = t .. viewers.table_row() .. viewers.table_dat("Arguments de Wikidata") .. viewers.table_dat("Sélecteur") .. viewers.table_dat("Arguments du modèle" ) .. viewers.table_dat("Arguments sélectionnés")
	t = p.authorities_select_test1(t, p.author_authorities_selector, datas.args_wikidata, modes.args_template)
	t = t .. viewers.table_end()
	return t -- , modes.args_selected, p.selected_autorities, p.authorities_from_args
end -- function p.list_selected_authorities(t)

function p.authorities_select_test(t)
	local select = "3, VIAF, BNF, SUDOC, LCCN, ISNI"
	--	   sur fr, sont indispensables : VIAF, BNF, SUDOC + LCCN (référence internationale) + ISNI et Worldcat... les autres, seulement en cas de manque dans les autorités "de base"... Clin d'œil
	t = (t or "") .. "\n* '''authorities_select''' : "
	t = t .. "\n* Le premier test porte sur le cas de l'auteur actuel. "
	t = t .. "\n* Attention : Nommer les autorités comme leur variable et non comme leur traduction. Exemple : WORLDCAT et non Worldcat."
	t = t .. "\n* Les autorités définies par des arguments du modèle sont toujours sélectionnées."
	t = t .. "\n* Exemple de " .. viewers.ta( "sélecteur", select )
	t = t .. "\n:: Sélectionner seulement les 3 premières autorités du sélecteur, parmi celles venant de wikidata. "
	t = t .. "\n* Autre exemple : sélecteur = '''+''' "
	t = t .. "\n:: Sélectionner toutes les autorités de wikidata. "
	t = t .. "\n* Autre exemple : sélecteur = '''-''' "
	t = t .. "\n:: Supprimer toutes les autorités de wikidata. Prioritaire sur '''+'''. "
	t = t .. "\n* Autre exemple : sélecteur = '''BNF, WORLDCAT, +2, VIAF, LCCN, 3, GKD''' "
	t = t .. "\n:: Sélectionner les premières, puis 2 de plus parmi les suivantes, puis 3 en tout au maximum, puis GKD si possible. "
	t = t .. "\n:: Dès qu'un nombre limité d'autorités est atteint, la sélection s'arrète. "
	t = t .. "\n:: Si un sélecteur '''+''' ou '''-''' est parmi d'autres il n'est exécuté qu'à son tour. "
--	t = t .. viewers.table_row() .. viewers.table_dat("Arguments de Wikidata") .. viewers.table_dat("Sélecteur") .. viewers.table_dat("Arguments du modèle" ) .. viewers.table_dat("Arguments sélectionnés") --	 .. modes.message_color(" ''' + arguments''' ")
	local head = mw.text.split( viewers.form9user("authorities_select_test_header") , ',')
	t = t .. viewers.table_row() .. viewers.table_col(head[1]) .. viewers.table_col(head[2]) .. viewers.table_col(head[3]) .. viewers.table_col(head[4])
	if modes.args_final and modes.args_final.authorities then
		t = p.authorities_select_test1( t, modes.args_final.authorities, modes.args_import )
	end
	-- function p.authorities_select(author_authorities_selector, args_wikidata, args_final, args_known)
	t = p.authorities_select_test1( t, "LCCN, ISNI, Worldcat", { WORLDCAT=1, GKD=1, LCCN=1,}, { VIAF=1, } )
	t = p.authorities_select_test1( t, select, { NLA=1, GKD=1, GKD=1, label=1, sitelink=1,}, {} )
	t = p.authorities_select_test1( t, select, { VIAF=1, BNF=1, SUDOC=1, LCCN=1, familyname=1, label=1,}, {} )
	t = p.authorities_select_test1( t, select, { VIAF=1, NLA=1, GKD=1, BNF=1, sitelink=1, familyname=1,}, { SWD=1, ULAN=1, epoch=1, mode="test", } )
	t = p.authorities_select_test1( t, select, { SUDOC=1, BNF=1, GKD=1, GKD=1, familyname=1, familyname=1,}, {} )
	t = p.authorities_select_test1( t, select, { VIAF=1, label=1, GKD=1, WORLDCAT=1, familyname=1, sitelink=1,}, { label=1, } )
	t = p.authorities_select_test1( t, "+", { VIAF=1, label=1, GKD=1, VIAF=1, familyname=1, sitelink=1,}, {} )
	t = p.authorities_select_test1( t, "LCCN, +, ISNI", { VIAF=1, label=1, GKD=1, LCCN=1, ISNI=1, BNF=1,}, {} )
	t = p.authorities_select_test1( t, "LCCN, -, +", { VIAF=1, label=1, LCCN=1, label=1,}, {} )
	t = p.authorities_select_test1( t, "LCCN, 0, +", { VIAF=1, label=1, LCCN=1, label=1,}, {} )
	t = p.authorities_select_test1( t, "LCCN, -2, +", { VIAF=1, label=1, LCCN=1, label=1,}, {} )
	t = p.authorities_select_test1( t, "VIAF, +2, SUDOC, LCCN", { VIAF=1, GKD=1, LCCN=1, ISNI=1, BNF=1,}, { ISNI, Worldcat, } )
	t = p.authorities_select_test1( t, "BNF, +4, VIAF, 3, GKD", { NLA=1, VIAF=1, GKD=1, LCCN=1, ISNI=1, BNF=1,}, {} )
	t = p.authorities_select_test1( t, "BNF, -, VIAF, 3, LCCN", { NLA=1, VIAF=1, LCCN=1, ISNI=1, BNF=1,}, { ULAN=1, title="Li", } )
	t = t .. viewers.table_end()
	return t
end -- function p.authorities_select_test( res, args_final)

function p.HTMLnotice(ref, noticeN, tag) -- Générer le wikitexte d'une notice
	-- exemple : notice("cb11888266r", noticeN)
	--	ARCitem = {base_base = "ARC", base_id = "ARCitem",	_space = "", base_test = "1234", not_type = "Book", ...
	if type(noticeN) ~= "table" then return "" end
	local base_id = noticeN.base_id
	local base_doc = noticeN.base_name
	local base_link = noticeN.not_link
	if type(base_id) ~= "string" then return "" end
	if type(noticeN.not_link) ~= "string" then return "" end
	if type(ref) ~= "string" or ref == "" then return "" end -- relire : declarer une erreur err_notice_missing_ref
	-- ne garder que le première reference si references multiples (voir Johnny Hallyday)
	-- Keep only the fisrt reference in case of multiple references (see Johnny Hallyday)
	local i = string.find( ref, ",")
	if i and (i > 1) then ref = string.sub(ref, 1, i-1) end
	-- = mw.text.trim( s, charset ) -- charset = "%t%r%n%f ". %s: represents all characters with General Category "Separator", plus tab, linefeed, carriage return, vertical tab, and form feed.
	local ref_link = string.gsub(ref, "%s", "") -- espace = space = %20
	local ref_link = mw.uri.encode(ref_link, "PATH") -- espace = space = %20
	local autority_alt_text = base_id .. " : " .. ref
	local wikipedia_name = noticeN.base_name
	local wikipedia_name_link = mw.uri.encode(wikipedia_name, "PATH") -- espace == %20
	local wikipedia_base_link = 'http://fr.wikipedia.org/wiki/' .. wikipedia_name_link
	local authority_icon_link = noticeN.not_link
	local res = ""
	-- REF_1 = reference en un seul identifiant comme "cb11888266r"
	-- REF_1/REF_2 = reference en 2 parties comme "...worldcat_org_all&q=REF_1+REF_2"
	-- REF_1/REF_2/REF_3 = reference en 3 parties comme "http://id.loc.gov/.../REF_1REF_2REF_3"
	local v = mw.text.split(ref_link, "/", true) -- nobug
	-- LCCNid : allonger à 6 chiffres, avec des 0 à gauche, la partie 3 de "n/50/23101", soit 023101.
	--	v[3] = string.sub( "000001234" .. tostring(v[3]), -8, -1 ) --	-6, -1 )
	local authority_icon_link = p.str_REF(authority_icon_link, v[1], v[2], v[3])
	--
	local img = 'Farm-Fresh draw calligraphic.png'
	if noticeN.not_type == "Book" then img = 'Nuvola_apps_bookcase_2.svg' end
	-- exemple : res = '<span style="margin-left:10px;" > &nbsp; * &nbsp; [' .. wikipedia_base_link .. ' ' .. base_id .. '] : [[File:' .. img .. '|22px|link=' .. authority_icon_link .. '|' .. autority_alt_text .. ']]</span>'
	if tag == "div" then -- align-self:flex-end; width=100%;
		res = '<div style=" align-self:center; " > <span style=" text-wrap:none; margin-left:10px; " > [' .. wikipedia_base_link .. ' ' .. base_id .. ']&nbsp;[[File:' .. img .. '|22px|link=' .. authority_icon_link .. '|' .. autority_alt_text .. ']]&nbsp; </span> </div>'
	else --
--		res = '<span style="color:#aaaa66;">•</span>[' .. authority_icon_link .. ' ' .. base_id .. '<small style="color:#0645ad;"> ' .. ref_link .. '</small>] '
		res = '&nbsp; [' .. authority_icon_link .. ' ' .. base_id .. '<small style="color:#0645ad;"> &nbsp; [[w:' .. base_doc .. '|*]]</small>] &nbsp; '
	end
	return res
end -- function p.HTMLnotice(ref, noticeN, tag)

--[[ example of autority notice definition
	BNF["label"]		= {
		typ = "not", ["need"] = 0,
		keyword = "BNF", ["prop"] = "P268", base_base = "BNF", base_id = "BNF", not_type = "Author",
		base_test = "119067514", -- BNF = 11888266 = Alain Fournier
		base_name = "Bibliothèque nationale de France",
		not_link = "http://catalogue.bnf.fr/ark:/12148/cbREF_1",
	},
--]]

-- Tester toutes les notices d'autorités indépendantes sur une personne, un livre ou autre.
-- Generate all know notices ARCid DNB GKD IBLid ...
function p.authorities_notices_test( res, args_known) -- 11 mars 15
	local args_known = args_known or modes.args_known or p.args_known or {} -- optional value from p.args_known = {...}
--	res = res or '\n\n* Test all know authority notices, some are deprecated (in grey): \n\n* '
	res = res or ('\n\n* ' .. viewers.form9user("author_authorities_notices_test_deprec") .. ': \n\n* ')
	local i, ntc, t = 1, "", ""
	for key, noticeN in pairs(args_known) do -- Pour toutes les notices connus
		t = p.HTMLnotice(noticeN.base_test, noticeN)
		if noticeN.deprecated == 1 then
			t = ' <span style=" background-color:#D0D0D0; "><small>(' .. t .. ')</small></span> '
		end
		res = res .. t
	end
	return res
end -- function p.authorities_notices_test( res, args_known)

-- Générer des notices d'autorités indépendantes sur une personne, un livre ou autre.
function p.form_notices(args_known, args_selected, tag)
	-- Generate notices ARCid DNB GKD IBLid ...
	local args_known = args_known or modes.args_known or p.args_known or {} -- optional value from p.args_known = {...}
	if type(args_selected) ~= "table" then args_selected = modes.args_selected end
	local res, ref_trim, ref_split = "", "", nil
	--	res = res .. '<span style="margin-left:10px;" >*</span><span style="margin-left:10px;" >[http://fr.wikipedia.org/wiki/Bibliothèque%20nationale%20de%20France BNF test]</span> [[File:Farm-Fresh draw calligraphic.png|22px|link=http://catalogue.bnf.fr/ark:/12148/cb119067514|BNF test 119067514]] &nbsp;'
	for key, ref in pairs(args_selected) do -- Pour tous les paramètres connus
		key = tostring(key)
		if args_known[key] and (args_known[key]["typ"] == "not") then
			local ref_split = mw.text.split(ref, ",", true) -- nobug
			for i, ref_i in ipairs(ref_split) do
				ref_trim = mw.text.trim(ref_i)
				if ref_trim and ref_trim ~= "" and ref_trim ~= "-" then
					res = res .. p.HTMLnotice(ref_trim, args_known[key], tag)
				end
				if args_known[key]["deprecated"] == 1 then
					--	author_err_deprecated_authority		= "Cette base d'autorité, %1, est ancienne et à éviter.",
					events.add_err("author_err_deprecated_authority", langs.user_translations[key])
				end
			end
		end
	end
	return res
end -- function p.form_notices(args_known, args_selected, tag)

function p.toUTF8(t)
	-- convert a simple texte to UTF8 for URL
	-- base_name = "Bibliothèque d'autorité (Suède)"
	-- wikipedia_name = "Biblioth%%C3%%A8que%%20d%%27autorit%%C3%%A9%%20%%28Su%%C3%%A8de%%29"
	-- The default type, "QUERY", encodes spaces using '+' for use in query strings; "PATH" encodes spaces as %20; and "WIKI" encodes spaces as '_'.
	if type(t) ~= "string" then return "" end
	--t = mw.uri.encode( t, "QUERY" )
	t = string.gsub(t, "%s", "%%20") -- espace == %20
	t = string.gsub(t, "'", "%%27") -- , == %27
	t = string.gsub(t, ",", "%%2C") -- , == %2C
	t = string.gsub(t, ":", "%%3A") -- : = %3A
	t = string.gsub(t, "%(", "%%%%28")
	t = string.gsub(t, "%)", "%%%%29")
	t = string.gsub(t, "é", "%%C3%%A9")
	t = string.gsub(t, "è", "%%C3%%A8")
	return t
end -- function p.toUTF8(t)

function p.scanNames(res, site, args_final)
	-- res = scanNames("http://gallic ... &q=-ws-name-+-ws-firstname-", md_data) -- replace names for scans
	-- anti errors
	if type(args_final) ~= "table" then args_final = modes.args_final end -- optional arguments
	local familyname = args_final.familyname or ""
	local firstname = args_final.firstname or ""
	local galliname = args_final.galliname or ""
	-- replace names for scans
	res = tostring(res)
	firstname = mw.uri.encode(firstname, "QUERY" )
	res = tostring(string.gsub(res, "wsfirstname", firstname) ) -- "ws_firstname", firstname
	familyname = mw.uri.encode(familyname, "QUERY" )
	res = tostring(string.gsub(res, "wsfamilyname", familyname) )
	galliname = mw.uri.encode(galliname, "QUERY" )
	res = tostring(string.gsub(res, "wsfirstgall", galliname) )
	res = "\n*[" .. res .. " " .. site .. "] - - " -- .. '<br/>[' .. res
	return res
end -- function p.scanNames(res, site, args_final)

function p.HTMLscans(prop)
	local prop = datas.get_item(p.args_known, QITEM) -- Get datas from mw.wikibase for the page.
	-- Generate scans to display
	local firstname, familyname, galliname = "x", "x", "x"
	local t = "" -- "HTMLscans "
	if type(prop.firstname) == "string"
		then firstname = string.gsub(prop.firstname, "%s", "+")
		else firstname = "" end
	if type(prop.familyname) == "string"
		--	familyname = "Noël+Renée"
		then familyname = string.gsub(prop.familyname, "%s", "+")
		else familyname = "" end
	if type(prop.galliname) == "string"
		then galliname = string.gsub(prop.galliname, "%s", "+")
		else galliname = "" end
	local scans = "" -- viewers.ta("firstname", firstname) .. viewers.ta("familyname", familyname) .. viewers.ta("galliname", galliname)
	local SCAN_gallica = "http://gallica.bnf.fr/Search?ArianeWireIndex=index&p=1&lang=FR&q=" .. familyname .. "+" .. firstname
	t = t .. " <span> &nbsp; [" .. SCAN_gallica .. " Gallica] </span>"
	local SCAN_europeana = "http://www.europeana.eu/portal/search.html?query=who:" .. firstname .. ",+" .. familyname .. "&rows=12"
	t = t .. " <span> &nbsp; [" .. SCAN_europeana .. " Europeana] </span>"
	local SCAN_google = "https://www.google.fr/search?q=inauthor%3A%22" .. firstname .. "+" .. familyname .. "%22&ie=utf-8&oe=utf-8&aq=t"
	t = t .. " <span> &nbsp; [" .. SCAN_google .. " Google] </span>"
	return t, SCAN_gallica, SCAN_europeana, SCAN_google
end -- function p.HTMLscans(prop)

------------------------------------------------------------
-- Gérer les catégories. Manage categories. Administrar categorías.
------------------------------------------------------------

function p.gener_categories(args_final) -- Produire les catégories sans les activer
	if type(args_final) ~= "table" then args_final = modes.args_final end
	if args_final.initial then
		events.add_err("author_authors_initial", args_final.initial)
	end
--	local keyword, keyval = modes.multiple_values("sex")
	local keyword, keyval = modes.multiple_values("sex", args_final.sex, args_final)
	if keyval == "female" then events.add_err("author_female_authors_cat") end -- author_author_sex_values = 'male,female'
	modes.catGroup("%1", args_final.genre) -- |genre=Romanciers/Poètes/Auteurs de théatre
	modes.catGroup("author_group_languages_cat", args_final.language) -- |langue=français/italien de naissance
	modes.catGroup("author_group_languages_cat", args_final.languages) -- |langue=anglais/vietnamien autres langues
	-- To use only if Module:Author is alone in the page.
	local Nautorities = 0
	for key, args_kwn in pairs(modes.args_known) do
		if args_kwn and (args_kwn.typ == "not") then
		--	if args_final.key then
			Nautorities = Nautorities + 1 -- end
		end
	end
	if Nautorities == 0 then -- err and cat for missing Autority, in whole the autorities
		events.add_err("author_err_author_without_authority", Nautorities)
		events.add_err("author_without_authority_cat", Nautorities)
	end
	return
end -- function p.gener_categories(args_final)

------------------------------------------------------------
-- Gérer et générer les droits d'auteurs, annotations, microformat
------------------------------------------------------------

------------------------------------------------------------
-- Gérer et générer l'entête de page d'un auteur
-- Voir aussi les styles dans Mediawiki:commons.css, Utilisateur:Xyz/commons.css
------------------------------------------------------------

function p.pcall_int2roman(val, errs) -- DEBUG : mathroman.int2roman() can fail without blocking page.
	local success, word, errs = pcall(mathroman.int2roman, val, errs) -- pcall or xpcall can run any function without blocking page.
	if success then return word, errs else return nil, errs end
end

function p.pcall_roman2int(word, errs) -- DEBUG : mathroman.roman2int() can fail without blocking page.
--	DEBUG: Without this patch the mathroman.int2roman() get the parser error "attempt to call field 'roman2int' ". Patched by Rical 2015-04-20.
--	val, errs = mathroman.roman2int(word, errs)
	local success, val, errs = pcall(mathroman.roman2int, word, errs) -- pcall or xpcall can run any function without blocking page.
	if success then return val, errs else return nil, errs end
end

-- Extract one number from a text, digital or roman
-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.compute_midle_year_century() p.year_century_epoch_cats() p.events_epochs()
function p.a_number( ee, base_in)
	--	ee = p.a_number( ee, "digit") -- example
	local err, cat = "", ""
	local wkt, tst = "", ""
	ee.nbr_out = nil
	ee.nbr_txt = ""
	ee.nbr_in = ee.nbr_in or ""
	--
	-- La base du nombre (digit ou roman) est définie par ee.base_in puis par ee.base ici.
	-- Ensuite elle sera forcée par des valeurs d'années décimales trop grandes pour être des siècles.
	-- Ensuite elle sera forcée par des chiffres romains de siècle.
	-- voir aussi author_err_year_in_roman_number
	--
	-- Normalize abnormal values. Normaliser des valeurs anormales
	if base_in then ee.base_in = base_in end
	if ee.base_in then ee.base = ee.base_in end
	if ee.base ~= "roman" then ee.base = "digit" end -- default values. valeur par défaut
	local val, error_roman, argmt, argmX = nil, "", "", ""
	local an_tab = {} -- table of found numbers
	-- Todo: Titus Livius (Q2039), format de dates : P569 = date of birth = 59 BCE, P570 = date of death = 17
	-- Todo: Tpt 20121005 19:48 : <span class="(b|d)day" title="DATE AU FORMAT YYYY">AFFICHAGE DE LA DATE</span>
	-- Search all roman numbers. Chercher tous les nombres romains.
	ee.digit_select = "[^MDCLXVIJ]"
	local numbers = string.gsub( " "..ee.nbr_in.." ", ee.digit_select, " " )
	local lst = wordstotable( numbers ) -- convertit un texte en table de mots
	for key, word in pairs(lst) do -- search eventual numbers
		val = nil
		if word then
			-- L'argument peut contenir un nombre décimal, un nombre romain ou les deux.
			-- On lit les deux pour traiter tous les cas plus tard.
		--	val, error_roman = mathroman.roman2int(word, "	")
			val, error_roman = p.pcall_roman2int( word, "	") -- DEBUG : mathroman.roman2int() can fail without blocking page.
			if not val then events.add_err(error_roman) end
			if (val ~= nil) then
				ee.roman_txt = word -- il y a au moins un nombre roman parmi les mots
				table.insert( an_tab, val )
				ee.nbr_out = val
				ee.base = "roman"
				ee.numbers = numbers
				ee.nbr_txt = ee.roman_txt -- ee.nbr_txt ..
				ee.vague_txt = string.gsub( ee.nbr_in, ee.nbr_txt or "", "" )
				ee.vague_txt = string.gsub( ee.vague_txt, "[^%l%<%=%>]", "" )
				ee.vague_roman = isDef(ee.vague_txt)
				ee.error_roman = error_roman
				if ee.error_roman then
					events.add_err("author_err_roman2int", ee.roman_txt, ee.nbr_out, ee.error_roman)
				end
			end
		end
	end
	-- Search all digital numbers. Chercher tous les nombres décimaux
	ee.digit_select = "[^%d]" -- "[^%d]"
	local numbers = string.gsub( " "..ee.nbr_in.." ", ee.digit_select, " " )
	local lst = wordstotable( numbers ) -- convertit un texte en table de mots " "..ee.nbr_in.." "
	for key, word in pairs(lst) do -- search eventual numbers
		val = nil
		if word then
			-- L'argument peut contenir un nombre décimal, un nombre romain ou les deux.
			-- On lit les deux pour traiter tous les cas plus tard.
			val = tonumber( word )
			if (val ~= nil) then
				ee.digit_txt = word -- il y a au moins un nombre décimal parmi les mots
				table.insert( an_tab, val )
				ee.nbr_out = val
				ee.base = "digit"
				ee.numbers = numbers
				ee.nbr_txt = ee.digit_txt
				-- Dans le texte d'entrée, sans le nombre trouvé, garder seulement les lettres et "<=>".
				-- In the input text, without the found number, keep only letters and "<=>"
				ee.vague_txt = string.gsub( ee.nbr_in, ee.nbr_txt or "", "" )
				ee.vague_txt = string.gsub( ee.vague_txt, "[^%l%<%=%>]", "" )
				ee.vague_digit = isDef(ee.vague_txt)
			end
		end
	end
	--
	ee.tabN = table.maxn( an_tab )
	if ee.tabN == 1 then -- verify the number is alone
		-- Si on a un nombre et un seul, on peut utiliser sa valeur
		-- Et on connait sa base par digit_txt ou roman_txt
		ee.nbr_out = an_tab[1]
	else -- erreur s'il n'y a pas de nombre ou s'il y en a plusieurs
		--	cat = cat .. events.add_err("author_err_one_number_argument", tostring( ee[argname] ) )
		ee.nbr_out = nil
		ee.nbr_txt = nil
	end
	if ee.nbr_out then -- adjust for negative numbers, including romans
		local negatif = string.find( ee.nbr_in, "-" .. ee.nbr_txt )
		if negatif then
			ee.nbr_out = - ee.nbr_out
	--			ee.nbr_txt = ""
	--			if ee.digit_txt then ee.nbr_txt = ee.digit_txt end
			-- Pour les catégories CE, BCE ou Av. JC
	--			if ee.roman_txt then ee.nbr_txt = ee.nbr_txt .. ee.roman_txt end
		end
	end
	-- Chercher du texte significatif en plus du nombre
	-- Search for significant text in addition to the number
	tst =  "\n* a_number " -- tostring(tst) .. "\n* a_number "
	tst = tst .. viewers.ta("nbr_in", ee.nbr_in) .. viewers.ta("base_in", ee.base_in) .. viewers.ta("base", ee.base)
	tst = tst .. viewers.ta("nbr_out", ee.nbr_out) .. viewers.ta("uncertain_txt", ee.vague_txt)
	--	tst = tst .. viewers.ta("numbers", ee.numbers) -- .. viewers.ta("argmX", argmX)
	tst = tst .. viewers.ta("tabN", ee.tabN) .. viewers.ta("nbr_txt", ee.nbr_txt)
	--	tst = tst .. viewers.ta("digit_txt", ee.digit_txt) .. viewers.ta("roman_txt", ee.roman_txt)
	--	tst = tst .. viewers.ta("err", err) .. viewers.ta("cat", cat)
	cat = cat or ""
	err = err or ""
	ee.cats = ee.cats or ""
	ee.errs = ee.errs or ""
--	ee.wkt = wkt or ""
--	ee.tst = tst or ""
	ee.cats = ee.cats .. cat
	ee.errs = ee.errs .. err
	return ee, ee.wkt
end -- function p.a_number( ee, base_in)

-- Convert a digital or roman number to a year or century
-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.compute_midle_year_century() p.year_century_epoch_cats() p.events_epochs()
function p.year_century( ee )
	ee.cats = ee.cats or ""
	ee.errs = ee.errs or ""
	local err, cat = "", ""
	ee.nowyear = modes.args_final.nowyear
	-- Type of arguments
	if ee.birthcentury then ee.argname = "birthcentury" end
	if ee.birthyear	   then ee.argname = "birthyear" end -- keep year rather than century
	if ee.deathcentury then ee.argname = "deathcentury" end
	if ee.deathyear	   then ee.argname = "deathyear" end -- keep year rather than century
	if ee.birthyear or ee.birthcentury then ee.event = "birth" end
	if ee.deathyear or ee.deathcentury then ee.event = "death" end
	-- Pour un évènement, on utilise l'argument année plus précis, sinon le siècle.
	if ee.event == "birth" then
		ee.nbr_in = ee.birthyear or ee.birthcentury -- keep year rather than century
	elseif ee.event == "death" then
		ee.nbr_in = ee.deathyear or ee.deathcentury -- keep year rather than century
	else -- Pour un évènement indéterminé, on utilise plutôt le décès pour les droits d'auteur, sinon la naissance.
		ee.nbr_in = ee.deathyear or ee.birthyear or ee.deathcentury or ee.birthcentury
	end
	local ee = p.a_number( ee, "digit")
	-- The number is a priori a year.
	-- Le nombre est à priori une année.
	ee.century = nil
	ee.year = ee.nbr_out
	-- A roman number defines a century, and cancel the year.
	-- Un nombre romain définit un siecle, et annule l'année.
	--	if ee.base_in == "roman" then
	if ee.base == "roman" then
		ee.century = ee.nbr_out
		ee.year = nil
	end
	-- A number coming from a century argument defines a century.
	-- Un nombre qui vient d'un argument de siècle définit un siecle.
	if ee.argname == "birthcentury" or ee.argname == "deathcentury" then
		ee.century = ee.nbr_out
		ee.year = nil
	end
	-- A number too big or too small to be a century is a year.
	-- Un nombre trop grand ou trop petit pour être un siècle est une année.
	-- L'Antiquité européenne commence au IVe millénaire BCE
	-- La civilisation de l'Indus (5000 BCE – 1900 BCE).
	-- In 2013, keep a margin of one unit (year or century).
	-- En 2013, garder une marge d'une unité (année ou siècle).
	if ee.nbr_out then
		if ee.nbr_out < -75 or 25 < ee.nbr_out then
			ee.century = nil
			ee.year = ee.nbr_out
		end
	end
	--
	-- Consequences for a year :
	-- Conséquences pour une année :
	if ee.year then
		ee.vague_year = ee.vague_digit or ee.vague_roman
		if ee.event == "birth" then
			-- Auteur par défaut à partir de 20 ans
			ee.event_author = ee.year + p.constants.author_writing_after_birth
		elseif ee.event == "death" then
			-- Auteur par défaut jusqu'à 5 ans avant le décès
			ee.event_author = ee.year - p.constants.author_writing_before_death
	--	elseif ee.event == "epoch" then
			-- Epoch specialy defined
	--		ee.event_author = ee.year_epoch
		else
			ee.event_author = ee.year
		end
		-- year. anno. année.
		ee.event_yr = ee.event_author
		if ee.year_epoch then ee.event_yr = ee.year_epoch end -- year_epoch enforce epoch
		-- Assurer la continuité des années autour de 1 pour tous les calculs
--		if ee.event_yr and ee.event_yr < 1 then ee.event_yr = ee.event_yr + 1 end
		-- To debug here ? Shift century of 2 year for negative centuries.
		if ee.event_yr and ee.event_yr < 1 then ee.event_yr = ee.event_yr + 2 end
		-- Century from event year. Siglo de anno de evenement. Siècle selon l'annee de l'evenement.
		ee.event_century_abs = math.floor( math.abs(ee.event_yr - 1 ) / 100 ) + 1
		if ee.event_yr < 1 then
			ee.event_century = - ee.event_century_abs -- event negative century
		--	ee.event_century_roman = mathroman.int2roman(ee.event_century_abs) -- mathroman.int2roman() fails sometime.
			ee.event_century_roman = p.pcall_int2roman(ee.event_century_abs) -- DEBUG patch: mathroman.int2roman() can fail without blocking page.
		else
		--	ee.event_century_roman = mathroman.int2roman(ee.event_century_abs) -- mathroman.int2roman() fails sometime.
			ee.event_century_roman = p.pcall_int2roman(ee.event_century_abs) -- DEBUG patch: mathroman.int2roman() can fail without blocking page.
		end
	elseif ee.century then -- Without year, do not shift event. Sans annee, ne pas decaler l'evenement.
		ee.vague_cent = ee.vague_digit or ee.vague_roman
		-- Event century. Siglo de evenement. Siècle d'evenement.
		ee.event_century_abs = math.abs(ee.century)
		if ee.century < 1 then
			ee.event_century = - ee.event_century_abs -- event negative century
		--	ee.event_century_roman = mathroman.int2roman(ee.event_century_abs) -- mathroman.int2roman() fails sometime.
			ee.event_century_roman = p.pcall_int2roman(ee.event_century_abs) -- DEBUG patch: mathroman.int2roman() can fail without blocking page.
		else -- ee.century_roman ?
			ee.event_century = ee.event_century_abs -- event positive century
		--	ee.event_century_roman = mathroman.int2roman(ee.event_century_abs) -- mathroman.int2roman() fails sometime.
			ee.event_century_roman = p.pcall_int2roman(ee.event_century_abs) -- DEBUG patch: mathroman.int2roman() can fail without blocking page.
		end
	end
	--
	tst = "\n* year_century " -- tostring(tst) ..
	tst = tst .. viewers.tam("event", ee.event) .. viewers.tam("nbr_in", ee.nbr_in)
	tst = tst .. viewers.tam("base", ee.base) -- .. viewers.tam("base_in", ee.base_in)
	tst = tst .. viewers.tam("year", ee.year) .. viewers.tam("event_author", ee.event_author)
	tst = tst .. viewers.tam("event_yr", ee.event_yr) .. viewers.tam("century", ee.century)
	tst = tst .. viewers.tam("event_ct", ee.event_ct) .. viewers.tam("century_roman", ee.century_roman)
	tst = tst .. viewers.tam("err", viewers.styles_color_error(err)) .. viewers.tam("cat", cat)
	ee.wkt = tst
	ee.cats = ee.cats .. cat
	ee.errs = ee.errs .. err
	return ee, ee.wkt
end -- function p.year_century( ee )


-- ee.birthyear, ee.deathyear, ee.year_epoch
-- Computes the epoch from a year or a century, and the region
-- Calcule l'époque pour une année ou un siècle, et pour une région
-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.compute_midle_year_century() p.year_century_epoch_cats() p.events_epochs()
function p.century_epoch(ee)
	--	ee, tst, cats = p.century_epoch( ee)
--	local err, cat = "", ""
	local epq, epoq, epoque = "", "", ""
	local val = ""
	local wkt = wkt or ""
	local cats = cats or ""
	local tst = tst or ""
	local errs = errs or ""
	local ee = p.year_century( ee, "digit") -- wkt, cats, xxx, errs,
	--
	-- Recherche des époques au niveau mondial, BCE = before christian era :
	--
	-- En Asie, l'Antiquité se termine à peu près vers l'an -200, avec la Dynastie Qin qui inaugure la période impériale en Chine et le début de la dynastie Chola en Inde.
	-- En Chine, la période des Printemps et Automnes s'étend de 770 à 453 BCE
	-- En Chine, la période des Royaumes combattants s'étend de 453 à 221 av. J.-C
	-- En Chine, la période de l'empire s'étend de 220 BCE à 1911.
	-- En Chine, la république commence en 1912.
	--
	-- En Inde, Des origines à l'Empire moghol (dynasties musulmanes venues de Perse et d'Afghanistan), dominant jusqu'au milieu du XVIIIe siècle. La période coloniale britannique (1750-1947), l'Empire britannique des Indes comprenant alors le Bangladesh et le Pakistan actuels, Depuis l'indépendance de l'Inde (1947-).
	-- En Inde, la civilisation de l'Indus (5000 BCE – 1900 BCE).
	-- En Inde, l'Antiquité finit vers l'an -200, suivie de la dynastie Chola.
	-- En Inde, la Civilisation védique en ... ?
	-- En Inde, Antiquité et Moyen Âge indien aux IVe et Ve siècles.
	-- En Inde, époque moderne depuis La colonie britannique (1750-1947).
	--
	-- l'Antiquité européenne commence au IVe millénaire BCE
	--
	-- Todo: valeurs autorisées pour un argument
	--	author_region_values			= "other,china,india,century",
	--	author_region_values			= "autre,chine,inde,siècle",
	--	author_err_args_values			= "Abnormal value of the argument %1",
	--	author_err_args_values			= "Valor anormal del argumento %1",
	--	author_err_args_values			= "Valeur anormale de l'argument %1",
	--	if ee.region and not string.find("other,china,india,century", ee.region) then
	--		ee.region = "fr"
	--		author_err_args_values = viewers.form9user("author_err_args_values", tostring(ee.region) )
	--		events.add_err("Valeur anormale de l'argument %1" .. author_err_args_values)
	--	events.add_err( epoque, epoque, ee.c )
	--	end

	if (ee.region ~= "china") and (ee.region ~= "india") and (ee.region ~= "century") then
		ee.region = "other"
	end
	local list_epochs = {
		{ reg = "china",	start = -9999, stop =	-771, cat = "author_epoch_china_antiquity_cat", calc = "", },
		{ reg = "china",	start =	 -770, stop =	-221, cat = "author_epoch_china_springs_cat", calc = "", },
		{ reg = "china",	start =	 -220, stop =	1911, cat = "author_epoch_china_empires_cat", calc = "", },
		{ reg = "china",	start =	 1912, stop =	9999, cat = "author_epoch_middle_age_cat", calc = "century_roman", },
		--[[ -- DEBUG from Utilisateur:Wuyouyuan
		{ reg = "india",	start = -9999, stop =  -1901, cat = "author_epoch_indian_indus_cat", calc = "", },
		{ reg = "india",	start = -1900, stop =	 500, cat = "author_epoch_indian_antiquity_cat", calc = "", },
		{ reg = "india",	start =	  501, stop =	1750, cat = "author_epoch_indian_muslim_cat", calc = "", },
		{ reg = "india",	start =	 1751, stop =	9999, cat = "author_epoch_middle_age_cat", calc = "century_roman", },
		--]]
		{ reg = "india",	start = -9999, stop =	 300, cat = "author_epoch_indian_antiquity_cat", calc = "", },
		{ reg = "india",	start =	  301, stop =	1000, cat = "author_epoch_indian_classic_cat", calc = "", },
		{ reg = "india",	start =	 1001, stop =	1600, cat = "author_epoch_indian_middle_age_cat", calc = "", },
		{ reg = "india",	start =	 1601, stop =	9999, cat = "author_epoch_middle_age_cat", calc = "century_roman", },
--	author_epoch_indian_indus_cat	l’antiquité indienne author_epoch_indian_antiquity_cat 300 301 période classique indienne author_epoch_indian_classic_cat 1000 1001 moyen-âge indien 1600 1601 période moderne à nos jours author_epoch_middle_age_cat author_epoch_indian_muslim_cat
		--
		{ reg = "century",	start = -9999, stop =	-100, cat = "author_epoch_author_century_BCE_cat", calc = "century_roman", },
		{ reg = "century",	start =	 -99,  stop =	   0, cat = "author_epoch_author_century_BCE_cat_1", calc = "century_roman", },
		{ reg = "century",	start =	 1,	   stop =	 100, cat = "author_epoch_middle_age_cat_1", calc = "century_roman", },
		{ reg = "century",	start =	 101,  stop =	9999, cat = "author_epoch_middle_age_cat", calc = "century_roman", },
		--
		{ reg = "other",	start = -9999, stop =	 500, cat = "author_epoch_antiquity_cat", calc = "", },
		{ reg = "other",	start =	  501, stop =	1400, cat = "author_epoch_middle_age_cat", calc = "", },
		{ reg = "other",	start =	 1401, stop =	9999, cat = "author_epoch_middle_age_cat", calc = "century_roman", },
	--	{ reg = "other",	start =	 1401, stop =	9999, cat = "author_epoch_middle_age_cat", val = ee.event_century_roman, },
	}
	-- BCE = Before Common Era = «BC». AEC = Antes de la Era Común = «a. C.». AEC = Avant l'ère commune = «av. J.-C.»
	local error_id = nil
	if ee.year_epoch then ee.yearNepoch = tonumber(ee.year_epoch) end
	if ee.midle_century then ee.event_century_roman = p.pcall_int2roman(ee.midle_century) end
	if ee.vague_year then cats = cats .. events.add_err("author_err_vague_year") end
	if ee.vague_cent then cats = cats .. events.add_err("author_err_vague_epoch") end
	--
	if modes.args_final.missing_epoch then -- no year, no century. ni année, ni époque.
		cats = cats .. events.add_err("author_err_unknown_epoch_cat") -- Category:Unknown epoch. Catégorie:Epoque inconnue.
	elseif ee.midle_century and not ee.midle_life then -- century without year
	--	ee.event_century_roman = mathroman.int2roman(ee.midle_century)
		if ee.midle_century > 0
		then cats = cats .. events.add_err("author_epoch_middle_age_cat", ee.midle_century )
		else cats = cats .. events.add_err("author_epoch_author_century_BCE_cat", ee.midle_century ) end
	else
		for i, epq in pairs(list_epochs) do -- Parmi toutes les époques définies
			if ee.region and ( epq.reg == ee.region) then -- enforce_roman_century by reg = region = "century"
				if ee.event_author and ( epq.start <= ee.event_author) and (ee.event_author <= epq.stop ) then
					if epq.calc == "century_roman" then epq.val = ee.event_century_roman else epq.val = "" end
				--	if epq.calc == "century_roman" then epq.val = ee.century else epq.val = "" end
					-- mathroman.
					cats = cats .. events.add_err(epq.cat, epq.val or "" )
				end
			end
		end
	end
	-- Only one number accepted. Un seul nombre accepté.
	if ee.tabN > 1 then -- verify the number is alone
		local arg_nm = langs.content_translations[ee.argname]
		arg_nm = viewers.styles_color_error(arg_nm)
		errs = errs .. events.add_err("author_err_one_number_argument", arg_nm )
	end
	-- Ambigüité des années en nombres romains
	if ee.year and ee.base and (ee.base == "roman") then
		errs = errs .. events.add_err("author_err_year_in_roman_number", ee.nbr_in )
	end
	-- Year to compute the epoch, for an event or an author
	if ee.birthyear and tonumber(ee.year) then
		ee.epoch_year = tonumber(ee.year) + p.constants.author_writing_after_birth
	end
	if ee.deathyear and tonumber(ee.year) then
		ee.epoch_year = tonumber(ee.year) - p.constants.author_writing_before_death
	end
	ee.event_century_roman = ee.event_century_roman
	if ee.event == "birth" then ee.birth_century_roman = ee.event_century_roman end
	if ee.event == "death" then ee.death_century_roman = ee.event_century_roman end
	if ee.year and ee.year < 1 then -- Naissance en ...
		ee.year_out = viewers.form9user( "author_year_BCE", - ee.year )
	end
	--
	local tst = "\n* century_epoch "
	tst = tst .. viewers.tam("event", ee.event) .. viewers.tam("nbr_in", ee.nbr_in)
	tst = tst .. viewers.tam("year", ee.year) .. viewers.tam("event_author", ee.event_author)
	tst = tst .. viewers.tam("century", ee.century) .. viewers.tam("event_century_roman", ee.event_century_roman)
	tst = tst .. viewers.tam("region", ee.region)
	tst = tst .. viewers.tam("errs", viewers.styles_color_error(errs)) .. viewers.tam("cat", cat)
	ee.wkt = tst
	ee.errs = ee.errs .. errs
	ee.cats = ee.cats .. cats
	return ee, tst, cats
end -- function p.century_epoch(ee)

-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.compute_midle_year_century() p.year_century_epoch_cats() p.events_epochs()
function p.compute_midle_year_century(birthyear, deathyear, year_epoch, birthcentury, deathcentury)
--	midle_life, midle_century = p.compute_midle_year_century( 1468, 1579, 1489)
--	midle_life, midle_century = p.compute_midle_year_century( ee_birth)
	local tbl
	if type(birthyear) == "table" then
		tbl = birthyear
		birthyear = tonumber(tbl.birthyear)
		deathyear = tonumber(tbl.deathyear)
		year_epoch = tonumber(tbl.year_epoch)
		birthcentury = tonumber(tbl.birthcentury)
		deathcentury = tonumber(tbl.deathcentury)
	else
		birthyear = tonumber(birthyear)
		deathyear = tonumber(deathyear)
		year_epoch = tonumber(year_epoch)
		birthcentury = tonumber(birthcentury)
		deathcentury = tonumber(deathcentury)
	end
	if birthyear or deathyear or year_epoch then modes.args_final.missing_epoch = false end
	local midle_life, midle_century, midle_birth, midle_death
	if birthyear then midle_birth = birthyear + p.constants.author_writing_after_birth end -- +20
	if deathyear then midle_death = deathyear - p.constants.author_writing_before_death end -- -5
	if midle_birth and midle_death then
		midle_life = math.floor( midle_birth / 2 + midle_death / 2 )
	elseif midle_birth then
		midle_life = midle_birth + 10
	elseif midle_death then
		midle_life = midle_death - 10
	elseif birthcentury then
		midle_century = birthcentury
	elseif deathcentury then
		midle_century = deathcentury
	end
	if year_epoch then midle_life = year_epoch end -- activate year_epoch, else midle_life
	if midle_life then
		midle_century = math.floor( midle_life / 100 )
		if midle_century > 0 then
			midle_century = midle_century + 1
		end
	end
	return midle_life, midle_century
end -- function p.compute_midle_year_century( birthyear, deathyear, year_epoch)

-- Generate categories from region, birthyear, deathyear, century, epoch, year_epoch
-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.compute_midle_year_century() p.year_century_epoch_cats() p.events_epochs()
function p.year_century_epoch_cats(ee)
	local year, century, epoch, tst, cats
	local t = ""
	modes.catView = ":"
	local nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")
	ee.midle_life, ee.midle_century = p.compute_midle_year_century(ee)
	ee, tst, cats = p.century_epoch(ee)
	return ee, t, cats
end -- function p.year_century_epoch_cats(ee)

-- Générer les textes de categories et d'erreurs des annees et siecles.
-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.compute_midle_year_century() p.year_century_epoch_cats() p.events_epochs()
function p.events_epochs(args_final, mode, c, verif)
--	local err, cat = "", ""
	local wkt = wkt or ""
	local t, cat, cts
	local cats = cats or ""
	local tst = tst or ""
	local errs = errs or ""
	local ee, ee_birth, ee_death, ee_epoch = {}, {}, {}, {}
	local events_text = " "
	if type(args_final) ~= "table" then args_final = modes.args_final end
	modes.args_final.missing_epoch = true
	--
	args_final.event_author = tonumber(args_final.event_author)
	args_final.event_yr = tonumber(args_final.event_yr)
	args_final.year_epoch = tonumber(args_final.year_epoch)
	--
	if args_final.year_epoch then
		-- calculer l'epoque ou le siècle à partir de l'argument fournit
		ee_epoch = { c = ":", argname = "birthyear", region = args_final.region, author_region_values = args_final.author_region_values,
		birthyear = args_final.birthyear, birthcentury = args_final.birthcentury, epoch = args_final.year_epoch, errs = "", cats = "" } --, event = "epoch"
		ee_epoch = p.century_epoch(ee_epoch)
		cats = cats .. ee_epoch.cats -- .. "epochA"
		ee.year_epoch = ee_epoch.year_epoch -- "epoch" ee.yearNepoch
		ee.yearNepoch = ee_epoch.yearNepoch -- "epoch" ee.yearNepoch
	end
	--
	args_final, t, cts = p.year_century_epoch_cats(args_final)
	cats = cats .. (cts or "")
	ee_birth = { c = ":", region = args_final.region, author_region_values = args_final.author_region_values, birthyear = args_final.birthyear, birthcentury = args_final.birthcentury, argname = "birthyear", event = "birth", errs = "", cats = "" }
	ee_death = { c = ":", region = args_final.region, author_region_values = args_final.author_region_values, deathyear = args_final.deathyear, deathcentury = args_final.deathcentury, argname = "deathyear", event = "death", errs = "", cats = "" }
	-- old : compute_midle_year_century
	-- Categorize the year of death for 100 years
	-- Clasificar el año que murió hace 100 años
	-- Catégoriser l'année de décès depuis 100 ans
	args_final.nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")
	local year_limit = args_final.nowyear - p.constants.author_categorise_death_for_n_years
	if ee_birth.year and (year_limit < ee_birth.year) then -- Naissance en ...
	--	cats = cats .. events.add_err( "author_authors_birthyear", ee_birth.year )
	end
	if ee_death.year and (year_limit < ee_death.year) then -- Décès en ...
		cats = cats .. "d" .. events.add_err( "author_authors_deathyear", ee_death.year )
	end
	--
	-- Vague, uncertain year or century. Année ou siècle vague incertain.
	local epq = nil
	if		ee_birth.vague_year or ee_death.vague_year	then epq = "author_err_vague_year"
	elseif	ee_birth.vague_cent or ee_death.vague_cent	then epq = "author_err_vague_epoch"
	end
	if epq then cats = cats .. "v" .. events.add_err( epq ) end
	--
	-- Verify bith < death. Comprobar nacer < muerte. Vérifier naissance < Décès
	ee_birth.event_yr = tonumber(ee_birth.year) -- annees
	ee_death.event_yr = tonumber(ee_death.year)
	ee_birth.event_ct = tonumber(ee_birth.century) -- siecles
	if ee_birth.event_ct then ee_birth.event_ct = ee_birth.event_ct*100 end
	ee_death.event_ct = tonumber(ee_death.century)
	if ee_death.event_ct then ee_death.event_ct = ee_death.event_ct*100 end
	if ee_birth.event_yr and ee_birth.event_yr < 0 then ee_birth.event_yr = ee_birth.event_yr + 1 end
	if ee_death.event_yr and ee_death.event_yr < 0 then ee_death.event_yr = ee_death.event_yr + 1 end
	if ee_birth.event_ct and ee_birth.event_ct < 0 then ee_birth.event_ct = ee_birth.event_ct + 100 end
	if ee_death.event_ct and ee_death.event_ct < 0 then ee_death.event_ct = ee_death.event_ct + 100 end
	--
	local birth_then_death = true -- Check Birth < Death. Vérifier naissance < Décès
	local lifetime = true -- Normal life < 120 years. Durée de vie normale < 120 ans
	local lifetime_txt = "" -- Normal life < 120 years. Durée de vie normale < 120 ans
	if ee_birth.event_yr and ee_death.event_yr then
		-- year -> year. annee -> annee
		if ( (ee_birth.event_yr + p.constants.author_lifetime_limit) < ee_death.event_yr ) then
			lifetime = false
			lifetime_txt = viewers.form9user("author_err_life_too_long", ee_birth.event_yr, ee_death.event_yr)
		end
		if ee_birth.event_yr > ee_death.event_yr then birth_then_death = false end
	elseif ee_birth.event_ct and ee_death.event_yr then
		-- century -> year. siecle -> annee
		if (ee_birth.event_ct + p.constants.author_lifetime_limit) < ee_death.event_yr then
			lifetime = false
			lifetime_txt = viewers.form9user("author_err_life_too_long", ee_birth.event_ct, ee_death.event_yr)
		end
		if (ee_birth.event_ct - 100) > ee_death.event_yr then birth_then_death = false end
	elseif ee_birth.event_yr and ee_death.event_ct then
		-- year -> century. annee -> siecle
		if (ee_birth.event_yr + p.constants.author_lifetime_limit) < (ee_death.event_ct - 100) then
			lifetime = false
			lifetime_txt = viewers.form9user("author_err_life_too_long", ee_birth.event_yr, (ee_death.event_ct - 100) )
		end
		if ee_birth.event_yr > (ee_death.event_ct) then birth_then_death = false end
	elseif ee_birth.event_ct and ee_death.event_ct then
		-- century -> century. siecle -> siecle
		if (ee_birth.event_ct + p.constants.author_lifetime_limit) < ee_death.event_ct then
			lifetime = false -- p.constants.author_lifetime_limit
			lifetime_txt = viewers.form9user("author_err_life_too_long", ee_birth.event_ct, ee_death.event_ct)
		end
		if ee_birth.event_ct > ee_death.event_ct then birth_then_death = false end
	end
	if not lifetime then
		-- author_err_life_too_long = "Durée de vie trop longue de %1 à %2.",
		errs = errs .. lifetime_txt -- viewers.form9user("author_err_life_too_long", ee_birth.year, ee_death.year)
		cats = cats .. events.add_err("author_err_life_too_long_cat")
		error_id = "err-year"..tostring(ee_birth.year)..">"..tostring(ee_death.year)
	end
	if not birth_then_death then -- si naissance apres Décès pour year ou century
		--	author_err_death_before_birth	= "Error: death <b>%1</b> is before birth <b>%2</b>.",
		--	author_err_death_before_birth_cat= "Author death is before birth",
		errs = errs .. viewers.form9user("author_err_death_before_birth", ee_death.year, ee_birth.year)
		cats = cats .. events.add_err("author_err_death_before_birth_cat")
		error_id = "err-year"..tostring(ee_birth.year)..">"..tostring(ee_death.year)
	end
--	if not (ee_birth.event_yr or ee_death.event_yr or ee_birth.event_ct or ee_death.event_ct) then
	if modes.args_final.missing_epoch then -- no year, no century. ni année, ni époque.
		-- Category:Unknown epoch. Catégorie:Epoque inconnue.
		cats = cats .. events.add_err("author_err_unknown_epoch_cat")
	end
	--
	errs = errs .. ee_birth.errs .. ee_death.errs
	tst = "\n* events_epochs "
	-- tst = tst .. viewers.tam("event", ee_birth.event) .. viewers.ta("nbr_in", ee_birth.nbr_in)
	if ee_birth.year then
		tst = tst .. viewers.tam("birth.nbr_in", ee_birth.nbr_in)
		tst = tst .. viewers.tam("birth.year", ee_birth.year)
		tst = tst .. viewers.tam("birth.author", ee_birth.event_author)
	elseif ee_birth.century then
		tst = tst .. viewers.tam("birth.nbr_in", ee_birth.nbr_in)
		tst = tst .. viewers.tam("birth.century", ee_birth.century)
	end
	-- tst = tst .. "<br/>" .. viewers.ta("event", ee_death.event) .. viewers.ta("nbr_in", ee_death.nbr_in)
	if ee_death.year then
		tst = tst .. viewers.tam("death.nbr_in", ee_death.nbr_in)
		tst = tst .. viewers.tam("death.author", ee_death.year_author)
		tst = tst .. viewers.tam("death.year", ee_death.year)
	elseif ee_death.century then
		tst = tst .. viewers.tam("death.nbr_in", ee_death.nbr_in)
		tst = tst .. viewers.tam("death.century", ee_death.century)
	end
	tst = tst .. viewers.tam("region", ee_death.region)
	-- tst = tst .. viewers.ta("birth_yr", birth_yr) .. viewers.ta("death_yr", death_yr)
	-- tst = tst .. wkt
	tst = tst .. viewers.tam("err", viewers.styles_color_error(err)) -- .. viewers.ta("cats", cats)
	--
	-- Remplacer les siècles sans texte par X ème siècle
	local birth_txt, death_txt = "", ""
	if ee_birth.century and not ee_birth.year and not ee_birth.vague
		then birth_txt = ee_birth.event_century_roman
		else birth_txt = ee_birth.nbr_in
	end
	if ee_death.century and not ee_death.year and not ee_death.vague
		then death_txt = ee_death.event_century_roman
		else death_txt = ee_death.nbr_in
	end
	--
	birth_txt = ee_birth.vague_year or ee_birth.vague_cent or ""
	death_txt = ee_death.vague_year or ee_death.vague_cent or ""
--	wkt = "<br/>(" .. (ee_birth.nbr_in or " ") .. " - " .. (ee_death.nbr_in or " ") .. ") " .. cats
--	events_text = "( " .. (ee_birth.nbr_in or ee_birth.year_out or " ") .. " - " .. (ee_death.nbr_in or ee_death.year_out or " ") .. " )"
	events_text = "( " .. (ee_birth.birthyear or ee_birth.nbr_in or ee_birth.year_out or " ")
				.. " – " .. (ee_death.deathyear or ee_death.nbr_in or ee_death.year_out or " ") .. " )"
	wkt = "<br/>" .. events_text .. " " .. cats
	--
	if ee_birth.error_roman then -- roman number error in ee_birth
		errs = errs .. events.add_err("author_err_roman2int", ee_birth.roman_txt, ee_birth.nbr_out, ee_birth.error_roman, langs.user_translations.birth) -- "/birth"
	end
	if ee_death.error_roman then -- roman number error in ee_death
		errs = errs .. events.add_err("author_err_roman2int", ee_death.roman_txt, ee_death.nbr_out, ee_death.error_roman, langs.user_translations.death) --	 "/death")
	end
	--
--	ee.year_epoch = ee_birth.year_epoch -- "epoch" ee.yearNepoch
--	ee.yearNepoch = ee_birth.yearNepoch -- "epoch" ee.yearNepoch
--	events_text = cats
	if ee_birth then ee.birth_in = ee_birth.nbr_in end
	if ee_birth then ee.death_in = ee_death.nbr_in end
	if ee_epoch then ee.epoch_in = ee_epoch.nbr_in end
	if ee_epoch then ee.year_epoch = ee_epoch.year_epoch end -- "epoch" ee.yearNepoch
	if ee_epoch then ee.yearNepoch = ee_epoch.yearNepoch end -- "epoch" ee.yearNepoch
	ee.events_text = events_text
	ee.wkt = wkt
	ee.tst = tst
	ee.errs = errs
	ee.cats = cats
	return ee -- wkt, cats, tst, errs, ee
end -- function p.events_epochs(args_final, mode, c, verif)

function p.century_epoch_test1( t, event, region, birthyear, birthcentury, deathyear, deathcentury)
	local ee = { c = ":", nowyear = modes.args_final.nowyear, event = event, region = region, birthyear = birthyear, birthcentury = birthcentury, deathyear = deathyear, deathcentury = deathcentury }
	ee = p.century_epoch( ee ) -- enforce_roman_century by reg = region = "century"
	if not ee.nbr_out then ee.nbr_out = "..." end
	t = t .. viewers.table_row() .. viewers.table_dat(ee.event) .. viewers.table_dat(ee.region) .. viewers.table_dat(ee.birthyear) .. viewers.table_dat(ee.birthcentury) .. viewers.table_dat(ee.deathyear) .. viewers.table_dat(ee.deathcentury)
	t = t .. viewers.table_dat(ee.year) .. viewers.table_dat(ee.nbr_out) .. viewers.table_dat(ee.epoch_year)
	t = t .. viewers.table_dat( (ee.cats or " ") .. " " .. (ee.errs or " ") )
	return t
end -- function p.century_epoch_test1( t, event, region, birthyear, birthcentury, deathyear, deathcentury)

function p.years_to_epoch_test(res, args_final)
	modes.catView = ":"
--	local nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")
	local t = "years_to_epoch_test"
	if type(res) == "string" then t = "\n* " .. tostring(res) .. " : "
	else t = "\n* '''years_to_epoch_test:''' " end
	local headers = viewers.table_dat("event") .. viewers.table_dat("region") .. viewers.table_dat("birth year") .. viewers.table_dat("birth century") .. viewers.table_dat("death year") .. viewers.table_dat("death century") .. viewers.table_dat("year") .. viewers.table_dat("nbr out") .. viewers.table_dat("epoch year")
	--
	t = t .. viewers.table_row() .. headers .. viewers.table_dat( " Catégories et erreurs " )
	t = t .. viewers.table_row() .. headers .. viewers.table_dat( " '''China''' ( antiquity, -770 springs, -220 empires, 1912 century ) (Authors write from 20 years.) " )
	t = p.century_epoch_test1( t, "birth", "china", "-791", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "china", "-790", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "china", "-241", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "china", "-240", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "china", "1891", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "china", "1892", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "china", "1980", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "china", "1981", nil, nil, nil)
	--
	t = t .. viewers.table_row() .. headers .. viewers.table_dat("	'''India''' ( antiquity, 301 classic, 1001 middle_age, 1601 modern ) (Authors write from 20 years.) ")
	t = p.century_epoch_test1( t, "birth", "india", "280", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "india", "281", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "india", "980", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "india", "981", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "india", "1580", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "india", "1581", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "india", "1680", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "india", "1681", nil, nil, nil)
	--
	t = t .. viewers.table_row() .. headers .. viewers.table_dat(" '''Other''' ( antiquity, 501 middle_age, 1401 century ) (Authors write from 20 years.) ")
	t = p.century_epoch_test1( t, "birth", "other", "-1000", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "480", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "481", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "1380", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "1381", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "1480", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "1481", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "1580", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "1581", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "1880", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "1881", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "1980", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "1981", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "2080", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "2081", nil, nil, nil)
	t = p.century_epoch_test1( t, "death", "other", nil, nil, "2005", nil)
	t = p.century_epoch_test1( t, "death", "other", nil, nil, "2006", nil)
	t = t .. viewers.table_end()
	t = t .. "<br>years_to_epoch_test : end "
--	
	return t
end -- function p.years_to_epoch_test( res, args_final)

function p.century_to_epoch_test( res, args_final)
	modes.catView = ":"
--	local nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")
	local t = tostring(res or "century_to_epoch_test:")
	local headers = viewers.table_dat("event") .. viewers.table_dat("region") .. viewers.table_dat("birth year") .. viewers.table_dat("birth century") .. viewers.table_dat("death year") .. viewers.table_dat("death century") .. viewers.table_dat("year") .. viewers.table_dat("nbr out") .. viewers.table_dat("epoch year")
	--
	t = t .. viewers.table_row() .. headers .. viewers.table_dat(" '''Region = century''' always force centuries (Authors write from 20 years.) ")
	t = p.century_epoch_test1( t, "birth", "century", "-221", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", "-220", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", "-121", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", "-120", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", "-21", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", "-20", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", "-19", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", "80", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", "81", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", "180", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", "181", nil, nil, nil)
	--
	t = t .. viewers.table_row() .. headers .. viewers.table_dat(" '''Year or century ?''' roman centuries from -75 to +25, else years. ")
	t = p.century_epoch_test1( t, "birth", "century", nil, "-CXI", nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", nil, nil, nil, "-CXI")
	t = p.century_epoch_test1( t, "birth", "century", "-CXI", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", nil, nil, "-CXI", nil)
	t = p.century_epoch_test1( t, "birth", "century", nil, "-LXXVI", nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", nil, "-LXXV", nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", nil, "XXV", nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", nil, "XXVI", nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", "CXI", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", nil, nil, "CXI", nil)
	t = p.century_epoch_test1( t, "birth", "century", nil, "CXI", nil, nil)
	t = p.century_epoch_test1( t, "birth", "century", nil, nil, nil, "CXI")
	--
	t = t .. viewers.table_row() .. headers .. viewers.table_dat(" '''Uncertain''' ")
	t = p.century_epoch_test1( t, "birth", "other", "vers -1357", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "vers MCXI", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "vers 1357 ou MCCCLIX", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "deux dates de naissance", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", "avant le X siècle", nil, nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", nil, "avant le X siècle", nil, nil)
	t = p.century_epoch_test1( t, "birth", "other", nil, nil, "avant le X siècle", nil)
	t = p.century_epoch_test1( t, "birth", "other", nil, nil, nil, "avant le X siècle")
	t = t .. viewers.table_end()
	t = t .. "<br>century_to_epoch_test : end "
--	
	return t
end -- function p.century_to_epoch_test( res, args_final)

-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.compute_midle_year_century() p.year_century_epoch_cats() p.events_epochs()
function p.events_epochs_test(res, args_final)
	-- Unitary tests of p.a_number
	local t = tostring(res or "")
	modes.catView = ":"
	function events_epochs_test1( t, region, birthyear, birthcentury, deathyear, deathcentury, yearNepoch)
		local ee = { c = ":", nowyear = modes.args_final.nowyear, region = region, birthyear = birthyear, birthcentury = birthcentury, deathyear = deathyear, deathcentury = deathcentury, yearNepoch = yearNepoch }
		modes.catView = ":"
		local ee = p.events_epochs(ee, mode, ":", verif)
		t = t .. viewers.table_row() .. viewers.table_dat(region) .. viewers.table_dat(birthyear) .. viewers.table_dat(birthcentury) .. viewers.table_dat(deathyear) .. viewers.table_dat(deathcentury) .. viewers.table_dat( (ee.events_text or " ") .. ", " .. (ee.cats or " ") .. ", " .. (ee.errs or " ") ) -- viewers.table_dat(ee.yearNepoch) ..
		return t
	end
	local head = mw.text.split( viewers.form9user("author_events_epochs_test_header") , ',')
	local headers = viewers.table_dat(head[1]) .. viewers.table_dat(head[2]) .. viewers.table_dat(head[3]) .. viewers.table_dat(head[4]) .. viewers.table_dat(head[5]) -- t .. viewers.table_row() ..
	local head_sub = mw.text.split( viewers.form9user("author_events_epochs_test_header_sub") , ',')
	--
	t = t .. viewers.table_row() .. headers .. viewers.table_dat(head[6])
	t = t .. viewers.table_row() .. headers .. viewers.table_dat("<b>" .. (head_sub[1] or "-") .. "<b>") -- Normal lifetime
	t = events_epochs_test1( t, "other", "-519", nil, "-400", nil, "-222")
	t = events_epochs_test1( t, "other", "-33", nil, "33", nil, nil)
	t = events_epochs_test1( t, "other", "82", nil, nil, "3", "1777")
	t = events_epochs_test1( t, "other", nil, "3", "419", nil, nil)
	t = events_epochs_test1( t, "other", "400", nil, "519", nil, "2121")
	--
	t = t .. viewers.table_row() .. headers .. viewers.table_dat("<b>" .. (head_sub[2] or "-") .. "<b>") -- Epochs in India
	t = events_epochs_test1( t, "india", "-1958", nil, "-1834", nil, nil)
	t = events_epochs_test1( t, "india", "1700", nil, "1777", nil, nil)
	--
	t = t .. viewers.table_row() .. headers .. viewers.table_dat("<b>" .. (head_sub[3] or "-") .. "<b>") -- Abnormal lifetime
	t = events_epochs_test1( t, "india", "-1758", nil, "-1834", nil, nil)
	t = events_epochs_test1( t, "india", "1700", nil, "1677", nil, nil)
	--
	t = t .. viewers.table_row() .. headers .. viewers.table_dat("<b>" .. (head_sub[4] or "-") .. "<b>") -- Very long lifetime
	t = events_epochs_test1( t, "other", "-520", nil, "400", nil, nil)
	t = events_epochs_test1( t, "other", "-20", nil, "100", nil, nil)
	t = events_epochs_test1( t, "other", "400", nil, "520", nil, nil)
	t = events_epochs_test1( t, "other", "400", nil, nil, "5", nil)
	t = events_epochs_test1( t, "other", "400", nil, nil, "6", nil)
	t = events_epochs_test1( t, "other", nil, "4", "555", nil, nil)
	--
	t = t .. viewers.table_row() .. headers .. viewers.table_dat("<b>" .. (head_sub[2] or "-") .. "<b>") -- Other cases: no epoch
	t = events_epochs_test1( t, "other")
	t = events_epochs_test1( t, "other", "1567", nil, "1654", nil, "1888")
	--
	t = t .. viewers.table_row() .. headers .. viewers.table_dat("<b>" .. (head_sub[6] or "-") .. "<b>") -- Other cases: year or century roman number
	t = events_epochs_test1( t, "other", nil, "début du XVIIème siècle", "avant 1885", nil, nil)
	t = events_epochs_test1( t, "other", "1768", nil, nil, "fin du XIXème siècle", nil)
	t = events_epochs_test1( t, "other", "après CDLVII", nil, "585", nil, nil)
	t = t .. viewers.table_end()
--	
	return t
end -- function p.events_epochs_test(res, args_final)

function p.year_century_epoch_cats_test1( t, region, birthyear, deathyear, year_epoch, name)
	--local ee = p.events_epochs(args_final, mode, ":", verif)
	local args_final = { c = ":", nowyear = modes.args_final.nowyear, region = region, birthyear = birthyear, deathyear = deathyear, year_epoch = year_epoch }
	modes.catView = ":"
	args_final = mw.clone(args_final) -- to not disturb args in final version
	--
	if args_final and tonumber(args_final.birthyear) and tonumber(args_final.deathyear) then
		-- compute midle_century
		args_final.midle_life = math.floor( tonumber(args_final.birthyear) / 2 + tonumber(args_final.deathyear) / 2 )
	elseif args_final and tonumber(args_final.birthyear) then
		args_final.midle_life = tonumber(args_final.birthyear) + 20
	elseif args_final and tonumber(args_final.deathyear) then
		args_final.midle_life = tonumber(args_final.deathyear) - 5
	end
	if args_final and args_final.year_epoch then
		args_final.midle_life = args_final.year_epoch -- activate year_epoch, else midle_life
	end
	if args_final and tonumber(args_final.midle_life) then
		args_final.midle_century = math.floor( tonumber(args_final.midle_life) / 100 )
		if args_final.midle_century > 0 then
			args_final.midle_century = args_final.midle_century + 1
		end
	end
	args_final.midle_life, args_final.midle_century = p.compute_midle_year_century(args_final)
--	args_final.year_epoch = year_epoch
	local ee_epoch_arg = p.events_epochs(args_final, mode, ":", verif)
	t = t .. viewers.table_row() .. viewers.table_dat(name) .. viewers.table_dat(region) .. viewers.table_dat(birthyear) .. viewers.table_dat(deathyear)
	t = t .. viewers.table_dat(args_final.midle_life) .. viewers.table_dat(year_epoch) .. viewers.table_dat(args_final.midle_century)
	t = t .. viewers.table_dat( (ee_epoch_arg.events_text or " ") .. " " .. (ee_epoch_arg.cats or " ") .. " " .. (ee_epoch_arg.errs or " ") )
--	
	return t
end -- function p.year_century_epoch_cats_test1( t, region, birthyear, deathyear, year_epoch, name)

function p.unique_century_life_test1( t, region, birthyear, deathyear, year_epoch, name)
	--local ee = p.events_epochs(args_final, mode, ":", verif)
	local args_final = { c = ":", nowyear = modes.args_final.nowyear, region = region, birthyear = birthyear, deathyear = deathyear, year_epoch = year_epoch }
	modes.catView = ":"
	args_final = mw.clone(args_final) -- to not disturb args in final version
	args_final.midle_life, args_final.midle_century = p.compute_midle_year_century(args_final)
	local ee_epoch_arg = p.events_epochs(args_final, mode, ":", verif)
	t = t .. viewers.table_row() .. viewers.table_dat(name) .. viewers.table_dat(region) .. viewers.table_dat(birthyear) .. viewers.table_dat(deathyear)
	t = t .. viewers.table_dat(args_final.midle_life) .. viewers.table_dat(year_epoch) .. viewers.table_dat(args_final.midle_century)
	t = t .. viewers.table_dat( (ee_epoch_arg.events_text or " ") .. " " .. (ee_epoch_arg.cats or " ") .. " " .. (ee_epoch_arg.errs or " ") )
	return t
end -- function p.unique_century_life_test1( t, region, birthyear, deathyear, year_epoch, name)

-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.compute_midle_year_century() p.year_century_epoch_cats() p.events_epochs()
function p.unique_century_life_test(res)
	local t = ""
	modes.catView = ":"
--	local nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")
--	t = t .. "\n* '''Époque unique pour divers auteurs :'''"
	if res then t = "\n* " .. tostring(res) .. " : "
	else t = "\n* '''Époque unique pour divers auteurs :'''" end
	t = t .. "\n* Le siècle unique convient-il dans tous les cas ?"
	t = t .. viewers.table_row() .. viewers.table_dat("nom") .. viewers.table_dat("région") .. viewers.table_dat("né") .. viewers.table_dat("mort")
	t = t .. viewers.table_dat("mi-vie n+20 à m-5") .. viewers.table_dat("force époque") .. viewers.table_dat("siècle unique") .. viewers.table_dat("catégories et erreurs <br/><b>AVEC siècle unique</b>")
	t = p.unique_century_life_test1( t, "china", " -551", " -479", nil,		"Confucius")
	t = p.unique_century_life_test1( t, "other", "	-59", "	  17", nil,		"Tite-Live")
	t = p.unique_century_life_test1( t, "other", "	120", "	 180", nil,		"Aulu-Gelle")
	t = p.unique_century_life_test1( t, "century"," 400", "		", nil,		"Astérix")
	t = p.unique_century_life_test1( t, "century","	   ", "	 500", nil,		"Obélix")
	t = p.unique_century_life_test1( t, "century","	   ", "	 500", "510",	"Obélix")
	t = p.unique_century_life_test1( t, "india", "	685", "	 763", nil,		"Shantideva")
	t = p.unique_century_life_test1( t, "other", " 1822", " 1909", nil,		"Ernest Pinard")
	t = p.unique_century_life_test1( t, "other", " 1822", " 1909", "1905",	"Ernest Pinard")
	t = p.unique_century_life_test1( t, "other", " 1868", " 1955", nil,		"Paul Claudel")
	t = p.unique_century_life_test1( t, "other", " 1955", " 1868", nil,		"Claudel Paul")
	t = p.unique_century_life_test1( t, "other", " 1918", " 2013", nil,		"Nelson Mandela")
	t = p.unique_century_life_test1( t, "other", " 1918", " 2013", "1666",	"Nelson Mandela")
	t = t .. viewers.table_end()
	return t
end -- function p.unique_century_life_test(res)

function p.interact_args_final(args_import) -- Interact arguments in international args_final
	if true then return Centralizer.interact_args_final(args_import) end
	-- args_final = p.interact_args_final(args_import)
	if type(args_import) ~= "table" then args_import = modes.args_import end
	local args_final = mw.clone(args_import)
	local a = args_import
	local i = {} -- interact
	--
	i.nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")
	-- update sources of untouch arguments
	local k = " wd.src = "
	for key, argm in pairs(modes.args_known) do
		if datas.args_wikidata[key] then
		-- and args_final[key] and (datas.args_wikidata[key] == args_final[key])
			argm.src = "wd"
			k = k .. key .. ":" .. argm.src .. ", "
		end
	end
	--[[
	if a.image then
		i.image = a.image -- string.gsub( a.image, "%s", "" )
		if (i.image == "") or (i.image == " ") then
			i.image = nil
		end
	end
	--]]
	if not a.label then -- If title is undefined, enforce it.
		if a.lastname and a.firstname then
			tit = a.firstname .. " " .. a.lastname
		end
		i.title = a.label or modes.main_title or a.QITEM or a.label or tit
	end
	--
	if not a.QITEM then -- The Title can come from several arguments to insure it.
		i.QITEM = a.label or modes.main_title or a.QITEM or a.label
	end
	--
	if not a.initiale then -- If initiale is undefined, enforce it.
		if a.lastname then
			i.initiale = string.sub( a.lastname, 1, 1 ) -- selector the first letter
			i.initiale = string.upper( i.initiale or "*" )
		end
	end
	-- if absent, default link to other wikis
	if not a.wikipedia then i.wikipedia = a.label end
	if not a.wikiquote then i.wikiquote = a.label end
	if not a.commons then i.commons = a.label end
	if not a.indexpages then i.indexpages = a.label end
	--
	--	familyname	= 'nom',		lastname	= 'nomfamille', firstname	= 'prenom', galliname	= 'prenomGalli',
	--	initial		= 'initiale',	pseudonym	= 'pseudo',		title		= 'titre',
	local sortkey = a.sortkey
	local lastkey, firstkey = ""
	local tabkey = mw.text.split( a.label, '%s')
	local maxkey = table.maxn( tabkey )
	if a.label and not a.firstname and not a.familyname and not sortkey then
		-- If sortkey is undefined, enforce it and inform the user.
		lastkey = tabkey[maxkey] or "" -- select the last word
		if maxkey > 1 then firstkey = tabkey[1] else firstkey = "" end
		sortkey = lastkey .. ", " .. firstkey
		x = x .. "1"
	end
	a.familyname = mw.text.trim(a.familyname or "")
	if a.familyname == "" then a.familyname = nil end
	if a.familyname and a.firstname and not sortkey then
		sortkey = a.familyname .. ", " .. a.firstname
		x = x .. "2"
	end
	if a.label and a.familyname and not a.firstname and not sortkey then
		local title = string.gsub( a.label, a.familyname, "" )
		sortkey = a.familyname .. ", " .. title
		x = x .. "3"
	end
	if a.label and a.firstname and not a.familyname and not sortkey then
		local title = string.gsub( a.label, a.firstname, "" )
		sortkey = title .. ", " .. a.firstname
		x = x .. "4"
	end
	--
	i.sortkey = mw.text.trim(sortkey or "")
--	i.sortkey = string.gsub(i.sortkey, "%s", "")
	i.sortkey_txt = "DEFAULTSORT: " .. i.sortkey -- example {{DEFAULTSORT:Hugo, Victor}}
	p.sortkey_txt = i.sortkey_txt
	-- https://www.mediawiki.org/wiki/Help:Categories#Sort_key
	-- [[Category:Name|Sort]] Sort keys are case-sensitive, and spaces and other characters are also valid.
	-- https://www.mediawiki.org/wiki/Help:Sorting#Sort_order
	-- !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_'abcdefghijklmnopqrstuvwxyz{|}~¡¢£¤¥¦§¨©ª«­®¯°±²³´µ•¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
	--
	if a.initial and (a.initial ~= string.upper(a.initial) ) then
		i.initial = string.upper(a.initial)
		x = x .. "6"
	end
	if i.sortkey and not a.initial then
		-- If initial is undefined, enforce it with the first word of sortkey
		i.initial = string.sub( i.sortkey, 1, 1 ) -- select the first letter
		i.initial = string.upper( i.initial or "" )
		x = x .. "7"
	end
	--
	i.sortkey_not_sure = nil
	if a.label then
		-- If sortkey is undefined, enforce it and inform the user.
		maxkey = table.maxn( tabkey )
		if (maxkey > 2) and not sortkey and not a.familyname then -- If sortkey will not be sure
			i.sortkey_not_sure = events.add_wng("author_tools_auto_val_warning_msg", langs.user_translations["sortkey"], i.sortkey)
			i.initial_not_sure = events.add_wng("author_tools_auto_val_warning_msg", langs.user_translations["initial"], i.initial)
		--	author_tools_auto_val_warning_msg		= "Vérifiez l'argument automatique : %1 = <b>%2</b>.",
		--	author_msg_automatic_argument		= "Vérifiez l'argument automatique <b>%1</b>.",
		end
	end
	-- i.initial_not_sure = events.add_wng("author_msg_automatic_argument", langs.user_translations["initial"])
	i.sortkey_test = (i.sortkey_txt or "") .. viewers.ta("sortkey", i.sortkey) .. viewers.ta("x", x) -- .. viewers.ta("initial", x)
	if i.initial_not_sure  then i.sortkey_test = (i.initial_not_sure or "") .. " " .. i.sortkey_test end
	if i.sortkey_not_sure  then i.sortkey_test = (i.sortkey_not_sure or "") .. "" .. i.sortkey_test end
	p.sortkey_test = i.sortkey_test
	local opt = ", "
	if a.distinctions then i.distinctions = modes.multiple_selection(opt, viewers.form9user("author_distinctions_selector"), a.distinctions) end
	if a.functions then i.functions = modes.multiple_selection(opt, viewers.form9user("author_functions_selector"), a.functions) end
	if a.occupations then i.occupations = modes.multiple_selection(opt, viewers.form9user("author_occupations_selector"), a.occupations) end
	if not a.description then
		-- If description is undefined, replace it with distinctions + functions + occupations
		i.description = (i.distinctions or " ") .. " " .. (i.functions or " ") .. " " .. (i.occupations or " ")
		i.description = mw.text.trim(i.description)
		i.description = string.sub(i.description,1,-2) -- delete the last coma ","
		events.add_wng("author_multi_selector_description", viewers.ta("opt", '"'..opt..'"') .. viewers.ta("distinctions", viewers.form9user("author_distinctions_selector") ) .. viewers.ta("functions", viewers.form9user("author_functions_selector") ) .. viewers.ta("occupations", viewers.form9user("author_occupations_selector") ) )
	end
	--	modes...nowyear = modes.args_final.nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")
	i.nowyear = tonumber(os.date("%Y") ) -- modes.args_final.nowyear from local now_date = os.date("%Y-%m-%d %H:%M:%S")
	--
	if a.birth and not a.birthyear then
		local yyyy, err = modes.date_to_part(a.birth, "yyyy") -- , viewers.form9user("author_date_to_part_format")
		if yyyy then
			i.birthyear = yyyy
		else
			events.add_err(err, viewers.form9user("birthyear"), "yyyy")
			events.add_err("author_date_to_part_call_cat")
		end
	end
	--
	if a.death and not a.deathyear then
		local yyyy, err = modes.date_to_part(a.death, "yyyy") -- , viewers.form9user("author_date_to_part_format")
		if yyyy then
			i.deathyear = yyyy
		else
			events.add_err(err, viewers.form9user("deathyear"), "yyyy")
			events.add_err("author_date_to_part_call_cat")
		end
	end
	--
	if a.userlang then
		i.userlang = a.userlang
		modes.init_user_lang(a.userlang, langs.content_lang)
	end
	if a.wikilang then
		i.wikilang = a.wikilang
		modes.init_user_lang(modes.user_lang, a.wikilang)
	end
	--
	-- memorize interactions in modes.args_final and show messages and/or errors
	local n = 0
	for key, val in pairs(i) do
		local args_kwn = modes.args_known[key]
		if args_kwn then
		--	args_kwn.trk = (args_kwn.trk or "").."i"
			args_final[key] = val -- .. args_kwn.trk -- = i[key]
			args_kwn.src = nil -- automatic_argument value come from internal computing
			n = n + 1
			if (args_kwn.need == 2) and not a[key] then --
				-- need=2 necessary from argument or module interaction
				events.add_wng("author_tools_auto_val_warning_msg", langs.user_translations[key], val)
			--	events.add_wng("author_msg_automatic_argument", langs.user_translations[initial], val)
			end
		else
			events.add_err("author_err_unknown_auto_arg", langs.content_translations[key], val)
		--	events.add_err("author_err_auto_val_unknown", langs.content_translations[key], val)
		end
	end
--	if modes.args_known.title then modes.args_known.title.trk = (modes.args_known.title.trk or "").."i="..n end
	modes.args_final = args_final
	return args_final, t
end -- function p.interact_args_final(args_final)

function p.default_sortkey_to_end(args_final) -- Implement sortkey for category to not disturb it by any other code.
	if type(args_final) ~= "table" then args_final = modes.args_final end
	local author_authors_initial = viewers.form9user(langs.content_translations, "author_authors_initial", args_final.initial)
	local t = "[[" .. mw.site.namespaces.Category.name .. ":" .. author_authors_initial .. "|" .. args_final.sortkey .. "]]"
	return t
end

function p.firstname_familyname_test(t)
	local t = t or "\n* <b>Test of firstname and of family name:</b>"
	local function firstname_familyname_test1(t, title, label, firstname, familyname, initial)
		local tab2 = p.interact_args_final( { title = title, label = label, firstname = firstname, familyname = familyname, initial = initial } )
		t = t .. viewers.table_row() .. viewers.table_dat(title) .. viewers.table_dat(label) .. viewers.table_dat(firstname) .. viewers.table_dat(familyname) .. viewers.table_dat(initial) .. viewers.table_dat(" ") .. viewers.table_dat(tab2.initial) .. viewers.table_dat(tab2.sortkey) .. viewers.table_dat(tab2.sortkey_test)
		return t
	end
	local head = mw.text.split( viewers.form9user("author_firstname_familyname_test_header") , ',')
	t = t .. viewers.table_row() .. viewers.table_dat(head[1]) .. viewers.table_dat(head[2]) .. viewers.table_dat(head[3]) .. viewers.table_dat(head[4]) .. viewers.table_dat(head[5]) .. viewers.table_dat(" ") .. viewers.table_dat(head[6]) .. viewers.table_dat(head[7]) .. viewers.table_dat(head[8])
--	t = (t or "") .. viewers.table_row() .. viewers.table_dat(wd) .. viewers.table_dat(author_authorities_selector) .. viewers.table_dat(ta) .. viewers.table_dat(cln)
--	It easy replaces: table_head, table_row, table_col, table_dat and table_end.
	t = firstname_familyname_test1( t, "Victor Hugo", "Victor Hugo")
	t = firstname_familyname_test1( t, "Victor Hugo", "Victor Hugo", "Victor")
	t = firstname_familyname_test1( t, "Victor Hugo", "Victor Hugo", "Victor", nil, "h")
	t = firstname_familyname_test1( t, "Victor Hugo", "Victor Hugo", nil, "Hugo")
	t = firstname_familyname_test1( t, "Victor Hugo", "Victor Hugo", "Victor", "Hugo")
	t = firstname_familyname_test1( t, "Ricardo De Magon", "Ricardo De Magon")
	t = firstname_familyname_test1( t, "Ricardo De Magon", "Ricardo De Magon", "Ricardo")
	t = firstname_familyname_test1( t, "Ricardo De Magon", "Ricardo De Magon", "Ricardo", nil, "m")
	t = firstname_familyname_test1( t, "Ricardo De Magon", "Ricardo De Magon", nil, "Magon")
	t = firstname_familyname_test1( t, "Ricardo De Magon", "Ricardo De Magon", "Ricardo", "Magon")
	t = t .. viewers.table_end()
	return t
end -- function p.firstname_familyname_test(t)

-- Done: Obsolete old arguments from Auteur2 fr.wikisource.org Modèle:Auteur/Documentation le 05/01/2014
function p.gener_oldargs(args_final) -- Could report use of some args and help to adapt wiki_selectors 25/09/2015
	-- Si un ancien argument spécial est utilisé, mettre la page dans la catégorie prévue, pour repérer toutes les pages concernées
	-- 27/01/2014 19:14 Norm=0 Obso=0 somme=0 + 6495 = 6495 Auteurs
	-- 27/01/2014 21:12 Norm=2887 Obso=0 somme=2887 + 3608 = 6495 Auteurs
	-- 09/02/2014 22:50 Norm=3489 Obso=0 somme=3489 + 3006 = 6495 Auteurs
	-- Aucune page d'auteur n'a utilisé les anciens arguments du Modèle:Auteur2 09/02/2014
	if type(args_final) ~= "table" then args_final = modes.args_final end -- optional arguments
	local res = ""
	local ifcat = false
	--	birth_text =	{typ = "oldargs", ["need"] = 0, keyword = "birth_text", },
	for key, argm in pairs(modes.args_known) do -- Parmi toutes les époques définies
		if (argm.typ == "oldargs") and (argm.val ~= nil) then
			ifcat = true
		end
	end
	--	if ifcat then res = res .. events.add_err("Arguments obsolètes") end
	--	if not ifcat then res = res .. events.add_err("Arguments normaux") end
	return res
end -- function p.gener_oldargs(args_final)

function p.list_wiki_selectors(t) -- author_list_wiki_selectors_title
	t = "\n* " .. (t or " <b>Selectors of this wiki</b>:")
	t = t .. "<br>" .. viewers.ta("author_authorities_selector", langs.user_translations["author_authorities_selector"])
	t = t .. "<br>" .. viewers.ta("author_distinctions_selector", langs.user_translations["author_distinctions_selector"])
	t = t .. "<br>" .. viewers.ta("author_functions_selector", langs.user_translations["author_functions_selector"])
	t = t .. "<br>" .. viewers.ta("author_occupations_selector", langs.user_translations["author_occupations_selector"])
	t = t .. "<br>" .. viewers.ta("author_region_values", langs.user_translations["author_region_values"])
	t = t .. "<br>" .. viewers.ta("author_rights_values", langs.user_translations["author_rights_values"])
	t = t .. "<br>" .. viewers.ta("author_author_sex_values", langs.user_translations["author_author_sex_values"])
	t = t .. "\n*" .. viewers.form9user("author_life_constants_of_module")
	t = t .. "<br>" .. viewers.form9user(langs.user_translations["author_categorise_death_for_n_years"], p.constants.author_categorise_death_for_n_years)
	t = t .. "<br>" .. viewers.form9user(langs.user_translations["author_writing_after_birth"], p.constants.author_writing_after_birth)
	t = t .. "<br>" .. viewers.form9user(langs.user_translations["author_writing_before_death"], p.constants.author_writing_before_death)
	t = t .. "<br>" .. viewers.form9user(langs.user_translations["author_mean_lifetime"], p.constants.author_mean_lifetime)
	t = t .. "<br>" .. viewers.form9user(langs.user_translations["author_lifetime_limit"], p.constants.author_lifetime_limit)
	return t
end -- function p.list_wiki_selectors(t)

function p.list_all_categories(t) -- author_list_all_categories_title
	t = "\n* " .. (t or " <b>List all eventual categories of this wiki:</b>")
	for key, txt in pairs(langs.user_translations) do
		if viewers.is_in("cat_", key) or viewers.is_in("_cat", key) then
			txt = viewers.form9user(txt, "**", "**", "**", "**", "**", "**")
			t = t .. "<br>" .. viewers.ta(key, txt)
		end
	end
	return t
end -- function p.list_all_categories(t)

function p.list_all_errors(t) -- author_list_all_errors_title
	t = "\n* " .. (t or " <b>List all detectable errors of this wiki:</b>")
	for key, txt in pairs(langs.user_translations) do
		if viewers.is_in("err_", key) or viewers.is_in("_err", key) then
			txt = viewers.form9user(txt, "**", "**", "**", "**", "**", "**")
			t = t .. "<br>" .. viewers.ta(key, txt)
		end
	end
	return t
end -- function p.list_all_errors(t)

function p.form_tests_init(args_source)
	if type(args_source) ~= "table" then args_source = modes.args_source end -- optional arguments
	if p.i18n and p.i18n.en then p.i18n.en.error_i18n_wanted_to_test_missing_translation = 'English error i18n wanted for tests missing translation' end
	if p.i18n and p.i18n.es then p.i18n.es.error_i18n_deseada_para_probar_traduccion_maquante = 'Espagnol error i18n deseada para probar traducción maquante' end
	if p.i18n and p.i18n.fr then p.i18n.fr.error_i18n_voulue_pour_test_de_traduction_manquante = 'Français erreur i18n voulue pour tests de traduction manquante' end
	if not args_source.description then args_source.description = "Victor Hugo est très connu." end
	if not args_source.genre then args_source.genre = "Romanciers/Poètes/Auteurs de théatre" end
	if not args_source.language then args_source.language = "français/japonais" end
	if not args_source.occupations then args_source.occupations = "Académiciens/Personnalités politiques" end
	if not args_source.prize then args_source.prize = "Nobel de littérature/Pulitzer" end
	if not args_source.wikipedia then args_source.wikipedia = "Alain Fournier" end
	if not args_source.wikiquote then args_source.wikiquote = "Charles Beaudelaire" end
	if not args_source.commons then args_source.commons = "Victor Hugo" end
	if not args_source.indexpages then args_source.indexpages = "Paul Claudel" end
	if not args_source.epoch then args_source.epoch = "1234" end
	if not args_source.epoque then args_source.epoque = "1357" end
	return
end -- function p.form_tests_init(args_source)

function p.docbox_namespace_error_and_cat() -- to insert before any other errors
	-- If DocBox is displayed out of Module or Template namespace, generate an error and a category "Module with usage error"
	-- Si DocBox est affiché hors de l'espace de nom Module ou Modèle, générer une erreur et une catégorie "erreur d'utilisation"
	local namespace = mw.title.getCurrentTitle().namespace
	local nsText = mw.title.getCurrentTitle().nsText
	if namespace ~= 10 and namespace ~= 828 then -- ns:Template and ns:Module
		events.add_err("author_docbox_namespace_error_err", nsText)
		events.add_err("author_docbox_namespace_error_cat")
	end
	return
end -- function p.docbox_namespace_error_and_cat()

-- Display the documentation in an infobox, similar to edit-boxs
-- Affichage de documentation dans un cadre (box), semblable aux boites d'edition
function p.formDocBox(args_final)
	-- modes.options = " docdata docmin docdef docmax docline docsrc docview : docafter docnotice docsrc" -- for documentation
	-- modes.options = " erron noerr nobox " -- without normal result
	-- modes.options = " debug tests en es fr " -- for debug or enforce language
	local res = ""
	if type(args_final) ~= "table" then args_final = modes.args_final end -- optional arguments
	langs.init_content_page_user_lang(modes.args_source.contentlang, modes.args_source.pagelang, modes.args_source.userlang)
	res = res .. "<center><small>" .. viewers.ta("contentlang", langs.content_lang) .. viewers.ta("pagelang", langs.page_lang) .. viewers.ta("userlang", langs.user_lang)
	res = res .. " - [https://fr.wikisource.org/wiki/MediaWiki:Scribunto/Central_modules_reference_manual User manual]"
	res = res .. " - [https://phabricator.wikimedia.org/T135845 Convert task]" .. "</small></center>"
	res = res .. viewers.styles_color_error("<center><b>" .. viewers.form9user("modes_delete_docbox_wng") .. "</b><br/></center>")
--	res = res .. drop_box.new("allwaysview", "versn_support_desk_title", versions.form_support_desk_report )
	res = res .. dropbox.form(dropbox.new_title(), versions.form_support_desk_report() )
	-- Centralizer begin
--	if modes.option("debug") then
		res = res .. "\n*" .. viewers.ta("modes.catView", modes.catView) .. viewers.ta("modes.template_options", modes.template_options) .. viewers.ta("modes.mode_options", modes.mode_options)
--	end
	local wd, tw, wd_mng = datas.get_item( modes.args_known, modes.args_final.QITEM or "Q535" ) -- for present page
--	local datas_link = '[[d:' .. wd_mng.wd_entity.id .. '|' .. viewers.form9user("datas_Datas_header") .. ']]'
	local datas_link = datas.one_arbitrary_access(wd_mng.wd_entity.id)
--	if modes.option("docdata")	then
		res = res .. "\n*" .. modes.generDoc(" docdef docline ", datas.args_wikidata, datas_link)
--	end
	res = res .. ", " .. viewers.form9user(" (%1	 properties)", (wd_mng.props_count_all or "") ) -- datas_structured_data_txt
--	if modes.option("docview")	then
		res = res .. "\n*" .. modes.generDoc("", args_final, "Arguments")
--	end
--	if not modes.option("noerr") then
		res = res .. "\n*" .. events.errors_lister()
--	end
	-- Centralizer end
	--
	-- Form events views
	local t = ""
	local wng, err, cat = events.sort_typ() -- Sort events by type in wng, err, cat.
	for key, evt in pairs(wng) do
		evt.res, evt = events.form(evt)
		if evt.res then t = t .. "<br>* " .. tostring(evt.res) end
	end
	for key, evt in pairs(err) do
		evt.res, evt = events.form(evt)
		if evt.res then t = t .. "<br>* " .. tostring(evt.res) end
	end
	for key, evt in pairs(cat) do
		evt.res, evt = events.form(evt)
		if evt.res then t = t .. "<br>* " .. tostring(evt.res) end
	end
	res = res .. t
	res = res .. "\n* " .. events.categories_lister(":")
	res = '<div style=" width=90%; border: 1px solid #AAAAAA; margin:1em; background-color:#F1F1F1; padding:0.3em; ">' .. res .. '</div>'
	return res
end -- function p.formDocBox(args_final)

-- Display the documentation in an infobox, similar to edit-boxs
-- Affichage de documentation dans un cadre (box), semblable aux boites d'edition
function p.formDocBox(args_final)
	-- modes.options edit = " docdata docmin docdef docmax docline docsrc docview : docafter docnotice docsrc" -- for documentation
	-- modes.options read = " erron noerr nobox1 " -- without normal result
	-- modes.options tests= " debug tests en es fr " -- for debug or enforce language
	local res = ""
	if type(args_final) ~= "table" then args_final = modes.args_final end -- optional arguments
	langs.init_content_page_user_lang(modes.args_source.contentlang, modes.args_source.pagelang, modes.args_source.userlang)
	res = res .. "<center><small>" .. viewers.discreet_main_version(versions.main_versions) .. viewers.ta("contentlang", langs.content_lang) .. viewers.ta("pagelang", langs.page_lang) .. viewers.ta("userlang", langs.user_lang)
--	res = res .. viewers.discreet_main_version(versions.main_versions)
	res = res .. " - [https://fr.wikisource.org/wiki/MediaWiki:Scribunto/Central_modules_reference_manual User manual]"
--	res = res .. " - [https://phabricator.wikimedia.org/T135845 Convert task]"
	res = res .. " - [[phab:T135845|T135845 Convert task]]" .. "</small></center>"
	res = res .. viewers.styles_color_error("<center><b>" .. viewers.form9user("modes_delete_docbox_wng") .. "</b><br/></center>")
--	res = res .. drop_box.new("allwaysview", "versn_support_desk_title", versions.form_support_desk_report )
	res = res .. dropbox.form(dropbox.new_title(), versions.form_support_desk_report() )
--	modes.mode_options = " debug docview docdata docdef docline "
	if modes.option("debug") then res = res .. "\n*" .. viewers.ta("modes.catView", modes.catView) .. viewers.ta("modes.template_options", modes.template_options) .. viewers.ta("modes.mode_options", modes.mode_options) end
--	local datas_link = datas.one_arbitrary_access(prop.QITEM) -- or "Q535")
	if modes.option("docdata")	then res = res .. "\n*" .. modes.generDoc(" docdef docline ", datas.args_wikidata, datas_link) end
	res = res .. ", " .. viewers.form9user(" (%1	 properties)", (datas.props_count_all or "") ) -- datas_structured_data_txt
	if modes.option("docview")	then res = res .. "\n*" .. modes.generDoc("", args_final, "Arguments") end
	if not modes.option("noerr")then res = res .. "\n*" .. events.errors_lister() end
	--
	local t = "" -- Form events views
	local wng, err, cat = events.sort_typ() -- Sort events by type in wng, err, cat.
	for key, evt in pairs(wng) do
		evt.res, evt = events.form(evt)
		if evt.res then t = t .. "<br>* " .. tostring(evt.res) end
	end
	for key, evt in pairs(err) do
		evt.res, evt = events.form(evt)
		if evt.res then t = t .. "<br>* " .. tostring(evt.res) end
	end
	for key, evt in pairs(cat) do
		evt.res, evt = events.form(evt)
		if evt.res then t = t .. "<br>* " .. tostring(evt.res) end
	end
--	local t = ""langs_main_i18n_languages_count =
	t = t .. langs.main_i18n_languages_list() -- List available translations languages
	res = res .. t
	local result = "\n------ " -- This code interact with DropBox and debug the bug T20151215 2016-11-13 17:57.
	result = result .. '<div class="CentralDocBox" style=" width=90%; border: 1px solid #AAAAAA; margin:1em; background-color:#F1F1F1; padding:0.3em; ">' .. res .. '</div>'
	result = result .. "\n* " .. events.categories_lister(":")
	return result
end -- function p.formDocBox(args_final)

function searchKey(key)
	-- normally the key does not contain any diacritic but it's a common misuse
	-- of the clef = so handle at least the most usual diacritics, note than
	-- prenom can be empty
	local nom, prenom = string.match(key, '^([A-ZÉÈÀÇa-zéèàç-]*)[,]?[ ]*(.*)$')
	return prenom .. ' ' .. 'intitle:' .. nom
end

function errorMessage(text)
	-- Return a html formated version of text stylized as an error.
	local html = mw.html.create('div')
	html:addClass('error')
		:wikitext(text)
		:wikitext('[[Catégorie:Pages faisant un appel erroné au modèle Auteur]]')
	return tostring(html)
end

function createLinkRow(link, site)
	-- Return some html stylised formated text of link
	local html = mw.html.create('div')
	html:tag('span')
		:css({['color'] = '#232388', ['font-size'] = '140%', ['line-height'] = '150%'})
		:wikitext('[[File:' .. site .. '-logo.svg|12px|logo de ' .. site .. ']]&nbsp;&nbsp;')
	html:wikitext(link)
	return html
end

function categorization(baseName, parameter)
	-- Return the categorisation wikitext for each element of parameter prefixed with baseName
	if parameter == nil then return '' end
	local wikitext = ''
	for _,param in pairs(mw.text.split(parameter, '/', true)) do
		wikitext = wikitext .. '[[Catégorie:' .. baseName .. ' ' .. param .. ']]'
	end
	return wikitext
end

function computeCenturyFromYear(year)
	-- Return the correpsonding century for the given year
	if year >= 0 then	return math.ceil(year / 100)
	else				return -math.ceil(-year / 100)
	end
end

function getTextForCentury(century, withHtml)
	-- Return a roman ordinal of century appended with a trailing text precising
	-- if the date is before of after the calendar reference point.
	local romanNumbers1 = {'', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X'}
	local romanNumbers2 = {'', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'}
	local text = romanNumbers2[math.floor(math.abs(century) / 10) + 1] .. romanNumbers1[math.floor(math.abs(century) % 10) + 1]
	if withHtml then text = text .. '<sup>e</sup>'
	else text = text .. 'e'	end
	if century > 0 then return text .. ' siècle'
	else return text .. ' siècle av. J.-C.' end
end

function getTextForYear(year)
	local text = math.abs(year)
	if year < 0 then text = text .. ' av. J.-C.' end
	return text
end

function getDateFromArgs(args, field, fieldUpper)
	local struct = {
		year = nil,
		century = nil,
		text = nil,
		precision = 0
	}
	--extract year or century
	local date = args['annee' .. fieldUpper]
	if date == nil then date = args[field] end
	if tonumber(date) ~= nil then
		struct.year = tonumber(date)
		if struct.year == 0 then
			struct.text = errorMessage("Le calendrier grégorien ne possède pas d’année 0 !")
			return struct
		end
		struct.century = computeCenturyFromYear(struct.year)
		struct.precision = 9
	elseif args['siecle' .. fieldUpper] ~= nil then
		struct.century = tonumber(args['siecle' .. fieldUpper])
		struct.precision = 7
	end
	--build text
	if struct.year ~= nil then
		struct.text = getTextForYear(struct.year)
	elseif struct.century ~= nil then
		struct.text = getTextForCentury(struct.century, true)
	else
		struct.text = date
	end
	if args['text' .. fieldUpper] ~= nil then
		struct.precision = 0 --we don't know anything
		struct.text = args['text' .. fieldUpper] .. ' ' .. struct.text
	end
	if args['incertitude' .. fieldUpper] ~= nil and struct.text ~= nil then
		struct.precision = 0 --we don't know anything
		struct.text = args['incertitude' .. fieldUpper] .. ' ' .. struct.text
	end
	return struct
end

function getDateFromTimeStatements(statements, field)
	if #statements == 0 then
		return { precision = 0 }
	end
	local time = nil
	for _, statement in pairs(statements) do
		local newTime = getDateFromTimeStatement(statement, field)
		if time == nil then
			time = newTime
		elseif time.year ~= newTime.year then --années contradictoires
			return {
				text = errorMessage('Plusieurs années de ' .. field .. ' possibles sur Wikidata. Une manière simple de résoudre se problème est de mettre la date à afficher au rang "préféré".'),
				precision = 0
			}
		end
	end
	if time == nil then
		return { precision = 0 }
	end
	return time
end

function parseWbTime(value)
	local _,_, year = string.find(value.time, '([%+%-]%d%d%d+)%-')
	year = tonumber(year)
	return {
		year = year,
		century = computeCenturyFromYear(year),
		text = nil,
		precision = value.precision
	}
end

function formatDates(naissance, deces)
	local prop = datas.get_item(args_known, QITEM) -- Get datas from mw.wikibase for the page.
	local text = '(' .. prop.birthyear .. " - " ..  prop.deathyear .. " )"
	if 1 then return text end
--	if naissance.text == nil and deces.text == nil then return '' end
	if (type(naissance) ~= "string") then naissance = 'naissance' end
	if (type(deces) ~= "string") then deces = 'deces' end -- naissance.
	local prop = datas.get_item(args_known, QITEM) -- Get datas from mw.wikibase for the page.
	local text = '('
	local prop = datas.get_item(args_known, QITEM) -- Get datas from mw.wikibase for the page.
	if naissance.precision >= 9 then
		text = text .. '<time datetime=' .. naissance.year .. ' class="bday" itemprop="birthDate">' .. naissance.text .. '</time> '
	elseif naissance.text ~= nil then
		text = text .. naissance.text .. ' '
	end
	text = text .. '–'
	if prop.deathprecision >= 9 then
		text = text .. ' <time datetime=' .. prop.deathyear .. '  class="dday" itemprop="deathDate">' .. deces.text .. '</time>'
	elseif deces.text ~= nil then
		text = text .. ' ' .. deces.text
	end
	return text .. ')'
end

function qidForProperty(item, property)
	local statements = item:getBestStatements(property)
	if statements[1] ~= nil and statements[1].mainsnak.datavalue ~= nil then
		return statements[1].mainsnak.datavalue.value.id
	end
	return nil
end

function searchKey(key)
	-- normally the key does not contain any diacritic but it's a common misuse
	-- of the clef = so handle at least the most usual diacritics, note than
	-- prenom can be empty
	local nom, prenom = string.match(key, '^([A-ZÉÈÀÇa-zéèàç-]*)[,]?[ ]*(.*)$')
	return prenom .. ' ' .. 'intitle:' .. nom
end

function p.errors_and_categories_report() -- Report main errors and categories
	local res = "\n* Report main errors and categories."
	if not langs.user_lang then
		res = res .. events.add_err("modes_no_user_lang_err") -- Missing langs.user_lang error
		events.add_cat("modes_no_user_lang_u_cat") -- Double category : no_user_lang and user_error
	end
	if not prop.description then
		res = res .. events.add_err("Missing description")
		events.add_cat("Missing description")
	end
	if type(datas.prop) ~= "table" then
		datas.prop, datas.allprops = datas.get_item(p.args_known, QITEM) -- Get datas from mw.wikibase for the page.
		prop = datas.prop
 	end
	return res
end -- res = res .. p.errors_and_categories_report() -- Report main errors and categories

-- To discard to DEBUG
function viewers.listSingle(list, sep, sep2, sep3) -- Remove repeats in a string list with separators. Can also sort.
	if type(list) ~= "string" then list = "" end
--	Patterns: Dot (.) always matches all characters, including newlines.
--	Patterns: Quantifiers (*, +, ?, and -) may only be applied to individual characters
	if type(sep) ~= "string" then sep = ";" end
	if type(sep2) ~= "string" then sep2 = ";" end
	if type(sep3) ~= "string" then sep3 = ";" end
	if viewers.is_in(sep, ".*+?-") then
		local pcsep = "%" .. sep
		list = string.gsub(list, pcsep, sep )
	end
	if viewers.is_in(sep2, ".*+?-") then
		local pcsep = "%" .. sep2
		list = string.gsub(list, pcsep, sep2 )
	end
	if viewers.is_in(sep3, ".*+?-") then
		local pcsep = "%" .. sep3
		list = string.gsub(list, pcsep, sep3 )
	end
	local listtab = mw.text.split(list or "", sep, true) -- names between commas
	local listtab2 = {}
	for i, name in ipairs(listtab) do -- for all names
		name = mw.text.trim(name) -- keep spaces inside each name
		table.insert(listtab2, name)
	end
	if (sep == "sort") or (sep2 == "sort") or (sep3 == "sort") then
		table.sort(listtab2, function (a, b) return (a < b) end ) -- sort in alphabetic order
	end
	local list2 = ""
	for i, name in ipairs(listtab2) do -- list all names, only one each, in alphabetic order
		name = mw.text.trim(name)
		if (name ~= "") and not viewers.is_in_sp(name, list2, sep) then list2 = list2 .. name .. sep end
	end
	local list = string.sub( list2, 1, (-string.len(sep)-1) ) -- without last sep or ;
	return list
end -- function viewers.listSingle(list, sep, sep2, sep3)

-- Normal result of the module
-- Resultado normal del módulo
-- Résultat normal du module
function p.form_result_old(args_final, main_module)
	local res = ""
	local memo = viewers.zzz_save_configs("p.form_result") -- Save global configuration before eventual changes.
	main_module = main_module or versions.main_module
	if type(args_final) ~= "table" then args_final = modes.args_final end -- optional arguments
	res = res .. lua_table.level_list(args_final, "string", "lang")
	res = res .. viewers.ta("modes.mode_name", modes.mode_name) .. viewers.ta("modes.options", modes.options)
	events.gener_categories(args_final) -- Form all categories without activate them
	local label = args_final.label or modes.main_title or args_final["QITEM"]
	res = res .. ( label or modes.main_title or datas.get_datas_report(label) ) -- Form a data item as title in p.form_result(args_final, main_module)
	res = res .. p.formDocBox(args_final)
--	["QITEM"]			= {typ = "dat", ["need"] = 2, keyword = "QITEM", ["prop"] = "Q16222597"},
	if modes.option("box1") then res = res .. Centralizer.normal_box(modes.args_final) end
	-- Display categories. Afficher les catégories.
	if modes.option("box1") or modes.option("catview") then res = res .. " catview = " .. events.categories_lister(":") end -- display actual categories
	events.categories_lister("") -- gererate actual categories
	res = res .. viewers.form9page("viewers_sentence_example_page_text")
	modes.time3 = os.clock()
	if modes.option("tests") then --   or (modes.args_final.mode == "tests")
		res = res .. viewers.docGroup("allwaysview")
		res = res .. versions.running_times(false, "")
	end
	viewers.zzz_restore_configs(memo, "p.form_result") -- Restore global configurations after eventual changes.
	return res
end -- function p.form_result_old(args_final, main_module)

------------------------------------------------------------
------------------------------------------------------------
-- Interfaces, alias and functions to templates
-- Interfaces, alias y funciones para modelos
-- Interfaces, allias et fonctions pour les modèles
------------------------------------------------------------
------------------------------------------------------------

function p.track_args()
	local notrack = ""
	local t = "- " .. viewers.ta("p.authorities_from_args", modes.tab_fields( p.authorities_from_args) )
	-- "<br/>* " ..
	t = t .. viewers.ta("modes.args_final.authorities_arg", modes.tab_fields(modes.args_final.authorities_arg) )
	t = t .. viewers.ta("langs.content_translations.author_authorities_selector", langs.content_translations.author_authorities_selector)
	t = t .. viewers.ta("p.selected_autorities", modes.tab_fields( p.selected_autorities) )
	return notrack
end

function p.trc(fn_mode, t) -- res = res .. p.trc("where", "text")
	local res = ""
	local a = modes.args_final or {}
	-- put this in comment to desactivate
--	res = res .. "<br/>* " .. (fn_mode or "m") .. ", " .. (t or "t") .. ", " .. viewers.ta("sortkey_test", a.sortkey_test)
	return res
end

function p.testsModule(selector, mask_sections) -- Form a group of dropboxes documentations and tests
	local res = ""
--	res = res .. drop_box.new(selector, "modes_args_known_report_title", modes.args_known_report)
--	res = res .. drop_box.new(selector, "modes_get_args_report_title", modes.get_args_report)
--	res = res .. drop_box.new(selector, "modes_used_options_list_title", modes.used_options_list )
	if not mask_sections then res = res .. viewers.doc_section(selector, "viewers_section_title_page", "h2", mask_sections) end
	res = res .. drop_box.new(selector, "author_copyright_box_test_title", p.copyright_box_test)
	res = res .. drop_box.new(selector, "author_rights_test_title", p.author_rights_test)
	res = res .. drop_box.new(selector, "author_authorities_notices_test_title", p.authorities_notices_test)
	res = res .. drop_box.new(selector, "author_authorities_select_test_title", p.authorities_select_test)
	res = res .. drop_box.new(selector, "author_firstname_familyname_test_title", p.firstname_familyname_test)
	res = res .. drop_box.new(selector, "author_unique_century_life_test_title", p.unique_century_life_test)
	res = res .. drop_box.new(selector, "author_year_to_epoch_test_title", p.years_to_epoch_test)
	res = res .. drop_box.new(selector, "author_century_to_epoch_test_title", p.century_to_epoch_test)
	res = res .. drop_box.new(selector, "author_events_epochs_test_title", p.events_epochs_test) -- , "Evenements et époques. Events and epochs :")
	res = res .. drop_box.new(selector, "mathroman_roman2int_testtitle", mathroman.roman2int_test)
	res = res .. drop_box.new(selector, "mathroman_int2roman_testtitle", mathroman.int2roman_test)
	res = res .. drop_box.new(selector, "tools_mixed_translations_title", modes.i18n_lister)
	--] ]drop_box.new(
	return res
end -- function p.testsModule(selector, QITEM)

function p.testsview(selector, QITEM) -- Form a documentation of one dropbox or all.
	local res = ""
--	res = res .. Centralizer.testsPage(selector, QITEM)
	res = res .. p.testsModule(selector, QITEM)
--	res = res .. Centralizer.testsInternal(selector, QITEM)
	return res
end

------------------------------------------------------------
------------------------------------------------------------
-- Interfaces, alias and functions to templates
-- Interfaces, alias y funciones para modelos
-- Interfaces, allias et fonctions pour les modèles
------------------------------------------------------------
------------------------------------------------------------

p.options_for_modes = { -- module options_for_modes
	read	= " box1 catview ",
	edit	= " box1 docdef docline docsrc docdata catview docview : ",
	doc		= " nobox1 noerr nocatview ",
	tests	= " box1 catview docdef docline docsrc docdata docview : tests docGroup ", -- p.box1()
	notice	= " nobox noerr nocat ",
	notices	= " nobox noerr nocat ",
}

function p.init(frame, mod_name, args_known, options_for_modes) -- Initialise this module.
	local res = ""
--	local mod_name = mod_name or "read"
	local args_known = args_known or modes.args_known or p.args_known or {} -- optional value from p.args_known = {...}
	local options_for_modes = options_for_modes or p.options_for_modes
	res = res .. Centralizer.init(frame, mod_name, args_known, options_for_modes) -- , "Q535" -- QITEM
	modes.args_final = p.interact_args_final(modes.args_import) -- Interactions between argumensts
	modes.args_final.nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")
	return res
end -- function p.init(frame)

function p.box1(prop) -- Generate the main box, in HTML
	local res = ""
 	datas.get_item(p.args_known) -- Get datas from mw.wikibase for the page.
 	prop = datas.prop
 	prop.birthyear_deathyear = '(' .. tostring(prop.birthyear) .. " - " ..  tostring(prop.deathyear) .. " )"
	-- Generate the main box, in HTML
	if type(args_final) ~= "table" then args_final = modes.args_final end -- optional arguments
	local title = args_final.title or "title"
	local caption = args_final.caption
	local image = args_final.image
	local initial = args_final.initial
	local description = args_final.description or ""
	local birthyear = args_final.birthyear
	local deathyear = args_final.deathyear
	local wikipedia = args_final.wikipedia
	local wikiquote = args_final.wikiquote
	local entityid = args_final.entityid
	local commons = args_final.commons
	local indexpages = args_final.indexpages
	local sortkey = args_final.sortkey
	local rights_limit = args_final.rights_limit
	local interwikis = {}
	local wt = ""
--	local warning_versions = modes.warning_short()
	--
	local ee = p.events_epochs(args_final, mode, c, verif)
	description = description .. " " .. ee.events_text
	res = res .. prop.birthyear_deathyear

--[= =[
--	wt = wt .. ee.cats
	if type(precededby) == "string" then
		-- use of another entity in wikidata
		-- a étudié à l'université du Witwatersrand en Afrique du Sud
		description = description .. viewers.form9user("preceded_by", precededby)
	end
	if type(sortkey) ~= "string" then sortkey = '' end
	-- Generate image part of the table
	if type(image) ~= "string" then image = "" end
	image = mw.text.trim(image)
	if image ~= "" then -- taille maximum 280px. Autrement les pages sont classées dans la [[:Catégorie:Taille d'image invalide]].
		image = '[[File:' .. image .. '|frameless|170x170px||class=photo]]'
	else
		image = "&nbsp;"
	end
	local cat_initiale, cat_view = "", ""
	if type(initial) == "string" then
	--	local authors_initial_cat = viewers.form9user("authors_initial_cat", initial)
		local authors_initial_cat = viewers.form9user(translate.wiki_translations, "authors_initial_cat", initial)
		local authors_initiale_txt = viewers.form9user("authors_initiale_txt", initial)
		local authors_initiale_pop = viewers.form9user("authors_initiale_pop", initial)
		cat_view = "[[:" .. mw.site.namespaces.Category.name .. ":" .. authors_initial_cat .. "|" .. authors_initiale_txt .. "]]"
		-- Encode the character ◀=(U+25C0) '<<' (U+25C4)
	end
	if type(indexpages) == "string" then -- Fichier:Quill and ink.svg
	--	indexpages = string.gsub(indexpages, "-", " ") -- space -> "+"
		indexpages = string.gsub(indexpages, "%s", "+") -- space -> "+"
		indexpages = 'Special:IndexPages?key=' .. indexpages -- Victor+Hugo
		icon = '[[File:Quill and ink.svg|14px]]'
		txt = viewers.form9user("box_links_indexpages")
		--	line-height:1.5em;
	end
	if type(wikipedia) == "string" then -- File:Wikipedia-logo.png
		-- [[File:' .. img .. '|22px|link=' .. authority_icon_link .. '|' .. autority_alt_text .. ']]
		txt = viewers.form9user("box_links_biography")
		icon = '[[File:Wikipedia-logo.png|14px|link=w:' .. translate.wiki_lang .. ':' .. wikipedia .. '|' .. txt .. ']]'
		res = res .. "<br/>" .. txt .. icon
	end
	if (type(wikiquote) == "string") and (type(entityid) == "string") then -- Fichier:Wikiquote-logo.png -- Wikiquote-logo-v3.png
		txt = viewers.form9user("box_links_wikiquote")
		icon = '[[File:Wikiquote-logo-v3.png|16px|link=wikiquote:' .. entityid .. '|' .. txt .. ']]'
		res = res .. "<br/>" .. txt .. icon
	end
	if (type(commons) == "string") and (type(entityid) == "string") then -- Fichier:Commons-logo.png
		txt = viewers.form9user("box_links_commons")
		icon = '[[File:Commons-logo.svg|16px|link=commons:' .. entityid .. '|' .. txt .. ']]'
		res = res .. "<br/>" .. txt .. icon
	end
--	prop.itemid = args_final.itemid -- or "Q535" -- DEBUG
	if type(prop.itemid) == "string" then -- File:Wikidata-logo.svg -- Q8023 for Nelson_Mandela
		txt = viewers.form9user("entityid_txt")
	--	[[phab:T135845|T135845 Convert]]
		icon = '[[File:Wikidata-logo.svg|16px]]' .. [[phab:prop.QITEM|Données]]
		res = res .. "<br/>" .. txt .. icon
	end
	local scans, SCAN_gallica, SCAN_europeana, SCAN_google = p.HTMLscans(args_final)
	scans = ""
	if type(SCAN_gallica) == "string" then
		-- scans = scans .. '<span style="color:#232388; ">•&nbsp;</span>[' .. SCAN_gallica .. ' Gallica]'
		scans = scans .. ' [' .. SCAN_gallica .. ' Gallica] &nbsp; '
	end
	if type(SCAN_europeana) == "string" then
		-- scans = scans .. '<br/><span style="color:#232388; ">•&nbsp;</span>[' .. SCAN_europeana .. ' Europeana]'
		scans = scans .. ' [' .. SCAN_europeana .. ' Europeana] &nbsp; '
	end
	if type(SCAN_google) == "string" then
		-- scans = scans .. '<br/><span style="color:#232388; ">•&nbsp;</span>[' .. SCAN_google .. ' Google]'
		scans = scans .. ' [' .. SCAN_google .. ' Google] &nbsp; '
	end
--	scans = viewers.styles_color_discreet( viewers.form9user("rights_limit_txt", rights_limit) ) .. ' &nbsp; ' .. scans
	-- FIXME: The french display is in HTML direct to better adapt the size and the look to plural environments.
	-- Generate scans to display
	local notices = p.form_notices(modes.args_known, args_final)
	if type(SCAN_gallica) == "string" then
		-- scans = scans .. '<span style="color:#232388; ">•&nbsp;</span>[' .. SCAN_gallica .. ' Gallica]'
		scans = scans .. ' [' .. SCAN_gallica .. ' Gallica] &nbsp; '
	end
--	scans = viewers.styles_color_discreet( viewers.form9user("rights_limit_txt", rights_limit) ) .. ' &nbsp; ' .. scans
	-- FIXME: The french display is in HTML direct to better adapt the size and the look to plural environments.
	-- Generate the main box.
	-- Generate scans to display
	local notices = p.form_notices(modes.args_known, args_final)
	-- Generate the main box.
--]= =]
--	Galilée (Q307), Victor Hugo (Q535), Aristote (Q868), Albert Einstein (Q937), Mohandas Karamchand Gandhi (Q1001), Christophe Colomb (Q7322),
--	Nelson Mandela (Q8023), Rudyard Kipling (Q34743), Martin Fleischmann (Q899264), Emmanuel Macron (Q3052772)

	--[= =[

	if type(QITEM) ~= "string" then QITEM = "Q307" end
	prop.label = prop.labelbylang or prop.labeluser or prop.labelpage or prop.labelcontent or prop.labelwithlang or prop.label or prop.sitelink
	prop.image = prop.image or prop.P18 or prop.Q16222597 or "Victor Hugo.jpg"
	local image = viewers.form_image(prop.image, 140, options)
	local Links = {
		Auteurs = "H",
		Wikisource = " Fac-similés",
		Wikipedia = "Biographie",
		Wikiquote = "Citations",
		Commons = "Médias",
		Wikidata = "Données",
	}
	-- Links in p.box1
	prop.initial1 = string.sub(prop.label, 1, 1)
	prop.initial2 = string.sub(prop.label, 1, 2)
	prop.Initial = viewers.styles_color_discreet("◄ ") .. viewers.form9user("[[s:Category:Authors-%1|Authors %2]]", prop.initial2, prop.initial1)
	local Fac = viewers.form_image("Wikisource-logo.svg", 12)
	prop.auteur = string.sub(prop.label, 1, 2)
	prop.Auteurs = Fac .. ' &nbsp; ' .. viewers.form9user("[[s:Category:Authors-%1|Fac-similés]]", prop.auteur)
	local Biographie = viewers.form_image("Wikipedia-logo-v2.svg", 12)
	prop.Biographie = Biographie .. ' &nbsp; ' .. viewers.form9user("[[w:%1|Biographie]]", prop.label)
	local Citations = viewers.form_image("Wikiquote-logo.svg", 12)
	prop.Citations = Citations .. ' &nbsp; ' .. viewers.form9user("[[w:%1|Citations]]", prop.label)
	local Media = viewers.form_image("Commons-logo.svg", 12)
	prop.Media = Media .. ' &nbsp; ' .. viewers.form9user("[[commons:%1|Media]]", prop.label)
	local Donnees = viewers.form_image("Wikidata-logo.svg", 12)
	prop.Donnees = Donnees .. ' &nbsp; ' .. viewers.form9user("[[d:%1|Données]]", prop.label)
	-- Aristote (Q868) replace Christophe Colomb (Q7322) ?
	local prop_links = '<td rowspan="3" >' -- data1 begin links
		.. prop.Initial .. '<br><br>'
		.. prop.Auteurs .. '<br><br>'
		.. prop.Biographie .. '<br><br>'
		.. prop.Citations .. '<br><br>'
		.. prop.Media .. '<br><br>'
		.. prop.Donnees .. '<br><br>'
	.. '</td>' -- data1 end links
	local prop_label = '' -- '<th valign="top" rowspan="1" align="center" style="min-width:40%; padding:0.5em; ">'
		.. '<p align="center"><big><big><b>' .. prop.label .. '</b></big></big></p>'
	local prop_descr = '' -- '<th valign="top" rowspan="1" align="center" style="min-width:40%; padding:0.5em; ">'
		.. '<p align="center" style=" padding:4px; ">' .. '<br>' .. '<br>' .. prop.description .. " " .. prop.birthyear_deathyear .. '</p>'
	  .. '' -- '</th>'
	local prop_img = '<td align="center" rowspan="3" style=" border-left:{{{border|0}}}px solid #CCCCCC; ">' -- data3 begin image
		.. '<div id="AuthorImage" style=" padding:4px; ">'
			.. image
		.. '</div>'
	  .. '</td>' -- data3 end image
	res = res .. " *p.box1* "
	.. '<div id="Author" itemscope="" itemtype="http://schema.org/Person" style="margin-right:5px; box-shadow:0.2em 0.3em 0.2em #B7B7B7; background-color:#F1F1DE; padding:0.3em; overflow:auto; line-height:80%; border-radius:0.7em; " >'
	--  .. '<table cellspacing="5%" cellpadding="5%" style="background-color: transparent; border:none; padding:2em;">'
	  .. '<table cellspacing="2%" cellpadding="2%" style="background-color: transparent; border:none;">'
		.. '<tr>' -- row1 begin = links + label/description + image
		  .. '<td>' -- data2 begin label/description
		  .. prop_links -- data1 end links
		  .. '</td>' -- data2 begin label/description
			.. '<td>' -- row1 begin label
		--	  .. '<th>' -- data2 begin label/description
				  .. prop_label
			  .. '<br>' -- data2 begin label/description
			  .. '<br>' -- data2 begin label/description
			  .. '<br>' -- data2 begin label/description
			  .. '<br>' -- data2 begin label/description
				  .. prop_descr
			  .. '<br>' -- data2 begin label/description
				  .. scans
			  .. '</td>' -- data2 begin label/description
			.. '</td>' -- row1 begin label
		  .. '<td>' -- data3 end image
			  .. prop_img
		  .. '</td>' -- data3 end image
		.. '</tr>' -- row1 end = links + label/description + image
	  .. '</table>'
	.. '</div>'
	-- Centralizer begin
	if modes.option("debug") then res = res .. "\n*" .. viewers.ta("modes.catView", modes.catView) .. viewers.ta("modes.template_options", modes.template_options) .. viewers.ta("modes.mode_options", modes.mode_options) end
--	local datas_link = '[[d:' .. wd_mng.wd_entity.id .. '|' .. viewers.form9user("datas_Datas_header") .. ']]'
--	local datas_link = datas.one_arbitrary_access(wd_mng.wd_entity.id)
	if modes.option("docdata")	then res = res .. "\n*" .. modes.generDoc(" docdef docline ", datas.args_wikidata, datas_link) end
	res = res .. ", " .. viewers.form9user(" (%1	 properties)", lua_table.level_count(prop) ) -- datas_structured_data_txt
	if modes.option("docview")	then res = res .. "\n*" .. modes.generDoc("", args_final, "Arguments") end
	if not modes.option("noerr")then res = res .. "\n*" .. events.errors_lister() end
	--]= =]
	return res
end -- function p.box1(prop) -- Generate the main box, in HTML

function p.form_result(args_final, main_module) -- Form all results of this module, and of others.
	local res = ""
	local memo = viewers.init_configs("p.form_result") -- Initialize global configurations and save them before eventual changes.
	main_module = main_module or versions.main_module
	if type(args_final) ~= "table" then args_final = modes.args_final end -- optional arguments
	res = res .. viewers.ta("modes.mode_name", modes.mode_name) .. viewers.ta("modes.options", modes.options)
	events.gener_categories(args_final) -- Form all categories without activate them
--	local label = modes.args_final.label or modes.main_title or prop.Label or modes.args_final.itemid
	local label = modes.args_final.label or modes.main_title or datas.prot("title") or modes.args_final.itemid
--	local label = modes.args_final.label or modes.main_title or modes.args_final.QITEM or modes.args_final.itemid
	if modes.option("docview") or modes.option(":") or modes.option("tests") or (modes.args_final.mode == "edit") then
--		res = res .. drop_box.new("allwaysview", "versn_support_desk_title", versions.form_support_desk_report )
		res = res .. p.formDocBox(modes.args_final)
	end
	datas.prop, datas.allprops = datas.get_item()-- p.args_known) , QITEM or "Q937") -- Get datas from mw.wikibase for the page.
	if modes.option("box1") then res = res .. " *form_result* " .. p.box1() end
	if modes.option("box1") or modes.option("catview")
	then res = res .. " catview = " .. events.categories_lister(":") end -- Display categories
	events.categories_lister("") -- Really to link to categories
	modes.time3 = os.clock()
	if modes.option("tests") then --   or (modes.args_final.mode == "tests")
		Centralizer.tst = false -- To form documentations of only some tests and reports.
		Centralizer.tst = "tst" -- To form all tests and reports.
		res = res .. p.box1()
		res = res .. viewers.docGroup("allwaysview")
--		res = res .. viewers.docPage("allwaysview", QITEM)
--		res = res .. viewers.docModule("allwaysview", QITEM)
--		res = res .. viewers.docInternal("allwaysview", QITEM)
		res = res .. p.testsModule("allwaysview", QITEM) -- Form a group of dropboxes documentations and tests
		res = res .. p.testsview("allwaysview", QITEM) -- Form a documentation of one dropbox or all.
	--	res = res .. versions.running_times(false, "") -- false to enforce the view
		res = res .. versions.running_times() -- false to enforce the view
	end
	--	selector = "allwaysview" -- To allways display one view. -- selector = "enforcerun" -- To debug one box with INTERNAL ERROR.
	viewers.restore_configs(memo, "p.form_result") -- Restore global configurations after eventual changes.
	return res
end -- res = res .. p.form_result(args_final, main_module) -- Form all the result of this module

function p.ModuleAuteur2_20161214() -- From Tpt on 2016-12-14 in ModuleAuteur2 20161214.lua
	local t = "\n* function p.ModuleAuteur2_20161214<br/>"
	return t
end -- function p.ModuleAuteur2_20161214() -- From Tpt on 2016-12-14 in ModuleAuteur2 20161214.lua

function p.read(frame) -- The read mode generates the normal result for read only users.
	-- Helpers or admins can add options to include edit or tests or user language...
	local res, t = "", ""
--	t = t .. Centralizer.init(frame, "read", p.args_known, p.options_for_modes) -- , "Q535" -- QITEM
	res = res .. p.init(frame, "read", p.args_known, p.options_for_modes) -- Initialise this module.
	res = res .. p.version.versionNumber
--	modes.args_import = modes.import_arguments(args_known, args_source, content_translations, args_wikidata)
	modes.args_final = p.interact_args_final(modes.args_import) -- Interactions between arguments
--	res = res .. p.ModuleAuteur2_20161214()
	datas.prop, datas.allprops = datas.get_item(p.args_known, QITEM) -- Get datas from mw.wikibase for the page.
	res = res .. p.form_result(modes.args_final)
	return res
end -- function p.read(frame)

function p.edit(frame) -- The edit mode verifies arguments, displays the edit panel with errors, warnings and categories.
	local res, t = "", ""
--	t = t .. Centralizer.init(frame, "edit", p.args_known, p.options_for_modes) -- , "Q535" -- QITEM
	res = res .. p.init(frame, "edit", p.args_known, p.options_for_modes) -- , "Q535" Initialise this module.
--	versions.site_currentVersion_memo = "1.29.0-wmf.18 (9ab639f)"

--	versions.detect_mediawiki_changes()
--	res = res .. "<br>Begin " .. viewers.ta("currentVersion", p.version.currentVersion)
	modes.args_final = p.interact_args_final(modes.args_import) -- Interactions between argumensts
	langs.init_content_page_user_lang()
	res = res .. p.form_result(modes.args_final)
--	res = res .. "<br>End " .. viewers.ta("currentVersion", p.version.currentVersion)
--	res = res .. p.version.currentVersion
	return res
end -- function p.edit(frame)

function p.doc(frame) -- Form a documentation or a test in a dropbox.
	local res, t = "", ""
--	t = t .. Centralizer.init(frame, "doc", p.args_known, p.options_for_modes) -- , "Q535" -- QITEM
	t = t .. p.init(frame, "doc", p.args_known, p.options_for_modes) -- Initialise this module.
	t = t .. p.version.versionNumber .. ", " .. p.version.mainDescription .. ", " .. p.version.taskDescription
--	versionName = "Author3", versionNumber = "1.0.0(180407:06:30)", versionDate = "2018-04-07T06:30",
	-- UTC version structure :		  main.fonction.task(yymmdd:hh:mm)
--	mainDescription = "Begin to use", functionDescription = "try Module.Author3", taskDescription = "update for the last Module.Author3 version",
--	t = t .. "\n*" .. viewers.ta("modes.mode_options", modes.mode_options)
--	t = t .. viewers.ta("modes.invoke_options", modes.invoke_options)
--	local dockey = modes.args_final.dockey or modes.args_source[1]
--	local QITEM = modes.args_final.QITEM or modes.args_final.id or modes.args_source[2]
	modes.change_itemid() -- "Q41568"
	modes.args_final = p.interact_args_final(modes.args_import) -- Interactions between argumensts
	langs.init_content_page_user_lang()
	modes.time3 = os.clock()
	if dockey then
--		res = res .. viewers.docGroup(dockey, QITEM)
--		return res
	else
--		return ""
	end
	res = res .. p.form_result(modes.args_final)
end -- function p.doc(frame)

function p.notice(frame) return p.notices(frame) end -- alias function
function p.notices(frame) -- Forms only the selected notices of authorities.
	if 1 then return "p.notices(frame) = p.notices(frame)" end
	local res = ""
--	res = res .. Centralizer.init(frame, "notices", p.args_known, p.options_for_modes) -- , "Q535" -- QITEM
	res = res .. p.init(frame, "notices", p.args_known, p.options_for_modes) -- Initialise this module.
	res = res .. p.version.currentVersion
--	res = res .. p.form_result(modes.args_final)
	modes.time3 = os.clock()
	modes.args_final = p.interact_args_final(modes.args_import) -- Interactions between argumensts
	modes.args_selected, p.selected_autorities, p.authorities_from_args = p.authorities_select() -- depends of several arguments
	res = res .. p.form_notices(modes.args_known, modes.args_selected)
	return res
end	 -- function p.notices(frame)

function p.tests(frame)
	local res, t = "", ""
--	t = t .. Centralizer.init(frame, "tests", p.args_known, p.options_for_modes) -- , "Q535" -- QITEM
	res = res .. p.init(frame, "tests", p.args_known, p.options_for_modes) -- Initialise this module.
	t = t .. p.version.versionNumber
--	versionName = "Author3", versionNumber = "180209.1525", versionDate = "2018-02-09 15:25",
	t = t .. "\n* getEntityIdForCurrentPage = " .. tostring( mw.wikibase.getEntityIdForCurrentPage() ) -- Returns the Item id as string, like "Q42"
	p.form_tests_init()
--	res = res .. t
	modes.args_final = p.interact_args_final(modes.args_import) -- Interactions between argumensts
	modes.mode_name = modes.args_final.mode or modes.args_final.mode or "tests" -- or modes.args_import.mode
	langs.init_content_page_user_lang()
	versions.main_versions = versions.main_versions or { versionName = "versionName", versionNumber = "0.0", }
	local res_function = "<br>* " .. versions.main_versions.versionName .. ":" .. modes.mode_name .. ":" .. langs.content_lang .. " "
	if not versions.main_versions then versions.main_versions = versions.versions or p.version end
	local res_function = "<br/>\n" .. (versions.main_versions.versionName or "MainModule_t") .. " " .. (versions.main_versions.versionNumber or "0.0_t") .. ":" .. modes.mode_name .. ":" .. langs.content_lang .. " "
	res = res .. res_function .. " Begin:" .. "<br>"
	--[[
--	res = res .. drop_box.new("allwaysview", dropbox.form_doc_title(), modes.used_options_list() )
	res = res .. p.formDocBox(args_final)
	res = res .. p.form_result() -- Generate wikitext, categories, and others
--	res = res .. viewers.docGroup("allwaysview")
--	res = res .. viewers.docPage("allwaysview")
	res = res .. viewers.docModule("allwaysview")
--	res = res .. viewers.docInternal("allwaysview")
--]]
	res = res .. p.box1(vals) -- Form a box with variables to replace from a table of string values.
--	res = res .. p.testsModule("allwaysview", QITEM) -- Form a group of dropboxes documentations and tests
--	res = res .. p.testsview("allwaysview", QITEM) -- Form a documentation of one dropbox or all.
--	res = res .. versions.running_times(true, "")
	return res
end -- function p.tests(frame)

--	function viewers.docInternal(selector, QITEM) -- Form some dropboxes of tests to document internal functions.
--	Usual pages for Translations (for easier select the test page when edit this module in other wikis)
--	Utilisateur:Rical/Auteur:Victor Hugo	(Q535)
--	Utilisateur:Rical/Auteur:Nelson Mandela	(Q8023)
--	Module:Author3/Documentation
--	Modulenn:Centralizer-s-br/doc				{{#invoke:Centralizer-s-br|read}}	br = Breton = Brezhoneg
--	Modul:Centralizer-s-de/Doku					{{#invoke:Centralizer-s-de|read}}	de = German = Deutsch
--	Module:Centralizer-s-en/Documentation		{{#invoke:Centralizer-s-en|read}}	en = English = English
--	Module:Centralizer-s-es/Documentación		{{#invoke:Centralizer-s-es|read}}	es = Spanish = español
--	Modul:Centralizer-w-hu/doc					{{#invoke:Centralizer-w-hu|read}}	hu = Hungarian = Magyar
--	Module:Centralizer-mw-en/doc				{{#invoke:Centralizer-mw-en|read}}	en = English = English
--	Mô đun:Centralizer-w-vi/tài liệu			{{#invoke:Centralizer-w-vi|read}}	vi = Vietnamese = Tiếng việt
--	MediaWiki:Scribunto/Central modules reference manual
--	Module:Centralizer-s-fr/Documentation		{{#invoke:Central-s-fr|read}}	fr = French = Français proto
return p