Documentation for this module may be created at Module:Infobox disease/i18n/doc

local p = {}

--Warning: If an "Args" item has more one value: These values must be written between "{" and "}". More than two values are allowed.
local MLMT	= require "Module:Multilang module tools"
local GIBTi	= require "Module:Global infobox tools/items"
local GIBT	= require "Module:Global infobox tools"
local MIBIi	= require "Module:Medical infobox items/items"
local IDi = require "Module:Infobox disease/items"

p.rs_val = { --reserved keys and their values for infobox configuration
	-- When here a value is nil or "", the used value is the value read from Global infobox tools/i18n.rs_val
	-- To see the values that these variables take, use |allitems=list
	--colors
	[GIBTi.rk.rs_colorbox]			= "", --color for title and headers
	[GIBTi.rk.rs_color_tit_cllps]	= "", --color for header of the collapsible text data
	--styles
    [GIBTi.rk.rs_bodystyle]			= "",
    [GIBTi.rk.rs_titlestyle]		= "", -- by default is rs_colorbox as background and centered text
    [GIBTi.rk.rs_headerstyle]		= "", -- by default is rs_colorbox as background 
    [GIBTi.rk.rs_subheaderstyle]	= "", -- by default is rs_color_tit_cllps as background and centered text
    [GIBTi.rk.rs_imagestyle]		= "", -- by default is padding-bottom:0.1em;line-height:1.35;font-size:98%
    [GIBTi.rk.rs_captionstyle]		= "", -- by default is padding-top:0.3em;padding-bottom:0.1em;line-height:1.35;font-size:98%
    [GIBTi.rk.rs_labelstyle]		= "", -- by default is text-align:start; padding-right:1.2em; background:#eeeeee (approx. silver)
    [GIBTi.rk.rs_datastyle]			= "", -- by default is text-align:start
    [GIBTi.rk.rs_belowstyle]		= "", -- 
    --icon
	[GIBTi.rk.rs_icon]				= "", -- filename of the icon that appears beside of the title
	[GIBTi.rk.rs_icon_at_begin]		= true, -- the position in relation to the title
	[GIBTi.rk.rs_icon_hint]			= "", -- by default is the template name, displayed when hovering over the icon with the mouse cursor 
	--image
	[GIBTi.rk.rs_image_max_num]		= 2, -- max number of images (1-2)
	[GIBTi.rk.rs_def_image_size]	= "", -- by default is 300x300px
	--referred to label/data content
	[GIBTi.rk.rs_changeable_lbls]	= false, -- if true, allows users to change the label text, using the next prefix:
	[GIBTi.rk.rs_param_prefix_lbl]	= "", -- by default is l_
	[GIBTi.rk.rs_def_charnum_cllps]	= 180, --number of characters from which the text will appear collapsed (for some label-data items)
	[GIBTi.rk.rs_below]        		= "", --fixed text (i.e. information) for for all the same infoboxes
}

p.items = { --This is (perhaps) the only table you need to modify to localize the content
	-- To see the current values for above variables use |allitems=list
	[MLMT.k.Args] = { -- alternative (localized) names for parameters
	--Warning: If an item has more one value: These values must be written between "{" and "}". More than two values are allowed.
		[GIBTi.rk.name]			= {"ainm","Ainm"},
		[IDi.k.type]			= "",
		[IDi.k.synonym]			= {"comhchiallach","comhchiallaigh"},
		[IDi.k.eponym]			= {"eapainm","eapainmneach"},
		[IDi.k.specialty]		= "speisialtacht",
		
		[IDi.k.symptoms]		= "comharthaí",
		[IDi.k.complication]	= "aimhréidh",
		[IDi.k.onset]			= "tosaigh",
		[IDi.k.duration]		= "ré",
		[IDi.k.types]			= "cineálacha",
		[IDi.k.causes]			= "cúiseanna",
		[IDi.k.risks]			= {"riosc","rioscaí"},
		[IDi.k.diagnosis]		= "diagnóis",
		[IDi.k.exams]			= {"scrúdú","scrúduithe"},
		[IDi.k.diff_diag]		= "diagnóis_difreálach",
		[IDi.k.prevention]		= {"chosc","cosc"},
		[IDi.k.treatment]		= "cóireáil", --old: 7
		[IDi.k.drug_used]		= {"cógas","cogais"}, --Error en plantilla!
		[IDi.k.prognosis]		= {"réamhaisnéis","reamhaisneis"},
		[IDi.k.frequency]		= {"minicíocht","miniciocht"},
		[IDi.k.deaths]			= "básanna",
		[IDi.k.d_burden]		= "ualach_galar",
		[IDi.k.measured_by]		= "tomhaiste_ag",

		[IDi.k.location]		= "suíomh",
		[IDi.k.genetic]			= "cúis ghéiniteach",
		[IDi.k.afflicts]		= "buaileann_sé",
		[IDi.k.transmitted]		= "tarchur_pataigineach",
		[IDi.k.has_cause]		= "cúis",
		[IDi.k.has_effec]		= "éifeacht",
		
		[IDi.k.ICD10]			= {"ICD-10","ICD-10"},
		[IDi.k.ICD9]			= {"ICD9","ICD-9"},
		[IDi.k.ICD_O]			= {"ICD0","ICD-O"},
		[IDi.k.ICPC]			= "CIAP-2",
		[IDi.k.DSM]				= "",

		[IDi.k.OMIM]			= "",
		[IDi.k.OMIM_mult]		= "",
		[IDi.k.DiseasesDB]		= "",
		[IDi.k.DiseasesDB_mult]	= "",
		[IDi.k.MedlineP]		= "",
		[IDi.k.MedlineP_mult]	= "",
		[IDi.k.NCI]				= "",
		[IDi.k.P_UK]			= "",
		[IDi.k.Orphanet]		= "",
		[IDi.k.umls_cui]		= "",
		[IDi.k.doid]			= "",
	},
	[MLMT.k.Labels] = { -- alternative (localized) name to header/label returned from Wikidata 
	-- If possible, it is always best to modify the locazation in Wikidata	
		[IDi.k.type]			= "Cineál",
		[IDi.k.synonym]			= "Comhchiallaigh",
		[IDi.k.eponym]			= "Eapainm",
		[IDi.k.specialty]		= "[[Speisialtacht leighis]]",
		
		[IDi.k.hd_Clinical]		= "Cliniciúil",
		[IDi.k.hd_ClinicManag]	= "Cóireáil chliniciúil",
		[IDi.k.symptoms]		= "Comharthaí", --old: 6, new 12
		[IDi.k.complication]	= "[[Seachghalair]]",
		[IDi.k.onset]			= "Tosaigh",
		[IDi.k.duration]		= "Tréimhse",
		[IDi.k.types]			= "Cineálacha",
		[IDi.k.causes]			= "Cúis", -- P1479 ? 
		[IDi.k.risks]			= "[[Fachtóir riosca|Fachtóirí riosca]]",
		[IDi.k.diagnosis]		= "[[Modh diagnóiseach]]",
		[IDi.k.exams]			= "Scrúduithe", --old: 11 
		[IDi.k.diff_diag]		= "[[Diagnóis difreálach]]",
		[IDi.k.prevention]		= "Cosc",	
		[IDi.k.treatment]		= "Cóireáil", --old: 7
		[IDi.k.drug_used]		= "Cógais", --old: 8
		[IDi.k.prognosis]		= "Réamhaisnéis",
		[IDi.k.frequency]		= "Minicíocht",
		[IDi.k.deaths]			= "Básanna",
		[IDi.k.d_burden]		= "[[Ualach tinnis]]", --old: 16
		[IDi.k.measured_by]		= "Mesurat per", --old: 17

		[IDi.k.hd_Pathos]		= "[[Pataigineas]]", --new
		[IDi.k.location]		= "Suíomh",
		[IDi.k.genetic]			= "Cúis ghéiniteach", --old: 9
		[IDi.k.afflicts]		= "Buaileann sé", --old: 10
		[IDi.k.transmitted]		= "Tarchur pataigineach", --Transmès per ?? --old: 13
		[IDi.k.has_cause]		= "Cúis", --old: 14
		[IDi.k.has_effec]		= "Éifeacht", --old: 15
		
		--Old 32, 33, 34, etc.
		[IDi.k.hd_Classif]		= "Aicmiú",
		[IDi.k.ICD10]			= "[[ICD-10]]",
		[IDi.k.ICD9]			= "[[ICD-9]]",
		[IDi.k.ICD_O]			= "[[Classificació Internacional de Malalties per Oncologia|ICD-O]]",
		[IDi.k.ICPC]			= "[[Classificació Internacional d'Atenció Primària|CIAP]]",
		[IDi.k.DSM]				= "[[DSM]]",
		
		[IDi.k.hd_ExtRes]		= "Acmhainní seachtracha", 
		[IDi.k.OMIM]			= "[[Mendelian Inheritance in Man|OMIM]]",
		[IDi.k.DiseasesDB]		= "[[Diseases Database|DiseasesDB]]",
		[IDi.k.MedlineP]		= "[[MedlinePlus]]",
		[IDi.k.NCI]				= "[[National Cancer Institute|NCI]]",
		[IDi.k.P_UK]			= "[[Patient UK]]",
		[IDi.k.Orphanet]		= "[[Orphanet]]",
		[IDi.k.umls_cui]		= "[[Unified Medical Language System|UMLS]] [[Concept Unique Identifier|CUI]]",
		[IDi.k.doid]			= "[[Disease Ontology|DOID]]",
	},	
}

p.untranslat_args = { 
	--parameters to monitorize for untranslated words returned from Wikidata. 
	--article names are stored in rs_cat_wds_untranslat 
	IDi.k.specialty,
	IDi.k.symptoms,
}

------------------------------------------------------
-- OMIT PARAMETERS AND PRESET VALUES FOR PARAMETERS --
------------------------------------------------------

p.omit_params = {
	-- Key of standard params to omit
	-- When also change of the parameter order is required, the better solution is to use a new_idx
}

local NChars = GIBT.rs[GIBTi.rk.rs_def_charnum_cllps]
p.preset_params = {
	-- Key and a preset integer value
	-- Not used in this module
}

----------------------------------------
-- NEW ITEMS (non-standard) --
----------------------------------------

p.k = {
	-- definition of the keys of new items to use below, in format, i.g. name = "name"
	GEC_id		= "GEC_id",
}

p.new_items = {
	-- items to add
	[MLMT.k.Args] = {
		--[[
		Each item consists of:
		[key] = {"manual_parameter_name/s", "call to WD"},
		The first or second subitem can be omitted.	To omit a subitem means to leave it between "".
		"manual_parameter_name/s" can be "name" or {"name_1", "name2"}
		"call to WD" may be:
		  simple, e.g. "_P123456789" or
		  complex, e.g. {property = "P123456789", formatting = "[http:/web/$1 $1]", ...}		
		--]]	
		[p.k.GEC_id] = {"",	{property="P1296", 
							formatting='[https://www.enciclopedia.cat/ec-gec-$1.xml $1]'}},
	},	
	[MLMT.k.Labels] = {
		--[[
		Each item consists of:
		[key] = "label",
		"label" must be:
		  a text or 
		  a call to WD, e.g. "_P123456789"
		--]]	
		[p.k.GEC_id] = "[[Enciclopèdia Catalana]]",
	},
}

p.new_lims = {
	--[[
	It is an optional table to set parameter types for a new_args. 
	    type of the parameter. Usually types are: "s" or string, "i" or integer, "n" or number, "b" or boolean. 
			The numeric parameters can add "+" for positive value.
		By default the parameter type is a string ("s")
	e.g. {new_item,	'i'},
    --]]
}

function p.local_func (frame, args)
-- Only use this function for localized parameters
-- "frame" sometimes is required for a function (see below)
-- "args" contains all parameters and its values
	vals = {} -- ← Do not delete or change this line!
	--[[
	--"vals" is a table that will contain none to several items.
		--where EACH item contains the name of target standard parameter and its value 
	result_for_this_param = 
		"result_for_this_param" contains the value for one item.
		1. if you know how to program minimally with lua:
		    e.g. for two lines: args("param_1")..'</br>'..args("param_2")
		2. a call to a module:    
			require("Module:Module_name_to_call").called_function (parameter_list)
			parameter_list is the list of the comma separated parameters an between "{}":
				e.g. {separator='<br>', args("param_1"), args("param_2")
		3. if you don't know how to program or a template is a better solution:
			frame:expandTemplate {
				title = "template_name", --template_name is the name of the used template, it must be write between "". e.g. "My template"
				args = {the_args} -- "the_args" are the parameters passed to the used template
				                  -- e.g: {args("param_1"), args("param_2")}, where "param_1" and "param_2" are the name of two localized parameters
				} <-the last curly bracket
				also you can read: https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#frame:callParserFunction
	table.insert (vals, {target_param_name, result_for_this_param}) --It adds one item with the target parameter and a previous set value
	         "target_param_name" is the name of a target standard parameter
	e.g. for several values:
		result_for_this_param = args("param_1")
		table.insert (vals, {target_param_name_1, result_for_this_param})
		result_for_this_param = '<b>''..args("param_2")..'</b>' --always appears in bold
		table.insert (vals, {target_param_name_2, result_for_this_param})
	--]]
	result_for_this_param = args(p.k.GEC_id)
	table.insert (vals, {p.k.GEC_id, result_for_this_param})
	return vals -- ← Do not delete this line!
end --local_func

-- WARNING!: p.new_idx is a duplicated table of IDi.idx, and this replaces IDi.idx
p.new_idx = {
	{'a',  GIBTi.rk.name},
	{'-',  GIBT.images},
	{'al', IDi.k.type},
	{'al', IDi.k.synonym},
	{'al', IDi.k.eponym},
	{'al', IDi.k.specialty},
	
	{'L',  IDi.k.hd_Clinical},
	{'L',  IDi.k.hd_ClinicManag},
	{'al', IDi.k.symptoms},
	{'al', IDi.k.complication},
	{'al', IDi.k.onset},
	{'al', IDi.k.duration},
	{'al', IDi.k.types},
	{'al', IDi.k.causes},
	{'al', IDi.k.risks},
	{'al', IDi.k.diagnosis},
	{'al', IDi.k.exams},
	{'al', IDi.k.diff_diag},
	{'al', IDi.k.prevention},
	{'al', IDi.k.treatment},
	{'cl', IDi.k.drug_used},
	{'al', IDi.k.prognosis},
	{'al', IDi.k.frequency},
	{'al', IDi.k.deaths},
	{'al', IDi.k.d_burden},
	{'al', IDi.k.measured_by},

	{'L',  IDi.k.hd_Pathos},
	{'al', IDi.k.location},
	{'al', IDi.k.genetic},
	{'al', IDi.k.afflicts},
	{'al', IDi.k.transmitted},
	{'al', IDi.k.has_cause},
	{'al', IDi.k.has_effec},

	{'L',  IDi.k.hd_Classif},
	{'al', IDi.k.ICD10},
	{'al', IDi.k.ICD9},
	{'al', IDi.k.ICD_O},
	{'al', IDi.k.ICPC},
	{'al', IDi.k.DSM},

	{'L',  IDi.k.hd_ExtRes},
	{'al', p.k.GEC_id},
	{'al', IDi.k.OMIM},
	{'a',  IDi.k.OMIM_mult},
	{'al', IDi.k.DiseasesDB},
	{'a',  IDi.k.DiseasesDB_mult},
	{'al', IDi.k.MedlineP},
	{'a',  IDi.k.MedlineP_mult},
	{'-',  MIBIi.k.eMed},
	{'al', IDi.k.NCI},
	{'al', IDi.k.P_UK},
	{'-',  MIBIi.k.Mesh},
	{'-',  MIBIi.k.Gene},
	{'al', IDi.k.Orphanet},
	{'al', IDi.k.umls_cui},
	{'al', IDi.k.doid},
}

return p