-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Editor] Fix parsing translations in EditorTranslationParserPlugin
#99297
base: master
Are you sure you want to change the base?
[Editor] Fix parsing translations in EditorTranslationParserPlugin
#99297
Conversation
To illustrate the issue, this is the signature of the related virtual void _parse_file(const String &p_path, const TypedArray<String> &p_msgids, const TypedArray<Array> &p_msgids_context_plural); Haven't generated the headers for the current state but |
I'm not familiar with the GDExtension issue, but it looks good to me as long as
|
That makes sense, will test some alternatives for deprecation and update as needed I'm not familiar enough with the code here to say if merging the two methods into one is feasible, but if it is might merging the two, dropping The new method could be That way we could possibly detect if Would depend on if we consider deprecation worth it, unsure what happens in other languages but it is possible to use it in godot-cpp but requires casting, I don't know how it works in C# though so confirming how the current methods work or don't work for plugins made in C# would be good It does seem that these cases do work with plugins in GDScript so that's a reason to deprecate over entirely replacing, but will test with GDScript soon to confirm |
I haven't tested personally but since Arrays in C# are reference types I imagine they may work. #99195 uses the method so, assuming the PR works, it would prove that the method works in C#. Also, how is the GDExtension validation not complaining about breaking compatibility? Does it not check virtual methods? |
I guess it depends on how we handle other cases in #92175. Yes, the fact that it seems to work in GDScript and C# is an argument for deprecation instead of removal/replacement. However, I don't think |
I'll see about some options today for this and #92175 |
Will try investigate this properly this week Edit: haven't been able to find the time to investigate this yet but will try next week |
Bump :) This seems to be important to merge before 4.4, as IIUC it's fixing the return type of a newly exposed function. |
Agreed, will try get to this before the end of the week! |
Working on this and testing out making a new |
Gotten it to work, and works correctly with existing code and plugins, just tested the plugin in GDScript so couldn't test the deprecation The one question is if we keep Edit: Will update the documentation after we've decided on a solution |
ae2d0ec
to
9ae23f4
Compare
EditorTranslationParserPlugin._get_comments
EditorTranslationParserPlugin
Method used passed arguments as return data which does not work with extensions, switched to using a `Dictionary` return.
9ae23f4
to
7d041eb
Compare
Method used passed arguments as return data which does not work with extensions, switched to using a
Dictionary
return. This might work in extensions after fixing typed array copying, but unsure, and I think this return format is safer in any case to use, and is the standard in most of the virtual methods like this (also any binding for this will have to useconst_cast
as the resulting methods will pass asconst TypedArray<String> &
)Follow-up to:
TRANSLATORS:
andNO_TRANSLATE
comments #98099See also: