diff options
Diffstat (limited to 'doc/classes/EditorTranslationParserPlugin.xml')
-rw-r--r-- | doc/classes/EditorTranslationParserPlugin.xml | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml index 89746363d8..40b469de0a 100644 --- a/doc/classes/EditorTranslationParserPlugin.xml +++ b/doc/classes/EditorTranslationParserPlugin.xml @@ -27,27 +27,25 @@ [/gdscript] [csharp] using Godot; - using System; [Tool] - public class CustomParser : EditorTranslationParserPlugin + public partial class CustomParser : EditorTranslationParserPlugin { - public override void ParseFile(string path, Godot.Collections.Array msgids, Godot.Collections.Array msgidsContextPlural) + public override void _ParseFile(string path, Godot.Collections.Array<string> msgids, Godot.Collections.Array<Godot.Collections.Array> msgidsContextPlural) { - var file = new File(); - file.Open(path, File.ModeFlags.Read); + using var file = FileAccess.Open(path, FileAccess.ModeFlags.Read); string text = file.GetAsText(); - string[] splitStrs = text.Split(",", false); - foreach (var s in splitStrs) + string[] splitStrs = text.Split(",", allowEmpty: false); + foreach (string s in splitStrs) { msgids.Add(s); - //GD.Print("Extracted string: " + s) + //GD.Print($"Extracted string: {s}"); } } - public override Godot.Collections.Array GetRecognizedExtensions() + public override string[] _GetRecognizedExtensions() { - return new Godot.Collections.Array{"csv"}; + return new string[] { "csv" }; } } [/csharp] @@ -84,16 +82,16 @@ return ["gd"] [/gdscript] [csharp] - public override void ParseFile(string path, Godot.Collections.Array msgids, Godot.Collections.Array msgidsContextPlural) + public override void _ParseFile(string path, Godot.Collections.Array<string> msgids, Godot.Collections.Array<Godot.Collections.Array> msgidsContextPlural) { var res = ResourceLoader.Load<Script>(path, "Script"); string text = res.SourceCode; // Parsing logic. } - public override Godot.Collections.Array GetRecognizedExtensions() + public override string[] _GetRecognizedExtensions() { - return new Godot.Collections.Array{"gd"}; + return new string[] { "gd" }; } [/csharp] [/codeblocks] |