Fix root auto-translate mode ignored for child nodes when generating POT #108772
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #108744
Currently, when trying to determine whether a node using
AUTO_TRANSLATE_MODE_INHERIT
should be extracted or not, if only one of the node's ancestors has an explicit auto-translate mode, then this record is unexpectedly ignored (see theidx_last > 0
below).godot/editor/translations/packed_scene_translation_parser_plugin.cpp
Lines 106 to 114 in 71a9948
I believe this is a copy-paste error. The
if
condition is copied from the block a few lines above:godot/editor/translations/packed_scene_translation_parser_plugin.cpp
Lines 85 to 89 in 71a9948
If I understand correctly, this code makes sure that the array acts as a stack, making the array only contain information about the current node's ancestor nodes. When switching tree branches, it removes the previous branch's data. Since the root node is always one of the ancestor nodes, skipping it makes sense here as an optimization.
CC @YeldhamDev