summaryrefslogtreecommitdiff
path: root/modules/commands/ns_set.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-06-12 02:30:21 +0000
committerAdam <Adam@anope.org>2013-06-12 02:30:21 +0000
commitd463ae3b1eb44085ad06193f403bc8ec67b34422 (patch)
tree63826af31a8095cddd33156ab06f6493cb79f0ec /modules/commands/ns_set.cpp
parentebda113f448cdde52d4015b75b09211eac182c8e (diff)
Allow users to change their language to english when the default language is not
Diffstat (limited to 'modules/commands/ns_set.cpp')
-rw-r--r--modules/commands/ns_set.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp
index 4b2dfe684..7b0de5565 100644
--- a/modules/commands/ns_set.cpp
+++ b/modules/commands/ns_set.cpp
@@ -941,20 +941,21 @@ class CommandNSSetLanguage : public Command
if (MOD_RESULT == EVENT_STOP)
return;
- for (unsigned j = 0; j < Language::Languages.size(); ++j)
- {
- if (param == "en" || Language::Languages[j] == param)
- break;
- else if (j + 1 == Language::Languages.size())
+ if (param != "en")
+ for (unsigned j = 0; j < Language::Languages.size(); ++j)
{
- this->OnSyntaxError(source, "");
- return;
+ if (Language::Languages[j] == param)
+ break;
+ else if (j + 1 == Language::Languages.size())
+ {
+ this->OnSyntaxError(source, "");
+ return;
+ }
}
- }
Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to change the langauge of " << nc->display << " to " << param;
- nc->language = param != "en" ? param : "";
+ nc->language = param;
source.Reply(_("Language changed to \002English\002."));
}