Module:Interlinear: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 20: Line 20:
GlossAbbrBoundary = "-.,;:<>‹›/\\~+=%?%s%[%]()%_\127'",
GlossAbbrBoundary = "-.,;:<>‹›/\\~+=%?%s%[%]()%_\127'",
GlossExcludeTable = {I = true,}, --strings not be treated as glossing abbreviations
GlossExcludeTable = {I = true,}, --strings not be treated as glossing abbreviations
GlossExcludePattern = '[0-9][0-9]+',
GlossExcludePattern = '^[0-9][0-9]+$', -- excludes strings consisting entirely of digits
GlossSmallCapsExclude = "^[AOPS]$", -- glossing abbreviations matching this pattern will not be rendered in small caps
GlossSmallCapsExclude = "^[AOPS]$", -- glossing abbreviations matching this pattern will not be rendered in small caps
GlossingType = "label", -- if set to "label" gloss abbreviations are formatted as an <abbr> with the "label" appearing in a tooltip
GlossingType = "label", -- if set to "label" gloss abbreviations are formatted as an <abbr> with the "label" appearing in a tooltip
-- if set to "wikilink" the abbreviation is formatted as a wikilink to the relevant wikipedia article
-- if set to "wikilink" the abbreviation is formatted as a wikilink to the relevant wikipedia article
-- if set to "none" abbreviations aren't formatted at all
-- if set to "none" abbreviations aren't formatted at all
ErrorCategory = "[[Category:Pages with errors in interlinear text]]",
AmbiguousGlossCategory = "[[Category:Articles with ambiguous glossing abbreviations]]",
MessageGlossingError = "Error(s) in interlinear glossing",
MessageGlossingError = "Error(s) in interlinear glossing",
combining_gender_numbers = "[0-9][0-9]?$", --e.g. G4 '4th gender' or CL7 'class 7'
combining_gender_numbers = "[0-9][0-9]?$", --e.g. G4 '4th gender' or CL7 'class 7'
Line 88: Line 90:
local function help_link (anchor)
local function help_link (anchor)
if anchor then
if anchor then
return " ([[" .. conf.ErrorHelpLocation .. "#" .. anchor .. "|help]])"
return " ([[w:" .. conf.ErrorHelpLocation .. "#" .. anchor .. "|help]])"
else return "" end
else return "" end
end
end
Line 215: Line 217:
end
end
if self.gloss_messages then
if self.gloss_messages then
div:wikitext("<p>  To change any of the following default expansions, see [[w:Template:Interlinear/doc#Custom abbreviations|the template's documentation]]:</p>")
div:wikitext("<p>  To change any of the following default expansions, see [[Template:Interlinear/doc#Custom abbreviations|the template's documentation]]:</p>")
end
end
for _,v in pairs(self.gloss_messages) do
for _,v in pairs(self.gloss_messages) do
Line 319: Line 321:
message = "assuming " .. gloss2 .. " means \"" .. abbr_label .. "\";" end
message = "assuming " .. gloss2 .. " means \"" .. abbr_label .. "\";" end
if glossing_type == "wikilink" and wikilink then
if glossing_type == "wikilink" and wikilink then
message = message .. " linking to [[w:" .. wikilink .. "|" .. wikilink "]];"
message = message .. " linking to [[" .. wikilink .. "]];"
end
end
msg:add("gloss_message", message, gloss)
msg:add("gloss_message", message, gloss)
Line 822: Line 824:
div:newline()
div:newline()
local temp_track = ""
local temp_track = ""
if last_line == 2
then temp_track = "[[Category:Pages with interlinear glosses using two unnamed parameters]]"
end
if last_line > 3 and template_name ~= 'Template:Fs interlinear'
then  temp_track = "[[Category:Pages with interlinear glosses using more than three unnamed parameters]]"
end
return tostring(div) .. temp_track .. msg:print_warnings()
return tostring(div) .. temp_track .. msg:print_warnings()
end
end


return p
return p