Added new translations;

Added new event;
This commit is contained in:
2023-07-26 00:32:11 +03:00
parent 658f9ed9c6
commit d8c667ff51
9 changed files with 254 additions and 222 deletions

View File

@@ -31,6 +31,8 @@ class EventsSystem:
"onCarDelete": [],
"onCarEdited": [],
"onCarReset": [],
""
"onCarFocusMove": [],
"onSentPing": [], # Only sync
"onChangePosition": [], # Only sync
"onPlayerDisconnect": [],

View File

@@ -1,48 +1,70 @@
{
"": "基阶段",
"hello": "来自KuiToi服务器的问候!",
"config_path": "使用{}进行配置。",
"": "基阶段",
"hello": "来自 KuiToi-Server 的问候!",
"config_path": "使用 {} 进行配置。",
"init_ok": "初始化完成。",
"start": "服务器已启动!",
"stop": "服务器已停止!",
"": "服务器认证",
"auth_need_key": "需要BeamMP密钥才能启动",
"auth_empty_key": "BeamMP密钥为空",
"auth_cannot_open_browser": "无法打开浏览器{}",
"auth_use_link": "使用此链接{}",
"auth_need_key": "启动需要 BeamMP 密钥!",
"auth_empty_key": "BeamMP 密钥为空!",
"auth_cannot_open_browser": "无法打开浏览器: {}",
"auth_use_link": "使用此链接: {}",
"": "GUI阶段",
"": "GUI 阶段",
"GUI_yes": "是",
"GUI_no": "否",
"GUI_ok": "确定",
"GUI_ok": "好的",
"GUI_cancel": "取消",
"GUI_need_key_message": "需要BeamMP密钥才能启动\n是否在浏览器中打开链接以获取密钥",
"GUI_enter_key_message": "请输入密钥",
"GUI_cannot_open_browser": "无法打开浏览器。\n使用此链接{}",
"GUI_need_key_message": "启动需要 BeamMP 密钥!\n是否在浏览器中打开链接以获取密钥?",
"GUI_enter_key_message": "请输入密钥:",
"GUI_cannot_open_browser": "无法打开浏览器。\n使用此链接: {}",
"": "Web阶段",
"web_start": "WebAPI已启动{}CTRL+C停止",
"": "Web 阶段",
"web_start": "WebAPI 已启动 {} (按 CTRL+C 停止)",
"": "命令man",
"man_message_man": "man - 显示COMMAND的帮助页面。\n用法man COMMAND",
"help_message_man": "显示COMMAND的帮助页面。",
"": "核心短语",
"core_direct_mode": "服务器以直接连接模式启动。",
"core_auth_server_error": "从 BeamMP 认证服务器收到不正确的响应。",
"core_auth_server_refused": "BeamMP 认证服务器拒绝您的密钥。原因: {}",
"core_auth_server_refused_no_reason": "BeamMP 认证服务器未提供原因。",
"core_auth_server_refused_direct_node": "服务器仍在运行,但以直接连接模式运行。",
"core_auth_server_no_response": "认证服务器无响应。",
"core_mods_loaded": "{} 个模组已加载。{}Mb",
"": "游戏短语",
"game_player_kicked": "因为 \"{}\" 被踢出游戏。",
"game_welcome_message": "欢迎 {}!",
"": "客户端短语",
"client_mod_request": "请求模组: {}",
"client_mod_sent": "发送模组: 大小: {}mb, 速度: {}Mb/s ({}秒)",
"client_mod_sent_limit": " (限制 {}Mb/s)",
"client_mod_sent_error": "发送模组时出错: {}",
"client_sync_time": "同步时间 {}秒。",
"client_event_invalid_data": "从事件返回的数据无效: {}",
"client_player_disconnected": "已从服务器断开连接。游戏时间: {} 分钟。",
"": "命令: man",
"man_message_man": "man - 显示 COMMAND 的帮助页面。\n用法man COMMAND",
"help_message_man": "显示 COMMAND 的帮助页面。",
"man_for": "帮助页面",
"man_message_not_found": "man找不到帮助页面。",
"man_command_not_found": "man找不到\"{}\"命令",
"man_message_not_found": "man: 找不到帮助页面。",
"man_command_not_found": "man: 找不到命令\"{}\"",
"": "命令help",
"man_message_help": "help - 显示命令的名称和简描述。\n用法help [--raw]\n命令`help`列出所有可用命令,并为每个命令提供简短描述。",
"help_message_help": "显示命令的名称和简描述。",
"": "命令: help",
"man_message_help": "help - 显示命令的名称和简描述。\n用法help [--raw]\n`help` 命令显示所有可用命令的列表以及每个命令的简要描述。",
"help_message_help": "显示命令的名称和简描述。",
"help_command": "命令",
"help_message": "文本",
"help_message_not_found": "文本",
"help_message_not_found": "找不到文本",
"": "命令stop",
"man_message_stop": "stop - 关闭服务器。\n用法stop",
"help_message_stop": "关闭服务器。",
"": "命令: stop",
"man_message_stop": "stop - 停止服务器。\n用法stop",
"help_message_stop": "停止服务器。",
"": "命令exit",
"man_message_exit": "exit - 关闭服务器。\n用法exit",
"help_message_exit": "关闭服务器。"
"": "命令: exit",
"man_message_exit": "exit - 停止服务器。\n用法exit",
"help_message_exit": "停止服务器。"
}

View File

@@ -1,42 +1,64 @@
{
"": "Basic phases",
"hello": "Greetings from KuiToi Server!",
"config_path": "Use {} to configure.",
"init_ok": "Initialization complete.",
"hello": "Hello from KuiToi-Server!",
"config_path": "Use {} for configuration.",
"init_ok": "Initialization completed.",
"start": "Server started!",
"stop": "Server stopped!",
"": "Server auth",
"auth_need_key": "A BeamMP key is required to start the server!",
"auth_empty_key": "The BeamMP key is empty!",
"auth_need_key": "A BeamMP key is required to start!",
"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_ok": "OK",
"GUI_cancel": "Cancel",
"GUI_need_key_message": "A BeamMP key is required to start the server!\nDo you want to open the link in a browser to obtain the key?",
"GUI_need_key_message": "A BeamMP key is required to start!\nDo you want to open the link in your browser to obtain 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 at {} (Press CTRL+C to quit)",
"web_start": "WebAPI started on {} (CTRL+C to stop)",
"": "Core phrases",
"core_direct_mode": "Server started in direct connection mode.",
"core_auth_server_error": "Incorrect response received from BeamMP authentication server.",
"core_auth_server_refused": "BeamMP authentication server rejected your key. Reason: {}",
"core_auth_server_refused_no_reason": "BeamMP authentication server did not provide a reason.",
"core_auth_server_refused_direct_node": "Server is still running, but in direct connection mode.",
"core_auth_server_no_response": "Failed to authenticate the server.",
"core_mods_loaded": "{} mods loaded. {}Mb",
"": "In-game phrases",
"game_player_kicked": "Kicked for reason: \"{}\"",
"game_welcome_message": "Welcome {}!",
"": "Client class phrases",
"client_mod_request": "Mod requested: {}",
"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_event_invalid_data": "Invalid data returned from event: {}",
"client_player_disconnected": "Disconnected from the server. Game time: {} min.",
"": "Command: man",
"man_message_man": "man - Displays help page for COMMAND.\nUsage: man COMMAND",
"help_message_man": "Displays help page for COMMAND.",
"man_message_man": "man - Shows help page for COMMAND.\nUsage: man COMMAND",
"help_message_man": "Shows help page for COMMAND.",
"man_for": "Help page for",
"man_message_not_found": "man: Help page not found.",
"man_message_not_found": "man: No help page found.",
"man_command_not_found": "man: Command \"{}\" not found!",
"": "Command: help",
"man_message_help": "help - Displays the names and short descriptions of commands.\nUsage: help [--raw]\nThe `help` command displays a list of all available commands and a brief description of each command.",
"help_message_help": "Displays the names and short descriptions of commands.",
"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 and a brief description for each command.",
"help_message_help": "Shows the names and brief descriptions of commands.",
"help_command": "Command",
"help_message": "Description",
"help_message_not_found": "No description available.",
"help_message": "Text",
"help_message_not_found": "No text found.",
"": "Command: stop",
"man_message_stop": "stop - Stops the server.\nUsage: stop",

View File

@@ -24,6 +24,28 @@
"": "Web phases",
"web_start": "WebAPI запустился на {} (CTRL+C для выключения)",
"": "Core phrases",
"core_direct_mode": "Сервер запушен в режиме прямого подключения.",
"core_auth_server_error": "Поступил не корректный ответ от сервером авторизации BeamMP.",
"core_auth_server_refused": "Сервер авторизации BeamMP отклонил ваш ключ. Причина: {}",
"core_auth_server_refused_no_reason": "Сервер авторизации BeamMP не сообщил причины.",
"core_auth_server_refused_direct_node": "Сервер всё ещё работает, но в режиме прямого подключения.",
"core_auth_server_no_response": "Не получилось авторизовать сервер.",
"core_mods_loaded": "Загружено {} модов. {}Мб",
"": "In-game phrases",
"game_player_kicked": "Кикнут по причине: \"{}\"",
"game_welcome_message": "Добро пожаловать {}!",
"": "Client class phrases",
"client_mod_request": "Запрошен мод: {}",
"client_mod_sent": "Мод отправлен: Вес: {}мб, Скорость: {}Мб/с ({}сек)",
"client_mod_sent_limit": " (лимит {}Мб/с)",
"client_mod_sent_error": "Ошибка при отправке мода: {}",
"client_sync_time": "Время синхронизации {}сек.",
"client_event_invalid_data": "Из ивента вернулись не верные данные: {}",
"client_player_disconnected": "Вышел с сервера. Время игры: {} мин",
"": "Command: man",
"man_message_man": "man - Показывает страничку помощи для COMMAND.\nИспользование: man COMMAND",
"help_message_man": "Показывает страничку помощи для COMMAND.",

View File

@@ -1,93 +1,72 @@
class i18n:
# Basic phases
hello: str = data["hello"]
config_path: str = data["config_path"]
init_ok: str = data["init_ok"]
start: str = data["start"]
stop: str = data["stop"]
hello: str
config_path: str
init_ok: str
start: str
stop: str
# Server auth
auth_need_key: str = data["auth_need_key"]
auth_empty_key: str = data["auth_empty_key"]
auth_cannot_open_browser: str = data["auth_cannot_open_browser"]
auth_use_link: str = data["auth_use_link"]
auth_need_key: str
auth_empty_key: str
auth_cannot_open_browser: str
auth_use_link: str
# GUI phases
GUI_yes: str = data["GUI_yes"]
GUI_no: str = data["GUI_no"]
GUI_ok: str = data["GUI_ok"]
GUI_cancel: str = data["GUI_cancel"]
GUI_need_key_message: str = data["GUI_need_key_message"]
GUI_enter_key_message: str = data["GUI_enter_key_message"]
GUI_cannot_open_browser: str = data["GUI_cannot_open_browser"]
GUI_yes: str
GUI_no: str
GUI_ok: str
GUI_cancel: str
GUI_need_key_message: str
GUI_enter_key_message: str
GUI_cannot_open_browser: str
# Web phases
web_start: str = data["web_start"]
web_start: str
# Core phrases
core_direct_mode: str
core_auth_server_error: str
core_auth_server_refused: str
core_auth_server_refused_no_reason: str
core_auth_server_refused_direct_node: str
core_auth_server_no_response: str
core_mods_loaded: str
# In-game phrases
game_player_kicked: str
game_welcome_message: str
# Client class phrases
client_mod_request: str
client_mod_sent: str
client_mod_sent_limit: str
client_mod_sent_error: str
client_sync_time: str
client_event_invalid_data: str
client_player_disconnected: str
# Command: man
man_message_man: str = data["man_message_man"]
help_message_man: str = data["help_message_man"]
man_for: str = data["man_for"]
man_message_not_found: str = data["man_message_not_found"]
man_command_not_found: str = data["man_command_not_found"]
man_message_man: str
help_message_man: str
man_for: str
man_message_not_found: str
man_command_not_found: str
# Command: help
man_message_help: str = data["man_message_help"]
help_message_help: str = data["help_message_help"]
help_command: str = data["help_command"]
help_message: str = data["help_message"]
help_message_not_found: str = data["help_message_not_found"]
man_message_help: str
help_message_help: str
help_command: str
help_message: str
help_message_not_found: str
# Command: stop
man_message_stop: str = data["man_message_stop"]
help_message_stop: str = data["help_message_stop"]
man_message_stop: str
help_message_stop: str
# Command: exit
man_message_exit: str = data["man_message_exit"]
help_message_exit: str = data["help_message_exit"]
data = {
"": "Basic phases",
"hello": "Hello from KuiToi-Server!",
"config_path": "Use {} for config.",
"init_ok": "Initializing ready.",
"start": "Server started!",
"stop": "Goodbye!",
"": "Server auth",
"auth_need_key": "BEAM key needed for starting the server!",
"auth_empty_key": "Key is empty!",
"auth_cannot_open_browser": "Cannot 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": "BEAM key needed for starting the server!\nDo you need to open the web link to obtain the key?",
"GUI_enter_key_message": "Please type your key:",
"GUI_cannot_open_browser": "Cannot open browser.\nUse this link: {}",
"": "Command: man",
"man_message_man": "man - display the manual page for COMMAND.\nUsage: man COMMAND",
"help_message_man": "Display the manual page for COMMAND.",
"man_for": "Manual for command",
"man_message_not_found": "man: Manual message not found.",
"man_command_not_found": "man: command \"{}\" not found!",
"": "Command: help",
"man_message_help": "help - display names and brief descriptions of available commands.\nUsage: help [--raw]\nThe `help` command displays a list of all available commands along with a brief description of each command.",
"help_message_help": "Display names and brief descriptions of available commands",
"help_command": "Command",
"help_message": "Help message",
"help_message_not_found": "No help message found",
"": "Command: stop",
"man_message_stop": "stop - Just shutting down the server.\nUsage: stop",
"help_message_stop": "Server shutdown.",
"": "Command: exit",
"man_message_exit": "exit - Just shutting down the server.\nUsage: stop",
"help_message_exit": "Server shutdown."
}
man_message_exit: str
help_message_exit: str

View File

@@ -14,56 +14,13 @@ from core.utils import get_logger
class i18n:
data = {}
def __init__(self, data):
# Basic phases
self.hello: str = data["hello"]
self.config_path: str = data["config_path"]
self.init_ok: str = data["init_ok"]
self.start: str = data["start"]
self.stop: str = data["stop"]
i18n.data = data
# Server auth
self.auth_need_key: str = data["auth_need_key"]
self.auth_empty_key: str = data["auth_empty_key"]
self.auth_cannot_open_browser: str = data["auth_cannot_open_browser"]
self.auth_use_link: str = data["auth_use_link"]
# GUI phases
self.GUI_yes: str = data["GUI_yes"]
self.GUI_no: str = data["GUI_no"]
self.GUI_ok: str = data["GUI_ok"]
self.GUI_cancel: str = data["GUI_cancel"]
self.GUI_need_key_message: str = data["GUI_need_key_message"]
self.GUI_enter_key_message: str = data["GUI_enter_key_message"]
self.GUI_cannot_open_browser: str = data["GUI_cannot_open_browser"]
# Web phases
self.web_start: str = data["web_start"]
# Command: man
self.man_message_man: str = data["man_message_man"]
self.help_message_man: str = data["help_message_man"]
self.man_for: str = data["man_for"]
self.man_message_not_found: str = data["man_message_not_found"]
self.man_command_not_found: str = data["man_command_not_found"]
# Command: help
self.man_message_help: str = data["man_message_help"]
self.help_message_help: str = data["help_message_help"]
self.help_command: str = data["help_command"]
self.help_message: str = data["help_message"]
self.help_message_not_found: str = data["help_message_not_found"]
# Command: help
self.man_message_stop: str = data["man_message_stop"]
self.help_message_stop: str = data["help_message_stop"]
# Command: exit
self.man_message_exit: str = data["man_message_exit"]
self.help_message_exit: str = data["help_message_exit"]
self.data = data
def __getattribute__(self, key):
return i18n.data[key]
class MultiLanguage:
@@ -92,43 +49,65 @@ class MultiLanguage:
# noinspection PyDictDuplicateKeys
self.__data = {
"": "Basic phases",
"hello": "Greetings from KuiToi Server!",
"config_path": "Use {} to configure.",
"init_ok": "Initialization complete.",
"hello": "Hello from KuiToi-Server!",
"config_path": "Use {} for configuration.",
"init_ok": "Initialization completed.",
"start": "Server started!",
"stop": "Server stopped!",
"": "Server auth",
"auth_need_key": "A BeamMP key is required to start the server!",
"auth_empty_key": "The BeamMP key is empty!",
"auth_need_key": "A BeamMP key is required to start!",
"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_ok": "OK",
"GUI_cancel": "Cancel",
"GUI_need_key_message": "A BeamMP key is required to start the server!\nDo you want to open the link in a browser to obtain the key?",
"GUI_need_key_message": "A BeamMP key is required to start!\nDo you want to open the link in your browser to obtain 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 at {} (Press CTRL+C to quit)",
"web_start": "WebAPI started on {} (CTRL+C to stop)",
"": "Core phrases",
"core_direct_mode": "Server started in direct connection mode.",
"core_auth_server_error": "Incorrect response received from BeamMP authentication server.",
"core_auth_server_refused": "BeamMP authentication server rejected your key. Reason: {}",
"core_auth_server_refused_no_reason": "BeamMP authentication server did not provide a reason.",
"core_auth_server_refused_direct_node": "Server is still running, but in direct connection mode.",
"core_auth_server_no_response": "Failed to authenticate the server.",
"core_mods_loaded": "{} mods loaded. {}Mb",
"": "In-game phrases",
"game_player_kicked": "Kicked for reason: \"{}\"",
"game_welcome_message": "Welcome {}!",
"": "Client class phrases",
"client_mod_request": "Mod requested: {}",
"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_event_invalid_data": "Invalid data returned from event: {}",
"client_player_disconnected": "Disconnected from the server. Game time: {} min.",
"": "Command: man",
"man_message_man": "man - Displays help page for COMMAND.\nUsage: man COMMAND",
"help_message_man": "Displays help page for COMMAND.",
"man_message_man": "man - Shows help page for COMMAND.\nUsage: man COMMAND",
"help_message_man": "Shows help page for COMMAND.",
"man_for": "Help page for",
"man_message_not_found": "man: Help page not found.",
"man_message_not_found": "man: No help page found.",
"man_command_not_found": "man: Command \"{}\" not found!",
"": "Command: help",
"man_message_help": "help - Displays the names and short descriptions of commands.\nUsage: help [--raw]\nThe `help` command displays a list of all available commands and a brief description of each command.",
"help_message_help": "Displays the names and short descriptions of commands.",
"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 and a brief description for each command.",
"help_message_help": "Shows the names and brief descriptions of commands.",
"help_command": "Command",
"help_message": "Description",
"help_message_not_found": "No description available.",
"help_message": "Text",
"help_message_not_found": "No text found.",
"": "Command: stop",
"man_message_stop": "stop - Stops the server.\nUsage: stop",