2
0
Эх сурвалжийг харах

Add more translatable text for editor plugins.

geequlim 7 жил өмнө
parent
commit
52ad2e5418

+ 1 - 1
editor/plugins/animation_tree_editor_plugin.cpp

@@ -1435,7 +1435,7 @@ AnimationTreeEditorPlugin::AnimationTreeEditorPlugin(EditorNode *p_node) {
 	anim_tree_editor = memnew(AnimationTreeEditor);
 	anim_tree_editor->set_custom_minimum_size(Size2(0, 300));
 
-	button = editor->add_bottom_panel_item("AnimationTree", anim_tree_editor);
+	button = editor->add_bottom_panel_item(TTR("AnimationTree"), anim_tree_editor);
 	button->hide();
 }
 

+ 1 - 1
editor/plugins/resource_preloader_editor_plugin.cpp

@@ -444,7 +444,7 @@ ResourcePreloaderEditorPlugin::ResourcePreloaderEditorPlugin(EditorNode *p_node)
 	preloader_editor = memnew(ResourcePreloaderEditor);
 	preloader_editor->set_custom_minimum_size(Size2(0, 250));
 
-	button = editor->add_bottom_panel_item("ResourcePreloader", preloader_editor);
+	button = editor->add_bottom_panel_item(TTR("ResourcePreloader"), preloader_editor);
 	button->hide();
 
 	//preloader_editor->set_anchor( MARGIN_TOP, Control::ANCHOR_END);

+ 1 - 1
editor/plugins/sprite_frames_editor_plugin.cpp

@@ -840,7 +840,7 @@ SpriteFramesEditorPlugin::SpriteFramesEditorPlugin(EditorNode *p_node) {
 	editor = p_node;
 	frames_editor = memnew(SpriteFramesEditor);
 	frames_editor->set_custom_minimum_size(Size2(0, 300) * EDSCALE);
-	button = editor->add_bottom_panel_item("SpriteFrames", frames_editor);
+	button = editor->add_bottom_panel_item(TTR("SpriteFrames"), frames_editor);
 	button->hide();
 }
 

+ 1 - 1
editor/plugins/style_box_editor_plugin.cpp

@@ -103,6 +103,6 @@ StyleBoxEditorPlugin::StyleBoxEditorPlugin(EditorNode *p_node) {
 	stylebox_editor->set_custom_minimum_size(Size2(0, 250));
 
 	//p_node->get_viewport()->add_child(stylebox_editor);
-	button = p_node->add_bottom_panel_item("StyleBox", stylebox_editor);
+	button = p_node->add_bottom_panel_item(TTR("StyleBox"), stylebox_editor);
 	button->hide();
 }

+ 1 - 1
editor/plugins/theme_editor_plugin.cpp

@@ -934,6 +934,6 @@ ThemeEditorPlugin::ThemeEditorPlugin(EditorNode *p_node) {
 	theme_editor->set_custom_minimum_size(Size2(0, 200));
 
 	//p_node->get_viewport()->add_child(theme_editor);
-	button = editor->add_bottom_panel_item("Theme", theme_editor);
+	button = editor->add_bottom_panel_item(TTR("Theme"), theme_editor);
 	button->hide();
 }

+ 6 - 6
editor/plugins/tile_set_editor_plugin.cpp

@@ -314,7 +314,7 @@ TileSetEditorPlugin::TileSetEditorPlugin(EditorNode *p_node) {
 	autotile_editor->side_panel->set_anchors_and_margins_preset(Control::PRESET_WIDE);
 	autotile_editor->side_panel->set_custom_minimum_size(Size2(200, 0));
 	autotile_editor->side_panel->hide();
-	autotile_button = p_node->add_bottom_panel_item("Autotiles", autotile_editor);
+	autotile_button = p_node->add_bottom_panel_item(TTR("Autotiles"), autotile_editor);
 	autotile_button->hide();
 }
 
@@ -387,7 +387,7 @@ AutotileEditor::AutotileEditor(EditorNode *p_editor) {
 
 	tools[TOOL_SELECT] = memnew(ToolButton);
 	tool_containers[TOOLBAR_DUMMY]->add_child(tools[TOOL_SELECT]);
-	tools[TOOL_SELECT]->set_tooltip("Select sub-tile to use as icon, this will be also used on invalid autotile bindings.");
+	tools[TOOL_SELECT]->set_tooltip(TTR("Select sub-tile to use as icon, this will be also used on invalid autotile bindings."));
 	tools[TOOL_SELECT]->set_toggle_mode(true);
 	tools[TOOL_SELECT]->set_button_group(tg);
 	tools[TOOL_SELECT]->set_pressed(true);
@@ -533,7 +533,7 @@ void AutotileEditor::_on_edit_mode_changed(int p_edit_mode) {
 			tool_containers[TOOLBAR_BITMASK]->show();
 			tool_containers[TOOLBAR_SHAPE]->hide();
 			tools[TOOL_SELECT]->set_pressed(true);
-			tools[TOOL_SELECT]->set_tooltip("LMB: set bit on.\nRMB: set bit off.");
+			tools[TOOL_SELECT]->set_tooltip(TTR("LMB: set bit on.\nRMB: set bit off."));
 			spin_priority->hide();
 		} break;
 		case EDITMODE_COLLISION:
@@ -542,7 +542,7 @@ void AutotileEditor::_on_edit_mode_changed(int p_edit_mode) {
 			tool_containers[TOOLBAR_DUMMY]->show();
 			tool_containers[TOOLBAR_BITMASK]->hide();
 			tool_containers[TOOLBAR_SHAPE]->show();
-			tools[TOOL_SELECT]->set_tooltip("Select current edited sub-tile.");
+			tools[TOOL_SELECT]->set_tooltip(TTR("Select current edited sub-tile."));
 			spin_priority->hide();
 		} break;
 		default: {
@@ -550,10 +550,10 @@ void AutotileEditor::_on_edit_mode_changed(int p_edit_mode) {
 			tool_containers[TOOLBAR_BITMASK]->hide();
 			tool_containers[TOOLBAR_SHAPE]->hide();
 			if (edit_mode == EDITMODE_ICON) {
-				tools[TOOL_SELECT]->set_tooltip("Select sub-tile to use as icon, this will be also used on invalid autotile bindings.");
+				tools[TOOL_SELECT]->set_tooltip(TTR("Select sub-tile to use as icon, this will be also used on invalid autotile bindings."));
 				spin_priority->hide();
 			} else {
-				tools[TOOL_SELECT]->set_tooltip("Select sub-tile to change it's priority.");
+				tools[TOOL_SELECT]->set_tooltip(TTR("Select sub-tile to change it's priority."));
 				spin_priority->show();
 			}
 		} break;

+ 9 - 9
modules/mono/editor/godotsharp_editor.cpp

@@ -50,9 +50,9 @@ GodotSharpEditor *GodotSharpEditor::singleton = NULL;
 
 bool GodotSharpEditor::_create_project_solution() {
 
-	EditorProgress pr("create_csharp_solution", "Generating solution...", 2);
+	EditorProgress pr("create_csharp_solution", TTR("Generating solution..."), 2);
 
-	pr.step("Generating C# project...");
+	pr.step(TTR("Generating C# project..."));
 
 	String path = OS::get_singleton()->get_resource_dir();
 	String name = ProjectSettings::get_singleton()->get("application/config/name");
@@ -67,7 +67,7 @@ bool GodotSharpEditor::_create_project_solution() {
 		NETSolution solution(name);
 
 		if (!solution.set_path(path)) {
-			show_error_dialog("Failed to create solution.");
+			show_error_dialog(TTR("Failed to create solution."));
 			return false;
 		}
 
@@ -79,7 +79,7 @@ bool GodotSharpEditor::_create_project_solution() {
 		Error sln_error = solution.save();
 
 		if (sln_error != OK) {
-			show_error_dialog("Failed to save solution.");
+			show_error_dialog(TTR("Failed to save solution."));
 			return false;
 		}
 
@@ -89,13 +89,13 @@ bool GodotSharpEditor::_create_project_solution() {
 		if (!GodotSharpBuilds::make_api_sln(GodotSharpBuilds::API_EDITOR))
 			return false;
 
-		pr.step("Done");
+		pr.step(TTR("Done"));
 
 		// Here, after all calls to progress_task_step
 		call_deferred("_remove_create_sln_menu_option");
 
 	} else {
-		show_error_dialog("Failed to create C# project.");
+		show_error_dialog(TTR("Failed to create C# project."));
 	}
 
 	return true;
@@ -194,14 +194,14 @@ GodotSharpEditor::GodotSharpEditor(EditorNode *p_editor) {
 	error_dialog = memnew(AcceptDialog);
 	editor->get_gui_base()->add_child(error_dialog);
 
-	bottom_panel_btn = editor->add_bottom_panel_item("Mono", memnew(MonoBottomPanel(editor)));
+	bottom_panel_btn = editor->add_bottom_panel_item(TTR("Mono"), memnew(MonoBottomPanel(editor)));
 
 	godotsharp_builds = memnew(GodotSharpBuilds);
 
 	editor->add_child(memnew(MonoReloadNode));
 
 	menu_button = memnew(MenuButton);
-	menu_button->set_text("Mono");
+	menu_button->set_text(TTR("Mono"));
 	menu_popup = menu_button->get_popup();
 
 	String sln_path = GodotSharpDirs::get_project_sln_path();
@@ -209,7 +209,7 @@ GodotSharpEditor::GodotSharpEditor(EditorNode *p_editor) {
 
 	if (!FileAccess::exists(sln_path) || !FileAccess::exists(csproj_path)) {
 		bottom_panel_btn->hide();
-		menu_popup->add_item("Create C# solution", MENU_CREATE_SLN);
+		menu_popup->add_item(TTR("Create C# solution"), MENU_CREATE_SLN);
 	}
 
 	menu_popup->connect("id_pressed", this, "_menu_option_pressed");

+ 3 - 3
modules/mono/editor/mono_bottom_panel.cpp

@@ -197,7 +197,7 @@ MonoBottomPanel::MonoBottomPanel(EditorNode *p_editor) {
 		panel_builds_tab->add_child(toolbar_hbc);
 
 		ToolButton *build_project_btn = memnew(ToolButton);
-		build_project_btn->set_text("Build Project");
+		build_project_btn->set_text(TTR("Build Project"));
 		build_project_btn->set_focus_mode(FOCUS_NONE);
 		build_project_btn->connect("pressed", this, "_build_project_pressed");
 		toolbar_hbc->add_child(build_project_btn);
@@ -205,7 +205,7 @@ MonoBottomPanel::MonoBottomPanel(EditorNode *p_editor) {
 		toolbar_hbc->add_spacer();
 
 		warnings_btn = memnew(ToolButton);
-		warnings_btn->set_text("Warnings");
+		warnings_btn->set_text(TTR("Warnings"));
 		warnings_btn->set_toggle_mode(true);
 		warnings_btn->set_pressed(true);
 		warnings_btn->set_visible(false);
@@ -214,7 +214,7 @@ MonoBottomPanel::MonoBottomPanel(EditorNode *p_editor) {
 		toolbar_hbc->add_child(warnings_btn);
 
 		errors_btn = memnew(ToolButton);
-		errors_btn->set_text("Errors");
+		errors_btn->set_text(TTR("Errors"));
 		errors_btn->set_toggle_mode(true);
 		errors_btn->set_pressed(true);
 		errors_btn->set_visible(false);