Skip to content

Commit

Permalink
Merge pull request godotengine#82858 from KoBeWi/read_between_the_com…
Browse files Browse the repository at this point in the history
…ments

Provide translation strings for folder colors
  • Loading branch information
akien-mga committed Oct 17, 2023
2 parents 024172b + 47adf88 commit 060816c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions editor/filesystem_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2975,7 +2975,7 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, Vector<Str
folder_colors_menu->add_separator();

for (const KeyValue<String, Color> &E : folder_colors) {
folder_colors_menu->add_icon_item(get_editor_theme_icon(SNAME("Folder")), TTR(E.key.capitalize()));
folder_colors_menu->add_icon_item(get_editor_theme_icon(SNAME("Folder")), E.key.capitalize());

folder_colors_menu->set_item_icon_modulate(-1, editor_is_dark_theme ? E.value : E.value * 2);
folder_colors_menu->set_item_metadata(-1, E.key);
Expand Down Expand Up @@ -3535,16 +3535,16 @@ FileSystemDock::FileSystemDock() {
ED_SHORTCUT("filesystem_dock/open_in_external_program", TTR("Open in External Program"));
#endif

folder_colors = HashMap<String, Color>();
folder_colors["red"] = Color(1.0, 0.271, 0.271);
folder_colors["orange"] = Color(1.0, 0.561, 0.271);
folder_colors["yellow"] = Color(1.0, 0.890, 0.271);
folder_colors["green"] = Color(0.502, 1.0, 0.271);
folder_colors["teal"] = Color(0.271, 1.0, 0.635);
folder_colors["blue"] = Color(0.271, 0.843, 1.0);
folder_colors["purple"] = Color(0.502, 0.271, 1.0);
folder_colors["pink"] = Color(1.0, 0.271, 0.588);
folder_colors["gray"] = Color(0.616, 0.616, 0.616);
// Properly translating color names would require a separate HashMap, so for simplicity they are provided as comments.
folder_colors["red"] = Color(1.0, 0.271, 0.271); // TTR("Red")
folder_colors["orange"] = Color(1.0, 0.561, 0.271); // TTR("Orange")
folder_colors["yellow"] = Color(1.0, 0.890, 0.271); // TTR("Yellow")
folder_colors["green"] = Color(0.502, 1.0, 0.271); // TTR("Green")
folder_colors["teal"] = Color(0.271, 1.0, 0.635); // TTR("Teal")
folder_colors["blue"] = Color(0.271, 0.843, 1.0); // TTR("Blue")
folder_colors["purple"] = Color(0.502, 0.271, 1.0); // TTR("Purple")
folder_colors["pink"] = Color(1.0, 0.271, 0.588); // TTR("Pink")
folder_colors["gray"] = Color(0.616, 0.616, 0.616); // TTR("Gray")

assigned_folder_colors = ProjectSettings::get_singleton()->get_setting("file_customization/folder_colors");

Expand Down

0 comments on commit 060816c

Please sign in to comment.