diff --git a/src/misc.cpp b/src/misc.cpp index 44d4cdc91..13fe8b015 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -340,22 +340,24 @@ void ExampleWrapper::SendTo(CommandSource &source) header = false; } + const auto *trans_command = Language::Translate(source.nc, source.command.c_str()); + const auto *trans_description = Language::Translate(source.nc, entry.description.c_str()); if (flexible) { - source.Reply("\002%s%s%s\002: %s", source.command.c_str(), entry.example.empty() ? "" : " ", - entry.example.c_str(), entry.description.c_str()); + source.Reply("\002%s%s%s\002: %s", source.command.c_str(), *trans_command ? " " : "", + trans_command, trans_description); } else { source.Reply(" "); - const auto full_example = Anope::Format("%s%s%s", source.command.c_str(), - entry.example.empty() ? "" : " ", entry.example.c_str()); + const auto full_command = Anope::Format("%s%s%s", source.command.c_str(), + *trans_command ? " " : "", trans_command); - LineWrapper elw(Language::Translate(source.nc, full_example.c_str()), max_length - 2); + LineWrapper elw(full_command, max_length - 2); for (Anope::string line; elw.GetLine(line); ) source.Reply("%s \002%s\002", monospace, line.c_str()); - LineWrapper dlw(Language::Translate(source.nc, entry.description.c_str()), max_length - 4); + LineWrapper dlw(trans_description, max_length - 4); for (Anope::string line; dlw.GetLine(line); ) source.Reply("%s %s", monospace, line.c_str()); }