မေႃႇၵျူး:Pp-move-indef

လုၵ်ႉတီႈ ဝီႇၶီႇၽီးတီးယႃး ဢၼ်လွတ်ႈလႅဝ်းထၢင်ႇႁၢင်ႈ ၼၼ်ႉမႃး
Jump to navigation Jump to search

Documentation for this module may be created at မေႃႇၵျူး:Pp-move-indef/doc

-- This module implements [[Template:Pp-move-indef]].

local p = {}

function p.main(title)
	if type(title) == 'string' then
		title = mw.title.new(title)
	elseif type(title) ~= 'table' or not title.text or not title.getContent then
		-- The title parameter is absent or not a title object. It could be a
		-- frame object if we are being called from #invoke.
		title = mw.title.getCurrentTitle()
	end
	
	local level = title
		and title.protectionLevels
		and title.protectionLevels.move
		and title.protectionLevels.move[1]
	local namespace = title and title.namespace

	local category
	if level == 'sysop' or level == 'templateeditor' then
		if namespace == 2 or namespace == 3 then
			category = 'ၼႃႈလိၵ်ႈ တွၼ်ႈဢုပ်ႇၽူႈၸႂ်ႉတိုဝ်း လႄႈ ၽူႈၸႂ်ႉတိုဝ်း ဝီႇၶီႇၽီးတီးယႃး ဢၼ်ထုၵ်ႇႁႄႉၵင်ႈဝႆႉ လွင်ႈၶၢႆႉဢွင်ႈတီႈ'
		elseif namespace == 4 or namepace == 12 then
			category = 'ၼႃႈလိၵ်ႈပရေႃးၵျႅတ်ႉ ဝီႇၶီႇၽီးတီးယႃး ဢၼ်ထုၵ်ႇႁႄႉၵင်ႈဝႆႉ လွင်ႈၶၢႆႉဢွင်ႈတီႈ'
		elseif namespace == 100 then
			category = 'Wikipedia move-protected portals'
		elseif title.isTalkPage then
			category = 'ၼႃႈလိၵ်ႈတွၼ်ႈဢုပ်ႇၵုမ် ဝီႇၶီႇၽီးတီးယႃး ဢၼ်ထုၵ်ႇႁႄႉၵၼ်ဝႆႉ လွင်ႈၶၢႆႉဢွင်ႈတီႈ'
		else
			category = 'ၼႃႈလိၵ်ႈ ဝီႇၶီႇၽီးတီးယႃး ဢၼ်ထုၵ်ႇႁႄႉၵင်ႈဝႆႉဢမ်ႇမီးလွင်ႈမၵ်းၶၢၼ်း တွၼ်ႈတႃႇၶၢႆႉဢွင်ႈတီႈ'
		end
	else
		category = 'ၼႃႈလိၵ်ႈဝီႇၶီႇၽီးတီးယႃး ဢၼ်မီးလွင်ႈၽိတ်းပိူင်ႈ ထႅမ်းပလဵၵ်ႉလွင်ႈႁႄႉၵင်ႈ'
	end

	return string.format(
		'[[%s:%s|%s]]',
		mw.site.namespaces[14].name, -- "Category"
		category,
		title.text -- equivalent of {{PAGENAME}}
	)
end

return p