From 90ed32738f77a28b5b7adf071c62d87c093b5735 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Thu, 30 Nov 2023 00:55:26 -0500 Subject: [PATCH] Add translations --- app/classes/controllers/servers_controller.py | 9 +++++++-- app/translations/en_EN.json | 10 +++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/classes/controllers/servers_controller.py b/app/classes/controllers/servers_controller.py index 5c4df789..57b3348d 100644 --- a/app/classes/controllers/servers_controller.py +++ b/app/classes/controllers/servers_controller.py @@ -13,6 +13,7 @@ from app.classes.shared.server import ServerInstance from app.classes.shared.console import Console from app.classes.shared.helpers import Helpers from app.classes.shared.main_models import DatabaseShortcuts +from app.classes.shared.translation import Translation from app.classes.minecraft.stats import Stats @@ -39,6 +40,7 @@ class ServersController(metaclass=Singleton): self.stats = Stats(self.helper, self) self.ws = WebSocketManager() self.server_subpage = {} + self.translation = Translation(self.helper) # ********************************************************************************** # Generic Servers Methods @@ -172,10 +174,13 @@ class ServersController(metaclass=Singleton): def init_all_servers(self): servers = self.get_all_defined_servers() self.failed_servers = [] - + init_trans = self.translation.translate( + "startup", "server", self.helper.get_setting("language") + ) for server in servers: self.ws.broadcast_to_admins( - "update", {"message": f"Initializing {server['server_name']}."} + "update", + {"message": f"{init_trans}{server['server_name']}."}, ) server_id = server.get("server_id") diff --git a/app/translations/en_EN.json b/app/translations/en_EN.json index 6db96dfc..c1168973 100644 --- a/app/translations/en_EN.json +++ b/app/translations/en_EN.json @@ -590,6 +590,14 @@ "newServer": "Create New Server", "servers": "Servers" }, + "startup": { + "serverInit": "Initializing Servers", + "server": "Initializing ", + "internet": "Checking for internet connection", + "tasks": "Starting Tasks Scheduler", + "internals": "Configuring and starting Crafty's internal componenets", + "almost": "Finishing up. Hang on tight..." + }, "userConfig": { "apiKey": "API Keys", "auth": "Authorized? ", @@ -655,4 +663,4 @@ "webhook_body": "Webhook Body", "webhooks": "Webhooks" } -} +} \ No newline at end of file