]> git.lyx.org Git - lyx.git/blobdiff - src/support/Messages.cpp
Provide option to prevent unnecessary font loading.
[lyx.git] / src / support / Messages.cpp
index fd5d22823dc9b1eec0df95abce29d226daf922d0..842697ed538ed4328a60340031b2fcc381dc1d26 100644 (file)
@@ -83,9 +83,8 @@
 
 #include "support/lassert.h"
 
-#include <boost/cstdint.hpp>
-
 #include <cerrno>
+#include <cstdint>
 #include <fstream>
 #include <utility>
 
@@ -94,7 +93,6 @@
 #endif
 
 using namespace std;
-using boost::uint32_t;
 
 namespace lyx {
 
@@ -127,7 +125,7 @@ void cleanTranslation(docstring & trans)
        }
 }
 
-} // lyx
+} // namespace lyx
 
 
 #ifdef ENABLE_NLS
@@ -167,7 +165,7 @@ string realCode(string code)
        }
        return string();
 }
-}
+} // namespace
 
 
 bool Messages::available(string const & c)
@@ -238,7 +236,7 @@ void StringTable::swapEnd()
 }
 
 
-} // namespace anon
+} // namespace
 
 bool Messages::readMoFile()
 {
@@ -281,7 +279,7 @@ bool Messages::readMoFile()
 
        if (header->magic != 0x950412de) {
                LYXERR0("Wrong magic number for file " << filen
-                       << ".\nExpected 0x950412de, got 0x" << std::hex << header->magic);
+                       << ".\nExpected 0x950412de, got 0x" << std::hex << header->magic << std::dec);
                return false;
        }
 
@@ -347,6 +345,19 @@ docstring const Messages::get(string const & m) const
        }
 }
 
+
+docstring const Messages::getIfFound(string const & m) const
+{
+       if (m.empty())
+               return docstring();
+
+       TranslationMap::const_iterator it = trans_map_.find(m);
+       if (it != trans_map_.end())
+               return it->second;
+       else
+               return docstring();
+}
+
 } // namespace lyx
 
 #else // ENABLE_NLS
@@ -366,15 +377,20 @@ docstring const Messages::get(string const & m) const
 }
 
 std::string Messages::language() const
-    {
-        return string();
-    }
+{
+       return string();
+}
 
 bool Messages::available(string const & /* c */)
 {
        return false;
 }
 
+docstring const Messages::getIfFound(string const & /* m */) const
+{
+       return docstring();
+}
+
 } // namespace lyx
 
 #endif