Module:oyen-contionary-utils: Difference between revisions

m
this has to work (not)
m (...please)
m (this has to work (not))
Line 3: Line 3:


local m = {}
local m = {}
local function repl(param)
  if param == "info" then
    return mw.getContentLanguage():ucfirst("")
  end
  return "—"
end


function m.setup_entry(frame)
function m.setup_entry(frame)
Line 22: Line 30:


   if reconstructed then
   if reconstructed then
     mw_src = mw_src .. "{{Template:Reconstructed}}"
     mw_src = mw_src .. "{{Reconstructed}}"
   end
   end


Line 37: Line 45:
   mw_src = mw_src .. string.format("<h3>%s</h3>", word_type)
   mw_src = mw_src .. string.format("<h3>%s</h3>", word_type)


   mw_src = mw_src .. "<b>{{Template:PAGENAME}}</b><br>"
   mw_src = mw_src .. "<b>{{PAGENAME}}</b><br>"


   return mw_src
   return mw_src
Line 79: Line 87:
   local mw_src = table.concat(wikicode, "\n")
   local mw_src = table.concat(wikicode, "\n")


   return mw_src
   return mw.ustring.gsub(mw_src, "{{{([a-z0-9_]+)}}}", repl)
end
end


209

edits