Module:Cat see also

require 'Module:No globals'

local p = {}

function p.main(frame) local args = require('Module:Arguments').getArgs(frame) frame = mw.getCurrentFrame local links = {} local linkformat = ' %s ' if args[1] == 'V' then local title = mw.title.getCurrentTitle.text if title:sub(1, 1) == 'V' then args[1] = 'In' .. mw.getContentLanguage:lcfirst(title) elseif title:sub(1, 1) == 'I' then args[1] = mw.getContentLanguage:ucfirst(title:sub(3)) else args[1] = nil end end for _, v in ipairs(args) do		table.insert(links, linkformat:format(v, v)) end

if not args.lang or not mw.language.isSupportedLanguage(args.lang) then -- use page language instead of user language on pages translated using the Translate extension if frame:callParserFunction('#translation', ) ~=  then args.lang = frame:preprocess('') else args.lang = frame:callParserFunction('int', 'lang') end end local fallbacks = mw.language.getFallbacksFor(args.lang) table.insert(fallbacks, 1, args.lang)

for _, lang in ipairs(fallbacks) do if mw.title.new('Template:Cat see also/i18n/' .. lang).exists then args.lang = lang break end end

args.list = require('Module:Linguistic').conj(links, args.lang, 'and') args.length = #links

return frame:expandTemplate{ title = 'Template:Cat see also/i18n/' .. args.lang, args = args } end

return p