]> git.lyx.org Git - lyx.git/blobdiff - src/gettext.C
add comment
[lyx.git] / src / gettext.C
index 925e433363d50ab80972a4c4c70d3f5df129db64..46053cfc59e5407e4e66316470accbf6ed59e26d 100644 (file)
@@ -13,7 +13,9 @@
 
 #include "gettext.h"
 #include "messages.h"
+
 #include "support/environment.h"
+#include "support/lstrings.h"
 
 
 namespace lyx {
@@ -27,21 +29,9 @@ using support::setEnv;
 using std::string;
 
 
-namespace {
-
-static Messages & getLyXMessages()
-{
-       static Messages lyx_messages;
-
-       return lyx_messages;
-}
-
-} // anon namespace
-
-
 docstring const _(string const & str)
 {
-       return getLyXMessages().get(str);
+       return getGuiMessages().get(str);
 }
 
 
@@ -68,4 +58,18 @@ void locale_init()
 #endif
 
 
+docstring const translateIfPossible(docstring const & name)
+{
+       if (support::isAscii(name))
+               // Probably from a standard configuration file, try to
+               // translate
+               return _(to_ascii(name));
+       else
+               // This must be from a user defined configuration file. We
+               // cannot translate this, since gettext accepts only ascii
+               // keys.
+               return name;
+}
+
+
 } // namespace lyx