Module:GratisdataInfobox/labels

--[=[	Tables with labels fixed for infoboxes. Keep the structure:

-- Fixes for function getLabel local infoboxLabelsFromId = { }

-- Fixes for case=infoboxlabel local infoboxlabels = { }

-- Fixes for case=infoboxdata local infoboxdata = { }

-- Support function used from Module:GratisdataInfobox/i18n for function claim with case=infoboxlabel local function fixInfoboxLabel(label) return label end

-- Support function used from Module:GratisdataInfobox/i18n for function claim with case=infoboxdata local function fixInfoboxData(label) return label end ]=]

-- Exceptions for function getLabel

local infoboxLabelsFromId = { ["P31"]  = "Children",             -- text adjusted for infobox                 infobox: person ["P57"]  = "Director",             -- text adjusted for infobox                 infobox: movie, organization, .. ["P33"]  = "Formation",            -- text adjusted for infobox                 infobox: person ["P465"]  = "Title",               -- text adjusted for infobox                 infobox: person ["P102"] = "Party",                -- text adjusted for infobox                 infobox: person ["P136"] = "Genre",                -- text adjusted for infobox                 infobox: organization ["P138"] = "Eponymous",            -- text adjusted for infobox                 infobox: all ["P150"] = "It contains the subdivision",  -- text adjusted for infobox                 infobox: geogr.politics ["P159"] = "His",                  -- text adjusted for infobox                 infobox: website ["P161"] = "Papers destacats",     -- text adjusted for infobox                 infobox: person ["P166"] = "Premis",               -- text adjusted for infobox                 infobox: all ["P181"] = "Distribució", ["P186"] = "Material",             -- text adjusted for infobox                 infobox: place ["P412"] = "Veu",                  -- text adjusted for infobox                 infobox: person ["P417"] = "Patrocini",            -- text adjusted for infobox                 infobox: geogr.politics ["P428"] = "Abrev. botànica",      -- text adjusted for infobox                 infobox: person ["P421"] = "Fus horari",           -- text adjusted for infobox                 infobox: geogr.politics ["P571"] = "Creació",              -- text adjusted for infobox                 infobox: organization ["P697"] = "Exautor",              -- text adjusted for infobox                 infobox: being alive ["P737"] = "Influències",          -- text adjusted for infobox                 infobox: person ["P742"] = "Altres noms",          -- text adjusted for infobox                 infobox: all ["P800"] = "Obres destacables",    -- text adjusted for infobox                 infobox: person ["P802"] = "Alumnes",              -- text adjusted for infobox                 infobox: person ["P835"] = "Abrev. zoologia",      -- text adjusted for infobox                 infobox: person ["P856"] = "Lloc web",             -- text adjusted for infobox                 infobox: movie ["P915"] = "Rodatge",              -- text adjusted for infobox                 infobox: movie ["P921"] = "Tema",                 -- text adjusted for infobox                 infobox: movie ["P1038"] = "Parents",             -- text adjusted for infobox                 infobox: persona ["P1066"] = "Professors",          -- text adjusted for infobox                 infobox: persona ["P1120"] = "Morts",               -- text adjusted for infobox                 infobox: esdeveniment ["P1135"] = "Estatus",             -- text adjusted for infobox                 infobox: ésser viu ["P1174"] = "Visitants anuals",    -- text adjusted for infobox                 infobox: organització, edifici ["P1191"] = "Estrena",             -- text adjusted for infobox                 infobox: pel·lícula ["P1339"] = "Ferits",              -- text adjusted for infobox                 infobox: esdeveniments ["P1411"] = "Nominacions",         -- text adjusted for infobox                 infobox: pel·lícula ["P1412"] = "Llengua",             -- text adjusted for infobox                 infobox: all ["P1420"] = "Sinònims",            -- text adjusted for infobox                 infobox: ésser viu ["P1446"] = "Desapareguts",        -- text adjusted for infobox                 infobox: esdeveniments ["P1538"] = "Llars",               -- text adjusted for infobox                 infobox: geogr.política ["P1559"] = "Nom original",        -- text adjusted for infobox                 infobox: all ["P1619"] = "Obertura",            -- text adjusted for infobox                 infobox: edifici ["P1672"] = "Font de",             -- text adjusted for infobox                 infobox: ésser viu ["P2044"] = "Altitud",             -- text adjusted for infobox                 infobox: indret, geogr.política ["P2048"] = "Alçada",              -- text adjusted for infobox                 infobox: persona ["P2067"] = "Pes",                 -- text adjusted for infobox                 infobox: persona ["P2541"] = "Àmbit",               -- text adjusted for infobox                 infobox: publicació ["P2257"] = "Freqüència",          -- text adjusted for infobox                 infobox: esdeveniment ["P2635"] = "Parts",               -- text adjusted for infobox                 infobox: composició ["P2659"] = "Isolament",           -- text adjusted for infobox                 infobox: indret ["P2852"] = "Telèfon d'emergències", -- text adjusted for infobox               infobox: geogr.política ["P2868"] = "té el rol",             -- text adjusted for infobox                 infobox: persona ["P3373"] = "Germans",             -- text adjusted for infobox                 infobox: persona ["P3712"] = "Objectius",           -- text adjusted for infobox                 infobox: organització ["P3999"] = "Clausura",            -- text adjusted for infobox                 infobox: edifici ["P4647"] = "Escenari",            -- text adjusted for infobox                 infobox: composició ["P4628"] = "Genoma",

["Q7566"]    = "Parents",           -- en:parents                               infobox: persona ["Q929848"]  = "Movements",         -- en:movements                             infobox: composició ["Q1921834"] = "Characteristics",   -- en:characteristics                       infobox: all ["Q130146"]  = "EMEA",              -- en:European Medicines Agency             infobox: fàrmac ["Q204711"]  = "FDA",               -- en:Food and Drug Administration          infobox: fàrmac ["Q215972"]  = "Protagonist",       -- en:protagonist                           infobox: pel·licula ["Q959782"]  = "Excavations",       -- en:(archeological) excavations           infobox: indret ["Q1207505"] = "Quality",           -- en:quality                               infobox: pel·lícula ["Q4745081"] = "AHFS",    -- en:American Society of Health-System Pharmacists   infobox: fàrmac ["Q7406919"] = "Services",           -- en:services                             infobox: all ["Q29933828"] = "Launch",       -- text adjusted for infobox                    infobox: lloc web ["Q55579539"] = "Activity",        -- en:work period                            infobox: organització ["Q60313278"] = "Category:Articles of political geography without photo", --    infobox: IGP

["T0001"] = "ANUL·LAT",            -- en:VOID                                   infobox: all ["T0002"] = "ANUL·LAT",            -- en:VOID                                   infobox: all ["T0003"] = "ANUL·LAT",            -- en:new position (no value in P39/P1365)   infobox: all ["T0004"] = "ANUL·LAT",            -- en:ended position (no value in P39/P1366) infobox: all ["T0005"] = "ANUL·LAT",            -- en:unknown date (as a property value)     infobox: all ["T0006"] = "ANUL·LAT",            -- en:VOID                                   infobox: all ["T0007"] = "ANUL·LAT",            -- en:discovery of body                      infobox: persona ["T0008"] = "Es coneix per",       -- en:known by                               infobox: persona ["T0009"] = "ANUL·LAT",            -- en:remarkable ideas (philosophers, etc.)  infobox: persona ["T0010"] = "ANUL·LAT",            -- en:Period in service (military)           infobox: persona ["T0011"] = "ANUL·LAT",            -- en:end of worship (religion)         infobox: persona ["T0012"] = "ANUL·LAT",            -- en:disciples, followers (phil. relig, ..) infobox: persona ["T0013"] = "ANUL·LAT",            -- en:present team (sports)                  infobox: persona ["T0014"] = "ANUL·LAT",            -- en:professional withdrawn (sports)        infobox: persona ["T0015"] = "Estudiants notables", ["T0016"] = "Altres estudiants notables", ["T0017"] = "Assessorament acadèmic", ["T0018"] = "Situació judicial", ["T0019"] = "Enaltiment", ["T0020"] = "Història i celebracions", ["T0021"] = "Cota inicial",        -- en:starting spot height (river, walk)     infobox: indret ["T0022"] = "Cota final",          -- en:ending spot height (river, walk)       infobox: indret ["T0023"] = "Mars contigus",       -- en:adjacent seas (each side of a strait)  infobox: indret ["T0024"] = "Ciutats riberenques", -- en:riverside cities (of body of water)    infobox: indret ["T0025"] = "Element vertebrador", -- en:linking element (item and its environment) infobox: indret ["T0026"] = "Cims destacats",      -- en:highlighted summits                    infobox: indret ["T0027"] = "ANUL·LAT",            -- en:starting spot height (river, walk)     infobox: indret ["T0028"] = "ANUL·LAT",            -- en:ending spot height (river, walk)       infobox: indret ["T0029"] = "Ciutat més propera",  -- en:nearest city                           infobox: indret ["T0030"] = "Mesures i indicadors", -- en:measures and indicators (section)     infobox: indret ["T0031"] = "Mitjana de precipitacions", -- en:rainfall average                 infobox: indret ["T0032"] = "Congelació",          -- en:freezing                               infobox: indret ["T0033"] = "Tipus cascada",       -- en:Typus of waterfall (shape)             infobox: indret ["T0034"] = "Alçada cascada",      -- en:Waterfall height (full falls)          infobox: indret ["T0035"] = "Salt més llarg",      -- en:highlighted summits                    infobox: indret ["T0036"] = "Dificultat",          -- en:difficulty (for tracks, climb,..)      infobox: indret ["T0037"] = "Cultura/pobladors",   -- en:cultural/ethnic roots                  infobox: indret ["T0038"] = "Tipus d'erupció",     -- en:kind of eruption (volcanic)            infobox: indret ["T0039"] = "Última erupció",      -- en:last eruption (volcanic)               infobox: indret ["T0040"] = "Pistes",              -- en:pistes (ski piste plural)              infobox: indret ["T0041"] = "Ruta normal",         -- en:main itinerary (GR, trail, pathfoot)   infobox: indret ["T0042"] = "Etapes",              -- en:stages (GR, trail, pathfoot)           infobox: indret ["T0043"] = "Enllaç altres senders", -- en:link to other trails (GR, pathfoot)  infobox: indret ["T0044"] = "Separació mínima",    -- en:minimum separation (straits),          infobox: indret ["T0045"] = "Fusió de", -- en:amalgamation (entity "E" originated by merging "A"+"B") infobox: organitzacio ["T0046"] = "ANUL·LAT",            -- en:Merge with (entity "E" merge with "A"+...)  infobox: organitzacio ["T0047"] = "ANUL·LAT",            -- en:reconstruction  (entity second creation)    infobox: organitzacio ["T0048"] = "Redissolució",        -- en:redissolved (to dissolve entity again)      infobox: organitzacio ["T0049"] = "Àmbit",               -- en:thematic scope (library/museum area)        infobox: organitzacio ["T0050"] = "ANUL·LAT",            -- en:collections (museum specific collections)   infobox: organitzacio ["T0051"] = "Tipus de documents",  -- en:type of documents (in archive or museum)    infobox: organitzacio ["T0052"] = "ANUL·LAT",            -- en:book loans by year (in library )            infobox: organitzacio ["T0053"] = "ANUL·LAT",            -- en:potential population (library, hospital,..) infobox: organitzacio ["T0054"] = "ANUL·LAT",            -- en:member (of the club/organitzation/society)  infobox: organitzacio ["T0055"] = "Membres anteriors",   -- en:past members (music group/club/art school)  infobox: organitzacio ["T0056"] = "ANUL·LAT",            -- en:featured instruments (music group)         infobox: organitzacio ["T0057"] = "ANUL·LAT",            -- en:keyperson (within the organitzation)        infobox: organitzacio ["T0058"] = "Membres destacats",   -- en:remarkable members                          infobox: organitzacio ["T0059"] = "ANUL·LAT",            -- en:cap de colla (chief of castells team)       infobox: organitzacio ["T0060"] = "ANUL·LAT",        -- en:Youth Party (political party youth branch)  infobox: organitzacio ["T0061"] = "ANUL·LAT",        -- en:allied organization                         infobox: organitzacio ["T0062"] = "ANUL·LAT",        -- en:rival organization                          infobox: organitzacio ["T0063"] = "ANUL·LAT",        -- en:remarkable figures (organitzation's indicators) infobox: organitzacio ["T0064"] = "ANUL·LAT",        -- en:Other information                           infobox: organitzacio, ICQ, Llibre ["T0065"] = "ANUL·LAT",        -- en:company estate (not the HQ, but the origin) infobox: organitzacio ["T0066"] = "ANUL·LAT"         -- en:type of organisation & management           infobox: organitzacio }

-- Label corrections appropriately for an infotable (label parameter) -- Used to function claim with case=infoboxlabel

local infoboxlabels = { ["capital"] = "city", ["autonomous community"] = "autonomy", ["french department"] = "department", ["french district"] = "district", ["german federal state"] = "federal state", ["sovereign state"] = "state", ["commonwealth kingdom"] = "state", ["republic"] = "state", ["local government area of Australia"] = "local government" }

-- Changes in required values for an infotable (date parameter)

local infoboxdata = { ["American Society of Health-System Pharmacists"] = "ASHP", ["Bach Werke Verzeichnis"] = "BWV", ["standard offset"] = "standard", ["threaded"] = "threaded", ["maximum scroll"] = "maximum", ["deadweight tonnage"] = "DWT", ["International Code of Zoological Nomenclature"] = "FIVE", ["International Code of Botanical Nomenclature"] = "CINB", ["International Virus Classification and Nomenclature Code"] = "CICNV", ["International Code of Nomenclature for Cultivated Plants"] = "CINPC", ["International Bacteria Nomenclature Code"] = "CINBa", ["International Code of Botanical Nomenclature (Vienna edition)"] = "CINB (Vienna edition)", ["International Code of Botanical Nomenclature (Tokyo edition)"] = "CINB (Tokyo edition)", ["International Code of Botanical Nomenclature (Saint Louis Edition)"] = "CINB (Saint Louis Edition)", ["International Code of Nomenclature for algae, fungi, and plants (Melbourne edition)"] = "CINB (Melbourne edition)", ["male"] = "male", ["female"] = "female", ["Microsoft Windows"] = "Windows", ["Apollo Command and Service Module"] = "CSM", ["Apollo Lunar Module"] = "LM", ["Berkeley Open Infrastructure for Network Computing"] = "BOINC", ["take-off"] = "Arrival Ship", ["landing"] = "Return Ship", ["Advanced Packaging Tool"] = "APT", ["GNU General Public License"] = "GNU GPL", ["Common Development and Distribution License"] = "CDDL", ["Professional Tennis Association"] = "ATP", ["Central American Football Union"] = "UNCAF", ["Southeast Asian Football Federation"] = "AFF", ["West Asian Football Federation"] = "WAFF", ["length"] = "LOA", ["float length"] = "LWL", ["International Space Station"] = "EEI", ["United States Navy"] = "US Navy", ["Kaiserliche und Königliche Kriegsmarine"] = "K.u.K. Marine", ["Saffir-Simpson Hurricane Scale"] = "SSHS", ["JMA typhoon classification"] = "JAM", ["IMD cyclone classification"] = "IMD", ["MF cyclone classification"] = "MFR", ["BOM / FMS cyclone classification"] = "BOM / FMS", ["soft landing"] = "descent", ["surface scan"] = "scan", ["Moon"] = "the Moon", ["normal scroll"] = "normal", ["underwater"] = "diving", ["order"] = "authorized", ["drill"] = "drill", ["less than"] = "before", }

-- Support function code

local function fixInfoboxLabel(label) local lang = mw.language.getContentLanguage label = lang:lcfirst(label) if infoboxlabels[label] then label = infoboxlabels[label] else label = string.gsub(label, " de .+", "") label = string.gsub(label, " dels? .+", "") label = string.gsub(label, " d'.+", "") label = string.gsub(label, " %(.+", "")		if label == 'state' then			label = 'federal state'		end	end	return lang:ucfirst(label) end

local function fixInfoboxData(label) if infoboxdata[label] then label = infoboxdata[label] else label = string.gsub(label, "^[sS]tation of ", "") label = string.gsub(label, "^[sS]tation of'", "") label = string.gsub(label, "^[sS]tation of the ", "the") end return label end

-- Return exported functions return { infoboxLabelsFromId = infoboxLabelsFromId, fixInfoboxLabel = fixInfoboxLabel, fixInfoboxData = fixInfoboxData, }