]> git.lyx.org Git - lyx.git/blobdiff - src/messages.C
Fix loop when opening TOC widget in an empty document, basically by Richard Heck.
[lyx.git] / src / messages.C
index d1f8381fb22809480b6afe383befccb49199a7fe..b93ab6d1c7fa35dedbaccdbb4d7fbcecc568eafd 100644 (file)
@@ -66,7 +66,7 @@ Messages::Messages(string const & l)
        // strip off any encoding suffix, i.e., assume 8-bit po files
        string::size_type i = lang_.find(".");
        lang_ = lang_.substr(0, i);
-       lyxerr[Debug::DEBUG] << BOOST_CURRENT_FUNCTION
+       LYXERR(Debug::DEBUG) << BOOST_CURRENT_FUNCTION
                << ": language(" << lang_ << ")" << endl;
 }
 
@@ -112,19 +112,20 @@ docstring const Messages::get(string const & m) const
 
        setlocale(LC_CTYPE, lang_.c_str());
        errno = 0;
-       char const * c = bindtextdomain(PACKAGE, package().locale_dir().c_str());
+       string const locale_dir = package().locale_dir().toFilesystemEncoding();
+       char const * c = bindtextdomain(PACKAGE, locale_dir.c_str());
        int e = errno;
        if (e) {
-               lyxerr[Debug::DEBUG]
+               LYXERR(Debug::DEBUG)
                << BOOST_CURRENT_FUNCTION << '\n'
                        << "Error code: " << errno << '\n'
                        << "Lang, mess: " << lang_ << " " << m << '\n'
-                       << "Directory : " << package().locale_dir() << '\n'
+                       << "Directory : " << package().locale_dir().absFilename() << '\n'
                        << "Rtn value : " << c << endl;
        }
 
        if (!bind_textdomain_codeset(PACKAGE, ucs4_codeset)) {
-               lyxerr[Debug::DEBUG]
+               LYXERR(Debug::DEBUG)
                << BOOST_CURRENT_FUNCTION << '\n'
                        << "Error code: " << errno << '\n'
                        << "Codeset   : " << ucs4_codeset << '\n'
@@ -156,7 +157,7 @@ docstring const Messages::get(string const & m) const
                else
                        translated = from_ascii(tmp);
        } else {
-               lyxerr[Debug::DEBUG] << "We got a translation" << endl;
+               LYXERR(Debug::DEBUG) << "We got a translation" << endl;
                char_type const * ucs4 = reinterpret_cast<char_type const *>(msg);
                translated = ucs4;
        }
@@ -222,7 +223,8 @@ public:
                //lyxerr << "Messages: language(" << l
                //       << ") in dir(" << dir << ")" << endl;
 
-               cat_gl = mssg_gl.open(PACKAGE, loc_gl, package().locale_dir().c_str());
+               string const locale_dir = package().locale_dir().toFilesystemEncoding();
+               cat_gl = mssg_gl.open(PACKAGE, loc_gl, locale_dir.c_str());
 
        }