]> git.lyx.org Git - lyx.git/blobdiff - src/gettext.C
Alfredo's second patch
[lyx.git] / src / gettext.C
index d9f86c238fd6de2d19eca3c427f37e79766a541e..6165efb3fbb91e3938d5585a3137e2bab97f879c 100644 (file)
 
 namespace {
 
-boost::scoped_ptr<Messages> lyx_messages;
+Messages & getLyXMessages()
+{
+       static Messages lyx_messages;
+
+       return lyx_messages;
+}
 
 } // anon namespace
 
 
 char const * _(char const * str)
 {
-       // This breaks pretty much immediately
-       // lyx::Assert(str && str[0]);
-
-       if (!lyx_messages.get())
-               return str;
-
-       return lyx_messages->get(str).c_str();
+       return getLyXMessages().get(str).c_str();
 }
 
 
 string const _(string const & str)
 {
-       // This breaks pretty much immediately
-       // lyx::Assert(!str.empty());
-
-       if (!lyx_messages.get())
-               return str;
-
-       return lyx_messages->get(str);
-}
-
-
-void gettext_init(string const & localedir)
-{
-       lyx_messages.reset(new Messages("", localedir));
+       return getLyXMessages().get(str);
 }