Godot Engine – Multi-platform 2D and 3D game engine
.NET: Register C# translator plugin as standard to avoid overriding user plugins
Raul Santos9f57f3b7daac
diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.csindex 5a803324ab0..a7a771566cc 100644--- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs+++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs@@ -639,7 +639,7 @@ namespace GodotTools_inspectorPluginWeak = WeakRef(inspectorPlugin);// TranslationParser Plugin- AddTranslationParserPlugin(new CsTranslationParserPlugin());+ Internal.EditorTranslationParserAddParser(new CsTranslationParserPlugin());BuildManager.Initialize();diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.csindex 4c306158888..e8b54a079f0 100644--- a/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs+++ b/modules/mono/editor/GodotTools/GodotTools/Internals/Internal.cs@@ -54,6 +54,9 @@ namespace GodotTools.Internalspublic static void EditorDebuggerNodeReloadScripts() => godot_icall_Internal_EditorDebuggerNodeReloadScripts();+ public static void EditorTranslationParserAddParser(EditorTranslationParserPlugin translationParserPlugin) =>+ godot_icall_EditorTranslationParser_AddParser(translationParserPlugin.NativeInstance);+public static bool ScriptEditorEdit(Resource resource, int line, int col, bool grabFocus = true) =>godot_icall_Internal_ScriptEditorEdit(resource.NativeInstance, line, col, grabFocus);@@ -124,6 +127,8 @@ namespace GodotTools.Internalsint step,bool forceRefresh);+ public static partial void godot_icall_EditorTranslationParser_AddParser(IntPtr translationParserPlugin);+private static partial void godot_icall_Internal_FullExportTemplatesDir(out godot_string dest);private static partial bool godot_icall_Internal_IsMacOSAppBundleInstalled(in godot_string bundleId);diff --git a/modules/mono/editor/editor_internal_calls.cpp b/modules/mono/editor/editor_internal_calls.cppindex b7430560eb9..64eb5e4fd6c 100644--- a/modules/mono/editor/editor_internal_calls.cpp+++ b/modules/mono/editor/editor_internal_calls.cpp@@ -54,6 +54,7 @@#include "editor/script/script_editor_plugin.h"#include "editor/settings/editor_settings.h"#include "editor/themes/editor_scale.h"+#include "editor/translations/editor_translation_parser.h"#include "main/main.h"#ifdef GD_MONO_HOT_RELOAD@@ -105,6 +106,10 @@ bool godot_icall_EditorProgress_Step(const godot_string *p_task, const godot_strreturn EditorNode::progress_task_step(task, state, p_step, (bool)p_force_refresh);}+void godot_icall_EditorTranslationParser_AddParser(EditorTranslationParserPlugin *p_translation_parser_plugin) {+ EditorTranslationParser::get_singleton()->add_parser(p_translation_parser_plugin, EditorTranslationParser::STANDARD);+}+void godot_icall_Internal_FullExportTemplatesDir(godot_string *r_dest) {String full_templates_dir = EditorPaths::get_singleton()->get_export_templates_dir().path_join(GODOT_VERSION_FULL_CONFIG);memnew_placement(r_dest, String(full_templates_dir));@@ -266,6 +271,7 @@ static const void *unmanaged_callbacks[]{(void *)godot_icall_EditorProgress_Create,(void *)godot_icall_EditorProgress_Dispose,(void *)godot_icall_EditorProgress_Step,+ (void *)godot_icall_EditorTranslationParser_AddParser,(void *)godot_icall_Internal_FullExportTemplatesDir,(void *)godot_icall_Internal_IsMacOSAppBundleInstalled,(void *)godot_icall_Internal_LipOCreateFile,