Skip to content

Commit 23afc7d

Browse files
committed
make it pre-4.4 compatible
1 parent 4fec40e commit 23afc7d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

addons/block_code/block_code_plugin.gd

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ func _enter_tree():
5151
if TranslationServer.has_method(&"get_or_add_domain"):
5252
var tool_locale := TranslationServer.get_tool_locale()
5353
var tx := TranslationServer.get_translation_object(tool_locale)
54-
var tx_domain := TranslationServer.get_or_add_domain(&"godot_block_coding")
55-
tx_domain.add_translation(tx)
54+
var tx_domain = TranslationServer.call(&"get_or_add_domain", &"godot_block_coding")
55+
if tx_domain:
56+
tx_domain.call(&"add_translation", tx)
5657

5758
# Remove unwanted class nodes from create node
5859
old_feature_profile = EditorInterface.get_current_feature_profile()
@@ -103,8 +104,9 @@ func _exit_tree():
103104
EditorInterface.set_current_feature_profile("")
104105

105106
if TranslationServer.has_method(&"get_or_add_domain"):
106-
var tx_domain := TranslationServer.get_or_add_domain(&"godot_block_coding")
107-
tx_domain.clear()
107+
var tx_domain = TranslationServer.call(&"get_or_add_domain", &"godot_block_coding")
108+
if tx_domain:
109+
tx_domain.call(&"clear")
108110

109111

110112
func _ready():

addons/block_code/ui/main_panel.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var undo_redo: EditorUndoRedoManager:
4242

4343
func _ready():
4444
if has_method(&"set_translation_domain"):
45-
set_translation_domain(&"godot_block_coding")
45+
call(&"set_translation_domain", &"godot_block_coding")
4646

4747
_context.changed.connect(_on_context_changed)
4848

0 commit comments

Comments
 (0)