Browse Source

Make various strings translatable

foxydevloper 4 years ago
parent
commit
42d740d641

+ 5 - 5
editor/action_map_editor.cpp

@@ -581,7 +581,7 @@ void InputEventConfigurationDialog::set_allowed_input_types(int p_type_masks) {
 InputEventConfigurationDialog::InputEventConfigurationDialog() {
 InputEventConfigurationDialog::InputEventConfigurationDialog() {
 	allowed_input_types = INPUT_KEY | INPUT_MOUSE_BUTTON | INPUT_JOY_BUTTON | INPUT_JOY_MOTION;
 	allowed_input_types = INPUT_KEY | INPUT_MOUSE_BUTTON | INPUT_JOY_BUTTON | INPUT_JOY_MOTION;
 
 
-	set_title("Event Configuration");
+	set_title(TTR("Event Configuration"));
 	set_min_size(Size2i(550 * EDSCALE, 0)); // Min width
 	set_min_size(Size2i(550 * EDSCALE, 0)); // Min width
 
 
 	VBoxContainer *main_vbox = memnew(VBoxContainer);
 	VBoxContainer *main_vbox = memnew(VBoxContainer);
@@ -595,7 +595,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() {
 	main_vbox->add_child(tab_container);
 	main_vbox->add_child(tab_container);
 
 
 	CenterContainer *cc = memnew(CenterContainer);
 	CenterContainer *cc = memnew(CenterContainer);
-	cc->set_name("Listen for Input");
+	cc->set_name(TTR("Listen for Input"));
 	event_as_text = memnew(Label);
 	event_as_text = memnew(Label);
 	event_as_text->set_align(Label::ALIGN_CENTER);
 	event_as_text->set_align(Label::ALIGN_CENTER);
 	cc->add_child(event_as_text);
 	cc->add_child(event_as_text);
@@ -604,7 +604,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() {
 	// List of all input options to manually select from.
 	// List of all input options to manually select from.
 
 
 	VBoxContainer *manual_vbox = memnew(VBoxContainer);
 	VBoxContainer *manual_vbox = memnew(VBoxContainer);
-	manual_vbox->set_name("Manual Selection");
+	manual_vbox->set_name(TTR("Manual Selection"));
 	manual_vbox->set_v_size_flags(Control::SIZE_EXPAND_FILL);
 	manual_vbox->set_v_size_flags(Control::SIZE_EXPAND_FILL);
 	tab_container->add_child(manual_vbox);
 	tab_container->add_child(manual_vbox);
 
 
@@ -632,7 +632,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() {
 
 
 	Label *opts_label = memnew(Label);
 	Label *opts_label = memnew(Label);
 	opts_label->set_theme_type_variation("HeaderSmall");
 	opts_label->set_theme_type_variation("HeaderSmall");
-	opts_label->set_text("Additional Options");
+	opts_label->set_text(TTR("Additional Options"));
 	additional_options_container->add_child(opts_label);
 	additional_options_container->add_child(opts_label);
 
 
 	// Device Selection
 	// Device Selection
@@ -641,7 +641,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() {
 
 
 	Label *device_label = memnew(Label);
 	Label *device_label = memnew(Label);
 	device_label->set_theme_type_variation("HeaderSmall");
 	device_label->set_theme_type_variation("HeaderSmall");
-	device_label->set_text("Device:");
+	device_label->set_text(TTR("Device:"));
 	device_container->add_child(device_label);
 	device_container->add_child(device_label);
 
 
 	device_id_option = memnew(OptionButton);
 	device_id_option = memnew(OptionButton);

+ 4 - 4
editor/editor_log.cpp

@@ -398,22 +398,22 @@ EditorLog::EditorLog() {
 	vb_right->add_child(memnew(HSeparator));
 	vb_right->add_child(memnew(HSeparator));
 
 
 	LogFilter *std_filter = memnew(LogFilter(MSG_TYPE_STD));
 	LogFilter *std_filter = memnew(LogFilter(MSG_TYPE_STD));
-	std_filter->initialize_button("Toggle visibility of standard output messages.", callable_mp(this, &EditorLog::_set_filter_active));
+	std_filter->initialize_button(TTR("Toggle visibility of standard output messages."), callable_mp(this, &EditorLog::_set_filter_active));
 	vb_right->add_child(std_filter->toggle_button);
 	vb_right->add_child(std_filter->toggle_button);
 	type_filter_map.insert(MSG_TYPE_STD, std_filter);
 	type_filter_map.insert(MSG_TYPE_STD, std_filter);
 
 
 	LogFilter *error_filter = memnew(LogFilter(MSG_TYPE_ERROR));
 	LogFilter *error_filter = memnew(LogFilter(MSG_TYPE_ERROR));
-	error_filter->initialize_button("Toggle visibility of errors.", callable_mp(this, &EditorLog::_set_filter_active));
+	error_filter->initialize_button(TTR("Toggle visibility of errors."), callable_mp(this, &EditorLog::_set_filter_active));
 	vb_right->add_child(error_filter->toggle_button);
 	vb_right->add_child(error_filter->toggle_button);
 	type_filter_map.insert(MSG_TYPE_ERROR, error_filter);
 	type_filter_map.insert(MSG_TYPE_ERROR, error_filter);
 
 
 	LogFilter *warning_filter = memnew(LogFilter(MSG_TYPE_WARNING));
 	LogFilter *warning_filter = memnew(LogFilter(MSG_TYPE_WARNING));
-	warning_filter->initialize_button("Toggle visibility of warnings.", callable_mp(this, &EditorLog::_set_filter_active));
+	warning_filter->initialize_button(TTR("Toggle visibility of warnings."), callable_mp(this, &EditorLog::_set_filter_active));
 	vb_right->add_child(warning_filter->toggle_button);
 	vb_right->add_child(warning_filter->toggle_button);
 	type_filter_map.insert(MSG_TYPE_WARNING, warning_filter);
 	type_filter_map.insert(MSG_TYPE_WARNING, warning_filter);
 
 
 	LogFilter *editor_filter = memnew(LogFilter(MSG_TYPE_EDITOR));
 	LogFilter *editor_filter = memnew(LogFilter(MSG_TYPE_EDITOR));
-	editor_filter->initialize_button("Toggle visibility of editor messages.", callable_mp(this, &EditorLog::_set_filter_active));
+	editor_filter->initialize_button(TTR("Toggle visibility of editor messages."), callable_mp(this, &EditorLog::_set_filter_active));
 	vb_right->add_child(editor_filter->toggle_button);
 	vb_right->add_child(editor_filter->toggle_button);
 	type_filter_map.insert(MSG_TYPE_EDITOR, editor_filter);
 	type_filter_map.insert(MSG_TYPE_EDITOR, editor_filter);
 
 

+ 1 - 1
editor/plugins/animation_tree_editor_plugin.cpp

@@ -79,7 +79,7 @@ void AnimationTreeEditor::_update_path() {
 	group.instantiate();
 	group.instantiate();
 
 
 	Button *b = memnew(Button);
 	Button *b = memnew(Button);
-	b->set_text("Root");
+	b->set_text(TTR("Root"));
 	b->set_toggle_mode(true);
 	b->set_toggle_mode(true);
 	b->set_button_group(group);
 	b->set_button_group(group);
 	b->set_pressed(true);
 	b->set_pressed(true);

+ 1 - 1
editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp

@@ -131,7 +131,7 @@ void GPUParticlesCollisionSDFEditorPlugin::_sdf_save_path_and_bake(const String
 	if (col_sdf) {
 	if (col_sdf) {
 		Ref<Image> bake_img = col_sdf->bake();
 		Ref<Image> bake_img = col_sdf->bake();
 		if (bake_img.is_null()) {
 		if (bake_img.is_null()) {
-			EditorNode::get_singleton()->show_warning("Bake Error.");
+			EditorNode::get_singleton()->show_warning(TTR("Bake Error."));
 			return;
 			return;
 		}
 		}
 
 

+ 1 - 1
editor/plugins/input_event_editor_plugin.cpp

@@ -86,7 +86,7 @@ InputEventConfigContainer::InputEventConfigContainer() {
 	mc->add_child(hb);
 	mc->add_child(hb);
 
 
 	open_config_button = memnew(Button);
 	open_config_button = memnew(Button);
-	open_config_button->set_text("Configure");
+	open_config_button->set_text(TTR("Configure"));
 	open_config_button->connect("pressed", callable_mp(this, &InputEventConfigContainer::_configure_pressed));
 	open_config_button->connect("pressed", callable_mp(this, &InputEventConfigContainer::_configure_pressed));
 	hb->add_child(open_config_button);
 	hb->add_child(open_config_button);
 
 

+ 2 - 2
editor/plugins/node_3d_editor_plugin.cpp

@@ -6248,7 +6248,7 @@ void Node3DEditor::_add_sun_to_scene(bool p_already_added_environment) {
 	ERR_FAIL_COND(!base);
 	ERR_FAIL_COND(!base);
 	Node *new_sun = preview_sun->duplicate();
 	Node *new_sun = preview_sun->duplicate();
 
 
-	undo_redo->create_action("Add Preview Sun to Scene");
+	undo_redo->create_action(TTR("Add Preview Sun to Scene"));
 	undo_redo->add_do_method(base, "add_child", new_sun);
 	undo_redo->add_do_method(base, "add_child", new_sun);
 	// Move to the beginning of the scene tree since more "global" nodes
 	// Move to the beginning of the scene tree since more "global" nodes
 	// generally look better when placed at the top.
 	// generally look better when placed at the top.
@@ -6278,7 +6278,7 @@ void Node3DEditor::_add_environment_to_scene(bool p_already_added_sun) {
 	WorldEnvironment *new_env = memnew(WorldEnvironment);
 	WorldEnvironment *new_env = memnew(WorldEnvironment);
 	new_env->set_environment(preview_environment->get_environment()->duplicate(true));
 	new_env->set_environment(preview_environment->get_environment()->duplicate(true));
 
 
-	undo_redo->create_action("Add Preview Environment to Scene");
+	undo_redo->create_action(TTR("Add Preview Environment to Scene"));
 	undo_redo->add_do_method(base, "add_child", new_env);
 	undo_redo->add_do_method(base, "add_child", new_env);
 	// Move to the beginning of the scene tree since more "global" nodes
 	// Move to the beginning of the scene tree since more "global" nodes
 	// generally look better when placed at the top.
 	// generally look better when placed at the top.

+ 1 - 1
editor/plugins/sprite_2d_editor_plugin.cpp

@@ -521,7 +521,7 @@ Sprite2DEditor::Sprite2DEditor() {
 
 
 	debug_uv_dialog = memnew(ConfirmationDialog);
 	debug_uv_dialog = memnew(ConfirmationDialog);
 	debug_uv_dialog->get_ok_button()->set_text(TTR("Create Mesh2D"));
 	debug_uv_dialog->get_ok_button()->set_text(TTR("Create Mesh2D"));
-	debug_uv_dialog->set_title("Mesh 2D Preview");
+	debug_uv_dialog->set_title(TTR("Mesh 2D Preview"));
 	VBoxContainer *vb = memnew(VBoxContainer);
 	VBoxContainer *vb = memnew(VBoxContainer);
 	debug_uv_dialog->add_child(vb);
 	debug_uv_dialog->add_child(vb);
 	ScrollContainer *scroll = memnew(ScrollContainer);
 	ScrollContainer *scroll = memnew(ScrollContainer);

+ 1 - 1
editor/plugins/tiles/tile_data_editors.cpp

@@ -1050,7 +1050,7 @@ void TileDataDefaultEditor::_notification(int p_what) {
 
 
 TileDataDefaultEditor::TileDataDefaultEditor() {
 TileDataDefaultEditor::TileDataDefaultEditor() {
 	label = memnew(Label);
 	label = memnew(Label);
-	label->set_text("Painting:");
+	label->set_text(TTR("Painting:"));
 	add_child(label);
 	add_child(label);
 
 
 	toolbar->add_child(memnew(VSeparator));
 	toolbar->add_child(memnew(VSeparator));

+ 5 - 5
editor/plugins/version_control_editor_plugin.cpp

@@ -164,7 +164,7 @@ void VersionControlEditorPlugin::_refresh_stage_area() {
 					_refresh_file_diff();
 					_refresh_file_diff();
 				}
 				}
 			}
 			}
-			commit_status->set_text("New changes detected");
+			commit_status->set_text(TTR("New changes detected"));
 		}
 		}
 	} else {
 	} else {
 		WARN_PRINT("No VCS addon is initialized. Select a Version Control Addon from Project menu.");
 		WARN_PRINT("No VCS addon is initialized. Select a Version Control Addon from Project menu.");
@@ -270,9 +270,9 @@ void VersionControlEditorPlugin::_clear_file_diff() {
 void VersionControlEditorPlugin::_update_stage_status() {
 void VersionControlEditorPlugin::_update_stage_status() {
 	String status;
 	String status;
 	if (staged_files_count == 1) {
 	if (staged_files_count == 1) {
-		status = "Stage contains 1 file";
+		status = TTR("Stage contains 1 file");
 	} else {
 	} else {
-		status = "Stage contains " + String::num_int64(staged_files_count) + " files";
+		status = vformat(TTR("Stage contains %d files"), staged_files_count);
 	}
 	}
 	commit_status->set_text(status);
 	commit_status->set_text(status);
 }
 }
@@ -280,9 +280,9 @@ void VersionControlEditorPlugin::_update_stage_status() {
 void VersionControlEditorPlugin::_update_commit_status() {
 void VersionControlEditorPlugin::_update_commit_status() {
 	String status;
 	String status;
 	if (staged_files_count == 1) {
 	if (staged_files_count == 1) {
-		status = "Committed 1 file";
+		status = TTR("Committed 1 file");
 	} else {
 	} else {
-		status = "Committed " + String::num_int64(staged_files_count) + " files ";
+		status = vformat(TTR("Committed %d files"), staged_files_count);
 	}
 	}
 	commit_status->set_text(status);
 	commit_status->set_text(status);
 	staged_files_count = 0;
 	staged_files_count = 0;

+ 3 - 3
editor/project_export.cpp

@@ -1153,7 +1153,7 @@ ProjectExportDialog::ProjectExportDialog() {
 
 
 	enc_directory = memnew(CheckButton);
 	enc_directory = memnew(CheckButton);
 	enc_directory->connect("toggled", callable_mp(this, &ProjectExportDialog::_enc_directory_changed));
 	enc_directory->connect("toggled", callable_mp(this, &ProjectExportDialog::_enc_directory_changed));
-	enc_directory->set_text("Encrypt Index (File Names and Info)");
+	enc_directory->set_text(TTR("Encrypt Index (File Names and Info)"));
 	sec_vb->add_child(enc_directory);
 	sec_vb->add_child(enc_directory);
 
 
 	enc_in_filters = memnew(LineEdit);
 	enc_in_filters = memnew(LineEdit);
@@ -1219,7 +1219,7 @@ ProjectExportDialog::ProjectExportDialog() {
 
 
 	export_all_dialog = memnew(ConfirmationDialog);
 	export_all_dialog = memnew(ConfirmationDialog);
 	add_child(export_all_dialog);
 	add_child(export_all_dialog);
-	export_all_dialog->set_title("Export All");
+	export_all_dialog->set_title(TTR("Export All"));
 	export_all_dialog->set_text(TTR("Choose an export mode:"));
 	export_all_dialog->set_text(TTR("Choose an export mode:"));
 	export_all_dialog->get_ok_button()->hide();
 	export_all_dialog->get_ok_button()->hide();
 	export_all_dialog->add_button(TTR("Debug"), true, "debug");
 	export_all_dialog->add_button(TTR("Debug"), true, "debug");
@@ -1253,7 +1253,7 @@ ProjectExportDialog::ProjectExportDialog() {
 	export_error2->set_text(" - " + TTR("Export templates for this platform are missing:") + " ");
 	export_error2->set_text(" - " + TTR("Export templates for this platform are missing:") + " ");
 
 
 	error_dialog = memnew(AcceptDialog);
 	error_dialog = memnew(AcceptDialog);
-	error_dialog->set_title("Error");
+	error_dialog->set_title(TTR("Error"));
 	error_dialog->set_text(TTR("Export templates for this platform are missing/corrupted:") + " ");
 	error_dialog->set_text(TTR("Export templates for this platform are missing/corrupted:") + " ");
 	main_vb->add_child(error_dialog);
 	main_vb->add_child(error_dialog);
 	error_dialog->hide();
 	error_dialog->hide();

+ 3 - 3
editor/shader_globals_editor.cpp

@@ -84,7 +84,7 @@ protected:
 
 
 		UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
 		UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
 
 
-		undo_redo->create_action("Set Shader Global Variable");
+		undo_redo->create_action(TTR("Set Shader Global Variable"));
 		undo_redo->add_do_method(RS::get_singleton(), "global_variable_set", p_name, p_value);
 		undo_redo->add_do_method(RS::get_singleton(), "global_variable_set", p_name, p_value);
 		undo_redo->add_undo_method(RS::get_singleton(), "global_variable_set", p_name, existing);
 		undo_redo->add_undo_method(RS::get_singleton(), "global_variable_set", p_name, existing);
 		RS::GlobalVariableType type = RS::get_singleton()->global_variable_get_type(p_name);
 		RS::GlobalVariableType type = RS::get_singleton()->global_variable_get_type(p_name);
@@ -395,7 +395,7 @@ void ShaderGlobalsEditor::_variable_added() {
 
 
 	Variant value = create_var(RS::GlobalVariableType(variable_type->get_selected()));
 	Variant value = create_var(RS::GlobalVariableType(variable_type->get_selected()));
 
 
-	undo_redo->create_action("Add Shader Global Variable");
+	undo_redo->create_action(TTR("Add Shader Global Variable"));
 	undo_redo->add_do_method(RS::get_singleton(), "global_variable_add", var, RS::GlobalVariableType(variable_type->get_selected()), value);
 	undo_redo->add_do_method(RS::get_singleton(), "global_variable_add", var, RS::GlobalVariableType(variable_type->get_selected()), value);
 	undo_redo->add_undo_method(RS::get_singleton(), "global_variable_remove", var);
 	undo_redo->add_undo_method(RS::get_singleton(), "global_variable_remove", var);
 	Dictionary gv;
 	Dictionary gv;
@@ -413,7 +413,7 @@ void ShaderGlobalsEditor::_variable_deleted(const String &p_variable) {
 	print_line("deleted " + p_variable);
 	print_line("deleted " + p_variable);
 	UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
 	UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
 
 
-	undo_redo->create_action("Add Shader Global Variable");
+	undo_redo->create_action(TTR("Add Shader Global Variable"));
 	undo_redo->add_do_method(RS::get_singleton(), "global_variable_remove", p_variable);
 	undo_redo->add_do_method(RS::get_singleton(), "global_variable_remove", p_variable);
 	undo_redo->add_undo_method(RS::get_singleton(), "global_variable_add", p_variable, RS::get_singleton()->global_variable_get_type(p_variable), RS::get_singleton()->global_variable_get(p_variable));
 	undo_redo->add_undo_method(RS::get_singleton(), "global_variable_add", p_variable, RS::get_singleton()->global_variable_get_type(p_variable), RS::get_singleton()->global_variable_get(p_variable));