From 4d3d3ce4a2e02d7008d32ee92080c4cf3ed03c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= Date: Mon, 23 Jun 2025 13:57:44 -0300 Subject: [PATCH] Block: Translate property only if possible The TranslationServer.get_or_add_domain() method was added in Godot 4.4, but the addon may still work in Godot 4.3 if we disable property translations when the method isn't present. https://github.com/endlessm/godot-block-coding/discussions/397 --- addons/block_code/ui/blocks/block/block.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/block_code/ui/blocks/block/block.gd b/addons/block_code/ui/blocks/block/block.gd index 9972cdfb..6a006174 100644 --- a/addons/block_code/ui/blocks/block/block.gd +++ b/addons/block_code/ui/blocks/block/block.gd @@ -129,7 +129,7 @@ func _get_format_string() -> String: if not definition: return "" - if definition.property_name: + if definition.property_name and TranslationServer.has_method(&"get_or_add_domain"): var domain: TranslationDomain = TranslationServer.get_or_add_domain("godot.properties") var translated_property: String = domain.translate(definition.property_name.capitalize()) # TODO: Ideally we should be also passing the context. See: