From 88bbe56467860d15f7cc5cfae4a688db536e2ac4 Mon Sep 17 00:00:00 2001 From: Rendo Date: Sun, 21 Dec 2025 02:56:55 +0500 Subject: [PATCH] Fixed version label not translating --- assets/translations/info.csv | 6 +++--- assets/translations/info.en.translation | Bin 674 -> 746 bytes assets/translations/info.ru.translation | Bin 873 -> 949 bytes gui/main_menu/version_label.gd | 14 +++++++++++--- systems/auto_update.gd | 12 ++++++------ 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/assets/translations/info.csv b/assets/translations/info.csv index 95cd18b..d906198 100644 --- a/assets/translations/info.csv +++ b/assets/translations/info.csv @@ -1,7 +1,7 @@ key,ru,en,ikg au_loading,Подгружаем данные с сервера…,Loading data from server…, -au_err_load,Ошибка загрузки данных: ,Error while loading data: , -au_err_install,Ошибка загрузки новой версии: ,Error while downloading new version: , +au_err_load,[color=red]Ошибка загрузки данных: {error}[/color] ,[color=red]Error while loading data: {error}[/color], +au_err_install,[color=red]Ошибка загрузки новой версии: {error}[/color],[color=red]Error while downloading new version: {error}[/color], au_new_version,Доступна новая версия!,New version available!, -au_current_version,У вас самая актуальная версия игры!,Your version is the current version!, +au_current_version,[color=green]У вас самая актуальная версия игры! [/color],[color=green]Your version is the current version! [/color], vr_version,Текущая версия игры: ,Game version: , diff --git a/assets/translations/info.en.translation b/assets/translations/info.en.translation index 2cc9f9222d9cef2f49473cc348600f51561ca515..3902be3177b45e7215dadd089264c96507c9aea2 100644 GIT binary patch delta 296 zcmZ3)`igbKB1T?a1_lOGAP)Q$5MMHRJ)?fTJygU2NHYO3BM^6-y%N<9q_u$98i;!) zc}?C3qZNRsoMJ#7ZSuy;B z2`y!F void: AutoUpdate.update_version_text.connect(update_version) - update_version(tr("au_loading")) + update_version("au_loading") -func update_version(version: StringName): - text = tr("vr_version") + preload("res://version.tres").version + "\n" + version +func update_version(version: StringName, new_error = -1): + status = version + error = new_error + text = tr("vr_version") + preload("res://version.tres").version + "\n" + tr(version).format({"error":error}) + +func _notification(what: int) -> void: + if what == NOTIFICATION_TRANSLATION_CHANGED: + text = tr("vr_version") + preload("res://version.tres").version + "\n" + tr(status).format({"error":error}) diff --git a/systems/auto_update.gd b/systems/auto_update.gd index b684782..e0eb7a4 100644 --- a/systems/auto_update.gd +++ b/systems/auto_update.gd @@ -5,7 +5,7 @@ var popup_scene: PackedScene = preload("uid://5goo8fyxkv33") var new_version_avaiable: bool var popup: ConfirmationDialog -signal update_version_text(to: StringName) +signal update_version_text(to: StringName,error: int) func _ready() -> void: request_completed.connect(on_request_completed) @@ -18,22 +18,22 @@ func _ready() -> void: patch_request.download_file = exec_dir.path_join("chelimbalo.pck") patch_request.request_completed.connect(patch_downloaded) - update_version_text.emit(tr("au_loading")) + update_version_text.emit("au_loading") request("https://2ndbeam.ru/durenije/chelimbalo/release/deploy_data") func on_request_completed(result: int, _response_code: int, _headers: PackedStringArray, body: PackedByteArray): if result != OK: - update_version_text.emit("[color=red]" + tr("au_err_load") + str(result) +"[/color]") + update_version_text.emit("au_err_load",result) return var ver_hash = body.get_string_from_ascii().split("\n")[1] if ver_hash != load("res://version.tres").version: - update_version_text.emit(tr("au_new_version")) + update_version_text.emit("au_new_version") popup.popup_centered() else: - update_version_text.emit("[color=green]"+tr("au_current_version")+"[/color]") + update_version_text.emit("au_current_version") func download_button_pressed() -> void: popup.get_node("HTTPRequest").request("https://2ndbeam.ru/durenije/chelimbalo/release/chelimbalo.pck") @@ -43,4 +43,4 @@ func patch_downloaded(result: int, _response_code: int, _headers: PackedStringAr OS.create_process(OS.get_executable_path(),OS.get_cmdline_args()) get_tree().quit() else: - update_version_text.emit("[color=red]" + tr("au_err_install") + str(result) +"[/color]") + update_version_text.emit("au_err_install",result)