ماڊيول:Redirect-distinguish
ڏيک
| هي سانچو لوا استعمال ڪري ٿو: |
ھي {{redirect-distinguish}} کي عمل ۾ آڻي ٿو.
پڻ ڏسو
local mHatnote = require('ماڊيول:Hatnote')
local mHatlist = require('ماڊيول:Hatnote list')
local mArguments --initialize lazily
local mTableTools = require('ماڊيول:TableTools')
local p = {}
function p.redirectDistinguish (frame)
mArguments = require('ماڊيول:Arguments')
local args = mArguments.getArgs(frame)
return p._redirectDistinguish(args)
end
function p._redirectDistinguish(args)
if not args[1] then
return mHatnote.makeWikitextError(
'ڪو ريڊائريڪٽ فراهم نه ڪيو ويو آھي',
'سانچو:Redirect-distinguish',
args.category
)
end
local redirectTitle = mw.title.new(args[1])
local currentTitle = currentTitle or mw.title.getCurrentTitle()
if
string.match(args[1], 'REDIRECT%d+') or
args[1] == 'TERM' or
currentTitle.namespace ~= 0
then
-- ڪجھ به نه ڪريو
elseif not redirectTitle or not redirectTitle.exists then
args[1] = args[1] .. '[[زمرو:غائب ريڊائريڪٽ]]'
elseif not redirectTitle.isRedirect then
if string.find(redirectTitle:getContent(), '#invoke:RfD') then
args[1] = args[1] ..
'[[زمرو:ريڊائريڪٽ ھيٽ نوٽن وارا مضمون جيڪي RfD کان متاثر آھن]]'
else
args[1] = args[1] ..
'[[زمرو:ريڊائريڪٽ ھيٽ نوٽن وارا مضمون جن کي جائزي جي ضرورت آھي]]'
end
end
if not args[2] then
return mHatnote.makeWikitextError(
'فرق ڪرڻ لاءِ ڪو صفحو فراهم نه ڪيو ويو آھي',
'سانچو:Redirect-distinguish',
args.category
)
end
args = mTableTools.compressSparseArray(args)
-- ھتي removal ذريعي assignment بعد ۾ آسان concatenation لاءِ آھي
local redirect = table.remove(args, 1)
local text = string.format(
'"%s" ھتي ريڊائريڪٽ ٿئي ٿو؛ ان کي %s سان غلط نہ سمجھيو وڃي.',
redirect,
mHatlist.orList(args, true)
)
return mHatnote._hatnote(text)
end
return p