summaryrefslogtreecommitdiff
path: root/src/win32/windows.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-10-30 19:41:13 -0400
committerAdam <Adam@anope.org>2010-10-30 19:41:13 -0400
commitfb9f41b3e52cfddada7773a65b9723cd3a96b785 (patch)
treebd97f21b4a5098d43f2a680ae09136f3e0ef6bb5 /src/win32/windows.cpp
parenta7e5d51616363214d391500b2d9d647379fba833 (diff)
Made gettext work on most OSs. Tested on Debian, FreeBSD, Gentoo, and Windows.
Added a search path option to the Config script for cmake to use when finding libraries for modules or for gettext. Fixed m_mysql and m_ssl to work under Windows, made the Windows Config program remember the last used options, and fixed Windows release builds.
Diffstat (limited to 'src/win32/windows.cpp')
-rw-r--r--src/win32/windows.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/win32/windows.cpp b/src/win32/windows.cpp
index 5f0c6d5e4..af37282c8 100644
--- a/src/win32/windows.cpp
+++ b/src/win32/windows.cpp
@@ -12,6 +12,36 @@
#ifdef _WIN32
#include "services.h"
+struct WindowsLanguage
+{
+ const char *languageName;
+ USHORT windowsLanguageName;
+};
+
+WindowsLanguage WindowsLanguages[] = {
+ {"ca_ES", LANG_CATALAN},
+ {"de_DE", LANG_GERMAN},
+ {"el_GR", LANG_GREEK},
+ {"es_ES", LANG_SPANISH},
+ {"fr_FR", LANG_FRENCH},
+ {"hu_HU", LANG_HUNGARIAN},
+ {"it_IT", LANG_ITALIAN},
+ {"nl_NL", LANG_DUTCH},
+ {"pl_PL", LANG_POLISH},
+ {"pt_PT", LANG_PORTUGUESE},
+ {"ru_RU", LANG_RUSSIAN},
+ {"tr_TR", LANG_TURKISH},
+ {NULL, 0}
+};
+
+USHORT WindowsGetLanguage(const char *lang)
+{
+ for (int i = 0; WindowsLanguages[i].languageName; ++i)
+ if (!strcmp(lang, WindowsLanguages[i].languageName))
+ return WindowsLanguages[i].windowsLanguageName;
+ return LANG_NEUTRAL;
+}
+
/** This is inet_pton, but it works on Windows
* @param af The protocol type, AF_INET or AF_INET6
* @param src The address