diff --git a/language/anope.en_US.po b/language/anope.en_US.po index 0eb480110..b64776832 100644 --- a/language/anope.en_US.po +++ b/language/anope.en_US.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Anope\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-19 18:50+0100\n" -"PO-Revision-Date: 2025-09-19 18:50+0100\n" +"POT-Creation-Date: 2025-09-20 14:56+0100\n" +"PO-Revision-Date: 2025-09-20 14:56+0100\n" "Last-Translator: Sadie Powell \n" "Language-Team: English\n" "Language: en_US\n" @@ -393,7 +393,10 @@ msgstr "" msgid "{nick} ({mask}) [{real_name}]" msgstr "" -msgid "{nick}: expires in {expires}" +msgid "{nick}: registered on {registered}" +msgstr "" + +msgid "{nick}: registered on {registered}; expires in {expires}" msgstr "" msgid "{}{module_name}}:{name} = {value}" @@ -657,7 +660,7 @@ msgstr "" msgid "nickname {EMAIL | STATUS | MASK | QUIT} {ON | OFF}" msgstr "" -msgid "nickname {FIXED | FLEXIBLE}" +msgid "nickname {FIXED | FLEXIBLE | MONOSPACE}" msgstr "" msgid "nickname {ON | delay | OFF}" @@ -809,10 +812,6 @@ msgstr[1] "" msgid "%lu nicks are stored in the database, using %.2Lf kB of memory." msgstr "" -#, c-format -msgid "%s %s %s" -msgstr "" - #, c-format msgid "%s %s list is empty." msgstr "" @@ -1134,14 +1133,6 @@ msgstr "" msgid "%s's memo limit is %d." msgstr "" -#, c-format -msgid "%s: %s" -msgstr "" - -#, c-format -msgid "%s: %s %s" -msgstr "" - #, c-format msgid "%u channel" msgid_plural "%u channels" @@ -2268,13 +2259,27 @@ msgstr "" msgid "Configures reverses kicker" msgstr "" -msgid "Configures the layout used by the account for services messages. When the layout is set to FIXED services will use tables and position text such that it looks good in a client that uses a fixed-width font. When the layout is set to FLEXIBLE services will use an alternate format for messages and avoid any positioning that might be broken by a variable-width font." +msgid "" +"Configures the layout used by the account for services messages.\n" +"\n" +"When the layout is set to FIXED services will use tables and position text such that it looks good in a client that uses a fixed-width font.\n" +"\n" +"When the layout is set to FLEXIBLE services will use an alternate format for messages and avoid any positioning that might be broken by a variable-width font.\n" +"\n" +"When the layout is set to MONOSPACE services will format messages similar to FIXED but will prefix all messages with a monospace formatting character to force it to display correctly. This requires client support for monospace text formatting." msgstr "" msgid "Configures the layout used for services messages" msgstr "" -msgid "Configures the layout used for services messages. When the layout is set to FIXED services will use tables and position text such that it looks good in a client that uses a fixed-width font. When the layout is set to FLEXIBLE services will use an alternate format for messages and avoid any positioning that might be broken by a variable-width font." +msgid "" +"Configures the layout used for services messages.\n" +"\n" +"When the layout is set to FIXED services will use tables and position text such that it looks good in a client that uses a fixed-width font.\n" +"\n" +"When the layout is set to FLEXIBLE services will use an alternate format for messages and avoid any positioning that might be broken by a variable-width font.\n" +"\n" +"When the layout is set to MONOSPACE services will format messages similar to FIXED but will prefix all messages with a monospace formatting character to force it to display correctly. This requires client support for monospace text formatting." msgstr "" msgid "Configures the time bot bans expire in" @@ -3243,6 +3248,10 @@ msgstr "" msgid "Layout is now flexible for %s." msgstr "" +#, c-format +msgid "Layout is now monospace for %s." +msgstr "" + msgid "Level" msgstr "" @@ -3731,6 +3740,9 @@ msgstr "" msgid "Module: %s [%s] [%s]" msgstr "" +msgid "Monospace layout" +msgstr "" + #, c-format msgid "Multiple languages matched %s. Please be more specific." msgstr "" @@ -6585,7 +6597,7 @@ msgstr "" msgid "{number}: {mask} -- created by {creator} on {created}; {expires} ({reason})" msgstr "" -msgid "{number}: {mask} -- {limit} sessions" +msgid "{number}: {mask} -- {limit} sessions ({reason})" msgstr "" msgid "{number}: {mask} -- {limit} sessions; created by {creator} on {created}; {expires} ({reason})" diff --git a/modules/nickserv/ns_set_layout.cpp b/modules/nickserv/ns_set_layout.cpp index de3416c4e..f81931597 100644 --- a/modules/nickserv/ns_set_layout.cpp +++ b/modules/nickserv/ns_set_layout.cpp @@ -19,7 +19,7 @@ public: : Command(creator, sname, min, min + 1) { this->SetDesc(_("Configures the layout used for services messages")); - this->SetSyntax("{FIXED | FLEXIBLE}"); + this->SetSyntax("{FIXED | FLEXIBLE | MONOSPACE}"); } void Run(CommandSource &source, const Anope::string &user, const Anope::string ¶m) @@ -45,16 +45,25 @@ public: if (param.equals_ci("FIXED")) { - nc->Shrink("NS_FLEXIBLE"); + nc->Shrink("NS_FLEXIBLE"); + nc->Shrink("NS_MONOSPACE"); Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to change the layout to fixed for " << nc->display; source.Reply(_("Layout is now \002fixed\002 for \002%s\002."), nc->display.c_str()); } else if (param.equals_ci("FLEXIBLE")) { nc->Extend("NS_FLEXIBLE"); + nc->Shrink("NS_MONOSPACE"); Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to change the layout to flexible for " << nc->display; source.Reply(_("Layout is now \002flexible\002 for \002%s\002."), nc->display.c_str()); } + else if (param.equals_ci("MONOSPACE")) + { + nc->Shrink("NS_FLEXIBLE"); + nc->Extend("NS_MONOSPACE"); + Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to change the layout to monospace for " << nc->display; + source.Reply(_("Layout is now \002monospace\002 for \002%s\002."), nc->display.c_str()); + } else { this->OnSyntaxError(source, "LAYOUT"); @@ -71,11 +80,19 @@ public: this->SendSyntax(source); source.Reply(" "); source.Reply(_( - "Configures the layout used for services messages. When the layout is set to " - "\037FIXED\037 services will use tables and position text such that it looks " - "good in a client that uses a fixed-width font. When the layout is set to " - "\037FLEXIBLE\037 services will use an alternate format for messages and avoid " - "any positioning that might be broken by a variable-width font." + "Configures the layout used for services messages." + "\n\n" + "When the layout is set to \037FIXED\037 services will use tables and position " + "text such that it looks good in a client that uses a fixed-width font." + "\n\n" + "When the layout is set to \037FLEXIBLE\037 services will use an alternate " + "format for messages and avoid any positioning that might be broken by a " + "variable-width font." + "\n\n" + "When the layout is set to \037MONOSPACE\037 services will format messages " + "similar to \037FIXED\037 but will prefix all messages with a monospace " + "formatting character to force it to display correctly. This requires client " + "support for monospace text formatting." )); return true; } @@ -89,7 +106,7 @@ public: : CommandNSSetLayout(creator, "nickserv/saset/layout", 2) { this->ClearSyntax(); - this->SetSyntax(_("\037nickname\037 {FIXED | FLEXIBLE}")); + this->SetSyntax(_("\037nickname\037 {FIXED | FLEXIBLE | MONOSPACE}")); } void Execute(CommandSource &source, const std::vector ¶ms) override @@ -102,11 +119,19 @@ public: this->SendSyntax(source); source.Reply(" "); source.Reply(_( - "Configures the layout used by the account for services messages. When the " - "layout is set to \037FIXED\037 services will use tables and position text such " - "that it looks good in a client that uses a fixed-width font. When the layout is " - "set to \037FLEXIBLE\037 services will use an alternate format for messages and " - "avoid any positioning that might be broken by a variable-width font." + "Configures the layout used by the account for services messages." + "\n\n" + "When the layout is set to \037FIXED\037 services will use tables and position " + "text such that it looks good in a client that uses a fixed-width font." + "\n\n" + "When the layout is set to \037FLEXIBLE\037 services will use an alternate " + "format for messages and avoid any positioning that might be broken by a " + "variable-width font." + "\n\n" + "When the layout is set to \037MONOSPACE\037 services will format messages " + "similar to \037FIXED\037 but will prefix all messages with a monospace " + "formatting character to force it to display correctly. This requires client " + "support for monospace text formatting." )); return true; } @@ -120,6 +145,7 @@ private: CommandNSSASetLayout commandnssasetlayout; SerializableExtensibleItem nsflexible; + SerializableExtensibleItem nsmonospace; public: NSSetLayout(const Anope::string &modname, const Anope::string &creator) @@ -127,18 +153,21 @@ public: , commandnssetlayout(this) , commandnssasetlayout(this) , nsflexible(this, "NS_FLEXIBLE") + , nsmonospace(this, "NS_MONOSPACE") { } void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override { - if (nsflexible.HasExt(na->nc)) - info.AddOption(_("Flexible layout")); - else - info.AddOption(_("Fixed layout")); - if (!show_hidden) return; + + if (nsflexible.HasExt(na->nc)) + info.AddOption(_("Flexible layout")); + else if (nsmonospace.HasExt(na->nc)) + info.AddOption(_("Monospace layout")); + else + info.AddOption(_("Fixed layout")); } }; diff --git a/src/command.cpp b/src/command.cpp index d45299c6f..326a4fcd5 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -150,6 +150,7 @@ void Command::SendSyntax(CommandSource &source) { const auto *sourcenc = source.GetAccount(); const auto flexible = sourcenc ? sourcenc->HasExt("NS_FLEXIBLE") : false; + const auto *monospace = !flexible && sourcenc && sourcenc->HasExt("NS_MONOSPACE") ? "\021" : ""; auto first = true; Anope::string prefix = Language::Translate(source.GetAccount(), _("Syntax")); @@ -162,18 +163,23 @@ void Command::SendSyntax(CommandSource &source) if (first || flexible) { first = false; - source.Reply(_("%s: \002%s %s\002"), prefix.c_str(), source.command.nobreak().c_str(), + source.Reply("%s%s: \002%s %s\002", monospace, prefix.c_str(), + source.command.nobreak().c_str(), Language::Translate(source.GetAccount(), syntax.c_str())); } else { - source.Reply(_("%s \002%s %s\002"), padding.c_str(), source.command.nobreak().c_str(), + source.Reply("%s%s \002%s %s\002", monospace, padding.c_str(), + source.command.nobreak().c_str(), Language::Translate(source.GetAccount(), syntax.c_str())); } } if (first) - source.Reply(_("%s: \002%s\002"), prefix.c_str(), source.command.nobreak().c_str()); + { + source.Reply("%s%s: \002%s\002", monospace, prefix.c_str(), + source.command.nobreak().c_str()); + } } void Command::AllowUnregistered(bool b) diff --git a/src/misc.cpp b/src/misc.cpp index 14ab4b534..c7afcff52 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -152,6 +152,8 @@ void ListFormatter::SendTo(CommandSource &source) void ListFormatter::SendFixed(CommandSource &source) { + const auto *monospace = source.nc && source.GetAccount()->HasExt("NS_MONOSPACE") ? "\021" : ""; + std::vector tcolumns; std::map lengths; std::set breaks; @@ -185,13 +187,13 @@ void ListFormatter::SendFixed(CommandSource &source) /* Only put a list header if more than 1 column */ if (this->columns.size() > 1) { - Anope::string s; + Anope::string s = monospace; for (unsigned i = 0; i < this->columns.size(); ++i) { if (breaks.count(this->columns[i])) { source.Reply(s); - s = " "; + s = Anope::Format("%s ", monospace); } else if (!s.empty()) s += " "; @@ -205,13 +207,13 @@ void ListFormatter::SendFixed(CommandSource &source) for (auto &entry : this->entries) { - Anope::string s; + Anope::string s = monospace; for (unsigned j = 0; j < this->columns.size(); ++j) { if (breaks.count(this->columns[j])) { source.Reply(s); - s = " "; + s = Anope::Format("%s ", monospace); } else if (!s.empty()) s += " "; @@ -260,6 +262,8 @@ void InfoFormatter::SendTo(CommandSource &source) { const auto *sourcenc = source.GetAccount(); const auto flexible = sourcenc ? sourcenc->HasExt("NS_FLEXIBLE") : false; + const auto *monospace = !flexible && sourcenc && sourcenc->HasExt("NS_MONOSPACE") ? "\021" : ""; + for (const auto &[key, value] : this->replies) { if (flexible) @@ -270,7 +274,7 @@ void InfoFormatter::SendTo(CommandSource &source) else { Anope::string padding(longest - key.utf8length(), ' '); - source.Reply("%s: %s%s", key.c_str(), padding.c_str(), + source.Reply("%s%s: %s%s", monospace, key.c_str(), padding.c_str(), Language::Translate(this->nc, value.c_str())); } } @@ -317,6 +321,7 @@ void HelpWrapper::SendTo(CommandSource &source) { const auto *sourcenc = source.GetAccount(); const auto flexible = sourcenc ? sourcenc->HasExt("NS_FLEXIBLE") : false; + const auto *monospace = !flexible && sourcenc && sourcenc->HasExt("NS_MONOSPACE") ? "\021" : ""; const auto max_length = Config->GetBlock("options").Get("linelength", "100") - longest - 8; @@ -333,11 +338,14 @@ void HelpWrapper::SendTo(CommandSource &source) Anope::string padding(longest - entry_name.utf8length(), ' '); if (lw.GetLine(line)) - source.Reply(" %s%s %s", entry_name.nobreak().c_str(), padding.c_str(), line.c_str()); + { + source.Reply("%s %s%s %s", monospace, entry_name.nobreak().c_str(), + padding.c_str(), line.c_str()); + } padding = Anope::string(longest, ' '); while (lw.GetLine(line)) - source.Reply(" %s %s", padding.c_str(), line.c_str()); + source.Reply("%s %s %s", monospace, padding.c_str(), line.c_str()); } } };