پودمان:Main: تفاوت میان نسخه‌ها

۳۹ بایت اضافه‌شده ،  ‏۲۶ اوت ۲۰۲۱
جز
بدون خلاصۀ ویرایش
جز (۱ نسخه واردشده)
fa.wikipedia>Jeeputer
جزبدون خلاصۀ ویرایش
خط ۲۱: خط ۲۱:
local display = args['label ' .. k] or args['l' .. k]
local display = args['label ' .. k] or args['l' .. k]
local page = display and
local page = display and
string.format('%s|%s', string.gsub(v, '|.*$', ''), display) or v
mw.ustring.format('%s|%s', mw.ustring.gsub(v, '|.*$', ''), display) or v
pages[#pages + 1] = page
pages[#pages + 1] = page
end
end
خط ۴۳: خط ۴۳:
local currentTitle = mw.title.getCurrentTitle()
local currentTitle = mw.title.getCurrentTitle()
if #args == 0 then args = {currentTitle.text} end
if #args == 0 then args = {currentTitle.text} end
local firstPage = string.gsub(args[1], '|.*$', '')
local firstPage = mw.ustring.gsub(args[1], '|.*$', '')
-- Find the pagetype.
-- Find the pagetype.
local pageType = mHatnote.findNamespaceId(firstPage) == 0 and 'مقالهٔ' or 'صفحهٔ'
local pageType = mHatnote.findNamespaceId(firstPage) == 0 and 'مقالهٔ' or 'صفحهٔ'
خط ۵۴: خط ۵۴:
if (curNs == 14) or (curNs == 15) then --category/talk namespaces
if (curNs == 14) or (curNs == 15) then --category/talk namespaces
mainForm = isPlural and
mainForm = isPlural and
'The main %ss for this [[Help:Categories|category]] are %s.'
'%s‌های اصلی این [[راهنما:رده|رده]]، %s هستند.'
or
or
'The main %s for this [[Help:Categories|category]] is %s.'
'%s اصلی این [[راهنما:رده|رده]]، %s است.'
else
else
mainForm = isPlural and '%s اصلی: %s' or '%s اصلی: %s'
mainForm = isPlural and '%s اصلی: %s' or '%s اصلی: %s'
end
end
local text = string.format(mainForm, pageType, list)
local text = mw.ustring.format(mainForm, pageType, list)
-- Process the options and pass the text to the _rellink function in
-- Process the options and pass the text to the _rellink function in
-- [[Module:Hatnote]].
-- [[Module:Hatnote]].
کاربر ناشناس