File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,12 @@ func _enter_tree():
48
48
_translation_plugin = BlockTranslationParserPlugin .new ()
49
49
add_translation_parser_plugin (_translation_plugin )
50
50
51
+ if TranslationServer .has_method (& "get_or_add_domain" ):
52
+ var tool_locale := TranslationServer .get_tool_locale ()
53
+ 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 )
56
+
51
57
# Remove unwanted class nodes from create node
52
58
old_feature_profile = EditorInterface .get_current_feature_profile ()
53
59
@@ -96,6 +102,10 @@ func _exit_tree():
96
102
print ("Old feature profile was removed and cannot be reverted to. Reverting to default." )
97
103
EditorInterface .set_current_feature_profile ("" )
98
104
105
+ if TranslationServer .has_method (& "get_or_add_domain" ):
106
+ var tx_domain := TranslationServer .get_or_add_domain (& "godot_block_coding" )
107
+ tx_domain .clear ()
108
+
99
109
100
110
func _ready ():
101
111
editor_inspector .connect ("edited_object_changed" , _on_editor_inspector_edited_object_changed )
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ func _get_tooltip(at_position: Vector2) -> String:
217
217
if not definition :
218
218
return ""
219
219
220
- var description_tx := TranslationServer . translate (definition .description )
220
+ var description_tx := tr (definition .description )
221
221
if definition .variant_type == Variant .Type .TYPE_NIL :
222
222
return description_tx
223
223
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ var undo_redo: EditorUndoRedoManager:
41
41
42
42
43
43
func _ready ():
44
+ if has_method (& "set_translation_domain" ):
45
+ set_translation_domain (& "godot_block_coding" )
46
+
44
47
_context .changed .connect (_on_context_changed )
45
48
46
49
_picker .block_picked .connect (_drag_manager .copy_picked_block_and_drag )
You can’t perform that action at this time.
0 commit comments