Editing Module:PageRefGive feedback
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local lang_module = require("Module:Lang") | |||
local | |||
-- Generates appropriate filename from resource_name_localized | -- Generates appropriate filename from resource_name_localized | ||
| Line 26: | Line 13: | ||
file_name = resource_name_localized | file_name = resource_name_localized | ||
end | end | ||
-- Prefix with File namespace | |||
file_name = "File:" .. file_name | |||
local | -- Try to grab SVG if possible | ||
if | local svg_file_name = file_name .. ".svg" | ||
local png_file_name = file_name .. ".png" | |||
if mw.title.new(svg_file_name).exists then | |||
file_name = svg_file_name | |||
elseif mw.title.new(png_file_name).exists then | |||
file_name = png_file_name | |||
else | |||
file_name = "" | |||
end | end | ||
return file_name | return file_name | ||