Mô đun:Đổi hướng-phân biệt

local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments --initialize lazily
local mTableTools = require('Module:TableTools')
local p = {}

function p.redirectDistinguish (frame)
	mArguments = require('Module:Arguments')
	local args = mArguments.getArgs(frame)
	return p._redirectDistinguish(args)
end

function p._redirectDistinguish(args)
	if not args[1] then
		return mHatnote.makeWikitextError(
			'không có chuyển hướng được cung cấp',
			'Template:Redirect-distinguish',
			args.category
		)
	end
	local redirectTitle = mw.title.new(args[1])
	if redirectTitle and redirectTitle.exists then
		if not redirectTitle.isRedirect then
			args[1] = args[1] .. '[[Thể loại: Bài viết có chú thích chuyển hướng cần xem xét]]'
		end
	elseif not string.match(args[1], 'REDIRECT%d+') and not args[1] == 'TERM' then
		args[1] = args[1] .. '[[Thể loại:Thiếu chuyển hướng]]'
	end
	if not args[2] then
		return mHatnote.makeWikitextError(
			'không có trang nào được phân biệt',
			'Template:Redirect-distinguish',
			args.category
		)
	end
	args = mTableTools.compressSparseArray(args)
	--Assignment by removal here makes for convenient concatenation later
	local redirect = table.remove(args, 1)
	local text = string.format(
		'"%s" chuyển hướng đến đây. Đừng nhầm lẫn với %s.',
		redirect,
		mHatlist.orList(args, true)
	)
	return mHatnote._hatnote(text)
end

return p
Chúng tôi bán
Bài viết liên quan
Nhân vật Tokitou Muichirou - Kimetsu no Yaiba
Nhân vật Tokitou Muichirou - Kimetsu no Yaiba
Tokito Muichiro「時透 無一郎 Tokitō Muichirō​​」là Hà Trụ của Sát Quỷ Đội. Cậu là hậu duệ của Thượng Huyền Nhất Kokushibou và vị kiếm sĩ huyền thoại Tsugikuni Yoriichi.
Sơ lược về Dune - Hành Tinh Cát
Sơ lược về Dune - Hành Tinh Cát
Công tước Leto của Gia tộc Atreides – người cai trị hành tinh đại dương Caladan – đã được Hoàng đế Padishah Shaddam Corrino IV giao nhiệm vụ thay thế Gia tộc Harkonnen cai trị Arrakis.
Tất cả kết truyện với Yun Jin - Genshin Impact
Tất cả kết truyện với Yun Jin - Genshin Impact
Tổng hợp tất cả các kết truyện khi hẹn hò với Yun Jin
Nhân vật Ryuunosuke - Sakurasou No Pet Na Kanojo
Nhân vật Ryuunosuke - Sakurasou No Pet Na Kanojo
Akasaka Ryuunosuke (赤坂 龍之介 - Akasaka Ryūnosuke) là bệnh nhân cư trú tại phòng 102 của trại Sakurasou. Cậu là học sinh năm hai của cao trung Suiko (trực thuộc đại học Suimei).