mirror of
https://github.com/godotengine/godot.git
synced 2025-01-21 01:11:20 +00:00
Make action names translatable
This commit is contained in:
parent
20d46c5b9e
commit
284c6c81eb
@ -1596,8 +1596,14 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
||||
se->gizmo->commit_subgizmos(ids, restore, false);
|
||||
spatial_editor->update_transform_gizmo();
|
||||
} else {
|
||||
static const char *_transform_name[4] = { "None", "Rotate", "Translate", "Scale" };
|
||||
undo_redo->create_action(_transform_name[_edit.mode]);
|
||||
static const char *_transform_name[4] = {
|
||||
TTRC("None"),
|
||||
TTRC("Rotate"),
|
||||
// TRANSLATORS: This refers to the movement that changes the position of an object.
|
||||
TTRC("Translate"),
|
||||
TTRC("Scale"),
|
||||
};
|
||||
undo_redo->create_action(TTRGET(_transform_name[_edit.mode]));
|
||||
|
||||
List<Node *> &selection = editor_selection->get_selected_node_list();
|
||||
|
||||
|
@ -154,7 +154,7 @@ void AtlasMergingDialog::_merge_confirmed(String p_path) {
|
||||
Ref<Texture2D> new_texture_resource = ResourceLoader::load(p_path, "Texture2D");
|
||||
merged->set_texture(new_texture_resource);
|
||||
|
||||
undo_redo->create_action("Merge TileSetAtlasSource");
|
||||
undo_redo->create_action(TTR("Merge TileSetAtlasSource"));
|
||||
int next_id = tile_set->get_next_source_id();
|
||||
undo_redo->add_do_method(*tile_set, "add_source", merged, next_id);
|
||||
undo_redo->add_undo_method(*tile_set, "remove_source", next_id);
|
||||
|
@ -47,7 +47,7 @@ void TileProxiesManagerDialog::_menu_id_pressed(int p_id) {
|
||||
}
|
||||
|
||||
void TileProxiesManagerDialog::_delete_selected_bindings() {
|
||||
undo_redo->create_action("Remove Tile Proxies");
|
||||
undo_redo->create_action(TTR("Remove Tile Proxies"));
|
||||
|
||||
Vector<int> source_level_selected = source_level_list->get_selected_items();
|
||||
for (int i = 0; i < source_level_selected.size(); i++) {
|
||||
@ -151,7 +151,7 @@ void TileProxiesManagerDialog::_add_button_pressed() {
|
||||
Vector2i to_coords = to.get_atlas_coords();
|
||||
if (from_coords.x >= 0 && from_coords.y >= 0 && to_coords.x >= 0 && to_coords.y >= 0) {
|
||||
if (from.alternative_tile != TileSetSource::INVALID_TILE_ALTERNATIVE && to.alternative_tile != TileSetSource::INVALID_TILE_ALTERNATIVE) {
|
||||
undo_redo->create_action("Create Alternative-level Tile Proxy");
|
||||
undo_redo->create_action(TTR("Create Alternative-level Tile Proxy"));
|
||||
undo_redo->add_do_method(*tile_set, "set_alternative_level_tile_proxy", from.source_id, from.get_atlas_coords(), from.alternative_tile, to.source_id, to.get_atlas_coords(), to.alternative_tile);
|
||||
if (tile_set->has_alternative_level_tile_proxy(from.source_id, from.get_atlas_coords(), from.alternative_tile)) {
|
||||
Array a = tile_set->get_alternative_level_tile_proxy(from.source_id, from.get_atlas_coords(), from.alternative_tile);
|
||||
@ -160,7 +160,7 @@ void TileProxiesManagerDialog::_add_button_pressed() {
|
||||
undo_redo->add_undo_method(*tile_set, "remove_alternative_level_tile_proxy", from.source_id, from.get_atlas_coords(), from.alternative_tile);
|
||||
}
|
||||
} else {
|
||||
undo_redo->create_action("Create Coords-level Tile Proxy");
|
||||
undo_redo->create_action(TTR("Create Coords-level Tile Proxy"));
|
||||
undo_redo->add_do_method(*tile_set, "set_coords_level_tile_proxy", from.source_id, from.get_atlas_coords(), to.source_id, to.get_atlas_coords());
|
||||
if (tile_set->has_coords_level_tile_proxy(from.source_id, from.get_atlas_coords())) {
|
||||
Array a = tile_set->get_coords_level_tile_proxy(from.source_id, from.get_atlas_coords());
|
||||
@ -170,7 +170,7 @@ void TileProxiesManagerDialog::_add_button_pressed() {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
undo_redo->create_action("Create source-level Tile Proxy");
|
||||
undo_redo->create_action(TTR("Create source-level Tile Proxy"));
|
||||
undo_redo->add_do_method(*tile_set, "set_source_level_tile_proxy", from.source_id, to.source_id);
|
||||
if (tile_set->has_source_level_tile_proxy(from.source_id)) {
|
||||
undo_redo->add_undo_method(*tile_set, "set_source_level_tile_proxy", to.source_id, tile_set->get_source_level_tile_proxy(from.source_id));
|
||||
@ -186,7 +186,7 @@ void TileProxiesManagerDialog::_add_button_pressed() {
|
||||
}
|
||||
|
||||
void TileProxiesManagerDialog::_clear_invalid_button_pressed() {
|
||||
undo_redo->create_action("Delete All Invalid Tile Proxies");
|
||||
undo_redo->create_action(TTR("Delete All Invalid Tile Proxies"));
|
||||
|
||||
undo_redo->add_do_method(*tile_set, "cleanup_invalid_tile_proxies");
|
||||
|
||||
@ -213,7 +213,7 @@ void TileProxiesManagerDialog::_clear_invalid_button_pressed() {
|
||||
}
|
||||
|
||||
void TileProxiesManagerDialog::_clear_all_button_pressed() {
|
||||
undo_redo->create_action("Delete All Tile Proxies");
|
||||
undo_redo->create_action(TTR("Delete All Tile Proxies"));
|
||||
|
||||
undo_redo->add_do_method(*tile_set, "clear_tile_proxies");
|
||||
|
||||
|
@ -675,7 +675,7 @@ bool GridMapEditor::forward_spatial_input_event(Camera3D *p_camera, const Ref<In
|
||||
}
|
||||
|
||||
if (mb->get_button_index() == MOUSE_BUTTON_LEFT && input_action == INPUT_SELECT) {
|
||||
undo_redo->create_action("GridMap Selection");
|
||||
undo_redo->create_action(TTR("GridMap Selection"));
|
||||
undo_redo->add_do_method(this, "_set_selection", selection.active, selection.begin, selection.end);
|
||||
undo_redo->add_undo_method(this, "_set_selection", last_selection.active, last_selection.begin, last_selection.end);
|
||||
undo_redo->commit_action();
|
||||
|
@ -984,7 +984,7 @@ void VisualScriptEditor::_change_port_type(int p_select, int p_id, int p_port, b
|
||||
return;
|
||||
}
|
||||
|
||||
undo_redo->create_action("Change Port Type");
|
||||
undo_redo->create_action(TTR("Change Port Type"));
|
||||
if (is_input) {
|
||||
undo_redo->add_do_method(vsn.ptr(), "set_input_data_port_type", p_port, Variant::Type(p_select));
|
||||
undo_redo->add_undo_method(vsn.ptr(), "set_input_data_port_type", p_port, vsn->get_input_value_port_info(p_port).type);
|
||||
@ -1016,7 +1016,7 @@ void VisualScriptEditor::_port_name_focus_out(const Node *p_name_box, int p_id,
|
||||
return;
|
||||
}
|
||||
|
||||
undo_redo->create_action("Change Port Name");
|
||||
undo_redo->create_action(TTR("Change Port Name"));
|
||||
if (is_input) {
|
||||
undo_redo->add_do_method(vsn.ptr(), "set_input_data_port_name", p_port, text);
|
||||
undo_redo->add_undo_method(vsn.ptr(), "set_input_data_port_name", p_port, vsn->get_input_value_port_info(p_port).name);
|
||||
|
Loading…
Reference in New Issue
Block a user