Skip to content
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

Parse auto_translate when generating a POT file #94622

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions editor/plugins/packed_scene_translation_parser_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ Error PackedSceneEditorTranslationParserPlugin::parse_file(const String &p_path,
bool auto_translating = true;
bool auto_translate_mode_found = false;
for (int j = 0; j < state->get_node_property_count(i); j++) {
if (state->get_node_property_name(i, j) != "auto_translate_mode") {
String property = state->get_node_property_name(i, j);
// If an old scene wasn't saved in the new version, the `auto_translate` property won't be converted into `auto_translate_mode`,
// so the deprecated property still needs to be checked as well.
// TODO: Remove the check for "auto_translate" once the property if fully removed.
if (property != "auto_translate_mode" && property != "auto_translate") {
continue;
}

Expand All @@ -84,9 +88,14 @@ Error PackedSceneEditorTranslationParserPlugin::parse_file(const String &p_path,
idx_last -= 1;
}

int auto_translate_mode = (int)state->get_node_property_value(i, j);
if (auto_translate_mode == Node::AUTO_TRANSLATE_MODE_DISABLED) {
auto_translating = false;
if (property == "auto_translate_mode") {
int auto_translate_mode = (int)state->get_node_property_value(i, j);
if (auto_translate_mode == Node::AUTO_TRANSLATE_MODE_DISABLED) {
auto_translating = false;
}
} else {
// TODO: Remove this once `auto_translate` is fully removed.
auto_translating = (bool)state->get_node_property_value(i, j);
}

atr_owners.push_back(Pair(state->get_node_path(i), auto_translating));
Expand Down
Loading