--[[
	
	Returns an english translation of time (integer)
	
	EX: 1800 = "30 Minutes"
	
	Functions.TimeString(
		time,					<-- |REQ| 	Time integer (tick, os.time)
	)
	
--]]




return function(t)
	--- Split up time to several segments
	local days = _L.Functions.Round(t / 60 / 60 / 24 - 0.5)
	local hours = _L.Functions.Round(t / 60 / 60 % 24 - 0.5)
	local minutes = _L.Functions.Round(t / 60 % 60 - 0.5)
	local seconds = _L.Functions.Round(t % 60)
	
	--- Final string to be returned
	local str = ""
	
	--- Convert to a translated string based on appropriate parameters
	if days >= 1 then
		str = days .. (days > 1 and " Days" or " Day")
	elseif hours >= 1 then
		str = hours .. (hours > 1 and " Hours" or " Hour")
	elseif minutes >= 1 then
		str = minutes .. (minutes > 1 and " Minutes" or " Minute")
	else
		str = seconds .. (seconds > 1 and " Seconds" or " Second")
	end
	
	--
	return str
end
