Skip to content

Commit 4d3d3ce

Browse files
committed
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. #397
1 parent 6c43f58 commit 4d3d3ce

File tree

1 file changed

+1
-1
lines changed
  • addons/block_code/ui/blocks/block

1 file changed

+1
-1
lines changed

addons/block_code/ui/blocks/block/block.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func _get_format_string() -> String:
129129
if not definition:
130130
return ""
131131

132-
if definition.property_name:
132+
if definition.property_name and TranslationServer.has_method(&"get_or_add_domain"):
133133
var domain: TranslationDomain = TranslationServer.get_or_add_domain("godot.properties")
134134
var translated_property: String = domain.translate(definition.property_name.capitalize())
135135
# TODO: Ideally we should be also passing the context. See:

0 commit comments

Comments
 (0)