Difference between revisions of "Module:Languages"

From Team Fortress Wiki
Jump to: navigation, search
m
Line 2: Line 2:
  
 
function p.page(frame)
 
function p.page(frame)
return mw.title.getCurrentTitle()
+
return tostring(mw.title.getCurrentTitle())
 
end
 
end
  
 
function p.namespace(frame)
 
function p.namespace(frame)
return mw.title.getCurrentTitle().nsText
+
return tostring(mw.title.getCurrentTitle().nsText)
 
end
 
end
  

Revision as of 13:06, 11 February 2016

Documentation for this module may be created at Module:Languages/doc

local p = {}

function p.page(frame)
	return tostring(mw.title.getCurrentTitle())
end

function p.namespace(frame)
	return tostring(mw.title.getCurrentTitle().nsText)
end

function p.fullname(frame)
	return p.namespace(frame) .. ":" .. p.page(frame)
end	

function p.languages(frame)
	local languages = {'ar', 'cs', 'da', 'de', 'es', 'fi', 'fr', 'hu', 'it', 'ja', 'ko', 'nl', 'no', 'pl', 'pt', 'pt-br', 'ro', 'ru', 'sv', 'tr', 'zh-hans', 'zh-hant'}
end

return p