Modification de Module:Infobox/Personnage
La modification peut être annulée. Veuillez vérifier les différences ci-dessous pour voir si c’est bien ce que vous voulez faire, puis publier ces changements pour finaliser l’annulation de cette modification.
Version actuelle | Votre texte | ||
Ligne 4 : | Ligne 4 : | ||
-- Date à laquelle se déroule le jeu | -- Date à laquelle se déroule le jeu | ||
REFERENCE_DATE = 2330 | REFERENCE_DATE = 2330 | ||
-- Première lettre en minuscule | |||
function first_to_lower(str) | |||
return str:gsub("^%l", string.lower) | |||
end | |||
-- Cherche une année écrite sur 4 chiffres dans une date et la retourne | -- Cherche une année écrite sur 4 chiffres dans une date et la retourne | ||
Ligne 36 : | Ligne 41 : | ||
if death == nil then | if death == nil then | ||
if age ~= nil then | if age ~= nil then | ||
return string.format("%s (%s)", birth, age) | return string.format("%s (%s)", birth, first_to_lower(age)) | ||
elseif calculated_age ~= nil then | elseif calculated_age ~= nil then | ||
return string.format("%s (%s ans)", birth, calculated_age) | return string.format("%s (%s ans)", birth, calculated_age) | ||
Ligne 51 : | Ligne 56 : | ||
if death ~= nil then | if death ~= nil then | ||
if age ~= nil then | if age ~= nil then | ||
return string.format("%s (%s)", death, age) | return string.format("%s (%s)", death, first_to_lower(age)) | ||
elseif calculated_age ~= nil then | elseif calculated_age ~= nil then | ||
return string.format("%s (à %s ans)", death, calculated_age) | return string.format("%s (à %s ans)", death, calculated_age) | ||
Ligne 67 : | Ligne 72 : | ||
title = "Biographie", | title = "Biographie", | ||
rows = { | rows = { | ||
{type = "row", label = "Naissance", value = format_birth}, | {type = "row", label = "Naissance", value = format_birth}, | ||
{type = "row", label = "Mort", value = format_death}, | {type = "row", label = "Mort", value = format_death}, |