Skip to content

Commit

Permalink
Split editor help dialog text into multiple translatable lines
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi committed Jan 26, 2025
1 parent ecdc554 commit 0bf2289
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion src/supertux/menu/editor_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,37 @@ EditorMenu::menu_action(MenuItem& item)
case MNID_HELP:
{
auto dialog = std::make_unique<Dialog>();
dialog->set_text(_("Keyboard Shortcuts:\n---------------------\nEsc = Open Menu\nCtrl+S = Save\nCtrl+T = Test\nCtrl+Z = Undo\nCtrl+Y = Redo\nF5 = Toggle Autotiling\nF6 = Render Light\nF7 = Grid Snapping\nF8 = Show Grid\nCtrl++ or Ctrl+Scroll Up = Zoom In\nCtrl+- or Ctrl+Scroll Down = Zoom Out\nCtrl+D = Reset Zoom\n\nScripting Shortcuts:\n ------------- \nHome = Go to beginning of line\nEnd = Go to end of line\nLeft arrow = Go back in text\nRight arrow = Go forward in text\nBackspace = Delete in front of text cursor\nDelete = Delete behind text cursor\nCtrl+X = Cut whole line\nCtrl+C = Copy whole line\nCtrl+V = Paste\nCtrl+D = Duplicate line\nCtrl+Z = Undo\nCtrl+Y = Redo"));
auto help_dialog_text =
_("Keyboard Shortcuts:") + "\n" +
"---------------------" + "\n" +
_("Esc = Open Menu") + "\n" +
_("Ctrl+S = Save") + "\n" +
_("Ctrl+T = Test") + "\n" +
_("Ctrl+Z = Undo") + "\n" +
_("Ctrl+Y = Redo") + "\n" +
_("F5 = Toggle Autotiling") + "\n" +
_("F6 = Render Light") + "\n" +
_("F7 = Grid Snapping") + "\n" +
_("F8 = Show Grid") + "\n" +
_("Ctrl++ or Ctrl+Scroll Up = Zoom In") + "\n" +
_("Ctrl+- or Ctrl+Scroll Down = Zoom Out") + "\n" +
_("Ctrl+D = Reset Zoom") + "\n\n" +
_("Scripting Shortcuts:") + "\n" +
"-------------" + "\n" +
_("Home = Go to beginning of line") + "\n" +
_("End = Go to end of line") + "\n" +
_("Left arrow = Go back in text") + "\n" +
_("Right arrow = Go forward in text") + "\n" +
_("Backspace = Delete in front of text cursor") + "\n" +
_("Delete = Delete behind text cursor") + "\n" +
_("Ctrl+X = Cut whole line") + "\n" +
_("Ctrl+C = Copy whole line") + "\n" +
_("Ctrl+V = Paste") + "\n" +
_("Ctrl+D = Duplicate line") + "\n" +
_("Ctrl+Z = Undo") + "\n" +
_("Ctrl+Y = Redo");

dialog->set_text(help_dialog_text);
dialog->add_cancel_button(_("Got it!"));
MenuManager::instance().set_dialog(std::move(dialog));
}
Expand Down

0 comments on commit 0bf2289

Please sign in to comment.