summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-06-17 19:57:43 -0400
committerAdam <Adam@anope.org>2011-06-17 19:57:43 -0400
commita1b36ec0a527e6d7a9d224b56bf9571619d5f92e (patch)
tree5e74290f46205ef1ad86700e1f04ec016b1f66fd
parent48e995ddf2cd30a05222a51e665c02b1e7ae567a (diff)
Search all domains for language strings, fixes the mess that we used to use to translate strings in 3rd party modules
-rw-r--r--include/extern.h10
-rw-r--r--include/language.h172
-rw-r--r--include/modules.h6
-rw-r--r--include/services.h5
-rwxr-xr-xlanguage/update.sh2
-rw-r--r--modules/core/bs_kick.cpp4
-rw-r--r--modules/core/bs_main.cpp12
-rw-r--r--modules/core/cs_access.cpp2
-rw-r--r--modules/core/cs_main.cpp15
-rw-r--r--modules/core/cs_suspend.cpp2
-rw-r--r--modules/core/ms_main.cpp10
-rw-r--r--modules/core/ms_read.cpp2
-rw-r--r--modules/core/ns_help.cpp2
-rw-r--r--modules/core/ns_main.cpp10
-rw-r--r--modules/core/ns_recover.cpp4
-rw-r--r--modules/core/ns_resetpass.cpp6
-rw-r--r--modules/core/ns_sendpass.cpp6
-rw-r--r--modules/core/ns_set_language.cpp6
-rw-r--r--modules/core/os_main.cpp4
-rw-r--r--modules/extra/cs_appendtopic.cpp6
-rw-r--r--modules/extra/cs_enforce.cpp28
-rw-r--r--modules/extra/cs_tban.cpp8
-rw-r--r--modules/extra/hs_request.cpp48
-rw-r--r--modules/extra/language/cs_appendtopic.de_DE.po8
-rw-r--r--modules/extra/language/cs_appendtopic.it_IT.po7
-rw-r--r--modules/extra/language/cs_appendtopic.nl_NL.po7
-rw-r--r--modules/extra/language/cs_appendtopic.pot6
-rw-r--r--modules/extra/language/cs_appendtopic.pt_PT.po7
-rw-r--r--modules/extra/language/cs_appendtopic.ru_RU.po7
-rw-r--r--modules/extra/language/cs_enforce.de_DE.po19
-rw-r--r--modules/extra/language/cs_enforce.it_IT.po19
-rw-r--r--modules/extra/language/cs_enforce.nl_NL.po19
-rw-r--r--modules/extra/language/cs_enforce.pot18
-rw-r--r--modules/extra/language/cs_enforce.pt_PT.po19
-rw-r--r--modules/extra/language/cs_enforce.ru_RU.po19
-rw-r--r--modules/extra/language/cs_entrymsg.pot30
-rw-r--r--modules/extra/language/cs_tban.de_DE.po17
-rw-r--r--modules/extra/language/cs_tban.it_IT.po17
-rw-r--r--modules/extra/language/cs_tban.nl_NL.po17
-rw-r--r--modules/extra/language/cs_tban.pot16
-rw-r--r--modules/extra/language/cs_tban.pt_PT.po17
-rw-r--r--modules/extra/language/cs_tban.ru_RU.po17
-rw-r--r--modules/extra/language/hs_request.it_IT.po90
-rw-r--r--modules/extra/language/hs_request.nl_NL.po90
-rw-r--r--modules/extra/language/hs_request.pot73
-rw-r--r--modules/extra/language/hs_request.pt_PT.po90
-rw-r--r--modules/extra/language/hs_request.ru_RU.po90
-rw-r--r--modules/extra/language/m_ldap_authentication.pot27
-rw-r--r--modules/extra/language/ns_maxemail.pot2
-rw-r--r--modules/extra/language/os_defcon.pot100
-rwxr-xr-xmodules/extra/language/update.sh2
-rw-r--r--modules/extra/m_async_commands.cpp5
-rw-r--r--modules/extra/ns_maxemail.cpp4
-rw-r--r--modules/extra/os_defcon.cpp4
-rw-r--r--src/botserv.cpp6
-rw-r--r--src/command.cpp7
-rw-r--r--src/commands.cpp13
-rw-r--r--src/language.cpp58
-rw-r--r--src/misc.cpp25
-rw-r--r--src/module.cpp17
-rw-r--r--src/modules.cpp22
-rw-r--r--src/regchannel.cpp4
-rw-r--r--src/users.cpp5
63 files changed, 762 insertions, 628 deletions
diff --git a/include/extern.h b/include/extern.h
index 8aa5428a7..91312d1ab 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -93,12 +93,12 @@ E void pmodule_ircd_message(IRCdMessage *message);
/**** language.cpp ****/
E std::vector<Anope::string> languages;
+E std::vector<Anope::string> domains;
E void InitLanguages();
-E const Anope::string GetString(NickCore *nc, const char *string);
-E const Anope::string GetString(const Anope::string &domain, const Anope::string &lang, const char *string);
-E void PushLanguage(const Anope::string &, Anope::string);
-E void PopLanguage();
-E const char *anope_gettext(const char *string);
+E const char *translate(const char *string);
+E const char *translate(User *u, const char *string);
+E const char *translate(NickCore *nc, const char *string);
+E const char *anope_gettext(const char *lang, const char *string);
E void SyntaxError(CommandSource &source, const Anope::string &command, const Anope::string &message);
/**** main.c ****/
diff --git a/include/language.h b/include/language.h
index e8d69aaf0..efddc0a34 100644
--- a/include/language.h
+++ b/include/language.h
@@ -6,107 +6,107 @@
* Please read COPYING and README for further details.
*/
-#define MORE_INFO gtl("\002%s%s HELP %s\002 for more information.")
-#define BAD_USERHOST_MASK gtl("Mask must be in the form \037user\037@\037host\037.")
-#define BAD_EXPIRY_TIME gtl("Invalid expiry time.")
-#define USERHOST_MASK_TOO_WIDE gtl("%s coverage is too wide; Please use a more specific mask.")
-#define READ_ONLY_MODE gtl("Services are in read-only mode!")
-#define PASSWORD_INCORRECT gtl("Password incorrect.")
-#define ACCESS_DENIED gtl("Access denied.")
-#define MORE_OBSCURE_PASSWORD gtl("Please try again with a more obscure password. Passwords should be at least\n \
+#define MORE_INFO _("\002%s%s HELP %s\002 for more information.")
+#define BAD_USERHOST_MASK _("Mask must be in the form \037user\037@\037host\037.")
+#define BAD_EXPIRY_TIME _("Invalid expiry time.")
+#define USERHOST_MASK_TOO_WIDE _("%s coverage is too wide; Please use a more specific mask.")
+#define READ_ONLY_MODE _("Services are in read-only mode!")
+#define PASSWORD_INCORRECT _("Password incorrect.")
+#define ACCESS_DENIED _("Access denied.")
+#define MORE_OBSCURE_PASSWORD _("Please try again with a more obscure password. Passwords should be at least\n \
five characters long, should not be something easily guessed\n \
(e.g. your real name or your nick), and cannot contain the space or tab characters.")
-#define PASSWORD_TOO_LONG gtl("Your password is too long. Please try again with a shorter password.")
-#define NICK_NOT_REGISTERED gtl("Your nick isn't registered.")
-#define NICK_X_NOT_REGISTERED gtl("Nick \002%s\002 isn't registered.")
-#define NICK_X_NOT_IN_USE gtl("Nick \002%s\002 isn't currently in use.")
-#define NICK_X_NOT_ON_CHAN gtl("\002%s\002 is not currently on channel %s.")
-#define NICK_X_SUSPENDED gtl("Nick %s is currently suspended.")
-#define CHAN_X_SUSPENDED gtl("Channel %s is currently suspended.")
-#define CHAN_X_NOT_REGISTERED gtl("Channel \002%s\002 isn't registered.")
-#define CHAN_X_NOT_IN_USE gtl("Channel \002%s\002 doesn't exist.")
-#define NICK_IDENTIFY_REQUIRED gtl("Password authentication required for that command.\n" \
+#define PASSWORD_TOO_LONG _("Your password is too long. Please try again with a shorter password.")
+#define NICK_NOT_REGISTERED _("Your nick isn't registered.")
+#define NICK_X_NOT_REGISTERED _("Nick \002%s\002 isn't registered.")
+#define NICK_X_NOT_IN_USE _("Nick \002%s\002 isn't currently in use.")
+#define NICK_X_NOT_ON_CHAN _("\002%s\002 is not currently on channel %s.")
+#define NICK_X_SUSPENDED _("Nick %s is currently suspended.")
+#define CHAN_X_SUSPENDED _("Channel %s is currently suspended.")
+#define CHAN_X_NOT_REGISTERED _("Channel \002%s\002 isn't registered.")
+#define CHAN_X_NOT_IN_USE _("Channel \002%s\002 doesn't exist.")
+#define NICK_IDENTIFY_REQUIRED _("Password authentication required for that command.\n" \
"Retry after typing \002%s%s IDENTIFY \037password\037\002.")
-#define MAIL_X_INVALID gtl("\002%s\002 is not a valid e-mail address.")
-#define NO_REASON gtl("No reason")
-#define UNKNOWN gtl("<unknown>")
-#define NO_EXPIRE gtl("does not expire")
-#define END_OF_ANY_LIST gtl("End of \002%s\002 list.")
-#define LIST_INCORRECT_RANGE gtl("Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002.")
-#define UNKNOWN_OPTION gtl("Unknown option \002%s\002.\n" \
+#define MAIL_X_INVALID _("\002%s\002 is not a valid e-mail address.")
+#define NO_REASON _("No reason")
+#define UNKNOWN _("<unknown>")
+#define NO_EXPIRE _("does not expire")
+#define END_OF_ANY_LIST _("End of \002%s\002 list.")
+#define LIST_INCORRECT_RANGE _("Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002.")
+#define UNKNOWN_OPTION _("Unknown option \002%s\002.\n" \
"Type %s%s HELP %s for more information.")
-#define NICK_IS_REGISTERED gtl("This nick is owned by someone else. Please choose another.\n" \
+#define NICK_IS_REGISTERED _("This nick is owned by someone else. Please choose another.\n" \
"(If this is your nick, type \002%s%s IDENTIFY \037password\037\002.)")
-#define NICK_IS_SECURE gtl("This nickname is registered and protected. If it is your\n" \
+#define NICK_IS_SECURE _("This nickname is registered and protected. If it is your\n" \
"nick, type \002%s%s IDENTIFY \037password\037\002. Otherwise,\n" \
"please choose a different nick.")
-#define FORCENICKCHANGE_NOW gtl("This nickname has been registered; you may not use it.")
-#define NICK_CANNOT_BE_REGISTERED gtl("Nickname \002%s\002 may not be registered.")
-#define NICK_ALREADY_REGISTERED gtl("Nickname \002%s\002 is already registered!")
-#define NICK_SET_SYNTAX gtl("SET \037option\037 \037parameters\037")
-#define NICK_SET_DISABLED gtl("Sorry, nickname option setting is temporarily disabled.")
-#define NICK_SET_UNKNOWN_OPTION gtl("Unknown SET option \002%s%s\002.")
-#define NICK_SET_DISPLAY_CHANGED gtl("The new display is now \002%s\002.")
-#define NICK_SASET_SYNTAX gtl("SASET \037nickname\037 \037option\037 \037parameters\037")
-#define NICK_SASET_DISPLAY_INVALID gtl("The new display for \002%s\002 MUST be a nickname of the nickname group!")
-#define NICK_SASET_PASSWORD_FAILED gtl("Sorry, couldn't change password for \002%s\002.")
-#define NICK_SASET_PASSWORD_CHANGED gtl("Password for \002%s\002 changed.")
-#define NICK_SASET_PASSWORD_CHANGED_TO gtl("Password for \002%s\002 changed to \002%s\002.")
-#define NICK_INFO_OPTIONS gtl(" Options: %s")
-#define NICK_LIST_SYNTAX gtl("LIST \037pattern\037")
-#define LIST_HEADER gtl("List of entries matching \002%s\002:")
-#define NICK_RECOVERED gtl("User claiming your nick has been killed.\n" \
+#define FORCENICKCHANGE_NOW _("This nickname has been registered; you may not use it.")
+#define NICK_CANNOT_BE_REGISTERED _("Nickname \002%s\002 may not be registered.")
+#define NICK_ALREADY_REGISTERED _("Nickname \002%s\002 is already registered!")
+#define NICK_SET_SYNTAX _("SET \037option\037 \037parameters\037")
+#define NICK_SET_DISABLED _("Sorry, nickname option setting is temporarily disabled.")
+#define NICK_SET_UNKNOWN_OPTION _("Unknown SET option \002%s%s\002.")
+#define NICK_SET_DISPLAY_CHANGED _("The new display is now \002%s\002.")
+#define NICK_SASET_SYNTAX _("SASET \037nickname\037 \037option\037 \037parameters\037")
+#define NICK_SASET_DISPLAY_INVALID _("The new display for \002%s\002 MUST be a nickname of the nickname group!")
+#define NICK_SASET_PASSWORD_FAILED _("Sorry, couldn't change password for \002%s\002.")
+#define NICK_SASET_PASSWORD_CHANGED _("Password for \002%s\002 changed.")
+#define NICK_SASET_PASSWORD_CHANGED_TO _("Password for \002%s\002 changed to \002%s\002.")
+#define NICK_INFO_OPTIONS _(" Options: %s")
+#define NICK_LIST_SYNTAX _("LIST \037pattern\037")
+#define LIST_HEADER _("List of entries matching \002%s\002:")
+#define NICK_RECOVERED _("User claiming your nick has been killed.\n" \
"\002%s%s RELEASE %s\002 to get it back before %s timeout.")
-#define NICK_REQUESTED gtl("This nick has already been requested, please check your e-mail address for the pass code")
-#define NICK_CONFIRM_INVALID gtl("Invalid passcode has been entered, please check the e-mail again, and retry")
-#define CHAN_NOT_ALLOWED_TO_JOIN gtl("You are not permitted to be on this channel.")
-#define CHAN_X_INVALID gtl("Channel %s is not a valid channel.")
-#define CHAN_REACHED_CHANNEL_LIMIT gtl("Sorry, you have already reached your limit of \002%d\002 channels.")
-#define CHAN_EXCEEDED_CHANNEL_LIMIT gtl("Sorry, you have already exceeded your limit of \002%d\002 channels.")
-#define CHAN_SYMBOL_REQUIRED gtl("Please use the symbol of \002#\002 when attempting to register")
-#define CHAN_SASET_SYNTAX gtl("SASET \002channel\002 \037option\037 \037parameters\037")
-#define CHAN_SET_SYNTAX gtl("SET \037channel\037 \037option\037 \037parameters\037")
-#define CHAN_SET_DISABLED gtl("Sorry, channel option setting is temporarily disabled.")
-#define CHAN_SETTING_CHANGED gtl("%s for %s set to %s.")
-#define CHAN_SETTING_UNSET gtl("%s for %s unset.")
-#define CHAN_SET_MLOCK_DEPRECATED gtl("MLOCK is deprecated. Use \002%s%s HELP MODE\002 instead.")
-#define CHAN_ACCESS_LEVEL_RANGE gtl("Access level must be between %d and %d inclusive.")
-#define CHAN_ACCESS_LIST_HEADER gtl("Access list for %s:\n" \
+#define NICK_REQUESTED _("This nick has already been requested, please check your e-mail address for the pass code")
+#define NICK_CONFIRM_INVALID _("Invalid passcode has been entered, please check the e-mail again, and retry")
+#define CHAN_NOT_ALLOWED_TO_JOIN _("You are not permitted to be on this channel.")
+#define CHAN_X_INVALID _("Channel %s is not a valid channel.")
+#define CHAN_REACHED_CHANNEL_LIMIT _("Sorry, you have already reached your limit of \002%d\002 channels.")
+#define CHAN_EXCEEDED_CHANNEL_LIMIT _("Sorry, you have already exceeded your limit of \002%d\002 channels.")
+#define CHAN_SYMBOL_REQUIRED _("Please use the symbol of \002#\002 when attempting to register")
+#define CHAN_SASET_SYNTAX _("SASET \002channel\002 \037option\037 \037parameters\037")
+#define CHAN_SET_SYNTAX _("SET \037channel\037 \037option\037 \037parameters\037")
+#define CHAN_SET_DISABLED _("Sorry, channel option setting is temporarily disabled.")
+#define CHAN_SETTING_CHANGED _("%s for %s set to %s.")
+#define CHAN_SETTING_UNSET _("%s for %s unset.")
+#define CHAN_SET_MLOCK_DEPRECATED _("MLOCK is deprecated. Use \002%s%s HELP MODE\002 instead.")
+#define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.")
+#define CHAN_ACCESS_LIST_HEADER _("Access list for %s:\n" \
" Num Lev Mask")
-#define CHAN_ACCESS_VIEW_XOP_FORMAT gtl(" %3d %s %s\n" \
+#define CHAN_ACCESS_VIEW_XOP_FORMAT _(" %3d %s %s\n" \
" by %s, last seen %s")
-#define CHAN_ACCESS_VIEW_AXS_FORMAT gtl(" %3d %4d %s\n" \
+#define CHAN_ACCESS_VIEW_AXS_FORMAT _(" %3d %4d %s\n" \
" by %s, last seen %s")
-#define CHAN_AKICK_VIEW_FORMAT gtl("%3d %s (by %s on %s)\n" \
+#define CHAN_AKICK_VIEW_FORMAT _("%3d %s (by %s on %s)\n" \
" %s")
-#define CHAN_INFO_HEADER gtl("Information for channel \002%s\002:")
-#define CHAN_EXCEPTED gtl("\002%s\002 matches an except on %s and cannot be banned until the except have been removed.")
-#define CHAN_LIST_ENTRY gtl("%3d %s\n" \
+#define CHAN_INFO_HEADER _("Information for channel \002%s\002:")
+#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except have been removed.")
+#define CHAN_LIST_ENTRY _("%3d %s\n" \
" Added by %s on %s")
-#define MEMO_NEW_X_MEMO_ARRIVED gtl("There is a new memo on channel %s.\n" \
+#define MEMO_NEW_X_MEMO_ARRIVED _("There is a new memo on channel %s.\n" \
"Type \002%s%s READ %s %d\002 to read it.")
-#define MEMO_NEW_MEMO_ARRIVED gtl("You have a new memo from %s.\n" \
+#define MEMO_NEW_MEMO_ARRIVED _("You have a new memo from %s.\n" \
"Type \002%s%s READ %d\002 to read it.")
-#define MEMO_HAVE_NO_MEMOS gtl("You have no memos.")
-#define MEMO_X_HAS_NO_MEMOS gtl("%s has no memos.")
-#define MEMO_SEND_SYNTAX gtl("SEND {\037nick\037 | \037channel\037} \037memo-text\037")
-#define MEMO_SEND_DISABLED gtl("Sorry, memo sending is temporarily disabled.")
-#define MEMO_HAVE_NO_NEW_MEMOS gtl("You have no new memos.")
-#define MEMO_X_HAS_NO_NEW_MEMOS gtl("%s has no new memos.")
-#define BOT_DOES_NOT_EXIST gtl("Bot \002%s\002 does not exist.")
-#define BOT_NOT_ASSIGNED gtl("You must assign a bot to the channel before using this command.\n" \
+#define MEMO_HAVE_NO_MEMOS _("You have no memos.")
+#define MEMO_X_HAS_NO_MEMOS _("%s has no memos.")
+#define MEMO_SEND_SYNTAX _("SEND {\037nick\037 | \037channel\037} \037memo-text\037")
+#define MEMO_SEND_DISABLED _("Sorry, memo sending is temporarily disabled.")
+#define MEMO_HAVE_NO_NEW_MEMOS _("You have no new memos.")
+#define MEMO_X_HAS_NO_NEW_MEMOS _("%s has no new memos.")
+#define BOT_DOES_NOT_EXIST _("Bot \002%s\002 does not exist.")
+#define BOT_NOT_ASSIGNED _("You must assign a bot to the channel before using this command.\n" \
"Type %s%s HELP ASSIGN for more information.")
-#define BOT_NOT_ON_CHANNEL gtl("Bot is not on channel \002%s\002.")
-#define BOT_ASSIGN_READONLY gtl("Sorry, bot assignment is temporarily disabled.")
-#define ENABLED gtl("Enabled")
-#define DISABLED gtl("Disabled")
-#define OPER_LIST_FORMAT gtl(" %3d %-32s %s")
-#define OPER_VIEW_FORMAT gtl("%3d %s (by %s on %s; %s)\n" \
+#define BOT_NOT_ON_CHANNEL _("Bot is not on channel \002%s\002.")
+#define BOT_ASSIGN_READONLY _("Sorry, bot assignment is temporarily disabled.")
+#define ENABLED _("Enabled")
+#define DISABLED _("Disabled")
+#define OPER_LIST_FORMAT _(" %3d %-32s %s")
+#define OPER_VIEW_FORMAT _("%3d %s (by %s on %s; %s)\n" \
" %s")
-#define HOST_SET_ERROR gtl("A vhost must be in the format of a valid hostmask.")
-#define HOST_SET_IDENT_ERROR gtl("A vhost ident must be in the format of a valid ident")
-#define HOST_SET_TOOLONG gtl("Error! The vhost is too long, please use a host shorter than %d characters.")
-#define HOST_SET_IDENTTOOLONG gtl("Error! The Ident is too long, please use an ident shorter than %d characters.")
-#define HOST_NOT_ASSIGNED gtl("Please contact an Operator to get a vhost assigned to this nick.")
-#define HOST_NO_VIDENT gtl("Your IRCD does not support vIdent's, if this is incorrect, please report this as a possible bug")
+#define HOST_SET_ERROR _("A vhost must be in the format of a valid hostmask.")
+#define HOST_SET_IDENT_ERROR _("A vhost ident must be in the format of a valid ident")
+#define HOST_SET_TOOLONG _("Error! The vhost is too long, please use a host shorter than %d characters.")
+#define HOST_SET_IDENTTOOLONG _("Error! The Ident is too long, please use an ident shorter than %d characters.")
+#define HOST_NOT_ASSIGNED _("Please contact an Operator to get a vhost assigned to this nick.")
+#define HOST_NO_VIDENT _("Your IRCD does not support vIdent's, if this is incorrect, please report this as a possible bug")
diff --git a/include/modules.h b/include/modules.h
index 0f58afebb..b9ed03664 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -270,12 +270,6 @@ class CoreExport Module : public Extensible
*/
Version GetVersion() const;
- /** Send a message to a user in their language, if a translation is available
- * @param source The source of the message
- * @param fmt The message
- */
- void SendMessage(CommandSource &source, const char *fmt, ...);
-
/**
* Add a module provided command to the given service.
* @param bi The service to add the command to
diff --git a/include/services.h b/include/services.h
index 8aea5b019..fdc78ff59 100644
--- a/include/services.h
+++ b/include/services.h
@@ -45,11 +45,8 @@
#if GETTEXT_FOUND
# include <libintl.h>
-# define _(x) anope_gettext(x)
-#else
-# define _(x) x
#endif
-#define gtl(x) x
+#define _(x) x
#ifndef _WIN32
# include <unistd.h>
diff --git a/language/update.sh b/language/update.sh
index 8ebda609e..8302d813c 100755
--- a/language/update.sh
+++ b/language/update.sh
@@ -7,7 +7,7 @@ cd ..
FILES=`find ./ -name *.cpp -o -name *.h | grep -v /modules/extra/`
for f in $FILES
do
- xgettext -C -s -d Anope -j -o language/anope.pot --from-code=utf-8 --keyword --keyword=_ --keyword=gtl $f
+ xgettext -C -s -d Anope -j -o language/anope.pot --from-code=utf-8 --keyword --keyword=_ $f
done
cd -
diff --git a/modules/core/bs_kick.cpp b/modules/core/bs_kick.cpp
index 66232f10c..3e6719338 100644
--- a/modules/core/bs_kick.cpp
+++ b/modules/core/bs_kick.cpp
@@ -616,10 +616,8 @@ class BSKick : public Module
if (!ci || !ci->bi || !ci->c || !u || u->server->IsULined())
return;
- Anope::string fmt = GetString(u->Account(), message);
+ Anope::string fmt = translate(u, message);
va_start(args, message);
- if (fmt.empty())
- return;
vsnprintf(buf, sizeof(buf), fmt.c_str(), args);
va_end(args);
diff --git a/modules/core/bs_main.cpp b/modules/core/bs_main.cpp
index 442d522db..e325b012f 100644
--- a/modules/core/bs_main.cpp
+++ b/modules/core/bs_main.cpp
@@ -24,8 +24,6 @@ class BotServBotInfo : public BotInfo
void OnMessage(User *u, const Anope::string &message)
{
- PushLanguage("anope", u->Account() ? u->Account()->language : "");
-
spacesepstream sep(message);
Anope::string command, param;
if (sep.GetToken(command) && sep.GetToken(param))
@@ -40,30 +38,26 @@ class BotServBotInfo : public BotInfo
{
if (ci->HasFlag(CI_SUSPENDED) && !c->HasFlag(CFLAG_ALLOW_SUSPENDED))
{
- u->SendMessage(this, _(_(CHAN_X_SUSPENDED)), ci->name.c_str());
+ u->SendMessage(this, CHAN_X_SUSPENDED, ci->name.c_str());
Log(LOG_COMMAND, "denied", this) << "Access denied for user " << u->GetMask() << " with command " << command << " because of SUSPENDED channel " << ci->name;
- PopLanguage();
return;
}
}
else if (!c->HasFlag(CFLAG_ALLOW_UNREGISTEREDCHANNEL))
{
- u->SendMessage(this, _(_(CHAN_X_NOT_REGISTERED)), param.c_str());
- PopLanguage();
+ u->SendMessage(this, CHAN_X_NOT_REGISTERED, param.c_str());
return;
}
}
/* A user not giving a channel name for a param that should be a channel */
else
{
- u->SendMessage(this, _(CHAN_X_INVALID), param.c_str());
- PopLanguage();
+ u->SendMessage(this, CHAN_X_INVALID, param.c_str());
return;
}
}
}
- PopLanguage();
BotInfo::OnMessage(u, message);
}
};
diff --git a/modules/core/cs_access.cpp b/modules/core/cs_access.cpp
index 23d8c4e16..7d39b2ce5 100644
--- a/modules/core/cs_access.cpp
+++ b/modules/core/cs_access.cpp
@@ -716,7 +716,7 @@ class CommandCSLevels : public Command
levelinfo_maxwidth = len;
}
for (i = 0; levelinfo[i].what >= 0; ++i)
- source.Reply(_(" %-*s %s"), levelinfo_maxwidth, levelinfo[i].name.c_str(), GetString(source.u->Account(), levelinfo[i].desc).c_str());
+ source.Reply(_(" %-*s %s"), levelinfo_maxwidth, levelinfo[i].name.c_str(), translate(source.u, levelinfo[i].desc));
}
else
source.Reply(_("Syntax: \002LEVELS \037channel\037 SET \037type\037 \037level\037\002\n"
diff --git a/modules/core/cs_main.cpp b/modules/core/cs_main.cpp
index 9d1664afb..49d1c800b 100644
--- a/modules/core/cs_main.cpp
+++ b/modules/core/cs_main.cpp
@@ -23,12 +23,9 @@ class ChanServBotInfo : public BotInfo
void OnMessage(User *u, const Anope::string &message)
{
- PushLanguage("anope", u->Account() ? u->Account()->language : "");
-
if (!u->HasMode(UMODE_OPER) && Config->CSOpersOnly)
{
- u->SendMessage(ChanServ, _(ACCESS_DENIED));
- PopLanguage();
+ u->SendMessage(ChanServ, ACCESS_DENIED);
return;
}
@@ -46,30 +43,26 @@ class ChanServBotInfo : public BotInfo
{
if (ci->HasFlag(CI_SUSPENDED) && !c->HasFlag(CFLAG_ALLOW_SUSPENDED))
{
- u->SendMessage(this, _(_(CHAN_X_SUSPENDED)), ci->name.c_str());
+ u->SendMessage(this, CHAN_X_SUSPENDED, ci->name.c_str());
Log(LOG_COMMAND, "denied", this) << "Access denied for user " << u->GetMask() << " with command " << command << " because of SUSPENDED channel " << ci->name;
- PopLanguage();
return;
}
}
else if (!c->HasFlag(CFLAG_ALLOW_UNREGISTEREDCHANNEL))
{
- u->SendMessage(this, _(CHAN_X_NOT_REGISTERED), param.c_str());
- PopLanguage();
+ u->SendMessage(this, CHAN_X_NOT_REGISTERED, param.c_str());
return;
}
}
/* A user not giving a channel name for a param that should be a channel */
else
{
- u->SendMessage(this, _(CHAN_X_INVALID), param.c_str());
- PopLanguage();
+ u->SendMessage(this, CHAN_X_INVALID, param.c_str());
return;
}
}
}
- PopLanguage();
BotInfo::OnMessage(u, message);
}
};
diff --git a/modules/core/cs_suspend.cpp b/modules/core/cs_suspend.cpp
index 32d75bbeb..a027bc173 100644
--- a/modules/core/cs_suspend.cpp
+++ b/modules/core/cs_suspend.cpp
@@ -54,7 +54,7 @@ class CommandCSSuspend : public Command
if (uc->user->HasMode(UMODE_OPER))
continue;
- c->Kick(NULL, uc->user, "%s", !reason.empty() ? reason.c_str() : GetString(uc->user->Account(), gtl("This channel has been suspended.")).c_str());
+ c->Kick(