]> git.lyx.org Git - lyx.git/blobdiff - src/messages.C
Move #includes out of header files.
[lyx.git] / src / messages.C
index f2c0fcaecf38efa98700dbac278d167905c08c45..a933fbacdc55e6fd95f07fa3d00662ede5c6d719 100644 (file)
@@ -4,7 +4,7 @@
  *
  * \author Lars Gullik Bjønnes
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
@@ -12,6 +12,9 @@
 #include "messages.h"
 #include "debug.h"
 #include "support/filetools.h"
+#include "support/path_defines.h"
+
+using namespace lyx::support;
 
 
 #ifdef ENABLE_NLS
@@ -25,7 +28,7 @@ string const & getLocaleDir()
        if (locale_dir.empty()) {
                locale_dir = GetEnvPath("LYX_LOCALEDIR");
                if (locale_dir.empty())
-                       locale_dir = LOCALEDIR;
+                       locale_dir = lyx_localedir();
        }
        return locale_dir;
 }
@@ -37,7 +40,7 @@ string const & getLocaleDir()
 #include <locale>
 
 // This version of the Pimpl utilizes the message capability of
-// libstdc++ that is distributed with GNU G++
+// libstdc++ that is distributed with GNU G++.
 class Messages::Pimpl {
 public:
        typedef std::messages<char>::catalog catalog;
@@ -102,6 +105,9 @@ public:
 
        string const get(string const & m) const
        {
+               if (m.empty())
+                       return m;
+
                char * old = strdup(setlocale(LC_ALL, 0));
                char * n = setlocale(LC_ALL, lang_.c_str());
                const char* msg = gettext(m.c_str());
@@ -114,8 +120,6 @@ public:
 private:
        ///
        string lang_;
-       ///
-       string localedir_;
 };
 #endif