Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide translation strings for folder colors #82858

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions editor/filesystem_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2971,7 +2971,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 @@ -3531,16 +3531,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