feat: updated engine

This commit is contained in:
Sara Gerretsen 2026-07-10 17:04:34 +02:00
parent cbe99774ff
commit f4cf6b3999
6607 changed files with 910135 additions and 430025 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="EditorTranslationParserPlugin" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<class name="EditorTranslationParserPlugin" inherits="RefCounted" api_type="editor" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Plugin for adding custom parsers to extract strings that are to be translated from custom files (.csv, .json etc.).
</brief_description>
@ -98,11 +98,32 @@
}
[/csharp]
[/codeblocks]
Alternatively, the plugin can directly modify the final list of strings, by implementing [method _customize_strings].
To use [EditorTranslationParserPlugin], register it using the [method EditorPlugin.add_translation_parser_plugin] method first.
</description>
<tutorials>
</tutorials>
<methods>
<method name="_customize_strings" qualifiers="virtual const">
<return type="PackedStringArray[]" />
<param index="0" name="strings" type="PackedStringArray[]" />
<description>
Called after parsing all files. You can modify the [param strings] array to add or remove entries from the final list of strings, then return it after modifications. Each entry is a [PackedStringArray] like explained in the [EditorTranslationParserPlugin]'s description.
[codeblock]
@tool
extends EditorTranslationParserPlugin
func _customize_strings(strings):
# Add new string.
strings.append(["Test 1", "context", "test 1 plurals", "test 1 comment"])
# Remove all strings that begin with $.
strings = strings.filter(func(s): return not s[0].begins_with("$"))
return strings
[/codeblock]
</description>
</method>
<method name="_get_recognized_extensions" qualifiers="virtual const">
<return type="PackedStringArray" />
<description>