summaryrefslogtreecommitdiff
path: root/src/language.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-12-15 21:35:38 -0500
committerAdam <Adam@anope.org>2012-12-15 21:35:38 -0500
commit8e3ab0d10b8f1d7683d4301b66e6c0609995cff1 (patch)
tree316bb65021b91c9e981d4712cbe62dc1f99a1965 /src/language.cpp
parentb6407afa06917910732966ea3c49ac4bd7850fe4 (diff)
Made all langauges default to the UTF-8 charset
Diffstat (limited to 'src/language.cpp')
-rw-r--r--src/language.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/language.cpp b/src/language.cpp
index 1e1f9e704..62e5de90d 100644
--- a/src/language.cpp
+++ b/src/language.cpp
@@ -29,28 +29,28 @@ void Language::InitLanguages()
Log(LOG_DEBUG) << "Initializing Languages...";
Languages.clear();
+
+ if (!bindtextdomain("anope", Anope::LocaleDir.c_str()))
+ Log() << "Error calling bindtextdomain, " << Anope::LastError();
+ else
+ Log(LOG_DEBUG) << "Successfully bound anope to " << Anope::LocaleDir;
+
+ setlocale(LC_ALL, "");
+
spacesepstream sep(Config->Languages);
Anope::string language;
-
while (sep.GetToken(language))
{
- if (!IsFile(Anope::LocaleDir + "/" + language + "/LC_MESSAGES/anope.mo"))
+ const Anope::string &lang_name = Translate(language.c_str(), "English");
+ if (lang_name == "English")
{
- Log() << "Error loading language " << language << ", file does not exist!";
+ Log() << "Unable to use language " << language;
+ continue;
}
- else
- {
- Log(LOG_DEBUG) << "Found language file " << language;
- Languages.push_back(language);
- }
- }
- if (!bindtextdomain("anope", Anope::LocaleDir.c_str()))
- Log() << "Error calling bindtextdomain, " << Anope::LastError();
- else
- Log(LOG_DEBUG) << "Successfully bound anope to " << Anope::LocaleDir;
-
- setlocale(LC_ALL, "");
+ Log(LOG_DEBUG) << "Found language " << language;
+ Languages.push_back(language);
+ }
#else
Log() << "Unable to initialize languages, gettext is not installed";
#endif