1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

[Editor] Fix return of EditorTranslationParserPlugin._parse_file

Merged `_get_comments` into `_parse_file` and changed to using a
returned `Array[PackedStringArray]` instead.
This commit is contained in:
A Thousand Ships
2024-11-15 20:19:00 +01:00
committed by AThousandShips
parent e567f49cbb
commit fec3d9e68c
9 changed files with 82 additions and 111 deletions

View File

@@ -43,11 +43,7 @@ class GDScriptEditorTranslationParserPlugin : public EditorTranslationParserPlug
const HashMap<int, GDScriptTokenizer::CommentData> *comment_data = nullptr;
Vector<String> *ids = nullptr;
Vector<Vector<String>> *ids_ctx_plural = nullptr;
Vector<String> ids_comment;
Vector<String> ids_ctx_plural_comment;
Vector<Vector<String>> *translations = nullptr;
// List of patterns used for extracting translation strings.
StringName tr_func = "tr";
@@ -81,8 +77,7 @@ class GDScriptEditorTranslationParserPlugin : public EditorTranslationParserPlug
void _extract_fd_filter_array(const GDScriptParser::ExpressionNode *p_expression);
public:
virtual Error parse_file(const String &p_path, Vector<String> *r_ids, Vector<Vector<String>> *r_ids_ctx_plural) override;
virtual void get_comments(Vector<String> *r_ids_comment, Vector<String> *r_ids_ctx_plural_comment) override;
virtual Error parse_file(const String &p_path, Vector<Vector<String>> *r_translations) override;
virtual void get_recognized_extensions(List<String> *r_extensions) const override;
GDScriptEditorTranslationParserPlugin();