From bf285cfa50ce1cc7e38bbed232a426f57c2586db Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 17 Nov 2011 02:19:10 +0000 Subject: [PATCH] Make the undo/redo strings more localization-friendly. Closes #1104. Originally committed to SVN as r5869. --- aegisub/src/command/edit.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/aegisub/src/command/edit.cpp b/aegisub/src/command/edit.cpp index 868973193..7e3830e69 100644 --- a/aegisub/src/command/edit.cpp +++ b/aegisub/src/command/edit.cpp @@ -355,10 +355,14 @@ struct edit_redo : public Command { CMD_TYPE(COMMAND_VALIDATE | COMMAND_DYNAMIC_NAME) wxString StrMenu(const agi::Context *c) const { - return wxString::Format(_("&Redo %s"), c->ass->GetRedoDescription()); + return c->ass->IsRedoStackEmpty() ? + _("Nothing to &redo") : + wxString::Format(_("&Redo %s"), c->ass->GetRedoDescription()); } wxString StrDisplay(const agi::Context *c) const { - return wxString::Format(_("Redo %s"), c->ass->GetRedoDescription()); + return c->ass->IsRedoStackEmpty() ? + _("Nothing to redo") : + wxString::Format(_("Redo %s"), c->ass->GetRedoDescription()); } bool Validate(const agi::Context *c) { @@ -378,10 +382,14 @@ struct edit_undo : public Command { CMD_TYPE(COMMAND_VALIDATE | COMMAND_DYNAMIC_NAME) wxString StrMenu(const agi::Context *c) const { - return wxString::Format(_("&Undo %s"), c->ass->GetUndoDescription()); + return c->ass->IsUndoStackEmpty() ? + _("Nothing to &undo") : + wxString::Format(_("&Undo %s"), c->ass->GetUndoDescription()); } wxString StrDisplay(const agi::Context *c) const { - return wxString::Format(_("Undo %s"), c->ass->GetUndoDescription()); + return c->ass->IsUndoStackEmpty() ? + _("Nothing to undo") : + wxString::Format(_("Undo %s"), c->ass->GetUndoDescription()); } bool Validate(const agi::Context *c) {