Autres langues
Autres actions
Page créée avec « local p = {} local function is_set (var) return not (var == nil or var == ''); end local function italics (var) return "''" .. var .. "''" end function p.cite( frame ) local pframe = frame:getParent() local Author = pframe.args.author if is_set (pframe.args.journalist) then Author = pframe.args.journalist end local Date = pframe.args['date'] local Title = pframe.args.title local URL = pframe.args.url local Website = pframe.args.newspaper or pframe... » |
FR translation test |
||
| Ligne 12 : | Ligne 12 : | ||
local pframe = frame:getParent() | local pframe = frame:getParent() | ||
local Author = pframe.args. | local Author = pframe.args.auteur | ||
if is_set (pframe.args.journalist) then | if is_set (pframe.args.journalist) then | ||
Author = pframe.args. | Author = pframe.args.journaliste | ||
end | end | ||
local Date = pframe.args['date'] | local Date = pframe.args['date'] | ||
local | local title = pframe.args.titre | ||
local URL = pframe.args.url | local URL = pframe.args.url | ||
local Website = pframe.args. | local Website = pframe.args.journal or pframe.args['site web'] | ||
local ArchiveURL = pframe.args['archive-url'] | local ArchiveURL = pframe.args['archive-url'] | ||
local ArchiveDate = pframe.args['archive-date'] | local ArchiveDate = pframe.args['archive-date'] | ||
local Retrieved = pframe.args | local Retrieved = pframe.args['retrouvé'] | ||
local Quote = pframe.args. | local Quote = pframe.args.citation | ||
local Image = pframe.args.image | local Image = pframe.args.image | ||
local ImageCaption = pframe.args['image | local ImageCaption = pframe.args['légende-image'] | ||
if is_set (Author) then | if is_set (Author) then | ||
| Ligne 80 : | Ligne 80 : | ||
if is_set(ArchiveURL) then | if is_set(ArchiveURL) then | ||
if is_set(ArchiveDate) then | if is_set(ArchiveDate) then | ||
fourth_part = "[" .. ArchiveURL .. " " .. " | fourth_part = "[" .. ArchiveURL .. " " .. "Archive" .. "]" .. " " .. " de l'original le" .. " " .. ArchiveDate .. "." | ||
else | else | ||
fourth_part = "[" .. ArchiveURL .. " " .. " | fourth_part = "[" .. ArchiveURL .. " " .. "Archive" .. "]" .. " de l'original." | ||
end | end | ||
else | else | ||
| Ligne 89 : | Ligne 89 : | ||
if is_set (Retrieved) then | if is_set (Retrieved) then | ||
fifth_part = " | fifth_part = "Récupéré" .. " " .. Retrieved .. "." | ||
else | else | ||
fifth_part = "" | fifth_part = "" | ||
Version du 15 novembre 2025 à 20:03
local p = {}
local function is_set (var)
return not (var == nil or var == '');
end
local function italics (var)
return "''" .. var .. "''"
end
function p.cite( frame )
local pframe = frame:getParent()
local Author = pframe.args.auteur
if is_set (pframe.args.journalist) then
Author = pframe.args.journaliste
end
local Date = pframe.args['date']
local title = pframe.args.titre
local URL = pframe.args.url
local Website = pframe.args.journal or pframe.args['site web']
local ArchiveURL = pframe.args['archive-url']
local ArchiveDate = pframe.args['archive-date']
local Retrieved = pframe.args['retrouvé']
local Quote = pframe.args.citation
local Image = pframe.args.image
local ImageCaption = pframe.args['légende-image']
if is_set (Author) then
if is_set (Date) then
first_part = Author .. " (" .. Date .. ")."
else
first_part = Author .. "."
end
else
first_part = ""
end
if is_set (Image) then
local span = mw.html.create ( 'span' )
span
:wikitext('[[File:' .. Image .. '|center|300px|frameless]]')
local br = mw.html.create ('br', selfClosing)
if is_set(ImageCaption) then
local caption = mw.html.create ('div')
caption
:attr("style", "text-align:center;font-size:85%;")
:wikitext(ImageCaption)
first_part = tostring(span) .. tostring(caption) .. first_part
else
first_part = tostring(span) .. first_part
end
end
if is_set (Title) then
if is_set (URL) then
Title = "[" .. URL .. " " .. "\"" .. Title .. "\"" .. "]"
end
if not is_set (Author) then
if is_set (Date) then
Title = Title .. " (" .. Date .. ")."
else
Title = Title .. "."
end
end
second_part = Title
else
second_part = ""
end
if is_set(Website) then
third_part = "''" .. Website .. "''."
else
third_part = ""
end
if is_set(ArchiveURL) then
if is_set(ArchiveDate) then
fourth_part = "[" .. ArchiveURL .. " " .. "Archive" .. "]" .. " " .. " de l'original le" .. " " .. ArchiveDate .. "."
else
fourth_part = "[" .. ArchiveURL .. " " .. "Archive" .. "]" .. " de l'original."
end
else
fourth_part = ""
end
if is_set (Retrieved) then
fifth_part = "Récupéré" .. " " .. Retrieved .. "."
else
fifth_part = ""
end
if is_set (Quote) then
Quote = string.gsub(Quote,"\n","<br>")
Quote = "“" .. Quote .. "”"
local div = mw.html.create ('div')
div
:attr("style", "width:80%; margin-left:10%;")
:wikitext(Quote)
local br = mw.html.create ('br', selfClosing)
first_part = italics(tostring(div)) .. tostring(br) .. first_part
end
if is_set (first_part) then
first_part = first_part .. " "
end
if is_set (second_part) then
second_part = second_part .. " "
end
if is_set (third_part) then
third_part = third_part .. " "
end
if is_set (fourth_part) then
fourth_part = fourth_part .. " "
end
Render = first_part .. second_part .. third_part .. fourth_part .. fifth_part
return Render
end
return p