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:
parent
65295604a3
commit
45d2bff57a
@ -20,6 +20,7 @@ from app.classes.shared.helpers import helper
|
||||
from app.classes.shared.console import console
|
||||
from app.classes.shared.models import db_helper, Servers
|
||||
from app.classes.web.websocket_helper import websocket_helper
|
||||
from app.classes.shared.translation import translation
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -188,7 +189,7 @@ class Server:
|
||||
msg = "Server {} failed to start with error code: {}".format(self.name, ex)
|
||||
logger.error(msg)
|
||||
websocket_helper.broadcast('send_start_error', {
|
||||
'error': msg
|
||||
'error': translation.translate('error', 'start-error').format(self.name, ex)
|
||||
})
|
||||
return False
|
||||
if helper.check_internet():
|
||||
@ -198,11 +199,11 @@ class Server:
|
||||
})
|
||||
else:
|
||||
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:
|
||||
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",
|
||||
"terribleFailure": "What a Terrible Failure!",
|
||||
"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": {
|
||||
"contact": "Contact Crafty Control Support via Discord",
|
||||
|
@ -10,7 +10,10 @@
|
||||
"contact": "Ota yhteyttä Crafty Control -tukeen Discordin kautta",
|
||||
"terribleFailure": "Mikä kauhea epäonnistuminen!",
|
||||
"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": {
|
||||
"contact": "Ota yhteyttä Crafty Control -tukeen Discordin kautta",
|
||||
|
@ -10,7 +10,10 @@
|
||||
"contact": "Contacter le Support de Crafty Control via Discord",
|
||||
"terribleFailure": "C'est une Terrible Erreur !",
|
||||
"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": {
|
||||
"contact": "Contacter le Support de Crafty Control via Discord",
|
||||
|
Loading…
Reference in New Issue
Block a user