]> git.lyx.org Git - lyx.git/blobdiff - src/gettext.C
do not create invalid .lyx files when importing \i{}, \j{}, \l{} or \L{}.
[lyx.git] / src / gettext.C
index 925e433363d50ab80972a4c4c70d3f5df129db64..55b2ef80821f79cd55665386522d35198d16868f 100644 (file)
@@ -13,7 +13,9 @@
 
 #include "gettext.h"
 #include "messages.h"
+
 #include "support/environment.h"
+#include "support/lstrings.h"
 
 
 namespace lyx {
@@ -68,4 +70,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