]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/translation.cpp
Joystick: Remap joystick-specific KeyTypes to generic ones
[dragonfireclient.git] / src / translation.cpp
index 7ddd95591453c06a120e6396548462d221af6fa6..82e813a5d59b0f8f3813a828c566baa7260fcf18 100644 (file)
@@ -20,14 +20,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "translation.h"
 #include "log.h"
 #include "util/string.h"
+#include <unordered_map>
 
-static Translations main_translations;
-Translations *g_translations = &main_translations;
 
-Translations::~Translations()
-{
-       clear();
-}
+#ifndef SERVER
+// Client translations
+Translations client_translations;
+Translations *g_client_translations = &client_translations;
+#endif
+
 
 void Translations::clear()
 {
@@ -149,6 +150,8 @@ void Translations::loadTranslation(const std::string &data)
                                    << wide_to_utf8(oword1) << "\"" << std::endl;
                }
 
-               m_translations[textdomain + L"|" + oword1] = oword2;
+               std::wstring translation_index = textdomain + L"|";
+               translation_index.append(oword1);
+               m_translations[translation_index] = oword2;
        }
 }