Přeskočit na obsah

Modul:Language

Z Wikicitátů

Dokumentaci tohoto modulu lze vytvořit na stránce Nápověda:Modul:Language

-- @brief
--  Language utilities.
-- 
-- @author
--  [[meta:User:Danny B.]]
local Language = {}
----------------------------------------


local Languages = require( "Module:Languages" )


-- @brief
--  Gets the language direction by its code.
-- 
-- @param
--  String code Language code
-- 
-- @return
--  String Language direction
--  nil If language code is unknown
function Language.getDirection( code )
	
	return Languages[code] and Languages[code].dir or nil
	
end


-- @brief
--  Gets the language name by its code.
-- 
-- @param
--  String code Language code
-- 
-- @return
--  String Language name
--  nil If language code is unknown
function Language.getName( code )
	
	return Languages[code] and Languages[code].name or nil
	
end


----------------------------------------
return Language