]> git.lyx.org Git - lyx.git/blobdiff - src/support/gettext.cpp
add onoff support for "inset-modify changetype xxx" in include inset
[lyx.git] / src / support / gettext.cpp
index ce3a52da6dd58df5e320dc5e5d1f4e7a433de514..a129854e8219492cd2cec496b94041b1410da350 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  * \author Jean-Marc Lasgouttes
  *
  * Full author contact details are available in file CREDITS.
@@ -20,8 +20,7 @@
 #  include <locale.h>
 #endif
 
-using std::string;
-
+using namespace std;
 
 namespace lyx {
 
@@ -58,4 +57,18 @@ docstring const translateIfPossible(docstring const & name)
 }
 
 
+docstring const translateIfPossible(docstring const & name, std::string const & language)
+{
+       if (support::isAscii(name))
+               // Probably from a standard configuration file, try to
+               // translate
+               return getMessages(language).get(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