Module:Auteur4

From Wikipedia

Module:Auteur4 normal[edit]

Lua error at line 3702: attempt to call field 'trck' (a nil value).

  • Recueil de poèmes. Script error: No such module "Auteur".
  • Sous les toits de Paris. Script error: No such module "Auteur".

Module:Auteur4 notices[edit]

Lua error at line 3770: attempt to call field 'trck' (a nil value).

Module:Auteur4 tests[edit]

Lua error at line 3824: attempt to call field 'trck' (a nil value).


--[[

-- Fait : Le modèle definissait les années incertaines par plusieurs paramètres.
-- Le module reconnait l'année dans le texte libre du paramètre.
-- A faire OK : Catégorie:Siècle incertain -> Epoque incertaine
-- A faire : Catégorie:Epoque inconnue
-- A faire : (802 av. J.-C. – DEBUT= -802 après FIN=-803 Catégorie:Années début après fin 803 av. J.-C.)
-- A faire : verifier DEBUT < FIN pour annees siecles et mixages, avec traductions
-- A faire : verifier naissance avant la mort pour annees, siecles et mixages, avec traductions
-- A faire : Dans le calcul des époques et siècles, il y a une ambiguité depuis longtemps : le libelé des siècles est "Naissance en 1876" alors que les époques sont basées sur l'âge de publication à partir de 20 ans. A la transition entre siècles et époques il y a un flou.
-- A faire : Début de siècle avant année
-- A faire : verifier la durée de vie < 120 ans, selon les années et siècles
-- A faire : Verifier les parametre manquants apres wikidata et avant interactions
-- A faire : Wikidata categories de maintenance : Wikidata est innacsessible.
-- A faire : Wikidata categories de maintenance : Cet article n'existe pas dans Wikidata.
-- A faire : Wikidata categories de maintenance : Cette propriété n'existe pas dans Wikidata.
-- A faire : droits d'auteur, box et catégories.
-- A faire : droits d'auteur, dans les box renvoyer vers l'aide.
-- A faire : droits d'auteur, ajouter l'aide DP 1923 + DP-EU + DP-US
-- A faire : valider (ou non) le code de langue d'une table i18n par mw.language.isKnownLanguageTag( code )
-- A faire : verifier la structure des tables i18n par mw.language.isKnownLanguageTag( code )
-- A faire : finaliser l'intégration de microformat
--
-- Etat edit state : a detecter pour adapter les messages d'erreurs et categories
-- http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual
--    4.8.6 mw.uri.canonicalUrl
-- 		mw.uri.canonicalUrl( page, query )
--		Returns a URI object for the canonical url for a page, with optional query string/table.
--	4.8.7 mw.uri.fullUrl
--		mw.uri.fullUrl( page, query )
--		Returns a URI object for the full url for a page, with optional query string/table.
--		fullUrl( query, proto ): Returns the full URL (with optional query table/string) for this title. proto may be specified to control the scheme of the resulting url: "http", "https", "relative" (the default), or "canonical".
--
-- {{Paramètre|categorie=Auteurs|texte=langue|valeurs=grecs/russes/chinois}}
-- Catégorie:Auteurs grecsCatégorie:Auteurs russesCatégorie:Auteurs chinois 
-- {{Paramètre|texte=métiers|valeurs=Académiciens/Personnalités politiques}}
-- Catégorie:AcadémiciensCatégorie:Personnalités politiques
-- {{Paramètre|valeurs=grec/russe/arabe}}
-- Catégorie:grecCatégorie:russeCatégorie:arabe
-- siecleNaissance = ou siecleDeces = : numéro de siècle, au format numérique –5 pour le ve siècle av. J.-C.
-- tester les droits d’auteur
-- Catégories automatiques d’années depuis les derniers 100 ans
-- Doc : principales évolutions de modèle à module
	-- Ces arguments et détails, utiles aux sous-modèles, permettent de maîtriser des cas particuliers.

    droits = 70 : si les ayants droits de cet auteur(e) ont des droits d’auteur aux États-Unis jusqu’à 70 ans après son décès. Valeur par défaut.

        = mpf, si les ayants droits de cet auteur(e) mort(e) pour la France ont des droits d’auteur en France jusqu’à 95 ans après son décès.
        = non, si cet auteur(e) n’a aucun droit sur ses œuvres.

    pseudo = : un ou plusieurs pseudonymes, séparés par /, comme Arsène Lupin/Georges Sand.
    genre = : un ou plusieurs genres littéraires, parmi les genres existants si possible, séparés par /, comme Conteurs/Traducteurs.
    langue = : une ou plusieurs langues d’écriture dans ses œuvres, parmi les langues existantes si possible, séparées par /, comme allemands/syriens.
    Pour créer des catégories particulières, non prévues par le modèle, on peut détourner le paramètre langue :

    {{Auteur...| langue = .../des temps barbares}} donne la catégorie : Auteurs des temps barbares.

    pays = : un ou plusieurs pays dans lesquels il ou elle a notablement vécu, séparés par /, comme France/Italie.
    metier = : un ou plusieurs métiers ou activités notables qu’il ou elle a exercé, parmi les métiers existants si possible, séparés par /, comme Diplomates/Philologues.
    prix = : un ou plusieurs prix qui lui ont été décernés, parmi les prix existants si possible, séparés par /, comme Nobel de littérature/Goncourt.
    wp, wq ou commons = : noms de pages Wikipédia, Wikiquote ou Commons s’ils différent du nom complet.


* http://fr.wikisource.org/wiki/Module:Auteur
* Ce module dessine un cadre d'entête de page d'auteur dans wikisource français.
* Il est appelé par le modèle {{Author... ou {{Auteur...
* Il utilise le "Module:Multilingual Arguments" pour vérifier les paramètres (arguments en anglais), et pour alerter ou conseiller l'utilisateur.

* This module draws a header of Author page in french wikisource
* It is called by templates {{Author... or {{Auteur...
* It uses the "Module:Multilingual Arguments" to verify arguments (les paramètres en français), and to warm or advise the user.

Fonctions
* Le Module:Auteur utilise le Module:ControlArgs qui permet ceci :
* L'assistance à l'utilisateur génère des messages sur les paramètres à problèmes.
* Une table des arguments permet de repérer les arguments nécessaires, manquants, synonymes, numérotés ...
* Des tables de traductions permettent de recevoir les arguments ou de générer les messages en plusieurs langues.

Example of complex template with many arguments :
Exemple de modèle complexe avec de nombreux paramètres :
{{Auteur |c=:|options=fr test params
|nom=Hugo|prénom=Victor|prénomGall= Arthur
|cle=Hugo Victor|initiale=H
|image=Victor Hugo.jpg |description=écrivain français
|texte=vie |categorie=Auteurs |lien=du |liaison=de l'
|texteNaissance=a |categorieNaissance=Auteurs
|incertitudeNaissance= vers |lienNaissance=du |liaisonNaissance=en
|anneeNaissance= 1802 |siecleNaissance= 19
|texteDeces=a |categorieDeces=Auteurs
|incertitudeDeces= après |lienDeces= du |liaisonDeces=en
|anneeDeces= 1885 |siecleDeces= 19
|droits=non |pseudo=Monsieur Legrand
|genre=Romanciers/Poètes/Auteurs de théatre
|langue=français |pays=France/Italie/Grèce
|metier=Académiciens/Personnalités politiques
|prix=Prix Nobel de littérature
|VIAF=34452139|NLA=35096649|BNF=cb11888266r|SELIBR=34648|PND=11850133X|LCCN=n/50/23101
|border=0
}}

 *		GESTION DES PARAMETRES DU MODELE, MANAGING PARAMETERS OF THE TEMPLATE
 * 
 * La gestion des paramètres permet de :
 *	* Lire et mémoriser tous des paramètres fournis par le modèle (voir arg_input arg_memorize)
 *	* S'adapter à la langue du wiki ou une autre (voir arg_lang)
 *	* Lire ou modifier simplement la valeur mémorisée chaque fois que nécessaire, indépendamment de la langue (voir argv arg_memorize)
 *	* Lister les paramètres, tous(docmax), ou ceux définis(docdef), ou selon la spécialisation (docmin, doc1 à doc3)
 *	* Aider à documenter le modèle selon divers aspects, types, usages ...
 *	* Lire d'abord tous les paramètres définis, puis calculer les interactions des noms, prénoms, et autres.
 *	* Développer la vérification des paramètres, de leurs valeurs, de leurs interdépendances.
 * Une table args_known décrit les paramètres, leurs types, leurs valeurs et leurs appelations dans diverses langues.
 * Les types sont ctr = controle, dat = donnée, ntc = notice, opt = options, syn = synonyme, prg = géré uniquement par le programme
 * Les langues sont : en = anglais, es = espagnol, fr = français et il est facile d'en ajouter.
 * L'objet MArgms, tables et fonctions, est développé ici pour être déplacée dans un module indépendant et partagé.
 * Le 2013-01-27, l'objet MArgms est prévu pour fonctionner comme une classe, avec héritage et fonction New, mais n'est pas encore validé.
--]]

--[[
{{Auteur |options=fr par-ams docavant doc-min docmax docdef docnotice doc-apres docligne
 |c=x:|border=0
 | nom = Rimbaud | prénom = Arthur | cle = Rimbaud | prénomGall= Arthur
 | description = Poète français très connu.
 | naissance = 1854 | deces = 1891 | image = Carjat Arthur Rimbaud 1872 n2.jpg
 | droits = 70 | initiale = R | wikipedia    = Arthur Rimbaud
 | wikiquote    =  Arthur Rimbaud | commons      =  Arthur Rimbaud | commonscat   = 
|texte=vie |categorie=Auteurs |lien=du |liaison=de l'
|texteNaissance=a |categorieNaissance=Auteurs
|incertitudeNaissance= vers |lienNaissance=du |liaisonNaissance=en
|anneeNaissance= 1802 |siecleNaissance= 19 
|texteDeces=a |categorieDeces=Auteurs
|incertitudeDeces= après |lienDeces= du |liaisonDeces=en
|anneeDeces= 1885 |siecleDeces= 19
|droits=non |pseudo=Monsieur Legrand
|genre=Romanciers/Poètes/Auteurs de théâtre |langue=français |pays=France/Italie/Grèce
|metier=Académiciens/Personnalités politiques |prix=Nobel de littérature
 |VIAF=34452139 |NLA=35096649 |BNF=cb11888266r |SELIBR=34648 |PND=11850133X |LCCN=n/50/23101
 |ARC=34452139 |ISBN=123456789 |OCLC=1b5g6t7e |SWD=11/224/488 |ARCitem=Robert/Alain/Paul
 |WORLDCATch=Andrea/Mickel |ARCid=34-452-139
}}

--]]

--	Module dependencies. Dependencias del módulo. Dépendances du module.
local MathRoman = require "Module:MathRoman"
local CA = require "Module:ControlArgs"

i18n = { }

i18n_en = { -- English translations of arguments, categories and messages :
	lastname					= 'lastname',
	initiale					= 'initiale',
	familyname					= 'familyname',
	firstname					= 'firstname',
	pseudonym					= 'pseudonym',
	title						= 'title',
	galliname					= 'galliname',
	sex							= 'sex',
	sortkey						= 'sortkey',
	image						= 'image',
	birthyear					= 'birthyear',
	birth						= 'birth',
	birthcentury				= 'birthcentury',
	birthuncertain				= 'birthuncertain',
	region						= 'region',
	deathyear					= 'deathyear',
	death						= 'death',
	deathcentury				= 'deathcentury',
	deathuncertain				= 'deathuncertain',
	description					= 'description',
	occupation					= 'occupation',
	genre						= 'genre',
	language					= 'language',
	country						= 'country',
	prize						= 'prize',
	rights						= 'rights',
	wikipedia					= 'wikipedia',
	wikiquote					= 'wikiquote',
	commons						= 'commons',
	commonscat					= 'commonscat',
	namespace					= 'space',
	category					= 'Category',
	catspace					= 'catspace',

	-- Scans and Notices
	author_Scans				= 'Scans in',
	author_Notices				= 'Notices',
	ARC							= 'ARC',
	ARCid						= 'ARCid',
	ARCitem						= 'ARCitem',
	ARCorg						= 'ARCorg',
	ARCsub						= 'ARCsub',
	BNF							= 'BNF',
	DNB							= 'DNB',
	GKD							= 'GKD',
	GKD_V1						= 'GKD_V1',
	IA							= 'IA',
	ARCHIVE						= 'ARCHIVE',
	IBL							= 'IBL',
	IBLid						= 'IBLid',
	IBLbook						= 'IBLbook',
	ISBN						= 'ISBN',
	ISFDB						= 'ISFDB',
	ISFDBid						= 'ISFDBid',
	ISFDBpub					= 'ISFDBpub',
	ISFDBtitle					= 'ISFDBtitle',
	LCCN						= 'LCCN',
	LT							= 'LT',
	NLA							= 'NLA',
	OCLC						= 'OCLC',
	OL							= 'OL',
	PND							= 'PND',
	SELIBR						= 'SELIBR',
	SUDOC						= 'SUDOC',
	SWD							= 'SWD',
	ULAN						= 'ULAN',
	VIAF						= 'VIAF',
	WORLDCATID					= 'WORLDCATID',
	XXX							= 'XXX',
	
	-- Categories and Various messages
	-- These messages should also include those of module(s) called.
	wanted_error				= "EN wanted error",
	authors_authors				= "Authors",
	authors_initiale			= "Authors-%1",
	authors_birthyear			= 'Born in %1',
	authors_deathyear			= 'Death in %1',
	list_limit_levelmaxi		= "Structure limit levelmaxi=%1",
	list_limit_maxn				= "Structure limit maxn=%1",
	limit_cat_birth_death		= 'Limit the years of categories "Births in" and "Death in".',
	cat_epoch_china_antiquity	= "Author of Chinese antiquity",
	cat_epoch_china_springs		= "Author of Springs and Autumns",
	cat_epoch_china_empires		= "Author of Chinese empires",
	cat_epoch_indian_indus		= "Author of Indus civilisation",
	cat_epoch_indian_antiquity	= "Author of Indian antiquity",
	cat_epoch_indian_muslim		= "Author of Indo-Muslim period",
	cat_epoch_antiquity			= "Author of antiquity",
	cat_epoch_middle_age		= "Author of Middle Ages",
	cat_epoch_century_EC		= "Born in the %1 th century",
	cat_epoch_century_BEC		= "Born in the %1 th century BEC",
	century_EC					= "%1 th century",
	century_BEC					= "%1 th century BEC",
	
	-- Error messages and categories
	-- These messages should also include those of module(s) called.
	err_one_number_argument		= "Error: In parameter '''%1''', enter a single number between -5000 and now.",
	err_assist_user_param		= "<br/>User support for checking the settings:",
	err_module_error			= "Module error",
	--
	err_vague_year				= "Uncertain year.",
	err_death_before_birth		= "Error: death '''%1''' is before birth '''%2'''.",
	err_death_before_birth_cat	= "Author death is before birth.",
	err_life_too_long			= "Life is too long from %1 to %2.",
	err_life_too_long_cat		= "Life of author is too long",
	err_no_known_arguments		= "Module without known arguments table.",
	err_vague_epoch				= "Uncertain times.",
	err_unknown_epoch_cat		= "Unknown epoch",
	err_year_in_roman_number	= "Ambiguity: the year '''%1''' is in roman numerals. Do you want define a century ?",
	
	-- These messages are used to Cargs = ControlAgrs module and are copied here.
	c							= 'c',
	options						= 'options',
	err_error_list_header		= "Assistance on the parameters of this template in:",
	err_unknown_argument		= "Error: parameter '''%1''' is unknown in this template. Check the name or flag this gap.",
	err_nearest_argument		= "Error: the known argument '''%1''' is it the one you need ?",
	err_value_re_defined		= "Error: the value of the argument '''%1''' is already defined. Choose only one argument and value.",
	
	err_need_value				= "Error: This argument is required but absent : '''%1'''. Should define it.",
	err_none_value				= "Error: No argument has been defined.",
	err_too_unnamed_arguments	= "Error: Too many unnamed arguments ( '''%1''' ).",
	err_internal_notice_wsid	= "Internal Error: Notify the developer that the internal argument '''%1''' is unknown in the records.",
	err_without_translation		= "<br/>Known argument, but not translated: '''%1'''.",
	err_without_translation_N	= "<br/>There are %1 arguments untranslated.",
	err_is_defined				= "<br/>The argument %1:'''%2''' is defined.",
	err_is_undefined			= "<br/>The argument %1:'''%2''' is not defined.",
	err_module_with_error		= "Module with error",
	err_wikidata_wikibase		= "Error: Wikibase is not available.",
	err_wikidata_getEntity		= "Error: Wikidata element '''%1''' is not found.",
	err_wikidata_property		= "Error: Wikidata property '''%1''' is not found.",
	err_wikidata_cat			= "Error Wikidata",
	list_limit_levelmaxi		= "List limit levelmaxi=%1",
	list_limit_max_n			= "List limit max_n=%1",
	err_module_miss_i18n_arg	= "Internal Error: argument %1 missing i18n translation.",
	err_module_miss_i18n_cat	= "Module missing i18n translation",
	err_no_args_known			= "Module without known arguments table.",
	err_no_args_source			= "Module without source arguments table.",
	err_no_args_lang			= "Module without translated arguments table.",
	err_lang_table				= "The %1 language or its table is incorrect.",
	err_lang_table_cat			= "Erroneous language arguments",
	err_table_notices			= "Error: Table authority records undefined.",
	err_table_notices_cat		= "Module without authority records table.",

} -- i18n_en

-- i18n['es'] = {
i18n_es = { -- Traducciones al español de los argumentos, categorías y mensajes:
	lastname					= 'nombre',
	initiale					= 'initiale',
	familyname					= 'primernombre',
	firstname					= 'apellido',
	pseudonym					= 'apodo',
	title						= 'título',
	galliname					= 'apellidoGalli',
	sex							= 'sexo',
	sortkey						= 'especie clave',
	image						= 'imagen',
	birthyear					= 'año de nacimiento',
	birth						= 'nacimiento',
	birthcentury				= 'siglo de nacimiento',
	birthuncertain				= 'nacimiento incierto',
	region						= 'región',
	deathyear					= 'año de la muerte',
	death						= 'muerte',
	deathcentury				= 'siglo de la muerte',
	deathuncertain				= 'muerte incierto',
	description					= 'descripción',
	occupation					= 'profesión',
	genre						= 'tipo',
	language					= 'lengua',
	country						= 'país',
	prize						= 'premio',
	rights						= 'derechos',
	wikipedia					= 'wikipedia',
	wikiquote					= 'wikiquote',
	commons						= 'commons',
	commonscat					= 'commonscat',
	namespace					= 'espacio',
	category					= 'Categoría',
	catspace					= 'catespacio',

	-- Scans and Notices
	author_Scans				= 'Escanea en',
	author_Notices				= 'Avisos',
	ARC							= 'ARC',
	ARCid						= 'ARCid',
	ARCitem						= 'ARCitem',
	ARCorg						= 'ARCorg',
	ARCsub						= 'ARCsub',
	BNF							= 'BNF',
	DNB							= 'DNB',
	GKD							= 'GKD',
	GKD_V1						= 'GKD_V1',
	IA							= 'IA',
	ARCHIVE						= 'ARCHIVE',
	IBL							= 'IBL',
	IBLid						= 'IBLid',
	IBLbook						= 'IBLbook',
	ISBN						= 'ISBN',
	ISFDB						= 'ISFDB',
	ISFDBid						= 'ISFDBid',
	ISFDBpub					= 'ISFDBpub',
	ISFDBtitle					= 'ISFDBtitle',
	LCCN						= 'LCCN',
	LT							= 'LT',
	NLA							= 'NLA',
	OCLC						= 'OCLC',
	OL							= 'OL',
	PND							= 'PND',
	SELIBR						= 'SELIBR',
	SUDOC						= 'SUDOC',
	SWD							= 'SWD',
	ULAN						= 'ULAN',
	VIAF						= 'VIAF',
	WORLDCATID					= 'WORLDCATID',
	XXX							= 'XXX',
	
	-- Categorías y Varios mensajes
	-- Estos mensajes deben incluir también los de módulo(s) llamado.
	error_deseada				= 'ES error deseada',
	authors_authors				= "Autores",
	authors_initiale			= "Autores-%1",
	authors_birthyear			= 'Nacido en el año %1',
	authors_deathyear			= 'Muerte en %1',
	list_limit_levelmaxi		= "Limite de la estructura levelmaxi=%1",
	list_limit_maxn				= "Limite de la estructura maxn=%1",
	limit_cat_birth_death		= 'Limite los años de las categorías "Nacimientos en" y "Muerte en".',
	cat_epoch_china_antiquity	= "Autor de la antigüedad china",
	cat_epoch_china_springs		= "Autor de Primaveras y Otoños",
	cat_epoch_china_empires		= "Autor de los Imperios chinos",
	cat_epoch_indian_indus		= "Autor de la civilización del Indo",
	cat_epoch_indian_antiquity	= "Autor de la antigüedad india",
	cat_epoch_indian_muslim		= "Autor de el período indo-musulmán",
	cat_epoch_antiquity			= "Autor de la antigüedad",
	cat_epoch_middle_age		= "Autor de la Edad Media",
	cat_epoch_century_EC		= "Nacido en el siglo del día 1%",
	cat_epoch_century_BEC		= "Nacido en el siglo BEC día 1%",
	century_EC					= "%1 siglo",
	century_BEC					= "%1 siglo BEC",

	-- Los mensajes de error y categorías
	-- Estos mensajes deben incluir también los de módulo(s) llamado.
	err_one_number_argument		= "Error: En el parámetro '''%1''', ingrese un número único entre -5000 y ahora.",
	err_need_value				= "Error: Este argumento es necesario pero ausente : '''%1'''. Debe definir.",
	err_none_value				= "Error: Ningún argumento ha sido definido.",
	err_assist_user_param		= "<br/>Apoyo a los usuarios para comprobar los ajustes:",
	err_module_error			= "Module error",
	--
	err_vague_year				= "Año incierto.",
	err_death_before_birth		= "Error: muerte '''%1''' antes del nacimiento '''%2'''.",
	err_death_before_birth_cat	= "Autor muerte antes del nacimiento.",
	err_life_too_long			= "La vida es demasiado largo de %1 a %2.",
	err_life_too_long_cat		= "Vida del autor es demasiado largo",
	err_module_miss_i18n_arg	= "Error interno: el argumento %1 falta traducción i18n.",
	err_module_miss_i18n_cat	= "Módulo faltante traducción i18n.",
	err_no_known_arguments		= "Módulo sin argumentos tabla conocida.",
	err_vague_epoch				= "Épocas inciertas.",
	err_unknown_epoch_cat		= "Desconocido período",
	err_year_in_roman_number	= "Ambigüedad: el año '''%1''' es en números romanos ¿Qué quieres definir un siglo?",
	err_table_notices			= "Error: registros de autoridades tabla indefinida.",
	err_table_notices_cat		= "Módulo sin registros de autoridades tabla conocida.",

	-- Estos mensajes se utilizan para módulo Cargs = ControlAgrs, y se copian aquí.
	c							= 'c',
	options						= 'options',
	err_error_list_header		= "Asistencia en los parámetros del modelo en:",
	err_unknown_argument		= "Error: El parámetro '''%1''' es desconocido en este modelo. Compruebe el nombre o marca esta brecha.",
	err_nearest_argument		= "Error: la '''%1''' argumento conocido es el que necesita?",
	err_value_re_defined		= "Error: el valor del argumento '''%1''' ya se ha definido. Elige uno sólo argumento y valor.",
	
	err_need_value				= "Error: Este argumento es necesario pero ausente : '''%1'''. Debe definir.",
	err_none_value				= "Error: Ningún argumento ha sido definido.",
	err_too_unnamed_arguments	= "Error: Demasiados argumentos sin nombre ( '''%1''' ).",
	err_internal_notice_wsid	= "Error interno: Notificar al promotor que el argumento interno '''%1''' es desconocida en los registros.",
	err_without_translation		= "<br/>Conocido argumento, pero no traducido: '''%1'''.",
	err_without_translation_N	= "<br/>Hay %1 argumentos sin traducir.",
	err_is_defined				= "<br/>El argumento %1:'''%2''' está definido.",
	err_is_undefined			= "<br/>El argumento %1:'''%2''' no está definido.",
	err_module_with_error		= "Módulo con error",
	err_wikidata_wikibase		= "Error: Wikibase no está disponible.",
	err_wikidata_getEntity		= "Error: Elemento Wikidata '''%1''' no se encuentra.",
	err_wikidata_property		= "Error: Propiedad Wikidata '''%1''' no se encuentra.",
	err_wikidata_cat			= "Error Wikidata",
	list_limit_levelmaxi		= "Límite de la lista levelmaxi=%1",
	list_limit_max_n			= "Límite de la lista max_n=%1",
	err_module_miss_i18n_arg	= "Error interno: el argumento %1 falta traducción i18n.",
	err_module_miss_i18n_cat	= "Módulo faltante traducción i18n",
	err_no_args_known			= "Módulo sin tabla argumentos conocidos.",
	err_no_args_source			= "Módulo sin tabla argumentos fuentes.",
	err_no_args_lang			= "Módulo sin tabla argumentos trajo.",
	err_lang_table				= "La lengua %1 o su tabla es incorrecta.",
	err_lang_table_cat			= "Idioma argumentos erróneos",

} -- i18n_es

-- i18n['fr'] = {
i18n_fr = { -- Traductions en francais des arguments, catégories et messages :
	lastname					= 'nom',
	initiale					= 'initiale',
	familyname					= 'nomfamille',
	firstname					= 'prénom',
	pseudonym					= 'pseudo',
	title						= 'titre',
	galliname					= 'prénomGalli',
	sex							= 'sexe',
	sortkey						= 'cle',
	image						= 'image',
	birthyear					= 'anneeNaissance',
	birth						= 'naissance',
	birthcentury				= 'siecleNaissance',
	birthuncertain				= 'incertitudeNaissance',
	region						= 'région',
	deathyear					= 'anneeDeces',
	death						= 'deces',
	deathcentury				= 'siecleDeces',
	deathuncertain				= 'incertitudeDeces',
	description					= 'description',
	occupation					= 'metier',
	genre						= 'genre',
	language					= 'langue',
	country						= 'pays',
	prize						= 'prix',
	rights						= 'droits',
	wikipedia					= 'wikipedia',
	wikiquote					= 'wikiquote',
	commons						= 'commons',
	commonscat					= 'commonscat',
	namespace					= 'espace',
	category					= 'Category',
	catspace					= 'catspace',

	-- Scans et Notices
	author_Scans				= 'Scans sur',
	author_Notices				= 'Notices', -- search BNF
	ARC							= 'ARC',
	ARCid						= 'ARCid',
	ARCitem						= 'ARCitem',
	ARCorg						= 'ARCorg',
	ARCsub						= 'ARCsub',
	BNF							= 'BNF',
	DNB							= 'DNB',
	GKD							= 'GKD',
	GKD_V1						= 'GKD_V1',
	IA							= 'IA',
	ARCHIVE						= 'ARCHIVE',
	IBL							= 'IBL',
	IBLid						= 'IBLid',
	IBLbook						= 'IBLbook',
	ISBN						= 'ISBN',
	ISFDB						= 'ISFDB',
	ISFDBid						= 'ISFDBid',
	ISFDBpub					= 'ISFDBpub',
	ISFDBtitle					= 'ISFDBtitle',
	LCCN						= 'LCCN',
	LT							= 'LT',
	NLA							= 'NLA',
	OCLC						= 'OCLC',
	OL							= 'OL',
	PND							= 'PND',
	SELIBR						= 'SELIBR',
	SUDOC						= 'SUDOC',
	SWD							= 'SWD',
	ULAN						= 'ULAN',
	VIAF						= 'VIAF',
	WORLDCATID					= 'WORLDCATID',
	XXX							= 'XXX',
	
	-- Catégories et Messages divers
	-- Ces messages doivent aussi intégrer ceux du (ou des) module(s) appelé(s).
	erreur_voulue				= 'FR erreur voulue',
	authors_authors				= "Auteurs",
	authors_initiale			= "Auteurs-%1",
	authors_birthyear			= 'Naissance en %1',
	authors_deathyear			= 'Mort en %1',
	list_limit_levelmaxi		= "Limite de la structure levelmaxi=%1",
	list_limit_maxn				= "Limite de la structure maxn=%1",
	limit_cat_birth_death		= 'Limite les années des catégories "Naissance en" et "Mort en".',
	cat_epoch_china_antiquity	= "Auteur de l'antiquité chinoise",
	cat_epoch_china_springs		= "Auteur des Printemps et Automnes",
	cat_epoch_china_empires		= "Auteur des Empires chinois",
	cat_epoch_indian_indus		= "Auteur de la civilisation de l'Indus",
	cat_epoch_indian_antiquity	= "Auteur de l'antiquité indienne",
	cat_epoch_indian_muslim		= "Auteur de la période indo-musulmane",
	cat_epoch_antiquity			= "Auteur de l'antiquité",
	cat_epoch_middle_age		= "Auteur du Moyen Age",
	cat_epoch_century_EC		= "Auteurs du %1 e siècle‎",
	cat_epoch_century_BEC		= "Auteurs du %1 e siècle BEC",
	century_EC					= "%1 ème siècle",
	century_BEC					= "%1 ème siècle BEC",
	
	-- Messages d'erreurs et catégories
	-- Ces messages doivent aussi intégrer ceux du (ou des) module(s) appelé(s).
	err_one_number_argument		= "Erreur : Dans le paramètre '''%1''', entrer un seul nombre entre -5000 et maintenant.",
	err_need_value				= "Erreur : Cet argument est nécessaire mais absent : '''%1'''. Il faut le définir.",
	err_assist_user_param		= "<br/>Assistance à l'utilisateur pour la vérification des paramètres :",
	err_module_error			= "Module avec erreur",
	--
	err_vague_year				= "Année incertaine.",
	err_death_before_birth		= "Erreur : le décès '''%1''' est avant la naissance '''%2'''.",
	err_death_before_birth_cat	= "Erreur : le décès est avant la naissance.",
	err_life_too_long			= "Durée de vie trop longue de %1 à %2.",
	err_life_too_long_cat		= "Durée de vie de l'auteur trop longue",
	err_module_miss_i18n_arg	= "Erreur interne: l'argument %1 manque de traduction i18n.",
	err_module_miss_i18n_cat	= "Module manquant de traduction i18n.",
	err_no_known_arguments		= "Module sans table d'arguments connus.",
	err_vague_epoch				= "Époque incertaine.",
	err_unknown_epoch_cat		= "Époque inconnue",
	err_year_in_roman_number	= "Ambigüité : l'année '''%1''' est en nombres romains. Voulez-vous définir un siècle ?",
	err_table_notices			= "Erreur : Table de notices d'autorités non définie.",
	err_table_notices_cat		= "Module sans table de notices d'autorités connus.",
	
	-- Ces messages servent au module Cargs = ControlAgrs, et sont copiés ici.
	c							= 'c',
	options						= 'options',
	err_error_list_header		= "Assistance sur les paramètres de ce modèle dans :",
	err_unknown_argument		= "Erreur : Le paramètre '''%1''' est inconnu dans ce modèle. Vérifier ce nom ou signaler ce manque.",
	err_nearest_argument		= "Erreur: L'argument connu '''%1''' est-il celui que vous voulez ?",
	err_value_re_defined		= "Erreur : La valeur de l'argument '''%1''' est déjà définie. Choisir un seul argument et une seule valeur.",
	
	err_need_value				= "Erreur : Cet argument est nécessaire mais absent : '''%1'''. Il faut le définir.",
	err_none_value				= "Erreur : Aucun argument n'a été défini.",
	err_too_unnamed_arguments	= "Erreur : Trop de paramètres non nommés ( '''%1''' ).",
	err_internal_notice_wsid	= "Erreur interne : Signalez au developpeur que l'argument interne '''%1''' est inconnu dans les notices.",
	err_without_translation		= "<br/>Argument connu, mais non traduit : '''%1'''.",
	err_without_translation_N	= "<br/>Il y a %1 arguments non traduits.",
	err_is_defined				= "<br/>L'argument %1:'''%2''' est défini.",
	err_is_undefined			= "<br/>L'argument %1:'''%2''' n'est pas défini.",
	err_module_with_error		= "Module avec erreur",
	err_wikidata_wikibase		= "Erreur : Wikibase n'est pas disponible.",
	err_wikidata_getEntity		= "Erreur : L'élément '''%1''' de Wikidata n'est pas trouvé.",
	err_wikidata_property		= "Erreur : La propriété '''%1''' de Wikidata n'est pas trouvé.",
	err_wikidata_cat			= "Erreur Wikidata",
	list_limit_levelmaxi		= "Limite de liste levelmaxi=%1",
	list_limit_max_n			= "Limite de liste max_n=%1",
	err_module_miss_i18n_arg	= "Erreur interne: l'argument %1 manque de traduction i18n.",
	err_module_miss_i18n_cat	= "Module manquant de traduction i18n",
	err_no_args_known			= "Module sans table d'arguments connus.",
	err_no_args_source			= "Module sans table d'arguments sources.",
	err_no_args_lang			= "Module sans table d'arguments traduits.",
	err_lang_table				= "La langue %1 ou sa table est erronée.",
	err_lang_table_cat			= "Langue d'arguments erronée",
	
} -- i18n_fr

------------------------------------------------------------
-- i18n objects end
------------------------------------------------------------

------------------------------------------------------------
-- MArgms object table start
------------------------------------------------------------
local args_known_auteur = {
	-- special arguments to modify the fonctions and outputs of this module
	-- arguments speciaux pour modifier le fonctionnement et les sorties de ce module
	
	c =				{val = nil, typ = "opt", need = "0", found = "0", list = 1,
		keyword = "c", data = "catview"},

	options =		{val = nil, typ = "opt", need = "0", found = "0", list = 1,
		keyword = "options", data = "options"},

	-- All arguments have a keyword parameter identical to the registration name, except synonyms
	-- Tous les arguments ont un paramètre keyword identique au nom d'enregistrement, sauf les synonymes
			
	lastname =		{val = nil, typ = "dat", need = "1", found = "0", list = 2,
		keyword = "lastname", data = nil},
	
	initiale =		{val = nil, typ = "dat", need = "1", found = "0", list = 2,
		keyword = "initiale", data = nil},

	familyname =	{val = nil, typ = "dat", need = "0", found = "0", list = 9,
		keyword = "familyname", data = nil},

	firstname =		{val = nil, typ = "dat", need = "0", found = "0", list = 2,
		keyword = "firstname", data = nil},

	pseudonym =		{val = nil, typ = "ctr", need = "0", found = "0", list = 9,
		keyword = "pseudonym", data = nil},

	title =			{val = nil, typ = "dat", need = "0", found = "0", list = 9,
		keyword = "title", data = "sitelink"},

	galliname =		{val = nil, typ = "dat", need = "0", found = "0", list = 9,
		keyword = "galliname", data = nil},

	sex =			{val = nil, typ = "dat", need = "0", found = "0", list = 9,
		keyword = "sex", data = nil},

	sortkey =		{val = nil, typ = "dat", need = "0", found = "0", list = 9,
		keyword = "sortkey", data = nil},

	image =			{val = nil, typ = "ctr", need = "0", found = "0", list = 2,
		keyword = "image", data = "18"},
		
	birthyear =		{val = nil, typ = "dat", need = "0", found = "0", list = 2,
		keyword = "birthyear", data = "569"},

	birth =			{val = nil, typ = "syn", need = "0", found = "0", list = 1,
		keyword = "birthyear", data = "569"},

	birthcentury =	{val = nil, typ = "dat", need = "0", found = "0", list = 2,
		keyword = "birthcentury", data = "569"},

	birthuncertain ={val = nil, typ = "dat", need = "0", found = "0", list = 3,
		keyword = "birthuncertain", data = nil},

	region =		{val = nil, typ = "dat", need = "0", found = "0", list = 2,
		keyword = "region", data = nil},

	deathyear =		{val = nil, typ = "dat", need = "0", found = "0", list = 2,
		keyword = "deathyear", data = "570"},

	death =			{val = nil, typ = "syn", need = "0", found = "0", list = 1,
		keyword = "deathyear", data = "570"},

	deathcentury =	{val = nil, typ = "dat", need = "0", found = "0", list = 2,
		keyword = "deathcentury", data = "570"},

	deathuncertain ={val = nil, typ = "dat", need = "0", found = "0", list = 3,
		keyword = "deathuncertain", data = nil},

	description =	{val = nil, typ = "ctr", need = "0", found = "0", list = 1,
		keyword = "description", data = nil},

	occupation =	{val = nil, typ = "ctr", need = "0", found = "0", list = 3,
		keyword = "occupation", data = nil},

	genre =			{val = nil, typ = "ctr", need = "0", found = "0", list = 3,
		keyword = "genre", data = nil},

	language =		{val = nil, typ = "ctr", need = "0", found = "0", list = 3,
		keyword = "language", data = "27"},

	country =		{val = nil, typ = "ctr", need = "0", found = "0", list = 3,
		keyword = "country", data = "27"},

	prize =			{val = nil, typ = "ctr", need = "0", found = "0", list = 4,
		keyword = "prize", data = nil},

	rights =		{val = nil, typ = "ctr", need = "0", found = "0", list = 1,
		keyword = "rights", data = nil},

	wikipedia =		{val = nil, typ = "ctr", need = "0", found = "0", list = 2,
		keyword = "wikipedia", data = nil},

	wikiquote =		{val = nil, typ = "ctr", need = "0", found = "0", list = 2,
		keyword = "wikiquote", data = nil},

	commons =		{val = nil, typ = "ctr", need = "0", found = "0", list = 2,
		keyword = "commons", data = nil},

	commonscat =	{val = nil, typ = "ctr", need = "0", found = "0", list = 3,
		keyword = "commonscat", data = nil},

	namespace =		{val = nil, typ = "ctr", need = "0", found = "0", list = 4,
		keyword = "namespace", data = nil},

	category =		{val = nil, typ = "ctr", need = "0", found = "0", list = 3,
		keyword = "category", data = nil},

	-- The arguments for authority records are treated separately
	-- Les arguments pour les notices d'autorités sont traités à part

	ARC =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "ARC", data = "ARC"},

	ARCid =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "ARCid", data = "ARCid"},

	ARCitem =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "ARCitem", data = "ARCitem"},

	ARCorg =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "ARCorg", data = "ARCorg"},

	ARCsub =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "ARCsub", data = "ARCsub"},

	ARCHIVE =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "ARCHIVE", data = "ARCHIVE"},

	BNF =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "BNF", data = "268"},

	DNB =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "DNB", data = "DNB"},

	GKD =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "GKD", data = "GKD"},

	GKD_V1 =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "GKD_V1", data = "GKD-V1"},

	IA =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "IA", data = "IA"},

	IBL =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "IBL", data = "IBL"},

	IBLid =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "IBLid", data = nil},

	IBLbook =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "IBLbook", data = nil},

	ISBN =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "ISBN", data = "ISBN"},

	ISFDB =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "ISFDB", data = "ISFDB"},

	ISFDBid =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "ISFDBid", data = nil},

	ISFDBpub =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "ISFDBpub", data = nil},

	ISFDBtitle =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "ISFDBtitle", data = nil},

	LCCN =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "LCCN", data = "244"},

	LT =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "LT", data = "LT"},

	NLA =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "NLA", data = "NLA"},

	OCLC =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "OCLC", data = "OCLC"},

	OL =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "OL", data = "OL"},

	PND =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "PND", data = "PND"},

	SELIBR =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "SELIBR", data = "SELIBR"},

	SUDOC =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "SUDOC", data = "SUDOC"},

	SWD =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "SWD", data = "SWD"},

	ULAN =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "ULAN", data = "ULAN"},

	VIAF =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "VIAF", data = "214"},

	WORLDCATID =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "WORLDCATID", data = "WORLDCATID"},

	XXX =		{val = nil, typ = "not", need = "0", found = "0", list = 3,
		keyword = "XXX", data = nil},

	-- arguments managed only by program, not read from template
	--	p.arg_memorize("catspace", frame:preprocess("{{ns:Category}}")) -- memorize the localized namespace "Category"
	catspace =		{val = nil, typ = "prg", need = "0", found = "0", list = 9,
		keyword = "catspace", data = "catspace"},
		
	limit_cat_birth_death =	{val = "100", typ = "prg", need = "0", found = "0", list = 9,
		keyword = "catspace", data = "catspace"},
		
} -- local MArgms args_known_auteur

--[[ nameList of notices's properties
	-->|ARCid|ARCitem|ARCorg|ARCsub<!--
	-->|ARC=National Archives and Records Administration<!--
	-->|BNF=Bibliothèque nationale de France<!--
	-->|GKD|GKD-V1=Gemeinsame Kšrperschaftsdatei<!--
	-->|IA|ARCHIVE=Internet Archive<!--
	-->|IBL|IBLid|IBLbook=Internet Book List<!--
	-->|ISBN=International Standard Book Number<!--
	-->|ISFDBid|ISFDBpub|ISFDBtitle<!--
	-->|ISFDB=Internet Speculative Fiction Database<!--
	-->|LCCN=Numéro de contrôle de la Bibliothèque du Congrès<!--
	-->|LT=Library Thing<!--
	-->|OCLC=Online Computer Library Center<!--
	-->|OL=Open Library<!--
	-->|PND=Personennamendatei<!--
	-->|SELIBR=National Library of Sweden<!--
	-->|SUDOC=Système universitaire de documentation<!--
	-->|SWD=Schlagwortnormdatei<!--
	-->|ULAN=Union List of Artist Names<!--
	-->|VIAF=Fichier d'autorité international virtuel<!--
	-->|WORLDCATID=WorldCat<!--
	-->|XXX=XXX autorité<!--
	-->|#default={{{wp|{{{3|}}} }}} <!--
--]]

------------------------------------------------------------
-- Table de notices de notoriétés pour auteurs livres et autres
------------------------------------------------------------

local notices_properties = { -- Table of notices's properties, to automate them
	-- REF_0 = reference en un seul numéro comme "cb11888266r"
	-- REF_1/REF_2/REF_3 = reference en trois parties comme "123/456/789 ou "Hugo/Victor/Victor André"
	ARC		= {base = "ARC",	_id = "ARC",        _wsid = "ws-ARC",		_sauf = "", _space = "", _type = "",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},
	ARCgeo	= {base = "ARC",	_id = "ARCgeo",      _wsid = "ws-ARCgeo",	_sauf = "", _space = "", _type = "Geo",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},
	ARCid	= {base = "ARC",	_id = "ARCid",      _wsid = "ws-ARCid",		_sauf = "", _space = "", _type = "Auteur",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},
	ARCitem	= {base = "ARC",	_id = "ARCitem",    _wsid = "ws-ARCitem",	_sauf = "", _space = "", _type = "Book",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},
	ARCorg	= {base = "ARC",	_id = "ARCorg",    _wsid = "ws-ARCorg",		_sauf = "", _space = "", _type = "Org",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},
	ARCsub	= {base = "ARC",	_id = "ARCsub",    _wsid = "ws-ARCsub",		_sauf = "", _space = "", _type = "Auteur",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},
	ARCHIVE	= {base = "ARC",	_id = "ARCHIVE",    _wsid = "ws-ARCsub",	_sauf = "", _space = "", _type = "Auteur",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://www.archive.org/details/REF_0"},
	BNF		= {base = "BNF",	_id = "BNF",    _wsid = "BNF",		_sauf = "", _space = "", _type = "Auteur",
		text = "Bibliothèque nationale de France",
		wptx = "Biblioth%%C3%%A8que%%20nationale%%20de%%20France",
		_link= "http://catalogue.bnf.fr/ark:/12148/REF_0"},
	DNB		= {base = "DNB",	_id = "DNB",    _wsid = "DNB",		_sauf = "", _space = "", _type = "Auteur",
		text = "Bibliothèque nationale allemande",
		wptx = "Biblioth%%C3%%A8que%%20nationale%%20allemande",
		_link= "http://d-nb.info/gnd/REF_0"},
	GKD		= {base = "GKD",	_id = "GKD",    _wsid = "GKD",		_sauf = "", _space = "", _type = "Auteur",
		text = "Bibliothèque nationale allemande",
		wptx = "Biblioth%%C3%%A8que%%20nationale%%20allemande",
		_link= "http://d-nb.info/gnd/REF_0"},
	GKD_V1	= {base = "GKD",	_id = "GKD-V1",	_wsid = "GKD-V1",	_sauf = "", _space = "", _type = "Auteur",
		text = "Bibliothèque nationale allemande",
		wptx = "Biblioth%%C3%%A8que%%20nationale%%20allemande",
		_link= "http://d-nb.info/gnd/REF_0"},
	IA		= {base = "IA",		_id = "IA",    _wsid = "IA",		_sauf = "", _space = "", _type = "Auteur",
		text = "Internet Archive",
		wptx = "Internet%%20Archive",
		_link= "http://www.archive.org/REF_0"},
		
	IBL	= {base = "IBL",	_id = "IBL",    _wsid = "IBL",			_sauf = "", _space = "", _type = "Auteur",
		text = "Internet Book List", -- Pas de page fr, en redirige vers Base de données bibliographiques
		wptx = "Internet%%20Book%%20List",
		_link= "http://www.iblist.com/authorREF_0.html"},
		
	IBLbook	= {base = "IBL",_id = "IBLbook",_wsid = "IBLbook",		_sauf = "", _space = "", _type = "Book",
		text = "Internet Book List", -- Pas de page fr, en redirige vers Base de données bibliographiques
		wptx = "Internet%%20Book%%20List",
		_link= "http://www.iblist.com/bookREF_0.html"},
		
	IBLid	= {base = "IBL",	_id = "IBLid",    _wsid = "IBLid",		_sauf = "", _space = "", _type = "Auteur",
		text = "Internet Book List", -- Pas de page fr, en redirige vers Base de données bibliographiques
		wptx = "Internet%%20Book%%20List",
		_link= "http://www.iblist.com/authorREF_0.html"},
				
	ISNI	= {base = "ISNI",	_id = "ISNI",      _wsid = "ws-ISNI",	    _sauf = "", _space = "", _type = "Auteur",
		text = "International Standard Name Identifier",
		wptx = "International%%20Standard%%20Name%%20Identifier",
		_link="http://isni.oclc.nl/DB=1.2/SET=10/TTL=1/CMD?ACT=SRCHA&IKT=8006&SRT=&TRM=REF_0"},

	--[[
	linkList
	pour memoire, pour chaque nomlien : [ [Catégorie:Nota{{{nomlien|{{{1|}}} }}}] ]
	-->|ISBN=http://fr.wikisource.org/wiki/Spécial:Ouvrages_de_référence/{{{code|{{{2|}}} }}}<!--
	-->|ISFDBid=http://www.isfdb.org/cgi-bin/ea.cgi?{{{code|{{{2|}}} }}}<!-- Auteur:
	-->|ISFDBpub=http://www.isfdb.org/cgi-bin/pl.cgi?{{{code|{{{2|}}} }}}<!--
	-->|ISFDBtitle=http://www.isfdb.org/cgi-bin/title.cgi?{{{code|{{{2|}}} }}}<!--
	-->|ISFDB=http://catalogue.bnf.fr/ark:/12148/{{{code|{{{2|}}} }}}<!--
	--]]
	
	--[[ nameList of notices's properties
	-->|ARCid|ARCitem|ARCorg|ARCsub<!--
	-->|ARC=National Archives and Records Administration<!--
	-->|BNF=Bibliothèque nationale de France<!--
	-->|GKD|GKD-V1=Gemeinsame Kšrperschaftsdatei<!--
	-->|IA|ARCHIVE=Internet Archive<!--
	-->|IBL|IBLid|IBLbook=Internet Book List<!--
	-->|ISBN=International Standard Book Number<!--
	-->|ISFDBid|ISFDBpub|ISFDBtitle<!--
	-->|ISFDB=Internet Speculative Fiction Database<!--
	-->|LCCN=Numéro de contrôle de la Bibliothèque du Congrès<!--
	-->|LT=Library Thing<!--
	-->|OCLC=Online Computer Library Center<!--
	-->|OL=Open Library<!--
	-->|PND=Personennamendatei<!--
	-->|SELIBR=National Library of Sweden<!--
	-->|SUDOC=Système universitaire de documentation<!--
	-->|SWD=Schlagwortnormdatei<!--
	-->|ULAN=Union List of Artist Names<!--
	-->|VIAF=Fichier d'autorité international virtuel<!--
	-->|WORLDCATID=WorldCat<!--
	-->|XXX=XXX autorité<!--
	-->|#default={{{wp|{{{3|}}} }}} <!--
	--]]
		
	NLA	= {base = "NLA",	_id = "NLA",       _wsid = "ws-NLA",		_sauf = "", _space = "", _type = "Auteur",
		text = "Online Computer Library Center",
		wptx = "Online%%20Computer%%20Library%%20Center",
		_link="http://www.worldcat.org/oclc/REF_0"},
		
	OCLC	= {base = "OCLC",	_id = "OCLC",       _wsid = "ws-OCLC",		_sauf = "", _space = "", _type = "Auteur",
		text = "Online Computer Library Center",
		wptx = "Online%%20Computer%%20Library%%20Center",
		_link="http://www.worldcat.org/oclc/REF_0"},
		
	OL	= {base = "OL",	_id = "OL",       _wsid = "ws-OL",		_sauf = "", _space = "", _type = "Auteur",
		text = "Online Computer Library Center",
		wptx = "Online%%20Computer%%20Library%%20Center",
		_link="http://www.worldcat.org/oclc/REF_0"},
		
	PND	= {base = "PND",	_id = "PND",   	    _wsid = "ws-PND",		_sauf = "", _space = "Portail", _type = "Auteur",
		text = "Personennamendatei",
		wptx = "Personennamendatei",
		_link="http://d-nb.info/gnd/REF_0"},
		
--[[
	linkList
	pour memoire, pour chaque nomlien : [ [Catégorie:Nota{{{nomlien|{{{1|}}} }}}] ]
	-->|ARCgeo=http://arcweb.archives.gov/arc/action/ExecuteRelatedGeographicalSearch?id={{{code|{{{2|}}} }}}&relationship=AD_SUBJECT<!--
	-->|ARC<!--
	-->|ARCid=http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id={{{code|{{{2|}}} }}}<!--
	-->|ARCitem=http://arcweb.archives.gov/arc/action/ExternalIdSearch?id={{{code|{{{2|}}} }}}<!--
	-->|ARCorg=http://arcweb.archives.gov/arc/action/ExecuteRelatedOrganizationSearch?id={{{code|{{{2|}}} }}}&relationship=AD_SUBJECT<!--
	-->|ARCsub=http://arcweb.archives.gov/arc/action/ExecuteRelatedTopicalSubjectsSearch?id={{{code|{{{2|}}} }}}<!--
	-->|ARCHIVE=http://www.archive.org/details/{{{code|{{{2|}}} }}}<!--
	-->|BNF=http://catalogue.bnf.fr/ark:/12148/{{{code|{{{2|}}} }}}<!--
	-->|DNB=http://d-nb.info/gnd/{{{code|{{{2|}}} }}}<!--
	-->|GKD=http://d-nb.info/gnd/{{{code|{{{2|}}} }}}<!--
	-->|GKD-V1=http://d-nb.info/gnd/{{{code|{{{2|}}} }}}<!--
	-->|IA|ARCHIVE=http://catalogue.bnf.fr/ark:/12148/{{{code|{{{2|}}} }}}<!--
	-->|IBL<!--
	-->|IBLbook=http://www.iblist.com/book{{{code|{{{2|}}} }}}.html<!--
	-->|IBLid=http://www.iblist.com/author{{{code|{{{2|}}} }}}.html<!--
	-->|ISBN=http://fr.wikisource.org/wiki/Spécial:Ouvrages_de_référence/{{{code|{{{2|}}} }}}<!--
	-->|ISFDBid=http://www.isfdb.org/cgi-bin/ea.cgi?{{{code|{{{2|}}} }}}<!-- Auteur:
	-->|ISFDBpub=http://www.isfdb.org/cgi-bin/pl.cgi?{{{code|{{{2|}}} }}}<!--
	-->|ISFDBtitle=http://www.isfdb.org/cgi-bin/title.cgi?{{{code|{{{2|}}} }}}<!--
	-->|ISFDB=http://catalogue.bnf.fr/ark:/12148/{{{code|{{{2|}}} }}}<!--
	-->|LCCN=http://id.loc.gov/authorities/names/{{ParmPart|1|{{{code|{{{2|}}} }}} }}{{ParmPart|2|{{{code|{{{2|}}} }}} }}{{padleft:{{ParmPart|3|{{{code|{{{2|}}} }}} }}|6|0}}.html<!--
	-->|LCCNid=http://id.loc.gov/authorities/names/{{ParmPart|1|{{{code|{{{2|}}} }}} }}{{ParmPart|2|{{{code|{{{2|}}} }}} }}{{padleft:{{ParmPart|3|{{{code|{{{2|}}} }}} }}|6|0}}.html<!--
	-->|LCCNbook=http://lccn.loc.gov/{{{code|{{{2|}}} }}}<!--
	-->|LT=http://www.librarything.com/work/{{{code|{{{2|}}} }}}<!--
	-->|NLA=http://nla.gov.au/anbd.aut-an{{{code|{{{2|}}} }}}<!--
	-->|OCLC=http://www.worldcat.org/oclc/{{{code|{{{2|}}} }}}<!--
	-->|OL=http://openlibrary.org/books/{{{code|{{{2|}}} }}}<!--
	-->|PND=http://d-nb.info/gnd/{{{code|{{{2|}}} }}}<!--
	-->|SELIBR=http://libris.kb.se/auth/{{{code|{{{2|}}} }}}<!--
	-->|SUDOC=http://www.idref.fr/{{{code|{{{2|}}} }}}<!--
	-->|SWD=http://d-nb.info/gnd/{{{code|{{{2|}}} }}}<!--
	-->|ULAN=http://www.getty.edu/vow/ULANFullDisplay?find=&role=&nation=&subjectid={{{code|{{{2|}}} }}}<!--
	-->|VIAF=http://viaf.org/viaf/{{{code|{{{2|}}} }}}<!--
	-->|WORLDCAT=http://www.worldcat.org/search?qt=worldcat_org_all&q={{ParmPart|1|{{{code|{{{2|}}} }}} }}+{{ParmPart|2|{{{code|{{{2|}}} }}} }}<!-- http://www.worldcat.org/search?qt=worldcat_org_all&q=Alain+Fournier
	-->|WORLDCATch=http://www.worldcat.org/search?q={{ParmPart|1|{{{code|{{{2|}}} }}} }}-{{ParmPart|2|{{{code|{{{2|}}} }}} }}&qt=owc_search<!-- http://www.worldcat.org/search?q=Alain-Fournier&qt=owc_search
	-->|WORLDCATID=http://www.worldcat.org/identities/{{{code|{{{2|}}} }}}<!--
	-- http://www.worldcat.org/search?q=Alain-Fournier&qt=owc_search
	-- http://www.worldcat.org/search?qt=worldcat_org_all&q=Alain+Fournier
	-->|XXX=http://catalogue.bnf.fr/ark:/12148/{{{code|{{{2|}}} }}}[ [Catégorie:Nota{{{nomlien|{{{1|xxx}}} }}}] ]<!--
	-->|#default=http://fr.wikisource.org/wiki/Modèle:Notice_Autorité<!--
--]]

--[[
	wsdata["ws-ARC"] = args.ARC
	wsdata["ws-ARCgeo"] = args.ARCgeo
	wsdata["ws-ARCid"] = args.ARCid
	wsdata["ws-ARCitem"] = args.ARCitem
	wsdata["ws-ARCorg"] = args.ARCorg
	wsdata["ws-ARCsub"] = args.ARCsub
	wsdata["ws-ARCHIVE"] = args.ARCHIVE
	wsdata["ws-BNF"] = args.BNF
	wsdata["ws-GKD"] = args.GKD
	wsdata["ws-GKD-V1"] = args["GKD-V1"]
	wsdata["ws-IA"] = args.IA
	wsdata["ws-IBL"] = args.IBL
	wsdata["ws-IBLbook"] = args.IBLbook
	wsdata["ws-IBLid"] = args.IBLid
	wsdata["ws-ISBN"] = args.ISBN
	wsdata["ws-ISNI"] = args.ISNI
	wsdata["ws-LCCN"] = args.LCCN
	wsdata["ws-OCLC"] = args.OCLC
	wsdata["ws-NLA"] = args.NLA
	wsdata["ws-PND"] = args.PND
	wsdata["ws-SELIBR"] = args.SELIBR
	wsdata["ws-SWD"] = args.SWD
	wsdata["ws-VIAF"] = args.VIAF
	wsdata["ws-WORLDCAT"] = args.WORLDCAT
	wsdata["ws-WORLDCATch"] = args.WORLDCATch
	wsdata["ws-WORLDCATID"] = args.WORLDCATID
	wsdata["ws-XXX"] = args.XXX
--]]

	SELIBR	= {base = "SELIBR",	_id = "SELIBR",	_wsid = "ws-SELIBR",		_sauf = "", _space = "Auteur", _type = "Auteur",
		text = "Bibliothèque royale (Suède)",
		wptx = "Biblioth%%C3%%A8que_royale_%%28Su%%C3%%A8de%%29",
		_link="http://libris.kb.se/auth/REF_0"},
	SUDOC	= {base = "SUDOC",	_id = "SUDOC",	_wsid = "ws-SUDOC",			_sauf = "", _space = "", _type = "Auteur",
		text = "Système universitaire de documentation",
		wptx = "Syst%%C3%%A8me%%20universitaire%%20de%%20documentation",
		_link="http://www.idref.fr/REF_0"},
	SWD		= {base = "SWD",	_id = "SWD",	_wsid = "ws-SWD",			_sauf = "", _space = "", _type = "Auteur",
		text = "Schlagwortnormdatei",
		wptx = "Schlagwortnormdatei",
		_link="http://d-nb.info/gnd/REF_0"},
	ULAN	= {base = "ULAN",	_id = "ULAN",       _wsid = "ws-ULAN",			_sauf = "", _space = "", _type = "Auteur",
		text = "Union List of Artist Names",
		wptx = "Union%%20List%%20of%%20Artist%%20Names",
		_link="http://www.worldcat.org/oclc/REF_0"},
	VIAF	= {base = "VIAF",	_id = "VIAF",       _wsid = "ws-VIAF",			_sauf = "", _space = "", _type = "Auteur",
		text = "Fichier d'autorité international virtuel",
		wptx = "Fichier%%20d%%27autorit%%C3%%A9%%20international%%20virtuel",
		_link="http://viaf.org/viaf/REF_0"},
	WORLDCAT	= {base = "WORLDCAT",_id = "WORLDCAT",   _wsid = "ws-WORLDCAT",	_sauf = "", _space = "", _type = "",
		text = "WorldCat",
		wptx = "WorldCat",
		_link="http://www.worldcat.org/search?qt=worldcat_org_all&q=REF_2+REF_1"},
	WORLDCATch	= {base = "WORLDCAT",_id = "WORLDCATch", _wsid = "ws-WORLDCATch",_sauf = "", _space = "", _type = "",
		text = "WorldCat",
		wptx = "WorldCat",
		_link="http://www.worldcat.org/search?q=REF_2-REF_1&qt=owc_search"},
	WORLDCATID	= {base = "WORLDCAT",_id = "WORLDCATID", _wsid = "ws-WORLDCATID",_sauf = "", _space = "", _type = "Auteur",
		text = "WorldCat",
		wptx = "WorldCat",
		_link="http://www.worldcat.org/identities/REF_0"},
	-- Pour tests futurs sans perturber les notices réelles
	XXXid	= {base = "XXX",	_id = "XXXid",        _wsid = "ws-XXX",			_sauf = "", _space = "", _type = "Auteur",
		text = "XXX autorité",
		wptx = "XXX%%20autorit%%C3%%A9",
		_link="http://catalogue.bnf.fr/ark:/12148/REF_0"}
		
} -- notices_properties table
-- ws-OCLC ws-PND ws-ISNI SELIBR SWD VIAF WORLDCATch

------------------------------------------------------------
-- Test objects
-- http://lua-users.org/wiki/ObjectOrientationTutorial
------------------------------------------------------------

-- Create a simple quasi object Class, like in http://lua-users.org/wiki/ObjectOrientationTutorial
local Track = {} -- the table representing the class, which will double as the metatable for the instances
Track.__index = Track -- failed table lookups on the instances should fallback to the class table, to get methods
function Track.new(init)
	local self = setmetatable({}, Track)
	self.trc = init or "Track object"
	return self.trc
end
function Track.add(txt)
	self.trc = self.trc .. tostring(txt)
	return self.trc
end
function Track.unitest(txt)
	local t = CA.ta("trc", self.trc)
	return t
end

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

local table_iterator = function(t) -- iterator to use all elements of a table, one by one
	-- for noticeN in table_iterator(notices_properties) do
	-- modele : function list_iter (t)
	if type(t) ~= "table" then return { }, 0 ,0 end
	local i = 0
	local n = table.getn(t)
	return function ()
		i = i + 1
		n = table.getn(t)
		if t[i] ~= nil then return t[i], i ,n end
	end
end

local formatdate = function(date_time)
	-- formate "20130302153557" en "2013-03-02 15:35:57"
	date_time = tostring(date_time.year) .. "-" .. tostring(date_time.month) .. "-" .. tostring(date_time.day) .. " " .. tostring(date_time.hour) .. ":" .. tostring(date_time.min) .. ":" .. tostring(date_time.sec)
	return date_time
end -- local formatdate = function(date_time)

local formatime = function(date_time)
	-- formate de "20130302153557" vers "2013-03-02 15:35:57"
	date_time = tostring(date_time)
	date_time = string.sub(date_time, 1, 4) .. "-" .. string.sub(date_time, 5, 6) .. "-" .. string.sub(date_time, 7, 8) .. " " .. string.sub(date_time, 9, 10) .. ":" .. string.sub( date_time, 11, 12) .. ":" .. string.sub(date_time, 13, 14)
	return date_time
end -- local formatime = function(date_time)

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 isIn(word, list) -- word is it in list (string or table)
	-- if p.isIn("yes", "no maybe yes"   ) then return = "OK" end
	-- if p.isIn("yes", {no, maybe, yes} ) then return = "OK" end
	if type(list) == "string" then
		local n = string.find(list, word)
	end
	if type(list) == "table" then
		local n = list[word]
	end
	return ( n ~= nil )
end -- function p.isIn(word, list)

function wordstotable(txt, opt) -- convertit un texte en table de mots
	local t = ""
	local tab = { }
	function inserer(ti)
		if ti ~= "" then table.insert(tab, ti.."") end -- table.insert(tab, t.."")
	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)

-- Style des erreurs en rouge. Red color for errors
function span_color_red(t)
	return mw.text.tag{ name = "span", attrs = {style="color:red;"}, content = t }
	-- color red microformat
end -- function p.color_red(t)

local error_color = function(t)
	return '<span style="color:red;" >' .. tostring(t) .. '</span>'
end

local annotations = {}
annotations["lastname"] = "fn"
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

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

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

CA.trc = "<br/>* Modele:Auteur trace "
--local CA.trackon = false
--local CA.trck = function(x)
--	if CA.trackon then trc = trc .. tostring(x) end
--end

--	Options de maîtrise du fonctionnement de ce module
CA.invoke_options = " " -- options normales venant du modèle, normal options from template
--	options=fr params docavant doc-min docmax docdef docnotice doc-apres docligne
--	local CA.debug_options = " " -- pas d'options de debug du module par edit
CA.debug_options = " " -- " unitest debug erron params docavant no-box no-cat doc-min doc-max doc-notice doc-def docligne not-ices tra-ck " -- options de debug du module par edit

local option = function(key, opt)
	-- if CA.option("nocat") then cat = "" end
	-- Si le mot clé key est parmi les mots options, répondre true
	-- Chercher dans CA.invoke_options et ( opt ou CA.debug_options )
	-- Options de documentation : docmin docmax docnotice docdef docligne docavant docapres params
	-- Autres options : en es fr unitest notices nobox nocat track
	-- Veiller à toujours séparer les mots par des espaces.
	-- On peut désactiver les options en supprimant les mots clés ou en les coupant.
	-- Les identifiants de langues permettent de forcer certaines langues.
	-- Les erreurs n'apparaissent que dans les espaces de noms Modèle ou Module.
end -- local option = function(key, opt)

------------------------------------------------------------
-- Interface du module pour le modèle
------------------------------------------------------------

local p = {}

p.nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")

p.constantes = {
	-- Categorize the year of death for 100 years
	-- Clasificar el año que murió hace 100 años
	-- Catégoriser l'année de mort depuis 100 ans
	categorise_death_for_n_years	= 100,
	-- Start writing an author after birth
	-- Comience a escribir un autor después de su nacimiento
	-- Début d'écriture d'un auteur après la naissance
	author_birth_to_writing			= 20,
	-- Finished writing a writer before his death
	-- Terminó escribiendo un escritor antes de su muerte
	-- Fin d'écriture d'un auteur avant sa mort
	author_writing_before_death		= 5,
	-- Limit of normal life
	-- Límite de la vida normal
	-- Limite de durée de vie normale
	lifetime_limit					= 120,
}
	-- Limit of normal time writing of an author
	-- Límite de tiempo normal de escribir de un autor
	-- Limite normale de durée d'écriture d'un auteur
	p.constantes.author_writing_time_limit = p.constantes.lifetime_limit - p.constantes.author_birth_to_writing - p.constantes.author_writing_before_death

------------------------------------------------------------
-- Données de wikidata par mw.wikibase
------------------------------------------------------------
-- http://test2.wikipedia.org/w/index.php?title=Bertha_von_Suttner&action=edit
-- {{authority control|TYP=p|GND=118620126|LCCN=n/50/66831|NDL=01229737|VIAF=95160848}}
-- http://test2.wikipedia.org/wiki/Module:Wikibase

--[[
== Lua Test ==
* ID: {{#invoke:Wikibase|id}}
* Label(): {{#invoke:Wikibase|label}}
* Label(Q2099): {{#invoke:Wikibase|label|Q7259}}
* Label(q555555): {{#invoke:Wikibase|label|q555555}} <!-- Unknown or missing entity. Will result in empty output. -->
* Label(xyz): {{#invoke:Wikibase|label|xyz}} <!-- Invalid entity. Will result in "Script error". -->
* Page(): {{#invoke:Wikibase|page}}
* Page(Q7259): {{#invoke:Wikibase|page|Q7259}}
* Page(q555555): {{#invoke:Wikibase|page|q555555}} <!-- Unknown or missing entity. Will result in empty output. -->
* Page(xyz): {{#invoke:Wikibase|page|xyz}} <!-- Invalid entity. Will result in "Script error". -->
--]]

-- mw.wikibase.getEntityObject() --    gets entity data of the Wikidata item connected with the current page. See the section Entity table and data structure for an example of the structure returned.
-- mw.wikibase.label( id ) --    takes an item ID and returns the label in the language of the local wiki.
-- mw.wikibase.sitelink( id ) --    takes an item ID and returns the title of the corresponding page on the local wiki.
-- http://www.mediawiki.org/wiki/Extension:WikibaseClient/Lua
-- p.entity = mw.wikibase.getEntityObject()
-- p.father = mw.wikibase.label( "Q" .. entity.claims.p107[0].mainsnak.datavalue.value["numeric-id"])
-- p.id = ""
-- father == "Lord Byron"
-- http://www.wikidata.org/wiki/Wikidata:Project_chat#Getting_a_subset_of_claims_for_an_entity
-- The props=claims API query retrieves ALL the claims stored for an entity.
------------------------------------------------------------

function p.wiki_props( wd, claims, args_known )
--	local dat = entity.claims
	local t = ""
	local wd_props = {
		image			= { pp = "p18", id = "P18_image", keyword = "image", tab = claims.p18, },
		placeofbirth	= { pp = "p19", id = "P19_placeofbirth", keyword = "placeofbirth", tab = claims.p19, n=1, },
		gender			= { pp = "p21", id = "P21_gender", keyword = "gender", tab = claims.p21, n=1, },
		father			= { pp = "p22", id = "P22_father", keyword = "father", tab = claims.p22, n=1, },
		country			= { pp = "p27", id = "P27_country", keyword = "country", tab = claims.p27, n=1, },
		maintype		= { pp = "p107", id = "P107_maintype", keyword = "maintype", tab = claims.p107, n=1, },
		signature		= { pp = "p109", id = "P109_signature", keyword = "signature", tab = claims.p109, },
		BNF				= { pp = "p268", id = "P268_BNF", keyword = "BNF", tab = claims.p268, },
		GND				= { pp = "p227", id = "P227_GND", keyword = "GND", tab = claims.p227, },
		ISNI			= { pp = "p213", id = "P213_ISNI", keyword = "ISNI", tab = claims.p213, },
		LCCN			= { pp = "p244", id = "P244_LCCN", keyword = "LCCN", tab = claims.p244, },
		VIAF			= { pp = "p214", id = "P214_VIAF", keyword = "VIAF", tab = claims.p214, },
		birthyear		= { pp = "p569", id = "P569_birthyear", keyword = "birthyear", tab = claims.p569, t=1, },
		deathyear		= { pp = "p570", id = "P570_deathyear", keyword = "deathyear", tab = claims.p570, t=1, },
	}
	for key, prop in pairs(wd_props) do -- Pour tous les paramètres connus
		if prop.tab then
			vv = prop.tab[0].mainsnak.datavalue.value
			if prop.n then
				vv = vv["numeric-id"]
			end
			if prop.t then
				vv = mw.ustring.sub( (vv.time), 9, 12 )
			end
			wd[key] = vv
		end
		t = t .. CA.ta(key, vv)
	end
	return wd, t
end -- function p.wiki_props( wd, claims, args_known )

function p.wikidata( args_known, elem )
	if type(args_known) ~= "table" then args_known = CA.args_known end
	local t = "\n* wikidata : " .. CA.ta("elem", elem)
	--	t = t .. CA.ta("key", key) .. CA.ta("argm", argm) .. CA.ta("val", val)
	local wd, entity = {}
	-- local frame = mw.getCurrentFrame()
	elem = nil -- anti bug 49805
	if elem then -- Le 2013-06-19 acces restreint par Lua pour un autre élément
		-- https://bugzilla.wikimedia.org/show_bug.cgi?id=49805
		-- Bug 49805 - Allow mw.wikibase.getEntityObject and getProperty to access arbitrary Wikidata items
		-- Reported: 2013-06-19 10:52 UTC by Rical 
		wd.error = "elem"
		t = t .. CA.ta("element", elem) .. "Lua ne peux lire que le wikidata de la page actuelle, voir bug 49805."
	else -- elem
		if mw.wikibase then -- Wikidata disponible ?
			entity = mw.wikibase.getEntityObject( )
			if entity then -- infos normales pour la page affichee
				-- wd.P18_image = frame:preprocess( "{{#property:P18}}" ) -- Help:Extension:ParserFunctions
				wd.entity = entity.id
				wd.sitelink = mw.wikibase.sitelink( entity.id )
				wd.label = mw.wikibase.label( entity.id )
				t = t .. CA.ta("entity", wd.entity)
				t = t .. CA.ta("sitelink", wd.sitelink)
				t = t .. CA.ta("label", wd.label)
				local claims = entity.claims
				wd, td = p.wiki_props( wd, claims, args_known )
				-- Reading p18[0] (and others) does not work if one writes dat["p18"][0]
				-- Lectura p18[0] (y otros) no funciona si se escribe dat["p18"][0]
				-- Lire p18[0] (et autres) ne fonctionne pas si on écrit dat["p18"][0]
				-- err_wikidata_property = "Erreur : La propriété '''%1''' de Wikidata n'est pas trouvé.",
			else -- entity : id introuvable pour la page affichee
				CA.erreur_add("err_wikidata_getEntity", " ")
				local err_wikidata_cat = CA.str_vars("err_wikidata_cat")
				err_wikidata_cat = CA.catGen(err_wikidata_cat, err_wikidata_cat)
				wd.error = "getEntity"
				t = t .. " getEntity='''ERREUR''' "
			end -- entity
		else -- mw.wikibase
			local err_wikidata_cat = CA.str_vars("err_wikidata_cat")
			err_wikidata_cat = CA.catGen(err_wikidata_cat, err_wikidata_cat)
			wd.error = "wikibase" -- t = CA.error_color("\n* Wikidata n'est pas disponible.")
			t = t .. CA.erreur_add("err_wikidata_wikibase", "wikibase")
		end -- mw.wikibase
	end -- elem
	p.args_wikidata = wd
	CA.args_wikidata = wd
	return wd, t
end -- function p.wikidata( args_known, elem )

function p.wikidata_old( args_known, elem )
	if not mw.wikibase then -- Wikidata disponible ?
		wd.error = "wikibase"
--		t = CA.error_color("\n* Wikidata n'est pas disponible.")
		t = CA.erreur_add("err_wikidata_wikibase", "wikibase")
		local err_wikidata_cat = CA.str_vars("err_wikidata_cat")
		cat_initiale = CA.catGen(err_wikidata_cat, err_wikidata_cat)
		p.args_wikidata = wd
		CA.args_wikidata = wd
		return wd, t
	end
	if elem then -- Le 2013-06-19 acces restreint par Lua pour un autre élément
		-- https://bugzilla.wikimedia.org/show_bug.cgi?id=49805
		-- Bug 49805 - Allow mw.wikibase.getEntityObject and getProperty to access arbitrary Wikidata items
		-- Reported: 2013-06-19 10:52 UTC by Rical 
		t = t .. CA.ta("element", elem)
		p.args_wikidata = wd
		CA.args_wikidata = wd
		return wd, t
	end
	entity = mw.wikibase.getEntityObject( )
	if entity then -- infos normales pour la page affichee
		-- wd.P18_image = frame:preprocess( "{{#property:P18}}" ) -- Help:Extension:ParserFunctions
		wd.entity = entity.id
		wd.sitelink = mw.wikibase.sitelink( entity.id )
		wd.label = mw.wikibase.label( entity.id )
		t = t .. CA.ta("entity", wd.entity)
		t = t .. CA.ta("sitelink", wd.sitelink)
		t = t .. CA.ta("label", wd.label)
		local claims = entity.claims
		wd, td = p.wiki_props( wd, claims, args_known )
		-- Reading p18[0] (and others) does not work if one writes dat["p18"][0]
		-- Lectura p18[0] (y otros) no funciona si se escribe dat["p18"][0]
		-- Lire p18[0] (et autres) ne fonctionne pas si on écrit dat["p18"][0]
		-- err_wikidata_property = "Erreur : La propriété '''%1''' de Wikidata n'est pas trouvé.",
	else -- id introuvable pour la page affichee
		CA.erreur_add("err_wikidata_getEntity", " ")
		--[ [
		local err_wikidata_cat = CA.str_vars("err_wikidata_cat")
		err_wikidata_cat = CA.catGen(err_wikidata_cat, err_wikidata_cat)
		wd.error = "getEntity"
--		t = t .. " getEntity='''ERREUR''' "
		p.args_wikidata = wd
		CA.args_wikidata = wd
		return wd, t
	end
--	t=t.. CA.doctable_args(wd, "wd")
	t = t .. "\n* '''wikidata''' propriétés " .. td
	p.args_wikidata = wd
	CA.args_wikidata = wd
	return wd, t
	-- main type = P107, sex = P21, father = P22, image=P18, signature = P109, country=P27, place of birth=P19,
	-- BNF=P268, GND=P227, ISNI=P213, LCCN=P244, VIAF=P214,
	-- local father = mw.wikibase.label( "Q" .. entity.claims.p107[0].mainsnak.datavalue.value["numeric-id"])
	-- http://www.wikidata.org/wiki/Property:P107
	-- main type of item: person (Q215627), organization (Q43229), event (Q1656682), creative work (Q386724), term (Q1969448), place (Q618123, geographical feature), or disambiguation page (Q11651459, see "Wikidata:Infoboxes task force" for use)
end -- function p.wikidata(id, entity_table)

function p.wikidata_test(t)
--	local t = "\n* '''wikidata_test''' :"
	local wd, tw
	wd, tw = p.wikidata( CA.args_known, "Q899264") -- Q899264#sitelinks = Martin Fleischmann
	t = t .. tw
	wd, tw = p.wikidata( CA.args_known, "Q535") -- Q535 = Victor Hugo = Victor Marie Hugo
	t = t .. tw
	wd, tw = p.wikidata( CA.args_known )
	t = t .. tw
--	if type(wd.birthyear) == "table" then
--		t = t .. CA.doctable_args(wd.birthyear, "wd.birthyear", { levelmaxi = 5, maxn = 2 , exclude1 = "name" } )
--	end
--	t = t .. p.wikidata("899264") -- Q899264#sitelinks = Martin Fleischmann
--	t = t .. p.wikidata("535") -- Q535 = Victor Hugo = Victor Marie Hugo
--	t = t .. p.wikidata("Q899264", "q899264", "p18") -- Q899264#sitelinks = Martin Fleischmann
--	t = t .. p.wikidata("Q535", "p18", "P18") -- Q535 = Victor Hugo = Victor Marie Hugo
--	t = t .. p.wikidata("Martin Fleischmann") -- Q899264#sitelinks = Martin Fleischmann
--	t = t .. p.wikidata("Victor Hugo") -- Q535 = Victor Hugo = Victor Marie Hugo
	return t
end -- function p.wikidata_test(t)

------------------------------------------------------------
-- Gérer et générer les notices d'autorité et les scans
------------------------------------------------------------

	-- Notice book double :
	--srcset="//upload.wikimedia.org/wikipedia/commons/thumb/5/51/Nuvola_apps_bookcase_2.svg/33px-Nuvola_apps_bookcase_2.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/5/51/Nuvola_apps_bookcase_2.svg/44px-Nuvola_apps_bookcase_2.svg.png 2x"
	--src="//upload.wikimedia.org/wikipedia/commons/thumb/5/51/Nuvola_apps_bookcase_2.svg/22px-Nuvola_apps_bookcase_2.svg.png"
	-- {{Nota | BNF | {{{BNF | cb11888266r }}} | BNF | http://catalogue.bnf.fr/ark:/12148/{{{BNF|cb11888266r}}} | espace=Auteur }}

local toUTF8 = function(tx)
	-- convertir un simple texte en UTF8 pour URL
	-- text = "Bibliothèque d'autorité (Suède)"
	-- wptx = "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(tx) ~= "string" then tx = "" end
	local t = tostring(tx)
	--t = mw.uri.encode( t, "QUERY" )
	t = string.gsub(t, "%s", "%%%%20")
	t = string.gsub(t, "'", "%%%%27")
	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

local HTMLnotice = function(ref, noticeN)
	-- Générer le wikitexte d'une notice selon ref, "id", "sauf", et l'espace de nom
	-- exemple : notice(control, data, "cb11888266r", noticeN)
	if noticeN == nil then return "" end
	local id = noticeN._id
	if id == nil then return "" end
	if ref == nil then ref = "" end
--	local wptx = toUTF8(noticeN.text)
	local wptx = noticeN.wptx
	-- wikitext structure
	-- [[File:Farm-Fresh draw calligraphic.png|22px|link=http://lccn.loc.gov/cb11888266r|BNF : cb11888266r]]
	local wt = '<span style="margin-left:10px;" > &nbsp; * &nbsp; [link_1 title_1] : [[File:Farm-Fresh draw calligraphic.png|22px|link=link_2|a_l_t]]</span>'
	-- title1="ARCid"
	wt = string.gsub(wt, "title_1", '' .. id)
	-- link1="http://fr.wikipedia.org/wiki/Biblioth%C3%A8que_nationale_de_France"
	wt = string.gsub(wt, "link_1", 'http://fr.wikipedia.org/wiki/' .. wptx)
	-- title2="BNF : cb11888266r"
	wt = string.gsub(wt, "title_2", id .. " : " .. ref)
	-- link2="http://catalogue.bnf.fr/ark:/12148/cb11888266r"
	wt = string.gsub(wt, "link_2", noticeN._link)
	-- alt="BNF  : cb11888266r"
	wt = string.gsub(wt, "a_l_t", id .. " : " .. ref)
	-- Remplacer ref dans link
	wt = string.gsub(wt, "REF_0", ref)
	-- Remplacer des parties de ref dans link
	local N = 1
	-- ref = "ref1/ref2/ref3" comme "123/456/789" ou "Dubois/Angèle/Marie"
	for refN in string.gmatch(ref, "[^/]") do
		-- lire les portions de textes séparées par un /, ainsi [^/] sélectionne tous les caractères sauf /,
		if refN ~= ref then -- si on trouve des portions de ref
			wt = string.gsub(wt, "REF_" .. tostring(N), refN) -- on les remplace dans wt
		end
		N = N + 1
	end
	return wt
end -- HTMLnotice = function(ref, noticeN)

--	ARC	= {base = "ARC",      _id = "ARCid",      _wsid = "ws-ARCid",		_sauf = "", _space = "", _type = "Auteur",
--		text = "National Archives and Records Administration",
--		wptx = "National Archives and Records Administration",
--		_link="http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},

-- Générer des notices d'autorités indépendantes sur une personne, un livre ou autre.
function p.gener_notices(_known, args_final, table_notices)
	-- Generate notices ARCid DNB GKD IBLid ...
	if args_final == nil then args_final = CA.args_final end
	local ntckey = " _notic=" -- NLA VIAF BNF
	local ntc = "" -- _notic=" -- NLA VIAF BNF
	if type(table_notices) ~= "table" then
		ntc = ntc .. CA.erreur_add("err_table_notices")
		ntc = ntc .. CA.catGen(err_table_notices_cat)
		return ntc
	end
	for key, argm in pairs(args_final) do -- Pour tous les paramètres connus
		key = tostring(key)
		if (table_notices[key] ~= nil) then
			ntc = ntc .. HTMLnotice(val, table_notices[key])
		end
	end
	return ntc
	--[[
	for key, argm in pairs(table_notices) do -- Pour tous les paramètres connus
		key = tostring(key)
		val = tostring(argm)
		-- ntc = ntc .. ", " .. key .. "=" .. val
	end
	--]]
end -- function p.gener_notices(_known, _source, _notic)

-- Générer des notices d'autorités indépendantes sur une personne, un livre ou autre.
function p.gener_notices_src(_known, args_source, _notic)
	-- Generate notices ARCid DNB GKD IBLid
	if args_source == nil then args_source = CA.args_source end
	local ntckey = " _notic=" -- NLA VIAF BNF
	local ntc = "" -- _notic=" -- NLA VIAF BNF
	for key, argm in pairs(_notic) do -- Pour tous les paramètres connus
		key = tostring(key)
		val = tostring(argm)
		-- ntc = ntc .. ", " .. key .. "=" .. val
	end
	-- ntc = ntc .. " args_source : "
	for key, argm in pairs(args_source) do -- Pour tous les paramètres connus
		key = tostring(key)
		val = tostring(argm)
		-- ntc = ntc .. ", " .. key .. "=" .. val
		if (_notic[key] ~= nil) then
			ntckey = _notic[key]
			ntc = ntc .. HTMLnotice(val, _notic[key]) -- ntc .. "(" .. tostring(ntckey) .. ")" ..
		end
	end
	return ntc
end -- function p.gener_notices(_known, _source, _notic)

local scanNames = function(wt, site)
	-- wt = scanNames("http://gallic ... &q=-ws-name-+-ws-firstname-", md_data) -- replace names for scans
	-- anti errors
--	local name = tostring(data["ws-name"])
	local name = CA.argv("lastname")
	if name == nil then name = "" end
--	name = "Rimbaud"
	local firstname = tostring(CA.argv("firstname"))
	if firstname == nil then firstname = "" end
	local firstgall = CA.argv("galliname")
	if firstgall == nil then firstgall = "" end
	if firstgall == "" then firstgall = firstname end
	-- replace names for scans
	wt = tostring(wt)
	wt = tostring(string.gsub(wt, "ws_firstname", firstname) )
	wt = tostring(string.gsub(wt, "ws_name", name) )
	wt = tostring(string.gsub(wt, "ws_firstgall", firstgall) )
	wt = toUTF8(wt)
	-- str2 = str.gsub(/\s/,'')
	wt = '[' .. wt .. ' ' .. site .. ']'
	return wt
end -- local scanNames = function(wt, site)

local HTMLscans = function(args, data)
	-- à faire : i18n['fr']author_Scans				= 'Scans fr : ', author_Scans
	-- wt = scanNames("http://gallic ... &q=-ws-name-+-ws-firstname-") -- replace names for scans
	-- anti errors
	-- Generate scans to display
	local SCAN__gallica = "http://gallica.bnf.fr/Search?ArianeWireIndex=index&p=1&lang=FR&q=ws_name+ws_firstname"
	SCAN__gallica = "<span> &nbsp; " .. tostring(scanNames(SCAN__gallica, "Gallica") .. " </span>" )
	local SCAN__europeana = "http://www.europeana.eu/portal/search.html?query=who:ws_name,%20ws_firstname&qf=LANGUAGE:fr&qf=LANGUAGE:mul&qf=TYPE:TEXT"
	SCAN__europeana = "<span> &nbsp; " .. tostring(scanNames(SCAN__europeana, "Europeana") .. " </span>" )
	local SCAN__google = "https://www.google.fr/search?q=inauthor%3A%22ws_firstname+ws_name%22&ie=utf-8&oe=utf-8&aq=t"
	SCAN__google = "<span> &nbsp; " .. tostring(scanNames(SCAN__google, "Google") .. " </span>" )
	local scan_notices = p.gener_notices(CA.args_known, CA.args_source, notices_properties)
	--	local xxx = args_trad['author_Scans']
	local start = 'scans ' .. CA.trans('author_Scans') .. ' : &nbsp; '
	CA.trck( "CA.trans('author_Scans')" .. start )
	local scans = '<div id="Author" class="vcard" style=" background-color:#F1F1DE; border:0px solid #CCCCCC; "><span>' .. start .. SCAN__gallica .. SCAN__europeana .. SCAN__google .. scan_notices .. ' </span></div>'
	return scans
end -- local HTMLscans = function(args, data)

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

local categories = function(args_source, argfinal)
	--	category_space = frame:preprocess("{{ns:Category}}") -- Category namespace from system, par init
	if type(args_source) ~= "table" then args = CA.args_source end
	if type(argfinal) ~= "table" then argfinal = CA.argfinal end
	local catspace = CA.category_space
	local cats = CA.category_list
	local initiale = argfinal.initiale -- CA.argv("initiale")
	if not isDef(initiale) then initiale = "" end
	local sans = "" -- tostring(CA.argv("authors-category-no-initials") )
	CA.trck(" categories() initiale=" .. initiale .. " sans=" .. sans .. " catView=" .. CA.catView)
	local cat_initiale = ""
	if isDef(initiale) then
		cat_initiale = CA.str_vars("authors_initiale", initiale)
		cat_initiale = CA.catGen(cat_initiale, cat_initiale)
	end
	local commonscat = argfinal.commonscat
	if nil ~= commonscat then CA.catGen(catspace, "Commons category") end
	CA.trck(" birthyear=" .. tostring(argfinal.birthyear) .. " occupation=" .. tostring(argfinal.occupation) )
	CA.trck( "Naissance en " .. tostring(argfinal.birthyear) )
	if tonumber(argfinal.birthyear) then -- une_annee
		if tonumber(argfinal.birthyear) > (p.nowyear - p.constantes.categorise_death_for_n_years) then
			CA.catGroup("Naissance group %1", tostring(argfinal.birthyear) )
		end
	end
	if tonumber(argfinal.deathyear) then
		if tonumber(argfinal.deathyear) > (p.nowyear - p.constantes.categorise_death_for_n_years) then
			CA.catGroup("Décès group %1", tostring(argfinal.deathyear) )
		end
	end

	-- Traces de discussions pour debug :
	
	-- Pour les années de naissance avant 1901, le mettre en catégories de siècles. Le Modèle:Epoque ne génère pas de catégories d’années avant 1901, voir la documentation. De mémoire, parce qu'elles sont trop dispersées et que ces catégories servent surtout à repérer chaque année les auteurs nouvellement publiables. --Rical (d) 9 novembre 2012 à 21:04 (UTC) 

	-- Certaines catégories sont étranges. « Auteurs par pays : », « Auteurs par pseudo », etc. Est-ce que ce serait possible de mettre à jour ce modèle pour le faire correspondre aux catégories qui existent déjà ? Marc (d) 3 avril 2013 à 10:49 (UTC)
	
	-- Catégorie:Femmes auteurs
	-- Catégorie:Auteurs par nationalité [×] Auteurs anglais‎ (142 P) Catégorie:Auteurs anglais
	-- [+] Auteurs par pseudo‎ (1 C) à modifier -> Catégorie:Pseudonymes
	-- Auteurs par pays : n'existe pas
	-- [×] Auteurs morts pour la France‎ (15 P) Catégorie:Auteurs morts pour la France
	-- [+] Auteurs par période‎ (12 C, 1 P) Catégorie:Auteurs par période

--	end
	-- CA.catGroup(control, "Pays %1", "France/Italie/Grèce")
	-- |genre=Romanciers/Poètes/Auteurs de théatre
	-- table.insert(cats, 
	CA.catGroup("%1", argfinal.gender ) -- )
	-- |langue=français/japonais
	-- table.insert(cats, 
	CA.catGroup("%1", argfinal.language ) -- )
	-- |metier=Académiciens/Personnalités politiques
	-- table.insert(cats, 
	CA.catGroup("%1", argfinal.occupation ) -- )
	-- |pays=France/Italie/Grèce
	--	table.insert(cats, 
--	CA.catGroup("Pays %1", argfinal.country ) -- )
	-- |prix=Nobel de littérature/Pulitzer/Renaudot
	-- table.insert(cats, 
	CA.catGroup("%1", argfinal.prize ) -- )
--	table.insert(cats, CA.catGen(catspace, CA.argv("authors-category") ) )
--	table.insert(cats, CA.catGen(catspace, "Birth in %1", CA.argv("birthyear") ) )
--	table.insert(cats, CA.catGen(catspace, "Death in %1", CA.argv("deathyear") ) )
	return table.concat(cats)
end -- categories = function(args_source, argfinal)

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

function p.droits_auteur(args_final)
	-- wkt, ee = p.droits_auteur(args_final)
	if type(args_final) ~= "table" then args_final = CA.args_final end
	local rights = args_final.rights
	local birthyear = tonumber(args_final.birthyear)
	local deathyear = tonumber(args_final.deathyear)
	local tst = ""
	local wkt = ""
	local cat = ""
	local err = ""
	local box = nil
	-- quelques modèles : {{Auteur Mort pour la France}} {{DP-EU-Auteur}}
	-- =={{int:license-header}}== {{PD-US}} {{PD-1923}} {{PD-Old}}
	-- droits = 70 : si les ayants droits de cet auteur(e) ont des droits d’auteur aux États-Unis jusqu’à 70 ans après son décès. Valeur par défaut.
	-- droits = mpf, si les ayants droits de cet auteur(e) mort(e) pour la France ont des droits d’auteur en France jusqu’à 95 ans après son décès.
	-- droits = non, si cet auteur(e) n’a aucun droit sur ses œuvres.
	--
	-- Droits d'auteur par défaut
	if not rights then rights = "70" end
	--
	if rights == "mpf" then
		-- vérifier 'Auteur Mort pour la France'
		if not deathyear				then box = nil
		elseif p.nowyear < deathyear + 96 then box = 'Auteur Mort pour la France'
		else								 box = nil end
	elseif rights == "non" then
		box = nil
	else
		if not deathyear 				then box = 'DP-EU-Auteur'
		elseif p.nowyear < deathyear + 71 then box = 'DP-EU-Auteur'
		elseif not birthyear 			then box = 'DP-1923'
		elseif (birthyear + 20) < 1903 	then box = 'DP-EU-Auteur'
		else 								 box = nil end
	end
	-- Générer ou non le modèle de droits d'auteur
	if box and not CA.option("nobox") then -- pour normal et pour test
		-- Verifier si le modèle existe, pour éviter l'erreur de script
		local temp = mw.title.new( box, "template" )
		if temp.exists then
		--	err = err .. " ok "
			wkt = mw.getCurrentFrame():expandTemplate{ title = box }
			cat = CA.catGen(box, box, args_final.c)
		else
			err = err .. " " .. box .. " n'existe pas. "
		end
	else
		wkt = ""
	end
	tst = "\n* droits_auteur "
	tst = tst .. CA.ta("birthyear", birthyear) .. CA.ta("deathyear", deathyear)
	tst = tst .. CA.ta("rights", rights) .. CA.ta("box", box)
	tst = tst .. CA.ta("options", options)
	tst = tst .. CA.ta("err", CA.error_color(err)) .. CA.tam("cat", cat)
--	tst = tst .. wkt -- vraiment générer le modèle, mais pas dans le test
	--
	args_final.tst = tst
	args_final.wkt = wkt
	args_final.cats = args_final.cats or ""
	args_final.cats = args_final.cats .. cat
	args_final.errs = args_final.errs or ""
	args_final.errs = args_final.errs .. err
	return wkt, args_final
end -- function p.droits_auteur(args_final)

function p.droits_auteur_test( wkt, args_final)
	-- Unitary tests of p.droits_auteur
	--	res = res .. p.droits_auteur_test( "<br/><br/>\n* Test de '''droits_auteur''' : ", args_final)
	local args_final = mw.clone(args_final)
	wkt = wkt .. "<br>This list displays always the same variables."
	wkt = wkt .. "<br>Cette liste affiche toujours les mêmes variables."
	--
	args_final = { c = ":", options = " nobox ", birthyear = 1888, deathyear = (p.nowyear - 96), rights = "mpf" }
	res, args_final = p.droits_auteur(args_final)
	wkt = wkt .. args_final.tst
	--
	args_final = { c = ":", options = " nobox ", birthyear = 1888, deathyear = (p.nowyear - 95), rights = "mpf" }
	res, args_final = p.droits_auteur(args_final)
	wkt = wkt .. args_final.tst
	--
	args_final = { c = ":", options = " nobox ", birthyear = 1888, deathyear = (p.nowyear - 94), rights = "mpf" }
	res, args_final = p.droits_auteur(args_final)
	wkt = wkt .. args_final.tst
	--
	args_final = { c = ":", options = " nobox ", deathyear = (p.nowyear - 72), rights = "70" }
	res, args_final = p.droits_auteur(args_final)
	wkt = wkt .. args_final.tst
	--
	args_final = { c = ":", options = " nobox ", birthyear = (p.nowyear - 99), deathyear = (p.nowyear - 71), rights = "70" }
	res, args_final = p.droits_auteur(args_final)
	wkt = wkt .. args_final.tst
	--
	args_final = { c = ":", options = " nobox ", birthyear = (p.nowyear - 99), deathyear = (p.nowyear - 70), rights = "70" }
	res, args_final = p.droits_auteur(args_final)
	wkt = wkt .. args_final.tst
	--
	args_final = { c = ":", options = " nobox ", birthyear = (p.nowyear - 99), deathyear = (p.nowyear - 69), rights = "70" }
	res, args_final = p.droits_auteur(args_final)
	wkt = wkt .. args_final.tst
	--
	args_final = { c = ":", options = " nobox ", birthyear = (p.nowyear - 99), deathyear = (p.nowyear - 50), rights = "non" }
	res, args_final = p.droits_auteur(args_final)
	wkt = wkt .. args_final.tst
	--
	args_final = { c = ":", options = " nobox ", birthyear = (p.nowyear - 99), deathyear = (p.nowyear - 50), rights = "70" }
	res, args_final = p.droits_auteur(args_final)
	wkt = wkt .. args_final.tst
	--
	args_final = { c = ":", options = " nobox ", birthyear = (p.nowyear - 99), deathyear = (p.nowyear - 50), rights = "mpf" }
	res, args_final = p.droits_auteur(args_final)
	wkt = wkt .. args_final.tst
	--
--	wkt = wkt .. "\n* '''droits_auteur''' errors = " .. CA.error_color(errs)
	return wkt
end -- function p.droits_auteur_test( wkt, args_final)

local defaultsort = function(control, data)
	local key = tostring(CA.argv("sortkey"))
	local name = tostring(CA.argv("lastname"))
	local given = tostring(CA.argv("givenname"))
	local family = tostring(CA.argv("lastname"))
	local name = key or name or ((given or "_") .. "," .. (family or ""))
	-- local name = data["ws-key"] or data["ws-name"] or ((data["given-name"] or "_") .. "," .. (data["family-name"] or ""))
	return mw.getCurrentFrame():preprocess("{{DEFAULTSORT:" .. name .. "}}")
	-- return "{{DEFAULTSORT:" .. name .. "}}"
end

------------------------------------------------------------
-- 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.is_uncertain( txt, nbr)
--	res = res .. "\n\n\n* Test de '''une_annee''' : "
	local annee, an_tabN, uncertain, cat, err, base, t = p.un_nombre( txt, "[^%d]", "decim", argname, c, t)
	-- Si le texte est significatif sans l'année, ajouter la catégorie "année incertaine"
	local flou = string.gsub( txt, "[^%l%<%=%>]", "" ) -- garde les lettres et "<=>". keep only letters and "<=>"
	if isDef(flou) then
		err = err .. "Année incertaine. "
	--	err = err .. cat
	else
		cat = ""
	end
	--	an_lst = table.concat( an_lst, "," )
	--	t = t .. CA.ta("err", err)
	local ok = "" -- tostring(isDef(firstname)
	err = CA.error_color(err)
	t = t .. CA.ta("cat", cat) .. CA.ta("err", err)
	return annee, cat, err, base, t, c
--	return annee, cat, err, base, c, t, an_tabN
--	local annee, cat, err, base, t, c = p.une_annee(an_in, argname, c, roman)
end -- function p.is_uncertain(an_in, argname, c, roman, opt)

function p.century_text(nbr)
	-- Convert a number to century text
	nbr = tonumber(nbr)
	if not nbr then return "" end
	local siecleabs, epq = math.abs(nbr), ""
	local siecleroman, erreur = MathRoman.int2roman(siecleabs)
	siecleroman = tostring(siecleroman)
	if nbr > 0 then
		epq = "century_EC" -- "%1 ème siècle"
	else
		epq = "century_BEC" -- "%1 ème siècle BEC"
	end
	txt = CA.str_vars(epq, siecleroman )
	return txt
end -- function p.century_text(nbr)

-- Extract one number from a text, digital or roman
-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.events_epochs()
function p.a_number( ee, base_in)
--	ee = p.a_number( ee, "decim")
--	wkt, cats, tst, errs, ee = p.a_number( wkt, cats, tst, errs, ee, "decim")
	if type(wkt) ~= "string" then wkt = "" end
--	if type(cats) ~= "string" then cats = "" end
	if type(tst) ~= "string" then tst = "" end
--	if type(errs) ~= "string" then errs = "" end
--	local err, cat = "", ""
	ee.nbr = nil
	--
	-- La base du nombre (decim 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 err_year_in_roman_number
	ee.base = "decim" -- valeur par défaut
	if base_in then ee.base_in = base_in end
	if ee.base_in then ee.base = ee.base_in end
	-- correct abnormal values, corriger des valeurs anormales
	if ee.base ~= "roman" then ee.base = "decim" end
	local val, argmt, argmX = nil, "", ""
	local an_tab = {}
	ee.nbr_txt = ""
	ee.nbr_in = ee.nbr_in or ""
	-- Chercher les nombres romains
	ee.digit_select = "[^MDCLXVIJ]"
	local spaces = string.gsub( " "..ee.nbr_in.." ", ee.digit_select, " " )
	local lst = wordstotable( spaces ) -- 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, errx = MathRoman.roman2int(word)
			if val == 0 then val = nil 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 = val
				ee.base = "roman"
				ee.spaces = spaces
				ee.nbr_txt = ee.nbr_txt .. ee.roman_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)
			end
		end
	end
	-- Chercher les nombres décimaux
	ee.digit_select = "[^%d]" -- "[^%d]"
	local spaces = string.gsub( " "..ee.nbr_in.." ", ee.digit_select, " " )
	local lst = wordstotable( spaces ) -- convertit un texte en table de mots " "..ee.nbr_in.." "
	local xxxx = ""
	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.decim_txt = word -- il y a au moins un nombre décimal parmi les mots
				table.insert( an_tab, val )
				ee.nbr = val
				ee.base = "decim"
				ee.spaces = spaces
				ee.nbr_txt = ee.decim_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_decim = 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 decim_txt ou roman_txt
		ee.nbr = an_tab[1]
	else -- erreur s'il n'y a pas de nombre ou s'il y en a plusieurs
		--	cat = cat .. CA.erreur_add("err_one_number_argument", tostring( ee[argname] ) )
		ee.nbr = nil
		ee.nbr_txt = nil
	end
	if ee.nbr then -- adjust for negative numbers, including romans
		local negatif = string.find( ee.nbr_in, "-" .. ee.nbr_txt )
		if negatif then
			ee.nbr = - ee.nbr
--			ee.nbr_txt = ""
--			if ee.decim_txt then ee.nbr_txt = ee.decim_txt end
			-- Pour les catégories EC, BEC 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
--	errs = errs .. err
--	cats = cats .. cat
	tst =  "\n* a_number " -- tostring(tst) .. "\n* a_number "
	tst = tst .. CA.ta("nbr_in", ee.nbr_in) .. CA.ta("base_in", ee.base_in) .. CA.ta("base", ee.base)
	tst = tst .. CA.ta("nbr", ee.nbr) .. CA.ta("uncertain_txt", ee.vague_txt)
--	tst = tst .. CA.ta("spaces", ee.spaces) -- .. CA.ta("argmX", argmX)
	tst = tst .. CA.ta("tabN", ee.tabN) .. CA.ta("nbr_txt", ee.nbr_txt)
--	tst = tst .. CA.ta("decim_txt", ee.decim_txt) .. CA.ta("roman_txt", ee.roman_txt)
--	tst = tst .. CA.ta("err", err) .. CA.ta("cat", cat)
--	ee.cats = cats
--	ee.errs = errs
--	ee.tst = tst
	ee.wkt = tst
	return ee, tst -- wkt, cats, tst, errs, ee
end -- function p.a_number( ee, base_in)

-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.events_epochs()
function p.a_number_test( wkt, args_final)
	-- Unitary tests of p.a_number
	local ee, errs --  wkt, cats,
	wkt = tostring(wkt)
	wkt = wkt .. "<br>This list displays always the same variables."
	wkt = wkt .. "<br>Cette liste affiche toujours les mêmes variables."
	-- 	ee.base_in = "decim"
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = "1234" }
	ee = p.a_number( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = "vers -1234" }
	ee = p.a_number( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = "< -1234" }
	ee = p.a_number( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = ">= -1234" }
	ee = p.a_number( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = "MCCXXXIV" }
	ee = p.a_number( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = "1234" }
	ee = p.a_number( ee, "roman")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = "MMCXXXIJ" }
	ee = p.a_number( ee, "roman")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = "-MMMCCXJ" }
	ee = p.a_number( ee, "roman")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = "avant -CXJ" }
	ee = p.a_number( ee, "roman")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = "début du XVIIème siècle" }
	ee = p.a_number( ee, "roman")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = " vers 1357 ou 1358" }
	ee = p.a_number( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = "le 14/07/1789" }
	ee = p.a_number( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", nbr_in = "vers 1357 ou MCCXXXIV" }
	ee = p.a_number( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	wkt = wkt .. "\n* '''a_number_test''' errors = " .. CA.error_color(err or "")
	return wkt
end -- function p.a_number_test( wkt, args_final)

-- 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.events_epochs()
function p.year_century( ee )
--	ee = p.a_number( ee, "decim")
--	wkt, cats, tst, errs, ee = p.year_century( wkt, cats, tst, errs, ee, "decim")
	ee.cats = ee.cats or ""
	ee.errs = ee.errs or ""
	local err, cat = "", ""
	ee.nowyear = p.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 la mort 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, "decim")
	-- The number is a priori a year.
	-- Le nombre est à priori une année.
	ee.century = nil
	ee.year = ee.nbr
	-- 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
		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
		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 av. J.-C.
	-- La civilisation de l'Indus (5000 av. J.-C. – 1900 av. J.-C.).
	-- 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 then
		if ee.nbr < -60 or 22 < ee.nbr then
			ee.century = nil
			ee.year = ee.nbr
		end
	end
	--
	-- Consequences for a year :
	-- Conséquences pour une année :
	if ee.year then
		ee.vague_year = ee.vague_decim or ee.vague_roman
		if ee.event == "birth" then
			-- Auteur par défaut à partir de 20 ans
			ee.event_author = ee.year + p.constantes.author_birth_to_writing
		elseif ee.event == "death" then
			-- Auteur par défaut jusqu'à 5 ans avant la mort
			ee.event_author = ee.year - p.constantes.author_writing_before_death
		else
			ee.event_author = ee.year
		end
		-- year anno année
		ee.event_yr = ee.event_author
		-- Assurer la continuité des années autour de 1 pour comparaisons futures
		if ee.event_yr and ee.event_yr < 1 then ee.event_yr = ee.event_yr + 1 end
		-- century siglo siècle
		ee.event_century_abs = math.floor( math.abs(ee.event_author - 1 ) / 100 ) + 1
		ee.event_ct = ee.event_century_abs
		-- Assurer la continuité des siècles autour de 1 pour comparaisons futures
		if ee.event_ct and ee.event_ct < 1 then ee.event_ct = ee.event_ct + 1 end
		if ee.event_ct then ee.event_ct = ee.event_ct*100 end
		ee.century_roman, ee.error_roman = MathRoman.int2roman(ee.event_ct / 100)
	elseif ee.century then
		ee.vague_cent = ee.vague_decim or ee.vague_roman
		-- century siglo siècle
		ee.event_century_abs = math.floor( math.abs(ee.century) )
		ee.event_ct = ee.century
		-- Assurer la continuité des siècles autour de 1 pour comparaisons futures
		if ee.event_ct and ee.event_ct < 1 then ee.event_ct = ee.event_ct + 1 end
		if ee.event_ct then ee.event_ct = ee.event_ct*100 end
		ee.century_roman, ee.error_roman = MathRoman.int2roman(ee.event_ct / 100)
	end
	--
--	errs = errs .. err
--	cats = cats .. cat
--	if not ee.cats then ee.cats = "" end
--	if not ee.errs then ee.errs = "" end
	--
	tst = "\n* year_century " -- tostring(tst) ..
	tst = tst .. CA.tam("event", ee.event) .. CA.tam("nbr_in", ee.nbr_in)
	tst = tst .. CA.tam("base", ee.base) -- .. CA.tam("base_in", ee.base_in)
	tst = tst .. CA.tam("year", ee.year) .. CA.tam("event_author", ee.event_author)
	tst = tst .. CA.tam("event_yr", ee.event_yr) .. CA.tam("century", ee.century)
	tst = tst .. CA.tam("event_ct", ee.event_ct) .. CA.tam("century_roman", ee.century_roman)
	tst = tst .. CA.tam("err", CA.error_color(err)) .. CA.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 )

-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.events_epochs()
function p.year_century_test( wkt, args_final)
	-- Unitary tests of p.year_century
	local args_final = mw.clone(args_final)
	local cats, errs, ee -- wkt, 
	wkt = wkt .. "<br>This list do not displays nil variables."
	wkt = wkt .. "<br>Cette liste n'affiche pas les variables nil."
	-- 	ee.base_in = "decim"
	ee = { c = ":", argname = "birthyear", event = "birth", birthyear = "1234" } -- nbr_in = "1234" }
--	wkt, cats, tst, errs, 
	ee = p.year_century( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", birthyear = "vers -1234" } -- nbr_in = "vers -1234" }
--	wkt, cats, tst, errs, 
	ee = p.year_century( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", birthyear = "< -1234" }
--	wkt, cats, tst, errs, 
	ee = p.year_century( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", birthyear = ">= -1234" }
	ee = p.year_century( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", birthyear = "MCXI" }
	ee = p.year_century( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", birthyear = "1234" }
	ee = p.year_century( ee, "roman")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", birthyear = "MCXI" }
	ee = p.year_century( ee, "roman")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", birthyear = "-MMMMCCCXXIJ" }
	ee = p.year_century( ee, "roman")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", birthyear = "avant -CXJ" }
	ee = p.year_century( ee, "roman")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthcentury", event = "birth", birthcentury = "début du XVIIème siècle" }
	ee = p.year_century( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", birthyear = " vers 1357 ou 1358" }
	ee = p.year_century( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", birthyear = "le 14/07/1789" }
	ee = p.year_century( ee, "decim")
	wkt = wkt .. ee.wkt
	--
	ee = { c = ":", argname = "birthyear", event = "birth", birthyear = "vers 1357 ou MCCXXXIV" }
	ee = p.year_century( ee)
	wkt = wkt .. ee.wkt
	--[[]]
	wkt = wkt .. "\n* '''year_century_test''' errors = " .. CA.error_color(err or "")
	return wkt
end -- function p.year_century_test( tst, args_final)

-- Computes the epoch from a year or a century
-- Calcule l'époque pour une année ou un siècle
-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.events_epochs()
function p.century_epoch( ee)
--	ee = p.century_epoch( ee)
--	wkt, cats, tst, errs, ee = p.century_epoch( wkt, cats, tst, errs, ee)
--	ee = p.a_number( ee, "decim")
--	if type(wkt) ~= "string" then wkt = "" end
--	if type(cats) ~= "string" then cats = "" end
--	if type(tst) ~= "string" then tst = "" end
--	if type(errs) ~= "string" then errs = "" end
	local err, cat = "", ""
	wkt = wkt or ""
	cats = cats or ""
	tst = tst or ""
	errs = errs or ""
	local ee = p.year_century( ee, "decim") -- wkt, cats, xxx, errs, 
--	ee = p.year_century( ee, "decim")
	--
	-- 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 av. J.-C.
	-- 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 av. J.-C. à 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 av. J.-C. – 1900 av. J.-C.).
	-- 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 av. J.-C.
	--
	-- if not ee.region then ee.region = "other" end
	if (ee.region ~= "china") and (ee.region ~= "india") and (ee.region ~= "century") then
		ee.region = "other"
	end
	local liste_epoques = {
		{ reg = "china", start = -9999, stop =  -771, cat = "cat_epoch_china_antiquity", val = "", },
		{ reg = "china", start =  -770, stop =  -221, cat = "cat_epoch_china_springs", val = "", },
		{ reg = "china", start =  -220, stop =  1911, cat = "cat_epoch_china_empires", val = "", },
		{ reg = "china", start =  1912, stop =  9999, cat = "cat_epoch_century_EC", val = ee.century_roman, },
		--
		{ reg = "india", start = -9999, stop = -1901, cat = "cat_epoch_indian_indus", val = "", },
		{ reg = "india", start = -1900, stop =   500, cat = "cat_epoch_indian_antiquity", val = "", },
		{ reg = "india", start =   501, stop =  1750, cat = "cat_epoch_indian_muslim", val = "", },
		{ reg = "india", start =  1751, stop =  9999, cat = "cat_epoch_century_EC", val = ee.century_roman, },
		--
		{ reg = "century", start = -9999, stop =  -1, cat = "cat_epoch_century_BEC", val = ee.century_roman, },
		{ reg = "century", start =   1, stop =  9999, cat = "cat_epoch_century_EC", val = ee.century_roman, },
		--
		{ reg = "other", start = -9999, stop =   500, cat = "cat_epoch_antiquity", val = "", },
		{ reg = "other", start =   501, stop =  1400, cat = "cat_epoch_middle_age", val = "", },
		{ reg = "other", start =  1401, stop =  9999, cat = "cat_epoch_century_EC", val = ee.century_roman, },
	}
	error_id = nil
	for i, epq in pairs(liste_epoques) do -- Parmi toutes les époques définies
		if ee.region then
			if ee.event_author then
				if ( epq.reg == ee.region) and ( epq.start <= ee.event_author) and (ee.event_author <= epq.stop ) then
					epoque = CA.str_vars(epq.cat, epq.val )
					cat = cat .. CA.catGen( epoque, epoque, ee.c )
				end
			elseif ee.event_ct then
				if ( epq.reg == ee.region) and ( epq.start <= ee.event_ct) and (ee.event_ct <= epq.stop ) then
					epoque = CA.str_vars(epq.cat, epq.val )
					cat = cat .. CA.catGen( epoque, epoque, ee.c )
				end
			end
		end
	end
	--
	-- Un seul nombre accepté
	if ee.tabN > 1 then -- verify the number is alone
	--	err = err .. CA.error_color(" n ± 1 années. ")
		local arg_nm = CA.args_lang[ee.argname] -- p.args_final  
		arg_nm = CA.error_color(arg_nm)
		err = err .. CA.erreur_add("err_one_number_argument", arg_nm )
	end
	--
	-- Années ou siècles incertains
	--[ [ voir events_epochs
	if ee.vague then
--		if ee.century then epq = "err_vague_epoch" end -- Si le siècle est défini
		if ee.year then
			epq = "err_vague_year"
		elseif ee.century then
			epq = "err_vague_epoch"
		end -- Si l'année est définie
	end
--[[
--		if ee.argname == "birthyear" or ee.argname == "deathyear" then
		if not (ee.birthyear or ee.deathyear) then
			epq = "err_vague_year"
		end
--		if ee.argname == "birthcentury" or ee.argname == "deathcentury" then
		if not (ee.birthcentury or ee.deathcentury) then
			epq = "err_vague_epoch"
		end
		local epq = CA.str_vars(epq)
		cat = cat .. CA.catGen( epq, epq, ee.c )
--]]
	--
	-- Ambigüité des années en nombres romains
	if ee.year and ee.base and (ee.base == "roman") then
	--	local arg_nm = CA.args_lang[ee.argname] -- p.args_final
	--	arg_nm = CA.error_color(arg_nm)
		err = err .. CA.erreur_add("err_year_in_roman_number", ee.nbr_in )
	end
--	if (ee.deathyear) and ee.base and (ee.base == "roman") then
	--	local arg_nm = CA.args_lang[ee.argname] -- p.args_final
	--	arg_nm = CA.error_color(arg_nm)
--		err = err .. CA.erreur_add("err_year_in_roman_number", ee.deathyear )
--	end
	--
--	err = err .. " -ce:err- "
--	cat = cat .. " -ce:cat- "
	tst = "\n* century_epoch "
	tst = tst .. CA.tam("event", ee.event) .. CA.tam("nbr_in", ee.nbr_in)
	tst = tst .. CA.tam("year", ee.year) .. CA.tam("event_author", ee.event_author)
	tst = tst .. CA.tam("century", ee.century) .. CA.tam("century_roman", ee.century_roman)
	tst = tst .. CA.tam("region", ee.region)
	tst = tst .. CA.tam("err", CA.error_color(err)) .. CA.tam("cat", cat)
	ee.wkt = tst
	ee.errs = ee.errs .. err
	ee.cats = ee.cats .. cat
	return ee, tst -- wkt, cats, tst, errs, ee
end -- function p.century_epoch( wkt, cats, tst, errs, ee)

-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.events_epochs()
function p.century_epoch_test( wkt, args_final)
	-- Unitary tests of p.century_epoch
	--
	local args_final = mw.clone(args_final)
	wkt = wkt or ""
	cats = cats or ""
	errs = errs or ""
	--
	wkt = wkt .. "<br>This list do not displays nil variables."
	wkt = wkt .. "<br>Cette liste n'affiche pas les variables nil."
	wkt = wkt .. "\n* '''Chine''' "
	local c = ":"
	local ee = { c=c, nowyear=p.nowyear, region = "china", birthyear = "-771" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "china", birthyear = "-770" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "china", birthyear = "-221" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "china", birthyear = "-220" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--[ [
	local ee = { c=c, nowyear=p.nowyear, region = "china", birthyear = "1911" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "china", birthyear = "1912" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "china", birthyear = "2000" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "china", birthyear = "2001" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	wkt = wkt .. "\n* '''Inde''' "
	local ee = { c=c, nowyear=p.nowyear, region = "india", birthyear = "-1901" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "india", birthyear = "-1900" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "india", birthyear = "500" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "india", birthyear = "501" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "india", birthyear = "1750" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "india", birthyear = "1751" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "india", birthyear = "1900" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "india", birthyear = "1901" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	wkt = wkt .. "\n* '''Autres''' "
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "500" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "501" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "1379" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "1380" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "1381" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "1400" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "1401" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "1880" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "1881" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "1900" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "1901" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "500" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	wkt = wkt .. "\n* '''Siècles''' "
	local ee = { c=c, nowyear=p.nowyear, region = "century", birthyear = "-201" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "century", birthyear = "-1" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "century", birthyear = "1" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "century", birthyear = "201" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	wkt = wkt .. "\n* '''Siècles ou années ?''' "
	local ee = { c=c, nowyear=p.nowyear, region = "other", event = "x", birthcentury = "début du XVIIème siècle" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	wkt = wkt .. "\n* '''Incertains''' "
	local ee = { c=c, nowyear=p.nowyear, region = "other", event = "x", birthyear = "vers -1357" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", event = "x", birthyear = "vers MCXI" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", event = "x", birthyear = "vers 1357 ou MCCCLIX" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", event = "x", birthyear = "deux dates de naissance" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", event = "x", birthyear = "avant le X siècle" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", event = "x", birthcentury = "avant le X siècle" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", event = "x", deathyear = "avant le X ème siècle" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", event = "x", deathcentury = "avant le X ème siècle" }
	ee = p.century_epoch( ee)
	wkt = wkt .. ee.wkt
	--
	wkt = wkt .. "\n* '''century_epoch''' errors = " .. CA.error_color(errs)
	return wkt
end -- function p.century_epoch_test( tst, args_final)

-- Générer les textes categories et erreurs des annees et siecles.
-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.events_epochs()
function p.events_epochs(args_final, mode, c, verif)
	local err, cat = "", ""
	local wkt = wkt or ""
	local cats = cats or ""
	local tst = tst or ""
	local errs = errs or ""
	if type(args_final) ~= "table" then args_final = CA.args_final end
	--
	local ee_birth = { c = ":", region = args_final.region, birthyear = args_final.birthyear, birthcentury = args_final.birthcentury, argname = "birthyear", event = "birth" }
	local ee_birth = p.century_epoch( ee_birth)
	cats = cats .. ee_birth.cats
	--
	local ee_death = { c = ":", region = args_final.region , deathyear = args_final.deathyear, deathcentury = args_final.deathcentury, argname = "deathyear", event = "death" }
	local ee_death = p.century_epoch( ee_death)
	cats = cats .. ee_death.cats
	-- cat = cat .. ee_birth.cat .. ee_death.cat
	--
	-- Categorize the year of death for 100 years
	-- Clasificar el año que murió hace 100 años
	-- Catégoriser l'année de mort depuis 100 ans
	local year_limit = p.nowyear - p.constantes.categorise_death_for_n_years
	if ee_birth.year and (year_limit  < ee_birth.year) then -- Naissance en ...
		epq = CA.str_vars( "authors_birthyear", ee_birth.year )
		cat = cat .. CA.catGen( epq, c )
	end
	if ee_death.year and (year_limit  < ee_death.year) then -- Mort en ...
		epq = CA.str_vars( "authors_deathyear", ee_death.year )
		cat = cat .. CA.catGen( epq, c )
	end
	-- if event == "death" then event_cat = "authors_deathyear" -- Mort en ...
	--
	-- Années ou siècles incertains
	--[[ voir events_epochs
--	if ee.vague then
--		if ee.year then
--			epq = "err_vague_year"
--		elseif ee.century then
--			epq = "err_vague_epoch"
--		end -- Si l'année est définie
--	end
	--]]
	--
	-- Tous les calculs et catégories liés à la naissance et à la mort combinées
	-- ee.vague = isDef(ee.vague_txt)
	-- ee.vague_roman = isDef(ee.vague_txt)
	-- ee.vague_decim = isDef(ee.vague_txt)
--	if ee_birth.vague or ee_death.vague then -- mort ou naissance incertaine vague/vago/vague
	--	ee.vague_cent = ee.vague_decim or ee.vague_roman
	--	if		ee_birth.vague and ee_birth.year	then	epq = "err_vague_year"
	--	elseif	ee_death.vague and ee_death.year	then	epq = "err_vague_year"
	--	elseif	ee_birth.vague and ee_birth.century	then	epq = "err_vague_epoch"
	--	elseif	ee_death.vague and ee_death.century	then	epq = "err_vague_epoch"
	--	end
	--
	-- Années ou siècles vagues incertains
	local epq = nil
	if		ee_birth.vague_year	or ee_death.vague_year	then epq = "err_vague_year"
	elseif	ee_birth.vague_cent	or ee_death.vague_cent	then epq = "err_vague_epoch"
	end
	if epq then
		epq = CA.str_vars( epq )
		cat = cat .. CA.catGen( epq, c )
	end
--	end
	--
	-- Verify bith < death
	-- Comprobar nacer <muerte
	-- Vérifier naissance < mort
	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
--	birth_yr = birth_yr or birth_ct
--	death_yr = death_yr or death_ct
	--
	local birthdeath = true -- Vérifier naissance < mort
	local lifetime = true -- Durée de vie anormale > 120 ans
	local lifetime_txt = "" -- Durée de vie anormale > 120 ans
	if ee_birth.event_yr and ee_death.event_yr then
		-- annee -> annee
		if ( (ee_birth.event_yr + p.constantes.lifetime_limit) < ee_death.event_yr ) then
			lifetime = false
			lifetime_txt = CA.str_vars("err_life_too_long", ee_birth.event_yr, ee_death.event_yr)
		end
		if ee_birth.event_yr > ee_death.event_yr then birthdeath = false end
	elseif ee_birth.event_ct and ee_death.event_yr then
		-- siecle -> annee
		if (ee_birth.event_ct + p.constantes.lifetime_limit) < ee_death.event_yr then
			lifetime = false
			lifetime_txt = CA.str_vars("err_life_too_long", ee_birth.event_ct, ee_death.event_yr)
		end
		if (ee_birth.event_ct - 100) > ee_death.event_yr then birthdeath = false end
	elseif ee_birth.event_yr and ee_death.event_ct then
		-- annee -> siecle
		if (ee_birth.event_yr + p.constantes.lifetime_limit) < (ee_death.event_ct - 100) then
			lifetime = false
			lifetime_txt = CA.str_vars("err_life_too_long", ee_birth.event_yr, (ee_death.event_ct - 100) )
		end
		if ee_birth.event_yr > (ee_death.event_ct) then birthdeath = false end
	elseif ee_birth.event_ct and ee_death.event_ct then
		-- siecle -> siecle
		if (ee_birth.event_ct + p.constantes.lifetime_limit) < ee_death.event_ct then
			lifetime = false
			lifetime_txt = CA.str_vars("err_life_too_long", ee_birth.event_ct, ee_death.event_ct)
		end
		if ee_birth.event_ct > ee_death.event_ct then birthdeath = false end
	end
	if not lifetime then
		-- err_life_too_long = "Durée de vie trop longue de %1 à %2.",
		err = err .. lifetime_txt -- CA.str_vars("err_life_too_long", ee_birth.year, ee_death.year)
		local err_life_too_long_cat = CA.str_vars("err_life_too_long_cat")
		cat = cat .. CA.catGen(err_life_too_long_cat, err_life_too_long_cat, c)
		error_id = "err-year"..tostring(ee_birth.year)..">"..tostring(ee_death.year)
	end
	if not birthdeath then -- si naissance apres mort pour year ou century
		--	err_death_before_birth	= "Error: death '''%1''' is before birth '''%2'''.",
		--	err_death_before_birth_cat= "Author death is before birth",
		err = err .. CA.str_vars("err_death_before_birth", ee_death.year, ee_birth.year)
		local err_death_before_birth_cat = CA.str_vars("err_death_before_birth_cat")
		cat = cat .. CA.catGen(err_death_before_birth_cat, err_death_before_birth_cat, c)
		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 -- not (ee_birth.event_yr or ee_death.event_yr or birth_ct or death_ct)
		-- ni annees ni siecles
		local err_unknown_epoch_cat = CA.str_vars("err_unknown_epoch_cat")
		cat = cat .. CA.catGen(err_unknown_epoch_cat, c)
	end
	--
-- birthcentury birthuncertain deathyear death deathcentury
-- A faire : Catégorie:Siècle incertain
-- A faire : Catégorie:Epoque inconnue
--	return res, cat, err, t -- p.annees_epoques(args_final, mode, c, verif)
--	res = res .. tostring(t) ; errors = errors .. err
	--
	err = err .. ee_birth.errs .. ee_death.errs
	tst = "\n* events_epochs "
	-- tst = tst .. CA.tam("event", ee_birth.event) .. CA.ta("nbr_in", ee_birth.nbr_in)
	if ee_birth.year then
		tst = tst .. CA.tam("birth.nbr_in", ee_birth.nbr_in)
		tst = tst .. CA.tam("birth.year", ee_birth.year)
		tst = tst .. CA.tam("birth.author", ee_birth.event_author)
	elseif ee_birth.century then
		tst = tst .. CA.tam("birth.nbr_in", ee_birth.nbr_in)
		tst = tst .. CA.tam("birth.century", ee_birth.century)
	end
	-- tst = tst .. "<br/>" .. CA.ta("event", ee_death.event) .. CA.ta("nbr_in", ee_death.nbr_in)
	if ee_death.year then
		tst = tst .. CA.tam("death.nbr_in", ee_death.nbr_in)
		tst = tst .. CA.tam("death.author", ee_death.year_author)
		tst = tst .. CA.tam("death.year", ee_death.year)
	elseif ee_death.century then
		tst = tst .. CA.tam("death.nbr_in", ee_death.nbr_in)
		tst = tst .. CA.tam("death.century", ee_death.century)
	end
	tst = tst .. CA.tam("region", ee_death.region)
	-- tst = tst .. CA.ta("birth_yr", birth_yr) .. CA.ta("death_yr", death_yr)
	-- tst = tst .. wkt
	tst = tst .. CA.tam("err", CA.error_color(err)) -- .. CA.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.century_roman -- p.century_text( ee_birth.century )
		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.century_roman -- p.century_text( ee_death.century )
		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 .. " — " .. ee_death.nbr_in .. ") " .. cat
	local ee = {}
	ee.wkt = wkt
	ee.tst = tst
	ee.errs = err
	ee.cats = cats
	return ee -- wkt, cats, tst, errs, ee
end -- function p.events_epochs(args_final, mode, c, verif)

-- In the chain of calls : p.a_number() p.year_century() p.century_epoch() p.events_epochs()
function p.events_epochs_test( wkt, args_final)
	-- Unitary tests of p.century_epoch
	--
	local args_final = mw.clone(args_final)
	wkt = wkt or ""
	wkt = wkt .. "<br>This list do not displays nil variables."
	wkt = wkt .. "<br>Cette liste n'affiche pas les variables nil."
	--
	wkt = wkt .. "\n* '''Exemples d'époques en Inde''' "
	--
	local c = ":"
	local nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")
	local ee = { c=c, nowyear=p.nowyear, region = "india", birthyear = "-1958", deathyear = "-1834" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "india", birthyear = "1700", deathyear = "1777" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	wkt = wkt .. "\n* '''Durée de vie''' normale "
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "-519", deathyear = "-400" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "-33", deathyear = "33" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "82", deathcentury = "3" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthcentury = "3", deathyear = "419" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "400", deathyear = "519" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	wkt = wkt .. "\n* '''Durée de vie''' > 120 ans de la naissance à la mort"
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "-520", deathyear = "400" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "-20", deathyear = "100" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "400", deathyear = "520" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "400", deathcentury = "7" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthcentury = "4", deathyear = "555" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	wkt = wkt .. "\n* Autres cas : pas d'époque : "
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "après CDLVII", deathyear = "585" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "1907", deathyear = "1985" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	wkt = wkt .. "\n* Autres cas : année en nombre romain : "
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthcentury = "début du XVIIème siècle", deathyear = "avant 1885" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
	local ee = { c=c, nowyear=p.nowyear, region = "other", birthyear = "1768", deathcentury = "fin du XIXème siècle" }
	ee = p.events_epochs(ee, mode, c, verif)
	wkt = wkt .. ee.tst .. ee.wkt
	--
--	wkt = wkt .. "\n* '''events_epochs''' errors = " .. CA.error_color(errs)
	return wkt
end -- function p.events_epochs_test( wkt, argfinal)

--[[
	Générer un nom d'époque à partir d'un numéro de siècle ou d'année, comme "du XVe siècle", ou "de l'Antiquité".
	* Lier ce nom au texte précédent.
	* S'adapter à des valeurs numériques ou non.
	* Un auteur est dit du 20e siècle, de 1901 à 2000, s’il a écrit pendant ce siècle de 20 ans après sa naissance à 5 ans avant son décès.
	* Cette règle automatique peut donc classer un auteur dans deux siècles ou deux époques à la fois.
	* Le Ve siècle av. J.-C. s'étend de -500 à -401. Il n'existe pas d'an 0 ni de siècle 0 dans le calendrier grégorien ni dans le calendrier julien.
	Les époques sont :
	* à partir du siècle 15 (en l'an 1401 et suivants) : "du XVe siècle" et suivants
	* des siècles 6 à 14 inclus (de l'an 501 à l'an 1400 inclus) : "du Moyen Âge"
	* pour le siècle 5 et avant (avant l'an 501) : "de l'Antiquité"
	* pour le siècle -9 et avant (avant l'an -800) : "de l'Antiquité chinoise"
	* pour les années -771 et avant : "de l'Antiquité chinoise
	* On ne catégorise les années de naissances et de morts que dans les 100 dernières années.
--]]

-- Version française, French version, Versión en francés
function p.auteur_box(MArgms, args_final)
    -- Generate the main box, in HTML
--	local title = Args.argv("title") -- or Args.argv("lastname") or Args.argv("sortkey") or Args.argv("givenname")
	local title = tostring(args_final.title) or ""
	local caption = tostring(args_final.caption) or ""
	local image = tostring(args_final.image) or ""
	local initiale = tostring(args_final.initiale) or ""
	local description = tostring(args_final.description) or ""
	local birthyear = tostring(args_final.birthyear) or ""
	local deathyear = tostring(args_final.deathyear) or ""
	local commons = tostring(args_final.commons) or ""
	local wikipedia = tostring(args_final.wikipedia) or ""
	local wikiquote = tostring(args_final.wikiquote) or ""
	local interwikis = {}
	local cat = ""
--	CA.catView = args_final.c
	--
	-- desc = desc .. " ( " .. tostring(birthyear) .. " - " .. tostring(deathyear) .. " )"
	-- desc = desc .. p.description(args_final)
--	local desc, cat, txt, opt = p.description(args_final, c, opt)
	
	local ee = p.events_epochs(args_final, mode, c, verif)
	local desc = ee.wkt
	
	if image ~= "" then
		-- image = "[[File:" .. data["ws-image"] .. "|125px|" .. caption .. "]]"
		image = "[[File:" .. image .. "|frameless|170x170px||class=photo]]"
	else
		image = ""
	end
	-- Generate interwikis links
	--local inilien = CA.translate_msg("authors_initiale")
--	local wt = CA.args_lang["authors_initiale"]
--	inilien = '[[' .. args_final.c .. CA.category_space .. ':' .. wt .. initiale .. '|Auteurs-' .. initiale .. ']]'
	if isDef(initiale) then
		local cat_initiale = CA.str_vars("authors_initiale", initiale)
		cat_initiale = CA.catGen(cat_initiale, cat_initiale, ":")
		cat_initiale = '<br/><span style="color:#aaaa66; line-height:120%; ">◀</span>&nbsp;' .. cat_initiale .. '<br/><br/>'
		table.insert(interwikis, cat_initiale)
	end
	-- Failed to encode the character ◀=(U+25C0) '<<' (U+25C4) at column 73 in line 60
	if isDef(wikipedia) then table.insert(interwikis, '<span style="color:#232388; font-size:140%; line-height:120%; ">⦁&nbsp;&nbsp;</span>[[w:' .. wikipedia .. '|Biographie]]<br/>') end
	if isDef(wikiquote) then table.insert(interwikis, '<span style="color:#232388; font-size:140%; line-height:120%; ">⦁&nbsp;&nbsp;</span>[[wikiquote:' .. wikiquote .. '|Citations]]<br/>') end
	if isDef(commons) then table.insert(interwikis, '<span style="color:#232388; font-size:140%; line-height:120%; ">⦁&nbsp;&nbsp;</span>[[commons:' .. commons .. '|Médias]]<br/>') end
	local links = "<br/>" .. table.concat(interwikis)
	--
	-- FIXME: The styles, column widths, and CSS classes need adjusting.
	-- FIXME: The french display is in HTML direct to better adapt the size and the look to plural environments.
	--
	-- Generate scans to display
	local scans = HTMLscans(args)
	--
	-- Generate wikitext to display
	local wt = '<div id="Author" class="vcard" style="margin-right:5px; box-shadow:0.2em 0.3em 0.2em #B7B7B7; background-color:#F1F1DE; padding:0.3em; width=99.9%; overflow-x:hidden; ">'
	  .. '<table cellspacing="0" cellpadding="0" style="background-color: transparent; border:{{{border|1}}}px solid #CCCCCC; padding:0em;">'
		.. '<tr>'
		  .. '<td valign="middle" rowspan="2" style="padding: 0em 0.6em; background-color: #F1F1DE; text-align:left; font-size:90%; line-height:80%; ">'
			.. '<div style="text-align:left; font-size:120%; padding-top:0.5em; text-indent:1em">'
			  .. links
			.. '</div>'
		  .. '</td>'
		  .. '<td valign="top" align="center" style=" min-width:150px; border-left:{{{border|1}}}px solid #CCCCCC; padding:0.5em; ">'
			.. '<span class="fn" id="AuthorName" style="line-height:90%; font-size:160%; font-weight:bold; padding-top:0.1em; border-bottom: none; ">'
			  .. title
			.. '</span>'
		  .. '</td>'
		  .. '<td valign="middle" align="center" rowspan="2" style=" border-left:{{{border|1}}}px solid #CCCCCC; ">'
			.. '<div id="AuthorImage" style=" padding:4px; ">'
			  .. image
			.. '</div>'
		  .. '</td>'
		.. '</tr>'
		.. '<tr>'
		  .. '<td valign="top" align="center" style="width:100%; border-left:{{{border|1}}}px solid #CCCCCC; padding:1em; ">'
			.. '<span class="label" style=" font-size:110%; line-height:80%; text-align:center; " >'
			  .. desc
			.. '</span>'
		  .. '</td>'
		.. '</tr>'
		.. '<tr>'
		  .. '<td valign="top" align="center" colspan="3" style="width:100%; border-top:{{{border|1}}}px solid #CCCCCC; padding:1em; ">'
			.. '<span class="label" style=" font-size:110%; line-height:80%; text-align:center; " >'
			  .. scans
			.. '</span>'
		  .. '</td>'
		.. '</tr>'
	  .. '</table>'
	.. '</div>'
	return wt
end -- p.auteur_box = function(MArgms, args_final)

------------------------------------------------------------
-- Code récent en debug.
------------------------------------------------------------

-- voir mw.text.trim(s) mw.text.unstrip(s) truncate()
-- split()/gsplit() vers table
-- mw.text.nowiki( s ) ou mw.text.encode( s ) vers Html, mw.text.decode( s ) retour
-- mw.text.listToText( list, separator, conjunction )

function p.first_last_name( firstname, lastname, args_source)
	-- if there is no firstname, try to extract it from lastname
	-- s'il n'y a pas de prénom, essayer de le séparer du nom
	local first, last, initemp = "", "", nil
	local part_found, key_ini = false, 1
	local t = ""
	-- On cherche une particule dans le nom, et une initiale
	if isDef(lastname) then
		tab = mw.text.split(lastname, '%s') -- convertit tout le nom en table de mots
		max = table.maxn( tab )
		t = t .. " maxn=" .. max
	--	if max == 2 then
	--		firstname = tostring(tab[1]) -- .."*"
	--		lastname = tostring(tab[2]) -- "*"..
		if max > 0 then
		--	t = t .. " max > 0 "
			-- S'il n'y a qu'un mot dans le nom, c'est le nom
		--	if max == 1 then part_found = true end
	--		firstname = ""
	--		lastname = val
	--	elseif max > 1 then
	--		t = t .. " max > 1 "
			first = ""
			last = ""
			initemp = nil
			key_ini = 1
			for key, val in pairs(tab) do -- Pour tous les mots du nom
			--	if part_found then ini = ini or val end
				t = t .. " key=" .. key
				-- S'il y a une particule, on le note
				if val == "de" and not part_found then
					part_found = true
					if key_ini == 1 then key_ini = key end -- on note la position de la particule
				end
				if key == key_ini + 1 then
					initemp = val -- le premier mot après la particule donnera l'initiale
				end
				-- On cumule les mots dans le prénom, puis dans le nom, à partir de la particule
				if part_found then
					t = t .. CA.ta("part_found", val)
					last = last .. " " .. val
				else
					-- Avant la particule ou le dernier mot on cumule les prénoms
					first = first .. " " .. val
					t = t .. CA.ta("first", val)
				end
				-- Si on a pas de particule quand on arrive au dernier mot
				if key == max then
			--		first = first -- Les mots qu'on a déja sont les prénoms,
			--		last = val -- et le mot actuel est le nom
			--		t = t .. CA.ta("key == max last", last)
					firstname = firstname .. " " .. first
					lastname = last
				end
			end
--[[		--	initiale = initiale or ini
			if part_found then
				firstname = first -- .."e"..tostring(max)
				lastname = last -- .."d"..tostring(max)
			else
				if key == max then
					firstname = first
				end
			end
			firstname = firstname -- .. "-F-"..tostring(max)
			lastname = lastname -- .. "-L-"..tostring(max)
--]]
		end
	end
	return firstname, lastname, initemp
end -- function p.first_last_name( firstname, lastname, args_source)

-- Interact parameters in args_final international
function p.interact_args_final(args_import, wd, label)
	if type(args_import) ~= "table" then args_import = CA.args_import end -- arguments, new or known
	if type(args_import) ~= "table" then return nil end -- arguments, new or known
	if type(wd) ~= "table" then wd = CA.wd end -- wikidata, new or known
	--
	local args_final = mw.clone(args_import)
	--[[ normalize args
	local lastname = tostring(args_final.lastname)
	local firstname = tostring(args_final.firstname)
	local galliname = tostring(args_final.galliname)
	local pseudonym = tostring(args_final.pseudonym)
	local sortkey = tostring(args_final.sortkey)
	local familyname = tostring(args_final.familyname)
	local title = tostring(args_final.title)
	local image = tostring(args_final.image)
	local initemp = lastname -- pour calcul de initiale
	local initiale = tostring(args_final.initiale)
	local birthyear = tostring(args_final.birthyear)
	local deathyear = tostring(args_final.deathyear)
	local region = tostring(args_final.region)
	local wikipedia = tostring(args_final.wikipedia)
	local wikiquote = tostring(args_final.wikiquote)
	local commons = tostring(args_final.commons)
	local BNF = tostring(args_final.BNF)
	local GND = tostring(args_final.GND)
	local ISNI = tostring(args_final.ISNI)
	local LCCN = tostring(args_final.LCCN)
	local VIAF = tostring(args_final.VIAF)
	--]]
	-- normalize args
	local lastname = (args_final.lastname)
	local firstname = (args_final.firstname)
	local galliname = (args_final.galliname)
	local pseudonym = (args_final.pseudonym)
	local sortkey = (args_final.sortkey)
	local familyname = (args_final.familyname)
	local title = (args_final.title)
	local image = (args_final.image)
	local initemp = lastname -- pour calcul de initiale
	local initiale = (args_final.initiale)
	local birthyear = (args_final.birthyear)
	local deathyear = (args_final.deathyear)
	local region = (args_final.region)
	local wikipedia = (args_final.wikipedia)
	local wikiquote = (args_final.wikiquote)
	local commons = (args_final.commons)
	local BNF = (args_final.BNF)
	local GND = (args_final.GND)
	local ISNI = (args_final.ISNI)
	local LCCN = (args_final.LCCN)
	local VIAF = (args_final.VIAF)
	--]]
	local c = (args_final.c)
	local options = (args_final.options)
	CA.catView = args_final.c
	local t = ""
	t = t .. "\n* '''interact_args_final''' i='''" .. (initiale or "") .. " - " .. (firstname or "")
	t = t .. " + " .. (lastname or "") .. "'''=" .. (title or "") .. " "
--	t = t .. " wp=" .. wikipedia .. " wq=" .. wikiquote .. " cms=" .. commons
	--
	-- template values can replace wikidata values
--[[
	if not isDef(title) then title = wd.sitelink end -- sitelink ? label ?
	if not isDef(image) then image = wd.image end -- p18
	if not isDef(placeofbirth) then placeofbirth = wd.placeofbirth end -- p19
	if not isDef(sex) then sex = wd.sex end -- p21
	if not isDef(country) then country = wd.country end -- p27
	if not isDef(signature) then signature = wd.signature end -- p109
	if not isDef(BNF) then BNF = wd.BNF end -- p268
	if not isDef(GND) then GND = wd.GND end -- p227
	if not isDef(ISNI) then ISNI = wd.ISNI end -- p213
	if not isDef(LCCN) then LCCN = wd.LCCN end -- p244
	if not isDef(VIAF) then VIAF = wd.VIAF end -- p214
	if not isDef(birthyear) then birthyear = wd.birthyear end -- p569
	if not isDef(deathyear) then deathyear = wd.deathyear end -- p570
--]]
	--
	-- interact Names and initiale
	label = tostring(label)
	if not isDef(lastname) then lastname = "" end
	if not isDef(firstname) then firstname = "" end
	if not isDef(title) then title = "" end
	local tab = {}
	local max = 0
	-- S'il n'y a pas de prenom on le cherche dans le nom
	if isDef(lastname) and not isDef(firstname) then
		firstname, lastname, initemp = p.first_last_name( firstname, lastname)
	end
	--
	-- interact Names and title
	lastname = lastname or pseudonym or sortkey or familyname or initiale -- unused if normalize to string
	-- S'il n'y a pas de nom on le remplace par le prénom
	if isDef(firstname) and not isDef(lastname) then
		lastname = firstname
		firstname = nil
	end
--	if isDef(firstname) then
		-- S'il y a un prénom, on y ajoute les prénoms extraits du nom
--		firstname = firstname .. " " .. first
--	end
	-- 
	-- normalize initiale from interact Names and title
	if not isDef(initemp) then initemp = lastname end
	if isDef(initemp) then
		initemp = string.byte( initemp, 1, 1 )
		initemp = string.char( initemp )
		initiale = string.upper( initemp )
	else
		initiale = ""
	end
--	title = firstname .. " " .. lastname
	if not isDef(title) then
		if isDef(lastname) then
			if isDef(firstname) then
				title = firstname .. " " .. lastname
			else
				title = lastname
			end
	--		elseif galliname ~= "" then
	--			title = galliname .. " " .. lastname
		end
	end
--	CA.trck("\n* interact_args_final "..tostring(label)..", title="..title..", ")
--	t = t .. "\n* interact_args_final "..tostring(label).." * title="..title..", "
--	local cats = string.gsub(groupList, "[^/]+", "[[" .. catView .. catspace .. ":" .. groupCat .. "]] ")
--	cats = string.gsub(cats, "/", "")
	-- ...
	-- interact link to other wikis
	if not isDef(wikipedia) then wikipedia = title end
	if not isDef(wikiquote) then wikiquote = title end
	if not isDef(commons) then commons = title end
	--
	-- values to display
	--[[
	if not isDef(lastname) then lastname = "" end
	if not isDef(firstname) then firstname = "" end
	if not isDef(galliname) then galliname = "" end
	if not isDef(pseudonym) then pseudonym = "" end
	if not isDef(sortkey) then sortkey = "" end
	if not isDef(familyname) then familyname = "" end
	if not isDef(title) then title = "" end
	if not isDef(initiale) then initiale = "" end
	if not isDef(birthyear) then birthyear = "" end
	if not isDef(deathyear) then deathyear = "" end
	if not isDef(region) then region = "" end
	if not isDef(wikipedia) then wikipedia = "" end
	if not isDef(wikiquote) then wikiquote = "" end
	if not isDef(commons) then commons = "" end
	if not isDef(BNF) then BNF = "" end
	if not isDef(GND) then GND = "" end
	if not isDef(ISNI) then ISNI = "" end
	if not isDef(LCCN) then LCCN = "" end
	if not isDef(VIAF) then VIAF = "" end
	--]]
	local BNF = tostring(args_final.BNF)
	local GND = tostring(args_final.GND)
	local ISNI = tostring(args_final.ISNI)
	local LCCN = tostring(args_final.LCCN)
	local VIAF = tostring(args_final.VIAF)
	--
	-- to return and memorize in CA.args_final
	args_final.lastname = lastname
	args_final.firstname = firstname
	args_final.galliname = galliname
	args_final.pseudonym = pseudonym
	args_final.sortkey = sortkey
	args_final.familyname = familyname
	args_final.title = title
	args_final.initiale = initiale
	args_final.birthyear = birthyear
	args_final.deathyear = deathyear
	args_final.region = region
	args_final.wikipedia = wikipedia
	args_final.wikiquote = wikiquote
	args_final.commons = commons
	args_final.BNF = BNF
	args_final.GND = GND
	args_final.ISNI = ISNI
	args_final.LCCN = LCCN
	args_final.VIAF = VIAF
	args_final.c = c
	args_final.options = options
	--[[
	CA.arg_memorize("LCCN", LCCN)
	CA.arg_memorize("VIAF", VIAF)
	--
	-- Memorize in known arguments
	CA.arg_memorize("lastname", lastname)
	CA.arg_memorize("firstname", firstname)
	CA.arg_memorize("galliname", galliname)
	CA.arg_memorize("pseudonym", pseudonym)
	CA.arg_memorize("sortkey", sortkey)
	CA.arg_memorize("familyname", familyname)
	CA.arg_memorize("title", title)
	CA.arg_memorize("initiale", initiale)
	CA.arg_memorize("birthyear", birthyear)
	CA.arg_memorize("deathyear", deathyear)
	CA.arg_memorize("region", region)
	CA.arg_memorize("wikipedia", wikipedia)
	CA.arg_memorize("wikiquote", wikiquote)
	CA.arg_memorize("commons", commons)
	CA.arg_memorize("BNF", BNF)
	CA.arg_memorize("GND", GND)
	CA.arg_memorize("ISNI", ISNI)
	CA.arg_memorize("c", c)
	CA.arg_memorize("options", options)
	--]]
	local ok = "" -- tostring(isDef(firstname) )
	t = t .. "<br/>final : i - p + n = '''" .. (initiale or "") .. " - " .. (firstname or "")
	t = t .. " + " .. (lastname or "") .. "'''=" .. (title or "") .. " "
	--
	CA.args_final = args_final
	p.args_final = args_final
	return args_final, t
end -- function p.interact_args_final(args_import, wd, label)

function p.init_lang(_lang, lang_table)
	-- if p.init_lang(_lang) == _lang then OK
	-- en : init or change the language and its table
	-- es : inicializar o cambiar el idioma y su mesa
	-- fr : initialiser ou modifier la langue et sa table
	local args_table = nil
	-- Verify _lang, else use CONTENTLANG
	if (type(_lang) ~= "string") or (_lang == "") then
		_lang = mw.language.getContentLanguage().code -- {{CONTENTLANG}}
	end
	-- Verify the installation of the addition
	args_table = CA.i18n[_lang]
	if type(lang_table) == "table" then
		if (type(_lang) == "string") and (_lang ~= "") then
			args_table = lang_table
		end -- args_table = p.i18n[_lang]
	end
--	if _lang == "en" then args_table = p.i18n.en end
--	if _lang == "es" then args_table = p.i18n.es end
--	if _lang == "fr" then args_table = p.i18n.fr end
	local t = '<br/>init_lang '
	if type(args_table) == "table" then
		-- Change language only if coherent with a table
		CA.arg_lang = _lang
		CA.i18n[_lang] = args_table
		CA.args_lang = args_table
		t = t .. ', _lang='..tostring(_lang)..', p.args_lang.options='..tostring(CA.args_lang.options)
		t = t .. ', p.args_lang='..tostring(CA.args_lang)..', p.i18n[_lang]='..tostring(CA.i18n[_lang])
		CA.trck('\n* ' .. t .. ', OK.<br/>' )
		return CA.arg_lang
	else
		CA.trck('\n* ' .. t .. ', ERREUR de table.' .. '<br/>' )
		return nil
	end
end -- function p.init_lang(_lang, lang_table)

function p.control_arguments(args_known, lang, lang_i18n, args_src, args_wikidata)
-- args_final = p.control_arguments(args_known_auteur, "fr", lang_i18n, frame.args)
-- Connecte les tables des arguments connus et des arguments sources.
-- Connecte une table de traduction et initialise une langue.
-- Importe les arguments du modèle et les fusionne à ceux de wikidata
-- Fournit les arguments finals, s'ils n'ont pas besoin d'interactions entre eux.
	--
	local err = nil
	local res = ""
	--
	-- Initialise une trace éventuelle d'importation
	CA.trck("\n* control_arguments ")
	res = res .. "\n* '''control_arguments''' :<br/>"
	--
	-- Entrées alternatives et erreurs
	--[[
	-- S'il faut, essayer une table d'arguments connus définie avant l'appel à control_arguments()
	if type(args_known) ~= "table" then args_known = CA.args_known end
	-- La langue est par défaut celle de la page courante
	if type(lang) ~= "string" then lang = mw.language.getContentLanguage().code end
	-- S'il faut, essayer une table de langue définie avant l'appel à control_arguments()
	if type(lang_i18n) ~= "table" then lang_i18n = CA.lang_i18n end
	--
	-- Arguments sources, utiliser : une table déjà définie, normalement frame.args, sinon une table de test.
	if type(args_src) == "table" then CA.args_src = args_src end
	if not CA.args_src then
		local frame = mw.getCurrentFrame()
		CA.args_src = frame.args
	end
	--]]
	--[[
	-- S'il faut, essayer une table d'arguments de wikidata avant l'appel à control_arguments()
	if type(args_wikidata) ~= "table" then args_wikidata = CA.args_wikidata end
	res = res .. CA.ta("auteur.args_wikidata.sitelink", args_wikidata.sitelink)
	res = res .. CA.ta("auteur.CA.args_wikidata.sitelink", CA.args_wikidata.sitelink)
	res = res .. CA.ta("auteur.args_wikidata.birthyear", args_wikidata.birthyear)
	res = res .. CA.ta("auteur.CA.args_wikidata.birthyear", CA.args_wikidata.birthyear)
	--
	-- Connecte une table de traduction et initialise la langue initiale choisie
	CA.init_lang(lang, lang_i18n)
	local _known, _source, _lang, _langs, Argts_langs = CA.init_args(args_known_auteur, args_src, lang) --, i18n.fr)
	--]]
	-- S'il faut, Utiliser les tables prédéfinies
	if type(args_known) == "table" then
		CA.args_known = args_known
	else
		args_known = CA.args_known
	end
	if type(args_src) ~= "table" then args_src = CA.args_src end
	if type(lang_i18n) ~= "table" then lang_i18n = CA.lang_i18n end
	-- S'il manque une des 3 tables de base : messages d'erreurs
	if type(args_known) ~= "table" then return nil, "The table '''args_known''' is not defined." end
	if type(args_src) ~= "table" then return nil, "The table '''args_src''' is not defined." end
	if type(lang_i18n) ~= "table" then return nil, "The table '''lang_i18n''' is not defined." end
	res = res .. p.verif_tables("control_arguments après arguments alternatifs")
	--
	-- Connecte une table de traduction et initialise la langue initiale choisie
	p.init_lang(lang, lang_i18n) -- "fr" ou autres
--	res = res .. "\n\n* '''ControlArgs : fin''' :<br/>"
	CA.trck("\n* CA.init_args ")
	local _known, _source, _lang, _langs, Argts_langs = CA.init_args(args_known, args_src, lang) --, i18n.fr)
	-- Importe et fusionne les arguments du modèle et ceux de wikidata
	local args_import = CA.import_arguments(args_known, args_src, lang_i18n, args_wikidata)
	args_import.nowyear = nowyear
	CA.args_import = args_import
	--
--	local args_final = mw.clone(args_import)
	-- Fournit les arguments finals, s'ils n'ont pas besoin d'interactions entre eux.
--	CA.args_final = args_final -- mw.clone(CA.args_import)
	res = res .. p.verif_tables("control_arguments après import_arguments")
	--
	res = res .. CA.ta("auteur.args_import.sitelink", args_import.sitelink)
	res = res .. CA.ta("auteur.CA.args_import.sitelink", CA.args_import.sitelink)
	res = res .. CA.ta("auteur.args_import.birthyear", args_import.birthyear)
	res = res .. CA.ta("auteur.CA.args_import.birthyear", CA.args_import.birthyear)
	return args_import, " --control_arguments-res-- "
end -- function p.control_arguments(args_known, lang, lang_i18n, args_src)

------------------------------------------------------------
-- Tests internes. Internal tests.
------------------------------------------------------------

function p.minitest_args( res, args_source)
	if type(args_source) ~= "table" then args_source = CA.args_source end -- optional arguments
	-- res = res .. CA.minitest_args(args, " args verify ")
--	local res = "" -- CA.minitest_args(args, label)
	res = res .. "\n* "
	res = res .. CA.ta("args[prénom]", args_source["prénom"])
	res = res .. CA.ta("args.nom", args_source["nom"])
	res = res .. CA.ta("args.titre", args_source["titre"])
	return res
end -- function p.minitest_args( res, args_source)

function p.minitest_argfinal( res, args_final)
	if type(args_final) ~= "table" then args_final = CA.args_final end -- optional arguments
	-- res = res .. CA.minitest_args(args, " args verify ")
--	local res = "" -- CA.minitest_argfinal(args_final, label)
	res = res .. "\n* "
	res = res .. CA.ta("args_final.firstname", args_final.firstname)
	res = res .. CA.ta("args_final.lastname", args_final.lastname)
	res = res .. CA.ta("args_final.title", args_final.title)
	return res
end -- function p.minitest_argfinal( res, args_final)

function p.interact_test( res, args_final)
--	res = res .. "\n\n\n* Test de '''interact_args_final''' : "
	local wd = {}
	local argi, t = nil, ""
	argi, t = p.interact_args_final({firstname="Paul", lastname="", initiale=""}, wd, label)
	res = res .. t
	argi, t = p.interact_args_final({firstname="Noël-Gérard", lastname="de La Fontaine de Beauprés", initiale=""}, wd, label)
	res = res .. t
	argi, t = p.interact_args_final({lastname="Noël-Gérard Phương-Thắn de Gomez dos Santos", initiale=""}, wd, label)
	res = res .. t
	argi, t = p.interact_args_final({firstname="", lastname="La Fontaine", initiale="f", wikipedia="La Fontaine"}, wd, label)
	res = res .. t
	argi, t = p.interact_args_final({firstname="", lastname="Arthur Rimbaud", initiale=""}, wd, label)
	res = res .. t
	return res
end

--[[
function p.tables_tests(res, frame)
	local res = "<br/><br/>\n* '''Module:Auteur tables_tests''' "
--	if CA.option("i18non")	then 
	res = res .. "<br/>Arguments recus par le modèle appelant : "
	res = res .. CA.doctable_args(frame:getParent().args, "Modèle", { levelmaxi = 9 } )
	res = res .. "<br/>frame recue par le module : "
	res = res .. CA.doctable_args(frame, "frame", { levelmaxi = 9 } )
	res = res .. "<br/>Arguments recus par ce module : "
	res = res .. CA.doctable_args(frame.args, "frame.args", { levelmaxi = 9 } )
	res = res .. "<br/>Arguments recus de wikidata : "
	res = res .. CA.doctable_args(CA.args_wikidata, "args_wikidata", { levelmaxi = 9 } )
	res = res .. "<br/>Arguments recus par ce module : "
	res = res .. CA.doctable_args(CA.args_source, "args_source", { levelmaxi = 9 } )
	res = res .. "<br/>Arguments importés de wikidata et du module : "
	res = res .. CA.doctable_args(CA.args_import, "args_import", { levelmaxi = 9 } )
	res = res .. "<br/>Arguments après interactions entre eux : "
	res = res .. CA.doctable_args(CA.args_final, "args_final", { levelmaxi = 9 } )
	res = res .. "<br/>Langue actuelle : " .. CA.arg_lang
	res = res .. CA.doctable_args(CA.args_lang, "args_lang", { levelmaxi = 9 } )
	--
	res = res .. "<br/>Arguments (et notices) connus"
	res = res .. CA.doctable_args(CA.args_known, "args_known", { levelmaxi = 9 } )
	res = res .. "<br/>Propriétés des notices : "
	res = res .. CA.doctable_args(notices_properties, "notices_properties", { levelmaxi = 9 } )
	res = res .. "<br/>Arguments, messages et erreurs traduits en langue actuelle : " .. CA.arg_lang
	res = res .. CA.doctable_args(CA.args_val, "args_val", { levelmaxi = 9 } )
	res = res .. "<br/>Traductions, en langues connues, des messages et erreurs : ( langue courante :" .. CA.arg_lang .. ")"
--	res = res .. CA.doctable_args(CA.i18n, "i18n", { levelmaxi = 9 } )
--	res = res .. CA.doctable_args(CA.i18n, "i18n", { levelmaxi = 9 } )
	return res
end -- function p.tables_tests(frame)
--]]

function p.tests_unitaires( res, args_final)
	local res = "<br/><br/>\n* '''Module:Auteur tests_unitaires''' "
	local nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")
	p.nowyear = nowyear
	--
	res = res .. CA.levenshtein_test( "<br/><br/>\n* CA. Test du calcul des mots proches '''levenshtein''' : ", c)
	res = res .. p.wikidata_test("<br/><br/>\n* Test de '''wikidata''', données centralisées des wikipedia : ")
	res = res .. p.minitest_argfinal("<br/><br/>\n* Test de '''minitest_argfinal''' : ", args_final)
	res = res .. p.interact_test( "<br/><br/>\n* Test de '''interact_args_final''' : ", args_final)
	res = res .. p.a_number_test( "<br/><br/>\n* Test de '''a_number''' : ", args_final)
	res = res .. p.year_century_test( "<br/><br/>\n* Test de '''year_century''' : ", args_final)
	res = res .. p.century_epoch_test( "<br/><br/>\n* Test de '''century_epoch''' : ", args_final)
	res = res .. p.events_epochs_test( "<br/><br/>\n* Test de '''events_epochs''' : ", args_final)
	res = res .. p.droits_auteur_test( "<br/><br/>\n* Test de '''droits_auteur''' : ", args_final)
--	res = res .. p.description_test( "<br/><br/>\n* Test de '''description''' : ", args_final)
	return res
end

function p.tests_time( if_view, res, time1, time2, time3, time4)
	if not if_view then return "" end
	local nowyear = os.date("%Y-%m-%d %H:%M:%S")
	local mwtitle = mw.title.getCurrentTitle()
--	res = res .. CA.doctable_args( mwtitle, "mwtitle") -- Script Error : bug not enouth memory
--	local localUrl = tostring(mwtitle:localUrl( ))
	local url = tostring(mwtitle:canonicalUrl( ))
--	local fullUrl = mw.uri.fullUrl( canonicalUrl, "http" ) -- tostring(mwtitle:canonicalUrl( ))
--	local fullUrl_relat = fullUrl.relativePath -- relative mais pas edit
	time1 = tonumber(time1) or 0
	time2 = tonumber(time2) or 0
	time3 = tonumber(time3) or 0
	time4 = tonumber(time4) or 0
	time4 = time4 - time3
	time3 = time3 - time2
	time2 = time2 - time1
	res = res or ""
	res = res .."<br/>\n* Execution and test time : " .. nowyear .. " UTC"
	res = res .. CA.ta("url", url)
	res = res .. CA.ta("<br/>start", time1) .. CA.ta("import +", time2)
	res = res .. CA.ta("générer page +", time3) .. CA.ta("tests +", time4)
	return res
end -- function p.tests_time( if_view, res, time1, time2, time3, time4)

-- Execution and test time : 2013-06-25 13:11:39, url=http://test2.wikipedia.org/wiki/Victor_Hugo
-- , start = 0.015929905 , import = 0.182058582 , générer page = 0.187372364 , tests = 0.29485522
-- Execution and test time : 2013-07-07 21:09:56 UTC, url=http://test2.wikipedia.org/wiki/Victor_Hugo
-- , start = 0.321415473 , import + = 0.131845213 , générer page + = 0.004046632 , tests + = 0.054075742
-- Execution and test time : 2013-07-08 00:44:50 UTC, url=http://test2.wikipedia.org/wiki/Victor_Hugo
-- , start = 0.608310706 , import + = 0.138837626 , générer page + = 0.004156741 , tests + = 0.056325155
-- Execution and test time : 2013-07-15 18:01:21 UTC, url=http://test2.wikipedia.org/wiki/Victor_Hugo
-- , start = 0.567618459 , import + = 0.086441609 , générer page + = 0.00272198 , tests + = 0.085100533

function p.Boite_Deroulante(if_view, titre, contenu, alignT)
	if if_view ~= 0 then return end -- CA.ta("if_view", if_view) end
	if not contenu then return end -- CA.ta("contenu", contenu) end
	if not titre then titre = " Boîte déroulante " end
	if not alignT then alignT = "left" end
-- boîte déroulante pour module interactif ?
-- <a id="NavToggle3" class="NavToggle" href="javascript:toggleNavigationBar(3);">[Dérouler]</a>
	local txt = "{{Boîte déroulante/début|titre=" .. titre .. "|alignT=" .. alignT .. "}}" .. contenu .. "{{Boîte déroulante/fin}}"
	local frame = mw.getCurrentFrame()
	local res = frame:preprocess( txt )
--	frame:preprocess( string ) -- If you are expanding any text
--	frame:expandTemplate{ title = title, args = table } -- If you are expanding a single template
	return res
end -- function Argts.Boite_Deroulante(titre, contenu, alignT)

function p.detailed_doc(res)
	if type(res) ~= "string" then res = "" end
	res = res .. p.Boite_Deroulante( CA.option("testson"), "Détails des tests unitaires pour éviter les régressions : ",
		p.tests_unitaires( " ", CA.args_final) )
	res = res .. p.Boite_Deroulante( CA.option("testson"), "Détails de toute la table reçue par le module : frame ",
		CA.doctable_args(CA.frame, "frame") )
	res = res .. p.Boite_Deroulante( CA.option("testson"), "Détails de la table des arguments reçus : ",
		CA.doctable_args(CA.args_source, "CA.args_source") )
	res = res .. p.Boite_Deroulante( CA.option("testson"), "Détails des arguments connus : args_known ",
		CA.doctable_args(CA.args_known, "CA.args_known") )
	res = res .. p.Boite_Deroulante( CA.option("testson"), "Détails des tables de traductions : i18n ",
		CA.doctable_args(CA.i18n, "CA.i18n") )
	res = res .. p.Boite_Deroulante( CA.trackon, "Traces de l'importation des arguments reçus. ",
		CA.doctable_args(CA.trck_read(), "CA.trck_read()") )
	return res
end -- function p.detailed_doc()

-- Verifier la cohérence des tables de traductions
function p.autotest_trans(args_known, args_lang, i18n)
-- function p.autotest_trans(p.i18n, args_known, args_lang, args_source, lang, options, title)
--		CA.autotest_trans(CA.i18n, CA.args_known) ) --, CA.args_lang, CA.args_src, CA.arg_lang) )
	if type(args_known) ~= "table" then args_known = CA.args_known end
	if type(args_lang) ~= "table" then args_lang = CA.args_lang end
	if type(i18n) ~= "table" then i18n = CA.i18n end
	local trad = ""
	local n = 0
--	local t = "\n* " .. title
	local t = "\n* Verifier que tous les arguments connus ont une traduction"
	for key, parm in pairs(args_known) do -- Pour tous les parametres connus
		trad = args_lang[key]
		if trad == nil and tonumber(key) == nil then -- args en ordre numerique et renvoi vers un argument nommé
		--	t = t .. CA.error_color("<br/>Argument connu, mais non traduit : " .. tostring(key) )
			t = t .. CA.error_color(p.erreur_add("err_without_translation", key) )
		--	err_without_translation = "<br/>Argument connu, mais non traduit : %1"
			n = n + 1
		end
	end
	t = t .. CA.erreur_add("err_without_translation_N", n) -- "Il y a 2 arguments non traduits."
	t = t .. "\n* Lister toutes les différences des tables de traductions."
	local prec, suiv = nil, nil
	for key, parm in pairs(i18n) do -- Pour tous les parametres connus, de toutes les langues
		suiv = key -- table suivante de traduction d'une langue
		if prec ~= nil and suiv ~= nil then -- args en ordre numerique et renvoi vers un argument nommé
		--	t = t .. "<br/>Argument connu, mais non traduit : " .. tostring(key) err_without_translation
			n = n + 1
			prec_trad = i18n[prec]
			suiv_trad = i18n[suiv]
			for k, v in pairs(p.i18n[suiv]) do -- Pour tous les parametres connus
				trad = i18n[prec][k]
				if trad == nil and k ~= nil then -- args vers un argument nommé
					t = t .. CA.erreur_add("err_is_defined", suiv, k)
					t = t .. CA.error_color(p.erreur_add("err_is_undefined", prec, k) )
					n = n + 1
				end
			end
		end
		prec = suiv
	end
	t = t .. "<br/>Il y a " .. n .. " différences entre les tables de traductions."
	return t
end -- function p.autotest_trans(args_known, args_lang, i18n)

function p.verif_tables(txt)
	if not txt then return "" end
	local res = "\n* verif_tables : " .. txt .. " : "
	res = res .. CA.ta("CA.args_src", CA.args_src)
	res = res .. CA.ta("CA.args_lang", CA.args_lang)
	res = res .. CA.ta("CA.i18n", CA.i18n)
	res = res .. CA.ta("CA.args_wikidata", CA.args_wikidata)
	res = res .. CA.ta("CA.args_known", CA.args_known)
	res = res .. CA.ta("CA.args_import", CA.args_import)
	res = res .. CA.ta("CA.args_final", CA.args_final)
	return res
end -- function p.verif_tables()

-- Basic result for arguments only
	-- normal = " "
	-- doc = " docavant docligne docat "
	-- tests = " unitests tables tracks trackon docavant docligne docat "
function p.gener_result(args_final, options)
	local res = ""
	res = res .. p.verif_tables("gener_result avant optional arguments")
	-- optional arguments
	if type(args_final) ~= "table" then args_final = CA.args_final end
	if type(args_final) ~= "table" then return "Erreur : args_final " end
	--
	local res = res .. "<br/>gener_result " .. CA.ta("options", options)
	if type(options) ~= "string" then options = args_final.options end
	if type(options) ~= "string" then options = CA.invoke_options end
	if type(options) ~= "string" then options = " " end
	res = res .. CA.ta(", options altern", options)
	res = res .. p.verif_tables("gener_result après optional arguments")
	--
	p.time2 = os.clock()
	-- <br/>Assistance à l'utilisateur venant de la vérification des paramètres :
	--	if CA.option("wikidata")	then
	if CA.option("docavant")	then res = res .. CA.generDoc("", args_final) end
	if not CA.option("noerr")	then res = res .. CA.erreur_lister("err_assist_user_param") end
	if p.erron then
		res = res .. "\n" .. p.erreur_lister()
	end
	-- Générer normalement le wikitext, les catégories et autres
	if not CA.option("nobox")	then res = res .. p.auteur_box(Cargs, args_final) end
	if not CA.option("nobox")	then res = res .. microformat(args_src, args_final) end
	if not CA.option("nobox")	then res = res .. p.droits_auteur(args_src, args_final) end
	if not CA.option("nobox")	then res = res .. defaultsort(args_src, args_final) end
--	if not CA.option("nocat")	then res = res .. categories(args, args_final) end
	if not CA.option("nocat")	then res = res .. CA.categ_lister() end
	if CA.option("docapres")	then res = res .. "<br/>" .. CA.generDoc("", args_final) end
	p.time3 = os.clock()
	res = res .. p.verif_tables("gener_result après box et avant tests")
	--
	-- Documentations et tests détaillés supplémentaires
--	res = res .. p.Boite_Deroulante( CA.option("trackon") or 0, "Vérifier la présence de toutes les traductions : ",
--		p.autotest_trans(CA.args_known, CA.args_lang, CA.i18n) )
	res = res .. p.Boite_Deroulante( CA.option("unitests") or 0, "Détails des tests unitaires pour éviter les régressions : ",
		p.tests_unitaires( " ", CA.args_final) )
	res = res .. p.Boite_Deroulante( CA.option("tables") or 0, "Détails de toute la table reçue par le module : frame ",
		CA.doctable_args(CA.frame, "frame") )
	res = res .. p.Boite_Deroulante( CA.option("tables") or 0, "Détails de la table des arguments reçus : ", CA.doctable_args(CA.args_source, "CA.args_source") )
	res = res .. p.Boite_Deroulante( CA.option("tables") or 0, "Détails des arguments connus : args_known : ",
		CA.doctable_args(CA.args_known, "CA.args_known") )
	res = res .. p.Boite_Deroulante( CA.option("tables") or 0, "Détails des tables de traductions : i18n ",
		CA.doctable_args(CA.i18n, "CA.i18n") )
	res = res .. p.Boite_Deroulante( CA.option("trackon") or 0, "Traces de l'importation des arguments reçus : ",
		CA.trck_read() )
	--
	if CA.trackon then res = res .. "\n* Trace détaillée. Detailed track. " .. CA.trc end
	--
	res = res .. p.verif_tables("gener_result fin")
--	if true or CA.option("testson")	then res = res .. p.tables_tests("tableson", frame) end
	p.time4 = os.clock()
	res = res .. p.tests_time( true or CA.option("doctable"), "<br/>", p.time1, p.time2, p.time3, p.time4)
	-- Execution and test time : 2013-06-23 11:29:35, Module:Auteur/Documentation, , start = 0.013976359 , import = 0.105866377 , générer page = 0.112570652 , tests = 0.239319278
	return res
end -- function p.gener_result(args_final)

------------------------------------------------------------
-- Arguments sources exemples
------------------------------------------------------------

local args_source_example = { categoryEN = "cat author", imageEN = "Smith.jpg", prize = "Nobel", categorie = "catAuteur", image = "Franc.jpg", prix = "NobelFr", categoria = "catAuteur", imagen = "Espangnol.jpg", premio = "NobelES", }

local Argtest11 = { "Rimbaud", "Arthur", options = " debug docavant ", 1234, droits = "70", droits = "non", gauche = "ggcchh", deces = "1357", anneeDeces = "1955",  image = "Carjat Arthur Rimbaud 1872 n2.jpg", description = "Poète français.", title = "Titre de test Argtest" }

local ArgXXXtest = { c=":", options = " debug docavant docdef docligne erron trackon ", nom = "Rimbaud", ["prénom"] = "Arthur", droits = "70", anneeNaissance = "1842", anneeDeces = "1875", image = "Carjat Arthur Rimbaud 1872 n2.jpg", description = "Poète français.", paXXXys = "France", BNF = "cb11888266r", NLA = "35096649", VIAF = "7396281" }

local ArgtestEN = { c=":", options = " debug wikidata docavant docdef docligne docapres erron interon data-on test-on i18non ", 
	lastname = "Pierre Yves-André de La Fontaine", rights = "non", image = "Carjat Arthur Rimbaud 1872 n2.jpg", 
	birthyear = "before 1793", deathyear = "1950", region = "chine",
	description = "French poet.", genre = "Poètes‎", Prize = "Goncourt", prizze = "Lauréats du Prix Goncourt",
	occupation = "Idéologues/Personnalités politiques", language = "Littérature bretonne",
	BNF = "cb11888266r" }

local ArgtestES = { c=":", options = " debug wikidata docavant docdef docligne docapres erron interon data-on test-on i18non ", 
	nom = "Pierre Yves-André de La Fontaine", droits = "non", image = "Carjat Arthur Rimbaud 1872 n2.jpg", 
	anneeNaissance = "antes 1793", anneeDeces = "1950", ["región"] = "chine",
	description = "Poeta francés", Pris = "Goncourt", genre = "Poètes‎", 
	metier = "Idéologues/Personnalités politiques", prix = "Lauréats du Prix Goncourt", langue = "Littérature bretonne",
	BNF = "cb11888266r" }

local ArgtestFR = { c=":", options = " debug wikidata docavant docdef docligne docapres erron interon data-on test-on i18non ", 
	nom = "Pierre Yves-André de La Fontaine", droits = "non", image = "Carjat Arthur Rimbaud 1872 n2.jpg", 
	anneeNaissance = " 1793", anneeDeces = "1950", ["région"] = "chine",
	description = "Poète français.", Pris = "Goncourt", genre = "Poètes‎", 
	metier = "Idéologues/Personnalités politiques", prix = "Lauréats du Prix Goncourt", langue = "Littérature bretonne",
	BNF = "cb11888266r" }

-- ARCid = "R457-J-44", BNF = "45274126861", DNB = "3684200072", GKD = "71yhjey852", IBLid = "37581257954"
-- BNF = cb11888266r = Alain Fournier
-- LCCN = n/50/23101 = Alain Fournier
-- = http://www.worldcat.org/identities/lccn-n50-23101
-- NLA = 35096649 = Alain Fournier
-- PND = 11850133X = Alain Fournier
-- VIAF = 7396281 = Arthur Rimbaud
-- VIAF = 34452139 = Alain Fournier
-- worldcat = 35096649 = Happy Gilmore

------------------------------------------------------------
-- p.auteur(frame)
------------------------------------------------------------

function p.auteur(frame)
	return p.normal(frame)
end

function p.author(frame)
	return p.normal(frame)
end

function p.autor(frame)
	return p.normal(frame)
end

-- Interface to generate a panel of information about an author.
-- Interfaz para generar un panel de información sobre un autor.
-- Interface pour générer un panneau d'information sur un auteur.
function p.normal(frame)
	p.time1 = os.clock()
--	local pframe = frame:getParent()
--	local args = mw.clone(pframe.args)
	local args_src = mw.clone(frame.args)
	local res = ""
	local lang = mw.language.getContentLanguage().code
	--[[
	CA.args_src = args_src
	CA.args_known = nil
	CA.args_lang = nil
	CA.args_wikidata = nil
	CA.args_import = nil
	CA.args_final = nil
	--]]
	-- Préparer les tests selon les options du modèle
	if CA.option("testargs", args_src.options) then
		-- testargs = remplacer les arguments du modèle par des arguments de tests
		--	args = ArgtNormal -- pour debug
		if lang == "en" then args_src = ArgtestEN end
		if lang == "es" then args_src = ArgtestES end
		if lang == "fr" then args_src = ArgtestFR end
	end
	--
	--CA.args_lang = nil
	res = res .. p.verif_tables("p.auteur après option testargs")
	CA.frame = frame
	CA.trc = "\n* p.auteur : Traces du module."
	CA.init_spaces()
	CA.trck("\n* CA.normal : Traces du module.")
	-- Initialisations des tables de langues
	p.init_lang("en", i18n_en)
	p.init_lang("es", i18n_es)
	p.init_lang("fr", i18n_fr)
	res = res .. p.verif_tables("p.auteur après init_lang")
	--
	local args_wikidata, t = p.wikidata( args_known_auteur )
	res = res .. p.verif_tables("p.auteur après init_lang")
--	res = res .. t
	local args_import, trc = p.control_arguments(args_known_auteur, lang, nil, args_src, args_wikidata)
	CA.args_final = nil
	res = res .. p.verif_tables("p.auteur -1- après -1- control_arguments")
	res = res .. "trc=" .. trc
	CA.args_import = args_import
	res = res .. p.verif_tables("p.auteur -2- après -2- control_arguments")
	--[[
	CA.init_lang(lang) -- "fr" ou autres
--	res = res .. "\n\n* '''ControlArgs : fin''' :<br/>"
	CA.trck("\n* CA.init_args ")
	local _known, _source, _lang, _langs, Argts_langs = CA.init_args(args_known_auteur, args_src, lang) --, i18n.fr)
	local args_import = CA.import_arguments(args_kwn, args_src, lang_i18n, args_wikidata)
	local args_final = mw.clone(args_import)
	args_import.nowyear = nowyear
	--]]
	--	res = res .. t
	local args_final = p.interact_args_final(args_import) -- interact_args_final
	res = res .. p.verif_tables("p.auteur après args_final")
--	args_final = CA.args_final
	local nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")
	p.nowyear = nowyear
	p.time2 = os.clock()
--	res = res .. CA.ta("args_final.sitelink", args_final.sitelink)
--	res = res .. CA.ta("args_final.birthyear", args_final.birthyear)
	--
	-- Générer normalement le wikitext, les catégories et autres
--	args_final.options = ""
	res = res .. p.verif_tables("p.auteur avant gener_result")
	res = res .. p.gener_result(args_final, nil) -- , " unitests testson tables tracks trackon docavant docligne docat ")
	-- Execution and test time : 2013-06-23 11:29:35, Module:Auteur/Documentation, , start = 0.013976359 , import = 0.105866377 , générer page = 0.112570652 , tests = 0.239319278
	return res
end -- function p.auteur(frame)

------------------------------------------------------------
-- p.notice(frame)
-- p.notices(frame)
------------------------------------------------------------

function p.instructions(frame)
	return p.notice(frame)
end

function p.instrucciones(frame)
	return p.notice(frame)
end

function p.notices(frame)
	return p.notice(frame)
end

-- Interface to generate independent authority instructions over a person, a book or other.
-- Interfaz para generar autoridad independiente instruccione sobre una persona, un libro u otro.
-- Interface pour générer une notice d'autorité indépendante sur une personne, un livre ou autre.
function p.notice(frame)
	local args_src = mw.clone(frame.args)
	local res = ""
	local lang = mw.language.getContentLanguage().code
	CA.init_spaces()
	CA.trck("\n* CA.normal : Traces du module.")
	-- Initialisations des tables de langues
	p.init_lang("en", i18n_en)
	p.init_lang("es", i18n_es)
	p.init_lang("fr", i18n_fr)
	p.init_lang(lang) -- "fr" ou autres
	CA.frame = frame
	CA.trc = "\n* p.notice : Traces du module."
	res = res .. "\n\n* '''ControlArgs : fin''' :<br/>"
	CA.debug_options = ""
	CA.invoke_options = " docdef docavant docligne docnotice no-box no-err track-on tests-on "
	CA.init_options(CA.invoke_options)
	CA.trackon = CA.option("trackon")
	local _known, _source, _lang, _langs, Argts_langs = CA.init_args(args_known_auteur, args_src, lang) --, i18n.fr)
	local args_wikidata, t = p.wikidata( args_known_auteur )
	local args_import = CA.import_arguments(args_kwn, args_src, lang_i18n, args_wikidata)
	local nowyear = tonumber(os.date("%Y") ) -- local now_date = os.date("%Y-%m-%d %H:%M:%S")
	args_import.nowyear = nowyear
	local args_final = p.interact_args_final(args_import)
	res = res .. p.minitest_argfinal(" args_final interact_args ", args_final)
	local ntc = p.gener_notices(CA.args_known, CA.args_src, notices_properties)
	return ntc -- "notice : " ..
end -- p.notice(frame)

------------------------------------------------------------
-- p.tests(frame)
-- p.tests2(frame)
-- p.tests3(frame)
------------------------------------------------------------

function p.auteur2(frame)
	return p.tests(frame)
end

function p.tests2(frame)
	return p.tests(frame)
end

function p.tests3(frame)
	return p.tests(frame)
end

function p.tests(frame)
	p.time1 = os.clock()
	local args_src = mw.clone(frame.args)
--	args = ArgtNormal -- pour debug
	local res = ""
	local lang = mw.language.getContentLanguage().code
	if lang == "en" then args_src = ArgtestEN end
	if lang == "es" then args_src = ArgtestFR end
	if lang == "fr" then args_src = ArgtestFR end
	CA.frame = frame
	CA.trc = "\n* p.tests : Traces du module."
	CA.init_spaces()
	CA.trck("\n* CA.normal : Traces du module.")
	-- Initialisations des tables de langues
	p.init_lang("en", i18n_en)
	p.init_lang("es", i18n_es)
	--
	local args_wikidata, t = CA.wikidata( args_known_auteur )
	local args_import = CA.control_arguments(args_known_auteur, "fr", i18n_fr, args_src)
	-- Interactions entre parametres et doc (exemples : titre = prenom+nom, l'initiale vient du nom)
	local args_final = p.interact_args_final(CA.args_import)
--	local args_final, t = CA.manage_arguments(frame, lang, lang_i18n)
	res = res .. t
	p.time2 = os.clock()
	--
	-- Générer normalement le wikitext, les catégories et autres
--	if CA.option("wikidata")		then
	CA.invoke_options = CA.invoke_options  .. " docdef docavant docligne docnotice doctable   trackon testson "
	if CA.option("docavant")		then res = res .. CA.generDoc("", args_final) end
	if not CA.option("noerr")	then res = res .. CA.erreur_lister("err_assist_user_param") end
	-- <br/>Assistance à l'utilisateur pendant la vérification des paramètres :
	if not CA.option("nobox")	then res = res .. p.auteur_box(Cargs, args_final) end
	if not CA.option("nobox")	then res = res .. microformat(args_src, args_final) end
	if not CA.option("nobox")	then res = res .. p.droits_auteur(args_src, args_final) end
	if not CA.option("nobox")	then res = res .. defaultsort(args_src, args_final) end
--	if not CA.option("nocat")	then res = res .. categories(args, args_final) end
	if not CA.option("nocat")	then res = res .. CA.categ_lister() end
	if CA.option("docapres")	then res = res .. "<br/>" .. CA.generDoc("", args_final) end
	p.time3 = os.clock()
	--
	-- Générer des tests et traces très détaillés
--	if CA.option("interon")	then res = res .. p.tests_unitaires( " iargs ", args_final) end
	if CA.option("testson")	then res = res .. p.autotest_trans(CA.args_known, CA.args_lang, CA.i18n) end
--	if CA.option("i18non")	then res = res .. CA.doctable_args(CA.i18n, "CA.i18n", { levelmaxi = 1, exclude1 = "name" } ) end
--	if CA.trackon then res = res .. "\n* Trace détaillée. Detailed track. " .. CA.trc end
--	if true or CA.option("testson")	then res = res .. p.tables_tests("tableson", frame) end
	--
	res = res .. p.detailed_doc()
	--
	p.time4 = os.clock()
	res = res .. p.tests_time( true or CA.option("doctable"), "", time1, time2, time3, time4)
	-- Execution and test time : 2013-07-08 00:44:50 UTC, url=http://test2.wikipedia.org/wiki/Victor_Hugo
	-- , start = 0.608310706 , import + = 0.138837626 , générer page + = 0.004156741 , tests + = 0.056325155
	return res
end -- p.tests(frame)

--	Module dependencies. Dependencias del módulo. Dépendances du module.
--	local CA = require "Module:ControlArgs"
--	local MathRoman = require "Module:MathRoman"

return p