Fix for uninitialized members
[supertux.git] / src / util / gettext.hpp
index c73548d..d67c93b 100644 (file)
@@ -1,4 +1,4 @@
-//  SuperTux 
+//  SuperTux
 //  Copyright (C) 2006 Ingo Ruhnke <grumbel@gmail.com>
 //
 //  This program is free software: you can redistribute it and/or modify
 
 #include <tinygettext/tinygettext.hpp>
 #include <assert.h>
+#include <memory>
 
 #include "supertux/globals.hpp"
 
+extern std::unique_ptr<tinygettext::DictionaryManager> g_dictionary_manager;
+
 /*
  * If you need to do a nontrivial substitution of values into a pattern, use
  * boost::format rather than an ad-hoc concatenation.  That way, translators can
@@ -43,9 +46,9 @@
 
 static inline std::string _(const std::string& message)
 {
-  if (dictionary_manager)
+  if (g_dictionary_manager)
   {
-    return dictionary_manager->get_dictionary().translate(message);
+    return g_dictionary_manager->get_dictionary().translate(message);
   }
   else
   {