From 8819651847e0a51cad699aed76bb3f4470f69866 Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 29 Dec 2025 00:34:56 +0100 Subject: [PATCH] Fix some invalid translation usages --- editor/inspector/editor_resource_picker.cpp | 2 +- editor/project_manager/project_dialog.cpp | 2 +- editor/project_manager/project_manager.cpp | 2 +- editor/scene/3d/node_3d_editor_plugin.cpp | 12 ++++----- editor/settings/editor_settings_dialog.cpp | 2 +- .../editor/data_viewers/refcounted_view.cpp | 8 +++--- .../editor/data_viewers/shared_controls.cpp | 4 +-- .../editor/data_viewers/summary_view.cpp | 26 +++++++++---------- .../editor/objectdb_profiler_panel.cpp | 4 +-- 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/editor/inspector/editor_resource_picker.cpp b/editor/inspector/editor_resource_picker.cpp index 106028b646..cb6baf63f1 100644 --- a/editor/inspector/editor_resource_picker.cpp +++ b/editor/inspector/editor_resource_picker.cpp @@ -331,7 +331,7 @@ void EditorResourcePicker::_update_menu_items() { if (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) { modifier = "Cmd"; } - const String drag_and_drop_text = vformat(TTRC("Hold %s while drag-and-dropping from the FileSystem dock or another resource picker to automatically make a dropped resource unique."), modifier); + const String drag_and_drop_text = vformat(TTR("Hold %s while drag-and-dropping from the FileSystem dock or another resource picker to automatically make a dropped resource unique."), modifier); if (!unique_enabled) { if (EditorNode::get_singleton()->is_resource_internal_to_scene(edited_resource) && EditorNode::get_singleton()->get_resource_count(edited_resource) == 1) { diff --git a/editor/project_manager/project_dialog.cpp b/editor/project_manager/project_dialog.cpp index d0a0607e7d..4640eb6dd7 100644 --- a/editor/project_manager/project_dialog.cpp +++ b/editor/project_manager/project_dialog.cpp @@ -1159,7 +1159,7 @@ ProjectDialog::ProjectDialog() { rd_not_supported = memnew(Label); rd_not_supported->set_focus_mode(Control::FOCUS_ACCESSIBILITY); - rd_not_supported->set_text(vformat(TTRC("RenderingDevice-based methods not available on this GPU:\n%s\nPlease use the Compatibility renderer."), RenderingServer::get_singleton()->get_video_adapter_name())); + rd_not_supported->set_text(vformat(TTR("RenderingDevice-based methods not available on this GPU:\n%s\nPlease use the Compatibility renderer."), RenderingServer::get_singleton()->get_video_adapter_name())); rd_not_supported->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); rd_not_supported->set_custom_minimum_size(Size2(200, 0) * EDSCALE); rd_not_supported->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); diff --git a/editor/project_manager/project_manager.cpp b/editor/project_manager/project_manager.cpp index b93d35b2f6..af6ea9b250 100644 --- a/editor/project_manager/project_manager.cpp +++ b/editor/project_manager/project_manager.cpp @@ -1096,7 +1096,7 @@ void ProjectManager::_set_new_tag_name(const String p_name) { for (const String &c : forbidden_tag_characters) { if (p_name.contains(c)) { - tag_error->set_text(vformat(TTRC("These characters are not allowed in tags: %s."), String(" ").join(forbidden_tag_characters))); + tag_error->set_text(vformat(TTR("These characters are not allowed in tags: %s."), String(" ").join(forbidden_tag_characters))); return; } } diff --git a/editor/scene/3d/node_3d_editor_plugin.cpp b/editor/scene/3d/node_3d_editor_plugin.cpp index 624051f537..b357c95d80 100644 --- a/editor/scene/3d/node_3d_editor_plugin.cpp +++ b/editor/scene/3d/node_3d_editor_plugin.cpp @@ -3437,18 +3437,18 @@ void Node3DEditorViewport::_notification(int p_what) { if (show_info) { const String viewport_size = vformat(U"%d × %d", viewport->get_size().x * viewport->get_scaling_3d_scale(), viewport->get_size().y * viewport->get_scaling_3d_scale()); String text; - text += vformat(TTR("X: %s\n"), rtos(current_camera->get_position().x).pad_decimals(1)); - text += vformat(TTR("Y: %s\n"), rtos(current_camera->get_position().y).pad_decimals(1)); - text += vformat(TTR("Z: %s\n"), rtos(current_camera->get_position().z).pad_decimals(1)); + text += vformat(TTR("X: %s"), rtos(current_camera->get_position().x).pad_decimals(1)) + "\n"; + text += vformat(TTR("Y: %s"), rtos(current_camera->get_position().y).pad_decimals(1)) + "\n"; + text += vformat(TTR("Z: %s"), rtos(current_camera->get_position().z).pad_decimals(1)) + "\n"; text += "\n"; text += vformat( - TTR("Size: %s (%.1fMP)\n"), + TTR("Size: %s (%.1fMP)") + "\n", viewport_size, viewport->get_size().x * viewport->get_size().y * Math::pow(viewport->get_scaling_3d_scale(), 2) * 0.000001); text += "\n"; - text += vformat(TTR("Objects: %d\n"), viewport->get_render_info(Viewport::RENDER_INFO_TYPE_VISIBLE, Viewport::RENDER_INFO_OBJECTS_IN_FRAME)); - text += vformat(TTR("Primitives: %d\n"), viewport->get_render_info(Viewport::RENDER_INFO_TYPE_VISIBLE, Viewport::RENDER_INFO_PRIMITIVES_IN_FRAME)); + text += vformat(TTR("Objects: %d"), viewport->get_render_info(Viewport::RENDER_INFO_TYPE_VISIBLE, Viewport::RENDER_INFO_OBJECTS_IN_FRAME)) + "\n"; + text += vformat(TTR("Primitives: %d"), viewport->get_render_info(Viewport::RENDER_INFO_TYPE_VISIBLE, Viewport::RENDER_INFO_PRIMITIVES_IN_FRAME)) + "\n"; text += vformat(TTR("Draw Calls: %d"), viewport->get_render_info(Viewport::RENDER_INFO_TYPE_VISIBLE, Viewport::RENDER_INFO_DRAW_CALLS_IN_FRAME)); info_label->set_text(text); diff --git a/editor/settings/editor_settings_dialog.cpp b/editor/settings/editor_settings_dialog.cpp index a13a573d1e..ab9fad9ec1 100644 --- a/editor/settings/editor_settings_dialog.cpp +++ b/editor/settings/editor_settings_dialog.cpp @@ -784,7 +784,7 @@ Variant EditorSettingsDialog::get_drag_data_fw(const Point2 &p_point, Control *p return Variant(); } - String label_text = vformat(TTRC("Event %d"), selected->get_meta("event_index")); + String label_text = vformat(TTR("Event %d"), selected->get_meta("event_index")); Label *label = memnew(Label(label_text)); label->set_modulate(Color(1, 1, 1, 1.0f)); shortcuts->set_drag_preview(label); diff --git a/modules/objectdb_profiler/editor/data_viewers/refcounted_view.cpp b/modules/objectdb_profiler/editor/data_viewers/refcounted_view.cpp index 2b508c44cb..69745cf3cc 100644 --- a/modules/objectdb_profiler/editor/data_viewers/refcounted_view.cpp +++ b/modules/objectdb_profiler/editor/data_viewers/refcounted_view.cpp @@ -222,10 +222,10 @@ void SnapshotRefCountedView::_refcounted_selected() { Array ref_cycles = (Array)d->extra_debug_data["ref_cycles"]; String count_str = "[ul]\n"; - count_str += vformat(TTRC("Native References: %d\n"), native_refs); - count_str += vformat(TTRC("ObjectDB References: %d\n"), objectdb_refs); - count_str += vformat(TTRC("Total References: %d\n"), total_refs); - count_str += vformat(TTRC("ObjectDB Cycles: %d\n"), ref_cycles.size()); + count_str += vformat(TTR("Native References: %d"), native_refs) + "\n"; + count_str += vformat(TTR("ObjectDB References: %d"), objectdb_refs) + "\n"; + count_str += vformat(TTR("Total References: %d"), total_refs) + "\n"; + count_str += vformat(TTR("ObjectDB Cycles: %d"), ref_cycles.size()) + "\n"; count_str += "[/ul]\n"; RichTextLabel *counts = memnew(RichTextLabel(count_str)); counts->set_use_bbcode(true); diff --git a/modules/objectdb_profiler/editor/data_viewers/shared_controls.cpp b/modules/objectdb_profiler/editor/data_viewers/shared_controls.cpp index f82f603295..9bf026d1f7 100644 --- a/modules/objectdb_profiler/editor/data_viewers/shared_controls.cpp +++ b/modules/objectdb_profiler/editor/data_viewers/shared_controls.cpp @@ -199,11 +199,11 @@ void TreeSortAndFilterBar::_notification(int p_what) { TreeSortAndFilterBar::SortOptionIndexes TreeSortAndFilterBar::add_sort_option(const String &p_new_option, SortType p_sort_type, int p_sort_column, bool p_is_default) { sort_button->set_visible(true); bool is_first_item = sort_items.is_empty(); - SortItem item_ascending(sort_items.size(), vformat(TTRC("Sort By %s (Ascending)"), p_new_option), p_sort_type, true, p_sort_column); + SortItem item_ascending(sort_items.size(), vformat(TTR("Sort By %s (Ascending)"), p_new_option), p_sort_type, true, p_sort_column); sort_items[item_ascending.id] = item_ascending; sort_button->get_popup()->add_radio_check_item(item_ascending.label, item_ascending.id); - SortItem item_descending(sort_items.size(), vformat(TTRC("Sort By %s (Descending)"), p_new_option), p_sort_type, false, p_sort_column); + SortItem item_descending(sort_items.size(), vformat(TTR("Sort By %s (Descending)"), p_new_option), p_sort_type, false, p_sort_column); sort_items[item_descending.id] = item_descending; sort_button->get_popup()->add_radio_check_item(item_descending.label, item_descending.id); diff --git a/modules/objectdb_profiler/editor/data_viewers/summary_view.cpp b/modules/objectdb_profiler/editor/data_viewers/summary_view.cpp index 685bbed3c1..3d71978072 100644 --- a/modules/objectdb_profiler/editor/data_viewers/summary_view.cpp +++ b/modules/objectdb_profiler/editor/data_viewers/summary_view.cpp @@ -107,27 +107,27 @@ void SnapshotSummaryView::show_snapshot(GameStateSnapshot *p_data, GameStateSnap SnapshotView::show_snapshot(p_data, p_diff_data); explainer_text->set_visible(false); - String snapshot_a_name = diff_data == nullptr ? TTRC("Snapshot") : TTRC("Snapshot A"); - String snapshot_b_name = TTRC("Snapshot B"); + String snapshot_a_name = diff_data == nullptr ? TTR("Snapshot") : TTR("Snapshot A"); + String snapshot_b_name = TTR("Snapshot B"); - _push_overview_blurb(snapshot_a_name + " " + TTRC("Overview"), snapshot_data); + _push_overview_blurb(snapshot_a_name + " " + TTR("Overview"), snapshot_data); if (diff_data) { - _push_overview_blurb(snapshot_b_name + " " + TTRC("Overview"), diff_data); + _push_overview_blurb(snapshot_b_name + " " + TTR("Overview"), diff_data); } - _push_node_blurb(snapshot_a_name + " " + TTRC("Nodes"), snapshot_data); + _push_node_blurb(snapshot_a_name + " " + TTR("Nodes"), snapshot_data); if (diff_data) { - _push_node_blurb(snapshot_b_name + " " + TTRC("Nodes"), diff_data); + _push_node_blurb(snapshot_b_name + " " + TTR("Nodes"), diff_data); } - _push_refcounted_blurb(snapshot_a_name + " " + TTRC("RefCounteds"), snapshot_data); + _push_refcounted_blurb(snapshot_a_name + " " + TTR("RefCounteds"), snapshot_data); if (diff_data) { - _push_refcounted_blurb(snapshot_b_name + " " + TTRC("RefCounteds"), diff_data); + _push_refcounted_blurb(snapshot_b_name + " " + TTR("RefCounteds"), diff_data); } - _push_object_blurb(snapshot_a_name + " " + TTRC("Objects"), snapshot_data); + _push_object_blurb(snapshot_a_name + " " + TTR("Objects"), snapshot_data); if (diff_data) { - _push_object_blurb(snapshot_b_name + " " + TTRC("Objects"), diff_data); + _push_object_blurb(snapshot_b_name + " " + TTR("Objects"), diff_data); } } @@ -214,7 +214,7 @@ void SnapshotSummaryView::_push_node_blurb(const String &p_title, GameStateSnaps return; } - String c = TTRC("Multiple root nodes [i](possible call to 'remove_child' without 'queue_free')[/i]\n"); + String c = TTR("Multiple root nodes [i](possible call to 'remove_child' without 'queue_free')[/i]") + "\n"; c += "[ul]\n"; for (const String &node : nodes) { c += " " + node + "\n"; @@ -243,7 +243,7 @@ void SnapshotSummaryView::_push_refcounted_blurb(const String &p_title, GameStat return; } - String c = TTRC("RefCounted objects only referenced in cycles [i](cycles often indicate a memory leaks)[/i]\n"); + String c = TTR("RefCounted objects only referenced in cycles [i](cycles often indicate a memory leaks)[/i]") + "\n"; c += "[ul]\n"; for (const String &rc : rcs) { c += " " + rc + "\n"; @@ -273,7 +273,7 @@ void SnapshotSummaryView::_push_object_blurb(const String &p_title, GameStateSna return; } - String c = TTRC("Scripted objects not referenced by any other objects [i](unreferenced objects may indicate a memory leak)[/i]\n"); + String c = TTR("Scripted objects not referenced by any other objects [i](unreferenced objects may indicate a memory leak)[/i]") + "\n"; c += "[ul]\n"; for (const String &object : objects) { c += " " + object + "\n"; diff --git a/modules/objectdb_profiler/editor/objectdb_profiler_panel.cpp b/modules/objectdb_profiler/editor/objectdb_profiler_panel.cpp index 6366a55d8b..7cf75f0fcd 100644 --- a/modules/objectdb_profiler/editor/objectdb_profiler_panel.cpp +++ b/modules/objectdb_profiler/editor/objectdb_profiler_panel.cpp @@ -88,7 +88,7 @@ bool ObjectDBProfilerPanel::handle_debug_message(const String &p_message, const partial_snapshots[request_id] = PartialSnapshot(); partial_snapshots[request_id].total_size = total_size; Array args = { request_id, 0, SNAPSHOT_CHUNK_SIZE }; - take_snapshot->set_text(vformat(TTRC("Receiving Snapshot (0/%s MiB)"), _to_mb(total_size))); + take_snapshot->set_text(vformat(TTR("Receiving Snapshot (0/%s MiB)"), _to_mb(total_size))); EditorDebuggerNode::get_singleton()->get_current_debugger()->send_message("snapshot:request_snapshot_chunk", args); return true; } @@ -96,7 +96,7 @@ bool ObjectDBProfilerPanel::handle_debug_message(const String &p_message, const int request_id = p_data[0]; PartialSnapshot &chunk = partial_snapshots[request_id]; chunk.data.append_array(p_data[1]); - take_snapshot->set_text(vformat(TTRC("Receiving Snapshot (%s/%s MiB)"), _to_mb(chunk.data.size()), _to_mb(chunk.total_size))); + take_snapshot->set_text(vformat(TTR("Receiving Snapshot (%s/%s MiB)"), _to_mb(chunk.data.size()), _to_mb(chunk.total_size))); if (chunk.data.size() != chunk.total_size) { Array args = { request_id, chunk.data.size(), chunk.data.size() + SNAPSHOT_CHUNK_SIZE }; EditorDebuggerNode::get_singleton()->get_current_debugger()->send_message("snapshot:request_snapshot_chunk", args);