]> git.lyx.org Git - lyx.git/blobdiff - src/messages.C
explain why ownsClipbiard() does not work on Windows and OS X
[lyx.git] / src / messages.C
index bb83e90dfc143fd87c4ccad1e0b7e54135b8fd3e..37f8814a435cba6e7dcee871b0158c70bb934408 100644 (file)
@@ -17,7 +17,7 @@
 #include "support/environment.h"
 #include "support/filetools.h"
 #include "support/package.h"
-#include "support/types.h"
+#include "support/unicode.h"
 
 #include <boost/current_function.hpp>
 #include <boost/regex.hpp>
@@ -52,15 +52,9 @@ using support::getEnv;
 using support::setEnv;
 
 
-#ifdef WORDS_BIGENDIAN
-               char const * codeset = "UCS-4BE";
-#else
-               char const * codeset = "UCS-4LE";
-#endif
-
 // This version use the traditional gettext.
 Messages::Messages(string const & l)
-       : lang_(l)
+       : lang_(l), warned_(false)
 {
        if ( lang_.empty() ) {
                char const * lc_msgs = 0;
@@ -72,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;
 }
 
@@ -107,9 +101,8 @@ docstring const Messages::get(string const & m) const
        // Since this method gets called for every translatable
        // buffer string like e.g. "Figure:" we warn only once.
 #if !defined(_WIN32) && !defined(__CYGWIN__)
-       bool warned = false;
-       if (!warned && !lc_msgs) {
-               warned = true;
+       if (!warned_ && !lc_msgs) {
+               warned_ = true;
                lyxerr << "Locale " << lang_ << " could not be set" << endl;
        }
 #endif
@@ -122,7 +115,7 @@ docstring const Messages::get(string const & m) const
        char const * c = bindtextdomain(PACKAGE, 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'
@@ -130,11 +123,11 @@ docstring const Messages::get(string const & m) const
                        << "Rtn value : " << c << endl;
        }
 
-       if (!bind_textdomain_codeset(PACKAGE, codeset)) {
-               lyxerr[Debug::DEBUG]
+       if (!bind_textdomain_codeset(PACKAGE, ucs4_codeset)) {
+               LYXERR(Debug::DEBUG)
                << BOOST_CURRENT_FUNCTION << '\n'
                        << "Error code: " << errno << '\n'
-                       << "Codeset   : " << codeset << '\n'
+                       << "Codeset   : " << ucs4_codeset << '\n'
                        << endl;
        }
 
@@ -163,7 +156,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;
        }