diff --git a/addons/material_maker/nodes/scale.mmg b/addons/material_maker/nodes/scale.mmg index f9c3d49f3..8973bbaf4 100644 --- a/addons/material_maker/nodes/scale.mmg +++ b/addons/material_maker/nodes/scale.mmg @@ -60,7 +60,7 @@ "control": "P1.y", "default": 0, "label": "Center Y", - "longdesc": "The poisition of the scale center", + "longdesc": "The position of the scale center", "max": 1, "min": -1, "name": "cy", @@ -96,4 +96,4 @@ "shortdesc": "Scale" }, "type": "shader" -} \ No newline at end of file +} diff --git a/material_maker/main_window.gd b/material_maker/main_window.gd index 4d7f9b658..b94ed3923 100644 --- a/material_maker/main_window.gd +++ b/material_maker/main_window.gd @@ -377,14 +377,14 @@ func set_current_mode(mode : String) -> void: func create_menu_load_recent(menu) -> void: menu.clear() if recent_files.is_empty(): - menu.add_item("No items found", 0) + menu.add_item(tr("No items found"), 0) menu.set_item_disabled(0, true) else: for i in recent_files.size(): menu.add_item(recent_files[i], i) menu.connect_id_pressed(self._on_LoadRecent_id_pressed) menu.add_separator() - menu.add_item("Clear recent files", RECENTS_MENU_CLEAR) + menu.add_item(tr("Clear recent files"), RECENTS_MENU_CLEAR) func _on_LoadRecent_id_pressed(id) -> void: match id: @@ -655,7 +655,7 @@ func create_menu_show_panels(menu : MMMenuManager.MenuBase) -> void: menu.clear() var panels = layout.get_panel_list() for i in range(panels.size()): - menu.add_check_item(panels[i], i) + menu.add_check_item(tr(panels[i]), i) menu.set_item_checked(i, layout.is_panel_visible(panels[i])) if current_mode: menu.set_item_disabled(i, panels[i] in layout.HIDE_PANELS[current_mode]) @@ -663,8 +663,8 @@ func create_menu_show_panels(menu : MMMenuManager.MenuBase) -> void: func create_menu_panels_preset(menu : MMMenuManager.MenuBase) -> void: menu.clear() - menu.add_item("Save Preset", MENU_SAVE_PRESET) - menu.add_item("Manage Presets", MENU_MANAGE_PRESETS) + menu.add_item(tr("Save Preset"), MENU_SAVE_PRESET) + menu.add_item(tr("Manage Presets"), MENU_MANAGE_PRESETS) if not layout.presets.is_empty(): menu.add_separator() for id in layout.presets.size(): diff --git a/material_maker/panels/library/library.gd b/material_maker/panels/library/library.gd index 739fcfd97..1b594b25a 100644 --- a/material_maker/panels/library/library.gd +++ b/material_maker/panels/library/library.gd @@ -329,11 +329,11 @@ func _on_Libraries_about_to_show(): if i > 1: unload.add_item(library_manager.get_child(i).library_name, i) if not unload.item_count: - unload.add_item("No custom library loaded") + unload.add_item(tr("No custom library loaded")) unload.set_item_disabled(0, true) popup.add_separator() - popup.add_item("Create library", MENU_CREATE_LIBRARY) - popup.add_item("Load library", MENU_LOAD_LIBRARY) + popup.add_item(tr("Create library"), MENU_CREATE_LIBRARY) + popup.add_item(tr("Load library"), MENU_LOAD_LIBRARY) popup.add_submenu_item("Unload", "Unload") if not popup.window_input.is_connected(_on_Libraries_window_input): popup.window_input.connect(_on_Libraries_window_input.bind(popup)) @@ -440,7 +440,7 @@ func _on_PopupMenu_index_pressed(index): dialog.content_scale_factor = mm_globals.ui_scale_factor() dialog.min_size = Vector2(400, 90) * dialog.content_scale_factor add_child(dialog) - var status = await dialog.enter_text("Library item aliases", "Updated aliases for "+item_path, aliases) + var status = await dialog.enter_text(tr("Library item aliases"), tr("Updated aliases for %s") % [item_path], aliases) if ! status.ok: return library_manager.set_aliases(item_path, status.text) diff --git a/material_maker/projects_panel.tscn b/material_maker/projects_panel.tscn index a18fcf384..1b6aec8f1 100644 --- a/material_maker/projects_panel.tscn +++ b/material_maker/projects_panel.tscn @@ -45,8 +45,8 @@ keycode = 93 events = [SubResource("InputEventKey_lbgjg")] [node name="ProjectsPanel" type="Control" unique_id=235293066] -clip_contents = true custom_minimum_size = Vector2(100, 100) +clip_contents = true layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -302,7 +302,6 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 tooltip_text = "Direct Connections" -tooltip_auto_translate_mode = 2 toggle_mode = true button_group = ExtResource("10_lbgjg") shortcut = SubResource("Shortcut_7tisq") @@ -316,7 +315,6 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 tooltip_text = "Bezier Connections" -tooltip_auto_translate_mode = 2 toggle_mode = true button_pressed = true button_group = ExtResource("10_lbgjg") @@ -331,7 +329,6 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 tooltip_text = "Rounded Connections" -tooltip_auto_translate_mode = 2 toggle_mode = true button_group = ExtResource("10_lbgjg") shortcut = SubResource("Shortcut_7tisq") @@ -345,7 +342,6 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 tooltip_text = "Manhattan Connections" -tooltip_auto_translate_mode = 2 toggle_mode = true button_group = ExtResource("10_lbgjg") shortcut = SubResource("Shortcut_7tisq") @@ -359,7 +355,6 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 tooltip_text = "Diagonal Connections" -tooltip_auto_translate_mode = 2 toggle_mode = true button_group = ExtResource("10_lbgjg") shortcut = SubResource("Shortcut_7tisq") @@ -376,7 +371,7 @@ layout_mode = 2 [node name="ThicknessLabel" type="Label" parent="MenuBar/HBox/MainGraphMenuBar/HBox/ViewMenu/ViewMenuPanel/VBoxContainer/VBoxContainer2/Thickness" unique_id=537020243] layout_mode = 2 -text = "Thickness" +text = "Line Radius" [node name="LineThickness" parent="MenuBar/HBox/MainGraphMenuBar/HBox/ViewMenu/ViewMenuPanel/VBoxContainer/VBoxContainer2/Thickness" unique_id=688868721 instance=ExtResource("8_1w3oe")] unique_name_in_owner = true diff --git a/material_maker/tools/library_manager/library.gd b/material_maker/tools/library_manager/library.gd index 2712e4312..d652b0fa0 100644 --- a/material_maker/tools/library_manager/library.gd +++ b/material_maker/tools/library_manager/library.gd @@ -1,3 +1,4 @@ +class_name Library extends Node var library_path : String = "" @@ -10,6 +11,12 @@ var read_only : bool = false func _ready(): pass +static func translate_item_path(from_item_path : String) -> String: + var path_items : PackedStringArray = from_item_path.split("/") + for n in path_items.size(): + path_items[n] = str(TranslationServer.translate(path_items[n])) + return "/".join(path_items) + func create_library(path : String, lib_name : String) -> void: library_path = path library_name = lib_name @@ -73,21 +80,21 @@ func get_items(filter : String, disabled_sections : Array, aliased_items : Array var result_quality := 1.0 if filter: include = false - if i.display_name.to_lower().begins_with(filter) or " "+filter in i.display_name.to_lower(): + if tr(i.display_name).to_lower().begins_with(filter) or " "+filter in tr(i.display_name).to_lower(): include = true if not include: include = true result_quality = 0.8 for word in filter.split(" "): - if not word in i.display_name.to_lower(): + if not word in tr(i.display_name).to_lower(): include = false if (not include) and i.has("name"): include = true result_quality = 0.8 for word in filter.split(" "): - if not word in i.name.to_lower(): + if not word in tr(i.name).to_lower(): include = false if not include: @@ -102,8 +109,9 @@ func get_items(filter : String, disabled_sections : Array, aliased_items : Array if not include: include = true result_quality = 0.4 + for word in filter.split(" "): - if not word in i.tree_item.to_lower(): + if not word in i.tree_item.to_lower() or not word in translate_item_path(i.tree_item).to_lower(): include = false if include: diff --git a/material_maker/windows/about/about.gd b/material_maker/windows/about/about.gd index dfc55da79..e7f2b61e5 100644 --- a/material_maker/windows/about/about.gd +++ b/material_maker/windows/about/about.gd @@ -29,7 +29,7 @@ const CONTRIBUTORS = [ { name="Easynam", contribution="Propagate Changes function in subgraph nodes", url="https://github.com/RodZill4/material-maker/commits/master/?author=easynam" }, { name="Zhibade", contribution="Auto size new comment nodes to current selection", url="https://github.com/RodZill4/material-maker/commits/master/?author=Zhibade" }, { name="paddy-exe", contribution="New modes in the Blend node", url="https://github.com/RodZill4/material-maker/commits/master/?author=paddy-exe" }, - { name="Variable", contribution="UI fixes", url="https://github.com/RodZill4/material-maker/commits/master/?author=Variable-ind" }, + { name="Variable-ind", contribution="UI fixes", url="https://github.com/RodZill4/material-maker/commits/master/?author=Variable-ind" }, { name="jeremybeier", contribution="Unity export fixes", url="https://github.com/RodZill4/material-maker/commits/master/?author=jeremybeier" }, { name="Caroline Tilly", contribution="Steam trailer production and music for all showreels", url="https://tilcamusic.com/" }, { name="Margot Rindone", contribution="Steam achievements icons", url="https://www.artstation.com/margot_rindone" }, diff --git a/material_maker/windows/add_node_popup/add_node_popup.gd b/material_maker/windows/add_node_popup/add_node_popup.gd index 97555aa14..c5d48175c 100644 --- a/material_maker/windows/add_node_popup/add_node_popup.gd +++ b/material_maker/windows/add_node_popup/add_node_popup.gd @@ -180,7 +180,7 @@ func update_list(filter_text : String = "") -> void: var _name : String = obj.display_name _name = obj.tree_item# + "("+str(i.quality)+")" + " ("+str(i.idx)+")" - %List.add_item(_name, i.icon) + %List.add_item(Library.translate_item_path(_name), i.icon) %List.set_item_custom_fg_color(idx, color) %List.set_item_metadata(idx, i) %List.set_item_tooltip_enabled(idx, false)