mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Adds translations to start error messages.
This commit is contained in:
@ -20,6 +20,7 @@ from app.classes.shared.helpers import helper
|
|||||||
from app.classes.shared.console import console
|
from app.classes.shared.console import console
|
||||||
from app.classes.shared.models import db_helper, Servers
|
from app.classes.shared.models import db_helper, Servers
|
||||||
from app.classes.web.websocket_helper import websocket_helper
|
from app.classes.web.websocket_helper import websocket_helper
|
||||||
|
from app.classes.shared.translation import translation
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -188,7 +189,7 @@ class Server:
|
|||||||
msg = "Server {} failed to start with error code: {}".format(self.name, ex)
|
msg = "Server {} failed to start with error code: {}".format(self.name, ex)
|
||||||
logger.error(msg)
|
logger.error(msg)
|
||||||
websocket_helper.broadcast('send_start_error', {
|
websocket_helper.broadcast('send_start_error', {
|
||||||
'error': msg
|
'error': translation.translate('error', 'start-error').format(self.name, ex)
|
||||||
})
|
})
|
||||||
return False
|
return False
|
||||||
if helper.check_internet():
|
if helper.check_internet():
|
||||||
@ -198,11 +199,11 @@ class Server:
|
|||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
websocket_helper.broadcast('send_start_error', {
|
websocket_helper.broadcast('send_start_error', {
|
||||||
'error': "We have detected port {} may not be open on the host network or a firewall is blocking it. Remote client connections to the server may be limited.".format(loc_server_port)
|
'error': translation.translate('error', 'closedPort').format(loc_server_port)
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
websocket_helper.broadcast('send_start_error', {
|
websocket_helper.broadcast('send_start_error', {
|
||||||
'error': "We have detected the machine running Crafty has no connection to the internet. Client connections to the server may be limited."
|
'error': translation.translate('error', 'internet')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,10 @@
|
|||||||
"contact": "Contact Crafty Control Support via Discord",
|
"contact": "Contact Crafty Control Support via Discord",
|
||||||
"terribleFailure": "What a Terrible Failure!",
|
"terribleFailure": "What a Terrible Failure!",
|
||||||
"embarassing": "Oh my, well, this is embarrassing.",
|
"embarassing": "Oh my, well, this is embarrassing.",
|
||||||
"error": "Error!"
|
"error": "Error!",
|
||||||
|
"start-error": "Server {} failed to start with error code: {}",
|
||||||
|
"closedPort": "We have detected port {} may not be open on the host network or a firewall is blocking it. Remote client connections to the server may be limited.",
|
||||||
|
"internet": "We have detected the machine running Crafty has no connection to the internet. Client connections to the server may be limited."
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"contact": "Contact Crafty Control Support via Discord",
|
"contact": "Contact Crafty Control Support via Discord",
|
||||||
|
@ -10,7 +10,10 @@
|
|||||||
"contact": "Ota yhteyttä Crafty Control -tukeen Discordin kautta",
|
"contact": "Ota yhteyttä Crafty Control -tukeen Discordin kautta",
|
||||||
"terribleFailure": "Mikä kauhea epäonnistuminen!",
|
"terribleFailure": "Mikä kauhea epäonnistuminen!",
|
||||||
"embarassing": "No, tämähän on noloa.",
|
"embarassing": "No, tämähän on noloa.",
|
||||||
"error": "Virhe!"
|
"error": "Virhe!",
|
||||||
|
"start-error": "Server {} failed to start with error code: {}",
|
||||||
|
"closedPort": "We have detected port {} may not be open on the host network or a firewall is blocking it. Remote client connections to the server may be limited.",
|
||||||
|
"internet": "We have detected the machine running Crafty has no connection to the internet. Client connections to the server may be limited."
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"contact": "Ota yhteyttä Crafty Control -tukeen Discordin kautta",
|
"contact": "Ota yhteyttä Crafty Control -tukeen Discordin kautta",
|
||||||
|
@ -10,7 +10,10 @@
|
|||||||
"contact": "Contacter le Support de Crafty Control via Discord",
|
"contact": "Contacter le Support de Crafty Control via Discord",
|
||||||
"terribleFailure": "C'est une Terrible Erreur !",
|
"terribleFailure": "C'est une Terrible Erreur !",
|
||||||
"embarassing": "Oulà, c'est embarrassant.",
|
"embarassing": "Oulà, c'est embarrassant.",
|
||||||
"error": "Erreur !"
|
"error": "Erreur !",
|
||||||
|
"start-error": "Server {} failed to start with error code: {}",
|
||||||
|
"closedPort": "We have detected port {} may not be open on the host network or a firewall is blocking it. Remote client connections to the server may be limited.",
|
||||||
|
"internet": "We have detected the machine running Crafty has no connection to the internet. Client connections to the server may be limited."
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"contact": "Contacter le Support de Crafty Control via Discord",
|
"contact": "Contacter le Support de Crafty Control via Discord",
|
||||||
|
Reference in New Issue
Block a user