otclient-redemption/modules/corelib/net.lua

17 lines
701 B
Lua
Raw Permalink Normal View History

2013-02-27 16:24:32 -03:00
function translateNetworkError(errcode, connecting, errdesc)
2021-07-19 19:24:59 -03:00
local text
if errcode == 111 then
2022-04-29 23:14:24 -03:00
text = tr('Connection refused, the server might be offline or restarting.\nPlease try again later.')
2021-07-19 19:24:59 -03:00
elseif errcode == 110 then
2022-04-29 23:14:24 -03:00
text = tr('Connection timed out. Either your network is failing or the server is offline.')
2021-07-19 19:24:59 -03:00
elseif errcode == 1 then
text = tr('Connection failed, the server address does not exist.')
elseif connecting then
text = tr('Connection failed.')
else
2022-04-29 23:14:24 -03:00
text = tr('Your connection has been lost.\nEither your network or the server went down.')
2021-07-19 19:24:59 -03:00
end
text = text .. ' ' .. tr('(ERROR %d)', errcode)
return text
2013-02-27 16:24:32 -03:00
end