*
* \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>
#include "messages.h"
#include "debug.h"
#include "support/filetools.h"
+#include "support/path_defines.h"
+
+using namespace lyx::support;
#ifdef ENABLE_NLS
if (locale_dir.empty()) {
locale_dir = GetEnvPath("LYX_LOCALEDIR");
if (locale_dir.empty())
- locale_dir = LOCALEDIR;
+ locale_dir = lyx_localedir();
}
return locale_dir;
}
#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;
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());
private:
///
string lang_;
- ///
- string localedir_;
};
#endif