mirror of
https://github.com/PCSX2/pcsx2.git
synced 2025-12-16 04:08:48 +00:00
Debugger: Split debugger event actions strings for easier translation
This commit is contained in:
parent
a92297ceec
commit
f65c1dd5bc
@ -38,7 +38,8 @@ namespace DebuggerEvents
|
||||
|
||||
bool switch_to_tab = true;
|
||||
|
||||
static constexpr const char* ACTION_PREFIX = QT_TRANSLATE_NOOP("DebuggerEvents", "Go to in");
|
||||
static constexpr const char* ACTION_STRING = QT_TRANSLATE_NOOP("DebuggerEvents", "Go to in %1");
|
||||
static constexpr const char* ACTION_OVERFLOW_STRING = QT_TRANSLATE_NOOP("DebuggerEvents", "Go to in...");
|
||||
};
|
||||
|
||||
// The state of the VM has changed and views should be updated to reflect
|
||||
@ -53,6 +54,7 @@ namespace DebuggerEvents
|
||||
u32 address = 0;
|
||||
bool switch_to_tab = true;
|
||||
|
||||
static constexpr const char* ACTION_PREFIX = QT_TRANSLATE_NOOP("DebuggerEvents", "Add to");
|
||||
static constexpr const char* ACTION_STRING = QT_TRANSLATE_NOOP("DebuggerEvents", "Add to %1");
|
||||
static constexpr const char* ACTION_OVERFLOW_STRING = QT_TRANSLATE_NOOP("DebuggerEvents", "Add to...");
|
||||
};
|
||||
} // namespace DebuggerEvents
|
||||
|
||||
@ -257,7 +257,8 @@ std::vector<QAction*> DebuggerView::createEventActionsImplementation(
|
||||
u32 max_top_level_actions,
|
||||
bool skip_self,
|
||||
const char* event_type,
|
||||
const char* action_prefix,
|
||||
const char* action_string,
|
||||
const char* action_overflow_string,
|
||||
std::function<const DebuggerEvents::Event*()> event_func)
|
||||
{
|
||||
if (!g_debugger_window)
|
||||
@ -278,8 +279,7 @@ std::vector<QAction*> DebuggerView::createEventActionsImplementation(
|
||||
QMenu* submenu = nullptr;
|
||||
if (receivers.size() > max_top_level_actions)
|
||||
{
|
||||
QString title_format = QCoreApplication::translate("DebuggerEvent", "%1...");
|
||||
submenu = new QMenu(title_format.arg(QCoreApplication::translate("DebuggerEvent", action_prefix)), menu);
|
||||
submenu = new QMenu(QCoreApplication::translate("DebuggerEvents", action_overflow_string), menu);
|
||||
}
|
||||
|
||||
std::vector<QAction*> actions;
|
||||
@ -290,9 +290,8 @@ std::vector<QAction*> DebuggerView::createEventActionsImplementation(
|
||||
QAction* action;
|
||||
if (!submenu || i + 1 < max_top_level_actions)
|
||||
{
|
||||
QString title_format = QCoreApplication::translate("DebuggerEvent", "%1 %2");
|
||||
QString event_title = QCoreApplication::translate("DebuggerEvent", action_prefix);
|
||||
QString title = title_format.arg(event_title).arg(receiver->displayName());
|
||||
QString title_format = QCoreApplication::translate("DebuggerEvents", action_string);
|
||||
QString title = title_format.arg(receiver->displayName());
|
||||
action = new QAction(title, menu);
|
||||
menu->addAction(action);
|
||||
}
|
||||
|
||||
@ -127,7 +127,8 @@ public:
|
||||
u32 max_top_level_actions = 5)
|
||||
{
|
||||
return createEventActionsImplementation(
|
||||
menu, max_top_level_actions, skip_self, typeid(Event).name(), Event::ACTION_PREFIX,
|
||||
menu, max_top_level_actions, skip_self, typeid(Event).name(),
|
||||
Event::ACTION_STRING, Event::ACTION_OVERFLOW_STRING,
|
||||
[event_func]() -> DebuggerEvents::Event* {
|
||||
static std::optional<Event> event;
|
||||
event = event_func();
|
||||
@ -176,7 +177,8 @@ private:
|
||||
u32 max_top_level_actions,
|
||||
bool skip_self,
|
||||
const char* event_type,
|
||||
const char* action_prefix,
|
||||
const char* action_string,
|
||||
const char* action_overflow_string,
|
||||
std::function<const DebuggerEvents::Event*()> event_func);
|
||||
|
||||
// Used for sorting debugger views that have the same display name. Unique
|
||||
|
||||
Loading…
Reference in New Issue
Block a user