Module:IPA/overview: Difference between revisions

Content deleted Content added
sandbox
text
Line 12:
end
 
local function formatNameOrLinkaddNotes(internal, external, link, namenotes)
return #notes == 0 and '' or
local note
s = string.format('%s <small>(%s)</small>', stable.concat(notes, note'; '))
end
 
local function formatName(internal, external, text)
local notenotes = {}
if linkinternal then
if intTitleinternal ~== extTitleexternal then
table.insert(notes, 'redundant')
elseif external, then
table.insert(notes, string.format('overrides "%s"', external))
end
end
local s = internal or external
if notetext then
table.insert(notes, string.format('label: "%s"', text))
end
return s .. addNotes(notes)
end
 
local function formatLink(internal, external, name)
local notes = {}
local generated = not internal and name and name ~= '' and name .. ' language'
if internal or generated then
if (internal or generated) == external then
note =table.insert(notes, 'redundant')
elseif external then
local note = string.format('overrides [[%s]]', external)
local extTitleintTitle = mw.title.new(externalinternal or generated)
'overrides %s%s%s',
local intRedir = intTitle.redirectTarget
link and '[[' or '"',
intTitle = intRedir or intTitle
external,
local extTitle = mw.title.new(external)
link and ']]' or '"'
local extRedir = extTitle.redirectTarget
)
extTitle = extRedir or extTitle
if link then
localif intTitle ~= mw.title.new(internalextTitle or generated)then
note = note .. ', a different article'
local intRedir = intTitle.redirectTarget
intTitle = intRedir or intTitle
local extTitle = mw.title.new(external)
local extRedir = extTitle.redirectTarget
extTitle = extRedir or extTitle
if intTitle ~= extTitle then
note = note .. ', a different article'
end
end
table.insert(notes, note)
end
end
local s = generated or internal or external
s = generated and '([[' .. s .. ']])' or '[[' .. s .. ']]'
if link then
return s .. addNotes(notes)
s = generated and '([[' .. s .. ']])' or '[[' .. s .. ']]'
end
if note then
s = string.format('%s <small>(%s)</small>', s, note)
end
return s
end
 
Line 63 ⟶ 73:
table.insert(t, {
code = '<code>' .. code .. '</code>',
name = formatNameOrLinkformatName(lect.name, name, lect.text),
link = formatNameOrLinkformatLink(lect.link, link, true, lect.name),
key = lect.key and '[[' .. lect.key .. ']]'
or '([[' .. (parent and parent.key or data.defaultKey) .. ']])'