add: ability to translate help messages in controls.
This commit is contained in:
parent
a2273f3410
commit
25e673a547
2 changed files with 5 additions and 5 deletions
|
|
@ -356,12 +356,12 @@ int BotControl::cmdNode () {
|
||||||
if (strValue (cmd) == "help" && hasArg (cmd2) && commands.has (strValue (cmd2))) {
|
if (strValue (cmd) == "help" && hasArg (cmd2) && commands.has (strValue (cmd2))) {
|
||||||
auto &item = commands[strValue (cmd2)];
|
auto &item = commands[strValue (cmd2)];
|
||||||
|
|
||||||
msg ("Command: \"%s %s %s\"\nFormat: %s\nHelp: %s", m_args[root], m_args[alias], item.name, item.format, item.help);
|
msg ("Command: \"%s %s %s\"\nFormat: %s\nHelp: %s", m_args[root], m_args[alias], item.name, item.format, conf.translate (item.help));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (auto &desc : descriptions) {
|
for (auto &desc : descriptions) {
|
||||||
auto &item = commands[desc];
|
auto &item = commands[desc];
|
||||||
msg (" %s - %s", item.name, item.help);
|
msg (" %s - %s", item.name, conf.translate (item.help));
|
||||||
}
|
}
|
||||||
msg ("Currently Graph Status %s", graph.hasEditFlag (GraphEdit::On) ? "Enabled" : "Disabled");
|
msg ("Currently Graph Status %s", graph.hasEditFlag (GraphEdit::On) ? "Enabled" : "Disabled");
|
||||||
}
|
}
|
||||||
|
|
@ -1609,7 +1609,7 @@ bool BotControl::executeCommands () {
|
||||||
if (hasArg (1) && m_args[1] == "help") {
|
if (hasArg (1) && m_args[1] == "help") {
|
||||||
for (auto &item : m_cmds) {
|
for (auto &item : m_cmds) {
|
||||||
if (aliasMatch (item.name, m_args[2], cmd)) {
|
if (aliasMatch (item.name, m_args[2], cmd)) {
|
||||||
msg ("Command: \"%s %s\"\nFormat: %s\nHelp: %s", prefix, cmd, item.format, item.help);
|
msg ("Command: \"%s %s\"\nFormat: %s\nHelp: %s", prefix, cmd, item.format, conf.translate (item.help));
|
||||||
msg ("Aliases: %s", String::join (item.name.split ("/"), ", "));
|
msg ("Aliases: %s", String::join (item.name.split ("/"), ", "));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -1632,7 +1632,7 @@ bool BotControl::executeCommands () {
|
||||||
msg ("valid commands are: ");
|
msg ("valid commands are: ");
|
||||||
|
|
||||||
for (auto &item : m_cmds) {
|
for (auto &item : m_cmds) {
|
||||||
msg (" %s - %s", item.name.split ("/")[0], item.help);
|
msg (" %s - %s", item.name.split ("/")[0], conf.translate (item.help));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,7 @@ Bot *BotManager::findBotByIndex (int index) {
|
||||||
return bot.get ();
|
return bot.get ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nullptr; // no bot``
|
return nullptr; // no bot
|
||||||
}
|
}
|
||||||
|
|
||||||
Bot *BotManager::findBotByEntity (edict_t *ent) {
|
Bot *BotManager::findBotByEntity (edict_t *ent) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue