mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-17 08:15:42 +00:00
Compare commits
10 Commits
cb6adde7c2
...
f145048cc1
Author | SHA1 | Date | |
---|---|---|---|
f145048cc1 | |||
68bf7d0d00 | |||
e9815cdfcf | |||
acb2b45626 | |||
eb71fda356 | |||
cc400d5a12 | |||
67b3bd26bb | |||
77250561fb | |||
70dfb9b40c | |||
3118c74990 |
@ -1,3 +1,3 @@
|
||||
# MultiLanguage - i18n支持
|
||||
|
||||
在 [example.json](./example.json) 中是 [src/modules/i18n/files/ru.json](../../../src/modules/i18n/files/ru.json) 的副本。如果你想将其翻译成以前未翻译过的语言,或者更新现有的翻译,我将很高兴接受你的拉取请求。
|
||||
在 [example.json](./example.json) 中是 [src/modules/i18n/files/ru.json](../../../src/translates/ru.json) 的副本。如果你想将其翻译成以前未翻译过的语言,或者更新现有的翻译,我将很高兴接受你的拉取请求。
|
||||
|
@ -1,4 +1,4 @@
|
||||
# MultiLanguage - i18n Support
|
||||
|
||||
In [example.json](./example.json) you will find a copy of [src/modules/i18n/files/ru.json](../../../src/modules/i18n/files/ru.json).\
|
||||
In [example.json](./example.json) you will find a copy of [src/modules/i18n/files/ru.json](../../../src/translates/ru.json).\
|
||||
If you want to translate to a language that has not been translated before or update an existing translation, I would be happy to receive your pull requests.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# MultiLanguage - Поддержка i18n
|
||||
|
||||
В [example.json](./example.json) это копия [src/modules/i18n/files/ru.json](../../../src/modules/i18n/files/ru.json)\
|
||||
В [example.json](./example.json) это копия [src/modules/i18n/files/ru.json](../../../src/translates/ru.json)\
|
||||
Если есть желание перевести на не переведённый ранее язык, или обновить уже существующий перевод буду рад вашим пул реквестам.
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Developed by KuiToi Dev
|
||||
# File core.tcp_server.py
|
||||
# Written by: SantaSpeen
|
||||
# Core version: 0.4.3
|
||||
# Core version: 0.4.5
|
||||
# Licence: FPA
|
||||
# (c) kuitoi.su 2023
|
||||
import asyncio
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Developed by KuiToi Dev
|
||||
# File core.tcp_server.py
|
||||
# Written by: SantaSpeen
|
||||
# Core version: 0.4.3
|
||||
# Core version: 0.4.5
|
||||
# Licence: FPA
|
||||
# (c) kuitoi.su 2023
|
||||
import asyncio
|
||||
|
@ -1,8 +1,8 @@
|
||||
# Developed by KuiToi Dev
|
||||
# File core.__init__.py
|
||||
# Written by: SantaSpeen
|
||||
# Version 1.4
|
||||
# Core version: 0.4.3
|
||||
# Version 1.5
|
||||
# Core version: 0.4.5
|
||||
# Licence: FPA
|
||||
# (c) kuitoi.su 2023
|
||||
# Special thanks to: AI Sage(https://poe.com/Sage), AI falcon-40b-v7(https://OpenBuddy.ai)
|
||||
@ -10,8 +10,8 @@
|
||||
__title__ = 'KuiToi-Server'
|
||||
__description__ = 'BeamingDrive Multiplayer server compatible with BeamMP clients.'
|
||||
__url__ = 'https://github.com/kuitoi/kuitoi-Server'
|
||||
__version__ = '0.4.3'
|
||||
__build__ = 2125 # Я это считаю лог файлами
|
||||
__version__ = '0.4.5'
|
||||
__build__ = 2300 # Я это считаю лог файлами
|
||||
__author__ = 'SantaSpeen'
|
||||
__author_email__ = 'admin@kuitoi.su'
|
||||
__license__ = "FPA"
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Developed by KuiToi Dev
|
||||
# File core.core.py
|
||||
# Written by: SantaSpeen
|
||||
# Version: 0.4.3
|
||||
# Version: 0.4.5
|
||||
# Licence: FPA
|
||||
# (c) kuitoi.su 2023
|
||||
import asyncio
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Developed by KuiToi Dev
|
||||
# File core.core.pyi
|
||||
# Written by: SantaSpeen
|
||||
# Core version: 0.4.3
|
||||
# Core version: 0.4.5
|
||||
# Licence: FPA
|
||||
# (c) kuitoi.su 2023
|
||||
import asyncio
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Developed by KuiToi Dev
|
||||
# File core.tcp_server.py
|
||||
# Written by: SantaSpeen
|
||||
# Core version: 0.4.3
|
||||
# Core version: 0.4.5
|
||||
# Licence: FPA
|
||||
# (c) kuitoi.su 2023
|
||||
import asyncio
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Developed by KuiToi Dev
|
||||
# File core.tcp_server.pyi
|
||||
# Written by: SantaSpeen
|
||||
# Core version: 0.4.3
|
||||
# Core version: 0.4.5
|
||||
# Licence: FPA
|
||||
# (c) kuitoi.su 2023
|
||||
import asyncio
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Developed by KuiToi Dev
|
||||
# File core.udp_server.py
|
||||
# Written by: SantaSpeen
|
||||
# Core version: 0.4.3
|
||||
# Core version: 0.4.5
|
||||
# Licence: FPA
|
||||
# (c) kuitoi.su 2023
|
||||
import asyncio
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Developed by KuiToi Dev
|
||||
# File core.udp_server.py
|
||||
# Written by: SantaSpeen
|
||||
# Core version: 0.4.3
|
||||
# Core version: 0.4.5
|
||||
# Licence: FPA
|
||||
# (c) kuitoi.su 2023
|
||||
import asyncio
|
||||
|
@ -2,7 +2,7 @@
|
||||
# File core.utils.py
|
||||
# Written by: SantaSpeen
|
||||
# Version 1.1
|
||||
# Core version: 0.4.3
|
||||
# Core version: 0.4.5
|
||||
# Licence: FPA
|
||||
# (c) kuitoi.su 2023
|
||||
import datetime
|
||||
|
@ -25,7 +25,8 @@ class Config:
|
||||
"access_token": secrets.token_hex(16)}
|
||||
|
||||
def __repr__(self):
|
||||
return "%s(Auth=%r, Game=%r, Server=%r)" % (self.__class__.__name__, self.Auth, self.Game, self.Server)
|
||||
return f"{self.__class__.__name__}(Auth={self.Auth!r}, Game={self.Game!r}, Server={self.Server!r}, " \
|
||||
f"RCON={self.RCON!r}, Options={self.Options!r}, WebAPI={self.WebAPI!r})"
|
||||
|
||||
|
||||
class ConfigProvider:
|
||||
|
@ -15,7 +15,10 @@ from prompt_toolkit import PromptSession, print_formatted_text, HTML
|
||||
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
|
||||
from prompt_toolkit.completion import NestedCompleter
|
||||
from prompt_toolkit.history import FileHistory
|
||||
from prompt_toolkit.output.win32 import NoConsoleScreenBufferError
|
||||
try:
|
||||
from prompt_toolkit.output.win32 import NoConsoleScreenBufferError
|
||||
except AssertionError:
|
||||
class NoConsoleScreenBufferError(Exception): ...
|
||||
from prompt_toolkit.patch_stdout import patch_stdout
|
||||
|
||||
from core import get_logger
|
||||
|
@ -141,7 +141,7 @@ class EventsSystem:
|
||||
return funcs_data
|
||||
|
||||
def call_lua_event(self, event_name, *args):
|
||||
self.log.debug(f"Calling lua event: '{event_name}'")
|
||||
self.log.debug(f"Calling lua event: '{event_name} ({args})'")
|
||||
funcs_data = []
|
||||
if event_name in self.__lua_events.keys():
|
||||
for data in self.__lua_events[event_name]:
|
||||
|
@ -110,7 +110,7 @@ class MP:
|
||||
|
||||
def TriggerLocalEvent(self, event_name, *args):
|
||||
self.log.debug("request TriggerLocalEvent()")
|
||||
self.log.debug(f"Calling local lua event: '{event_name}'")
|
||||
self.log.debug(f"Calling local lua event: '{event_name} ({args})'")
|
||||
funcs_data = []
|
||||
if event_name in self._local_events.keys():
|
||||
for func_name in self._local_events[event_name]:
|
||||
@ -157,7 +157,7 @@ class MP:
|
||||
to_all = False
|
||||
if player_id < 0:
|
||||
to_all = True
|
||||
client = client[0]
|
||||
client = client[0] if len(client) > 0 else None
|
||||
if client and event_name and data:
|
||||
t = self.loop.create_task(client.send_event(event_name, data, to_all=to_all))
|
||||
self.tasks.append(t)
|
||||
@ -168,7 +168,7 @@ class MP:
|
||||
return False, "Can't found event_name or data"
|
||||
|
||||
def TriggerClientEventJson(self, player_id, event_name, data):
|
||||
self.log.debug("request TriggerClientEventJson()")
|
||||
self.log.debug(f"request TriggerClientEventJson({player_id, event_name, data})")
|
||||
data = self._lua.globals().Util.JsonEncode(data)
|
||||
self.TriggerClientEvent(player_id, event_name, data)
|
||||
|
||||
@ -232,7 +232,7 @@ class MP:
|
||||
|
||||
def GetPlayers(self):
|
||||
self.log.debug("request GetPlayers()")
|
||||
clients = ev.call_event("_get_players", cid=-1)
|
||||
clients = ev.call_event("_get_player", cid=-1)[0]
|
||||
return self._lua.table_from(clients)
|
||||
|
||||
def IsPlayerGuest(self, player_id) -> bool:
|
||||
@ -312,12 +312,18 @@ class Util:
|
||||
return {k: v for k, v in new_dict.items() if v is not None}
|
||||
|
||||
def JsonEncode(self, table):
|
||||
self.log.debug("requesting JsonEncode()")
|
||||
if all(isinstance(k, int) for k in table.keys()):
|
||||
data = self._recursive_list_encode(table)
|
||||
else:
|
||||
data = self._recursive_dict_encode(table)
|
||||
return json.dumps(data)
|
||||
data = {}
|
||||
try:
|
||||
self.log.debug("requesting JsonEncode()")
|
||||
if all(isinstance(k, int) for k in table.keys()):
|
||||
data = self._recursive_list_encode(table)
|
||||
else:
|
||||
data = self._recursive_dict_encode(table)
|
||||
except Exception as e:
|
||||
self.log.exception(e)
|
||||
data = json.dumps(data)
|
||||
self.log.debug(f"Encoded: {data}")
|
||||
return data
|
||||
|
||||
def JsonDecode(self, string):
|
||||
self.log.debug("requesting JsonDecode()")
|
||||
|
@ -8,6 +8,7 @@
|
||||
# (c) kuitoi.su 2023
|
||||
import builtins
|
||||
import json
|
||||
import os
|
||||
from json import JSONDecodeError
|
||||
|
||||
from core.utils import get_logger
|
||||
@ -25,135 +26,110 @@ class i18n:
|
||||
|
||||
class MultiLanguage:
|
||||
|
||||
def __init__(self, language: str = None, files_dir="modules/i18n/files/", encoding=None):
|
||||
def __init__(self, language: str = None, files_dir="translates/", encoding=None):
|
||||
if encoding is None:
|
||||
encoding = config.enc
|
||||
if language is None:
|
||||
language = "en"
|
||||
self.__data = {}
|
||||
self.__data = {
|
||||
"hello": "Hello from KuiToi-Server!",
|
||||
"config_path": "Use {} to configure.",
|
||||
"init_ok": "Initialization completed.",
|
||||
"start": "Server started!",
|
||||
"stop": "Server stopped!",
|
||||
"auth_need_key": "BeamMP key is required to run!",
|
||||
"auth_empty_key": "BeamMP key is empty!",
|
||||
"auth_cannot_open_browser": "Failed to open browser: {}",
|
||||
"auth_use_link": "Use this link: {}",
|
||||
"GUI_yes": "Yes",
|
||||
"GUI_no": "No",
|
||||
"GUI_ok": "OK",
|
||||
"GUI_cancel": "Cancel",
|
||||
"GUI_need_key_message": "BeamMP key is required to run!\nDo you want to open the link in your browser to get the key?",
|
||||
"GUI_enter_key_message": "Please enter the key:",
|
||||
"GUI_cannot_open_browser": "Failed to open browser.\nUse this link: {}",
|
||||
"web_start": "WebAPI started on {} (CTRL+C to stop)",
|
||||
"core_bind_failed": "Failed to bind port. Error: {}",
|
||||
"core_direct_mode": "Server started in direct connection mode.",
|
||||
"core_auth_server_error": "Received invalid response from BeamMP authentication server.",
|
||||
"core_auth_server_refused": "The BeamMP authentication server refused your key. Reason: {}",
|
||||
"core_auth_server_refused_no_reason": "The BeamMP authentication server did not provide a reason.",
|
||||
"core_auth_server_refused_direct_node": "The server is still running, but in direct connection mode.",
|
||||
"core_auth_server_no_response": "Failed to authenticate the server.",
|
||||
"core_mods_loaded": "Loaded {} mods. {}Mb",
|
||||
"core_identifying_connection": "Processing new connection...",
|
||||
"core_player_kick_outdated": "Incorrect version of BeamMP.",
|
||||
"core_player_kick_bad_key": "Invalid key passed!",
|
||||
"core_player_kick_invalid_key": "Invalid key! Please restart your game.",
|
||||
"core_player_kick_auth_server_fail": "BeamMP authentication server failed! Please try to connect again in 5 minutes.",
|
||||
"core_player_kick_stale": "Stale client. (Replaced by new connection)",
|
||||
"core_player_kick_no_allowed_default_reason": "You are not welcome on this server. Access denied.",
|
||||
"core_player_kick_server_full": "Server is full.",
|
||||
"core_player_set_id": "Player set ID {}",
|
||||
"core_identifying_okay": "Successful login.",
|
||||
"game_welcome_message": "Welcome {}!",
|
||||
"client_mod_request": "Requested mod: {}",
|
||||
"client_mod_sent": "Mod sent: Size: {}mb, Speed: {}Mb/s ({}sec)",
|
||||
"client_mod_sent_limit": " (limit {}Mb/s)",
|
||||
"client_mod_sent_error": "Error sending mod: {}",
|
||||
"client_sync_time": "Sync time {}sec.",
|
||||
"client_kicked": "Kicked for reason: \"{}\"",
|
||||
"client_event_invalid_data": "Invalid data returned from event: {}",
|
||||
"client_player_disconnected": "Left the server. Playtime: {} min",
|
||||
"events_not_callable": "Unable to add event \"{}\". Use \"{}\" instead. Skipping...",
|
||||
"events_not_found": "Event \"{}\" is not registered. Maybe {}? Skipping...",
|
||||
"events_calling_error": "Error calling \"{}\" in function \"{}\".",
|
||||
"events_lua_function_not_found": "Unable to call {}lua event - \"{}\" not found.",
|
||||
"events_lua_local": "local ",
|
||||
"events_lua_calling_error": "Error: \"{}\" - calling lua event \"{}\", function: \"{}\", arguments: {}",
|
||||
"plugins_not_found_load": "Function \"def load():\" not found.",
|
||||
"plugins_not_found_start": "Function \"def start():\" not found.",
|
||||
"plugins_not_found_unload": "Function \"def unload():\" not found.",
|
||||
"plugins_kt_invalid": "\"kt\" variable does not belong to the KuiToi class.",
|
||||
"plugins_invalid": "Plugin \"{}\" cannot be run in KuiToi.",
|
||||
"plugins_error_loading": "An error occurred while loading the plugin {}: {}",
|
||||
"plugins_lua_enabled": "You have enabled Lua plugin support.",
|
||||
"plugins_lua_nuances_warning": "There are some nuances when working with Kuiti. If you have a suggestion for their solution, and it is related to KuiToi, please contact the developer.",
|
||||
"plugins_lua_legacy_config_create_warning": "Some BeamMP plugins require a properly configured ServerConfig.toml file to function.",
|
||||
"plugins_lua_legacy_config_create": "Creating it.",
|
||||
"plugins_lua_unload": "Stopping Lua plugin: {}",
|
||||
"man_message_man": "man - Shows the help page for COMMAND.\nUsage: man COMMAND",
|
||||
"help_message_man": "Shows the help page for COMMAND.",
|
||||
"man_for": "Help page for",
|
||||
"man_message_not_found": "man: Help page not found.",
|
||||
"man_command_not_found": "man: Command \"{}\" not found!",
|
||||
"man_message_help": "help - Shows the names and brief descriptions of commands.\nUsage: help [--raw]\nThe `help` command displays a list of all available commands, with a brief description for each command.",
|
||||
"help_message_help": "Shows the names and brief descriptions of commands",
|
||||
"help_command": "Command",
|
||||
"help_message": "Text",
|
||||
"help_message_not_found": "No text found",
|
||||
"man_message_stop": "stop - Stops the server.\nUsage: stop",
|
||||
"help_message_stop": "Stops the server.",
|
||||
"man_message_exit": "exit - Stops the server.\nUsage: exit",
|
||||
"help_message_exit": "Stops the server."
|
||||
}
|
||||
self.__en_data = self.__data.copy()
|
||||
self.__i18n = None
|
||||
self.__encoding = encoding
|
||||
self.language = language
|
||||
if not os.path.exists(files_dir):
|
||||
os.makedirs(files_dir)
|
||||
if not os.path.exists(files_dir + "en.json"):
|
||||
with open(files_dir + "en.json", "w") as f:
|
||||
f.write(json.dumps(self.__en_data, indent=2))
|
||||
self.files_dir = files_dir
|
||||
self.log = get_logger("i18n")
|
||||
self.fi = False
|
||||
self.set_language(language)
|
||||
|
||||
def set_language(self, language):
|
||||
if language is None:
|
||||
language = "en"
|
||||
self.log.debug(f"set_language({language})")
|
||||
self.language = language
|
||||
if language != "en":
|
||||
self.open_file()
|
||||
def set_language(self, language="en"):
|
||||
if self.language == language and self.fi:
|
||||
return
|
||||
else:
|
||||
# noinspection PyDictDuplicateKeys
|
||||
self.__data = {
|
||||
"": "Basic phases",
|
||||
"hello": "Hello from KuiToi-Server!",
|
||||
"config_path": "Use {} to configure.",
|
||||
"init_ok": "Initialization completed.",
|
||||
"start": "Server started!",
|
||||
"stop": "Server stopped!",
|
||||
|
||||
"": "Server auth",
|
||||
"auth_need_key": "BeamMP key is required to run!",
|
||||
"auth_empty_key": "BeamMP key is empty!",
|
||||
"auth_cannot_open_browser": "Failed to open browser: {}",
|
||||
"auth_use_link": "Use this link: {}",
|
||||
|
||||
"": "GUI phases",
|
||||
"GUI_yes": "Yes",
|
||||
"GUI_no": "No",
|
||||
"GUI_ok": "OK",
|
||||
"GUI_cancel": "Cancel",
|
||||
"GUI_need_key_message": "BeamMP key is required to run!\nDo you want to open the link in your browser to get the key?",
|
||||
"GUI_enter_key_message": "Please enter the key:",
|
||||
"GUI_cannot_open_browser": "Failed to open browser.\nUse this link: {}",
|
||||
|
||||
"": "Web phases",
|
||||
"web_start": "WebAPI started on {} (CTRL+C to stop)",
|
||||
|
||||
"": "Core phrases",
|
||||
"core_bind_failed": "Failed to bind port. Error: {}",
|
||||
"core_direct_mode": "Server started in direct connection mode.",
|
||||
"core_auth_server_error": "Received invalid response from BeamMP authentication server.",
|
||||
"core_auth_server_refused": "The BeamMP authentication server refused your key. Reason: {}",
|
||||
"core_auth_server_refused_no_reason": "The BeamMP authentication server did not provide a reason.",
|
||||
"core_auth_server_refused_direct_node": "The server is still running, but in direct connection mode.",
|
||||
"core_auth_server_no_response": "Failed to authenticate the server.",
|
||||
"core_mods_loaded": "Loaded {} mods. {}Mb",
|
||||
"core_identifying_connection": "Processing new connection...",
|
||||
"core_player_kick_outdated": "Incorrect version of BeamMP.",
|
||||
"core_player_kick_bad_key": "Invalid key passed!",
|
||||
"core_player_kick_invalid_key": "Invalid key! Please restart your game.",
|
||||
"core_player_kick_auth_server_fail": "BeamMP authentication server failed! Please try to connect again in 5 minutes.",
|
||||
"core_player_kick_stale": "Stale client. (Replaced by new connection)",
|
||||
"core_player_kick_no_allowed_default_reason": "You are not welcome on this server. Access denied.",
|
||||
"core_player_kick_server_full": "Server is full.",
|
||||
"core_player_set_id": "Player set ID {}",
|
||||
"core_identifying_okay": "Successful login.",
|
||||
|
||||
"": "In-game phrases",
|
||||
"game_welcome_message": "Welcome {}!",
|
||||
|
||||
"": "Client class phrases",
|
||||
"client_mod_request": "Requested mod: {}",
|
||||
"client_mod_sent": "Mod sent: Size: {}mb, Speed: {}Mb/s ({}sec)",
|
||||
"client_mod_sent_limit": " (limit {}Mb/s)",
|
||||
"client_mod_sent_error": "Error sending mod: {}",
|
||||
"client_sync_time": "Sync time {}sec.",
|
||||
"client_kicked": "Kicked for reason: \"{}\"",
|
||||
"client_event_invalid_data": "Invalid data returned from event: {}",
|
||||
"client_player_disconnected": "Left the server. Playtime: {} min",
|
||||
|
||||
"": "Events system",
|
||||
|
||||
"events_not_callable": "Unable to add event \"{}\". Use \"{}\" instead. Skipping...",
|
||||
"events_not_found": "Event \"{}\" is not registered. Maybe {}? Skipping...",
|
||||
"events_calling_error": "Error calling \"{}\" in function \"{}\".",
|
||||
"events_lua_function_not_found": "Unable to call {}lua event - \"{}\" not found.",
|
||||
"events_lua_local": "local ",
|
||||
"events_lua_calling_error": "Error: \"{}\" - calling lua event \"{}\", function: \"{}\", arguments: {}",
|
||||
|
||||
"": "Plugins loader",
|
||||
|
||||
"plugins_not_found_load": "Function \"def load():\" not found.",
|
||||
"plugins_not_found_start": "Function \"def start():\" not found.",
|
||||
"plugins_not_found_unload": "Function \"def unload():\" not found.",
|
||||
"plugins_kt_invalid": "\"kt\" variable does not belong to the KuiToi class.",
|
||||
"plugins_invalid": "Plugin \"{}\" cannot be run in KuiToi.",
|
||||
"plugins_error_loading": "An error occurred while loading the plugin {}: {}",
|
||||
|
||||
"": "Lua plugins loader",
|
||||
|
||||
"plugins_lua_enabled": "You have enabled Lua plugin support.",
|
||||
"plugins_lua_nuances_warning": "There are some nuances when working with Kuiti. If you have a suggestion for their solution, and it is related to KuiToi, please contact the developer.",
|
||||
"plugins_lua_legacy_config_create_warning": "Some BeamMP plugins require a properly configured ServerConfig.toml file to function.",
|
||||
"plugins_lua_legacy_config_create": "Creating it.",
|
||||
"plugins_lua_unload": "Stopping Lua plugin: {}",
|
||||
|
||||
"": "Command: man",
|
||||
"man_message_man": "man - Shows the help page for COMMAND.\nUsage: man COMMAND",
|
||||
"help_message_man": "Shows the help page for COMMAND.",
|
||||
"man_for": "Help page for",
|
||||
"man_message_not_found": "man: Help page not found.",
|
||||
"man_command_not_found": "man: Command \"{}\" not found!",
|
||||
|
||||
"": "Command: help",
|
||||
"man_message_help": "help - Shows the names and brief descriptions of commands.\nUsage: help [--raw]\nThe `help` command displays a list of all available commands, with a brief description for each command.",
|
||||
"help_message_help": "Shows the names and brief descriptions of commands",
|
||||
"help_command": "Command",
|
||||
"help_message": "Text",
|
||||
"help_message_not_found": "No text found",
|
||||
|
||||
"": "Command: stop",
|
||||
"man_message_stop": "stop - Stops the server.\nUsage: stop",
|
||||
"help_message_stop": "Stops the server.",
|
||||
|
||||
"": "Command: exit",
|
||||
"man_message_exit": "exit - Stops the server.\nUsage: exit",
|
||||
"help_message_exit": "Stops the server."
|
||||
}
|
||||
self.fi = True
|
||||
self.log.debug(f"set_language({language})")
|
||||
self.language = language
|
||||
self.open_file()
|
||||
self.__i18n = i18n(self.__data)
|
||||
|
||||
def open_file(self):
|
||||
@ -165,9 +141,9 @@ class MultiLanguage:
|
||||
return
|
||||
except JSONDecodeError:
|
||||
self.log.error(
|
||||
f"Localisation \"{self.language}.json\" have JsonDecodeError. Using default localisation: en.")
|
||||
f"Localisation \"{file}\" have JsonDecodeError. Using default localisation: en.")
|
||||
except FileNotFoundError:
|
||||
self.log.warning(f"Localisation \"{self.language}.json\" not found; Using default localisation: en.")
|
||||
self.log.warning(f"Localisation \"{file}\" not found; Using default localisation: en.")
|
||||
self.set_language("en")
|
||||
|
||||
def builtins_hook(self) -> None:
|
||||
|
@ -1,6 +1,6 @@
|
||||
# pip install pyinstaller-versionfile
|
||||
# create-version-file win-metadata.yml --outfile win-ver_info.txt
|
||||
Version: 0.4.3
|
||||
Version: 0.4.5
|
||||
CompanyName: KuiToi
|
||||
FileDescription: KuiToi Server
|
||||
InternalName: KuiToi Server
|
||||
|
Loading…
x
Reference in New Issue
Block a user