Module:PornBaseDataIB: Difference between revisions
Content deleted Content added
PeaceDeadC (talk | contribs) No edit summary |
PeaceDeadC (talk | contribs) No edit summary |
||
Line 401:
and dprec > 8
and not pd
and model == "https://
calendarmodel = "julian"
end
Line 574:
prefix = prefix or ""
postfix = postfix or ""
lang = lang or "
-- see if item might need italics or quotes
local fmt = ""
Line 811:
.. ":OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt="
.. i18n["editonpornbasedata"]
.. "|link=https://
.. "?uselang=" .. langcode
if propertyID then icon = icon .. "#" .. propertyID end
Line 2,337:
-- if there's no local sitelink, create the sitelink from English label
if not sitelink then
local lbl = mw.wikibase.getLabelByLang(qid3, "
if lbl then
if lbl:sub(1,9) == "Category:" then
Line 2,428:
local cat = mw.wikibase.getSitelink(tmcID)
if not cat then
local lbl = mw.wikibase.getLabelByLang(tmcID, "
if lbl then
if lbl:sub(1,9) == "Category:" then
Line 2,781:
p.formatDate = function(frame)
return format_Date(frame.args[1], frame.args.df, frame.args.bc)
end
p.getImageLegend = function(frame)
-- look for named parameter id; if it's blank make it nil
local id = frame.args.id
if id and (#id == 0) then
id = nil
end
-- look for named parameter lang
-- it should contain a two-character ISO-639 language code
-- if it's blank fetch the language of the local wiki
local lang = frame.args.lang
if (not lang) or (#lang < 2) then
lang = mw.language.getContentLanguage().code
end
-- first unnamed parameter is the local parameter, if supplied
local input_parm = mw.text.trim(frame.args[1] or "")
if input_parm == "FETCH_WIKIDATA" then
local ent = mw.wikibase.getEntity(id)
local imgs
if ent and ent.claims then
imgs = ent.claims.P470
end
local imglbl
if imgs then
-- look for an image with 'preferred' rank
for k1, v1 in pairs(imgs) do
if v1.rank == "preferred" and v1.qualifiers and v1.qualifiers.P523 then
local imglbls = v1.qualifiers.P523
for k2, v2 in pairs(imglbls) do
if v2.datavalue.value.language == lang then
imglbl = v2.datavalue.value.text
break
end
end
end
end
-- if we don't find one, look for an image with 'normal' rank
if (not imglbl) then
for k1, v1 in pairs(imgs) do
if v1.rank == "normal" and v1.qualifiers and v1.qualifiers.P523 then
local imglbls = v1.qualifiers.P523
for k2, v2 in pairs(imglbls) do
if v2.datavalue.value.language == lang then
imglbl = v2.datavalue.value.text
break
end
end
end
end
end
end
return imglbl
else
return input_parm
end
end
Line 3,006 ⟶ 3,064:
-------------------------------------------------------------------------------
-- siteID returns the root of the globalSiteID
-- e.g. "
-- treats "en-gb" as "
-------------------------------------------------------------------------------
-- Dependencies: none
| |||