Fixed version label not translating

This commit is contained in:
Rendo 2025-12-21 02:56:55 +05:00
commit 88bbe56467
5 changed files with 20 additions and 12 deletions

View file

@ -1,10 +1,18 @@
extends RichTextLabel
var status: StringName = "au_loading"
var error: int
func _ready() -> 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})