Bug http://bugzilla.lyx.org/show_bug.cgi?id=3560 is about that we define the menu separator always
as \trangleright, while it needs to be \triangleleft for RTL languages.
This should be easy to fix, but I'm too stupid to get it right, see the
attached attempt. Any help?
Is there something like a collector where we store what languages are RTL ones? This would make the
code simpler as we only need to add new languages to this collector and get the right code. Then we
could use something like this:
if language::RTL then do something
thanks and regards
Uwe
Index: LaTeXFeatures.cpp
===================================================================
--- LaTeXFeatures.cpp (revision 27779)
+++ LaTeXFeatures.cpp (working copy)
@@ -59,9 +59,6 @@
static string const noun_def = "\\newcommand{\\noun}[1]{\\textsc{#1}}";
-static string const lyxarrow_def =
- "\\newcommand{\\lyxarrow}{\\leavevmode\\,$\\triangleright$\\,\\allowbreak}";
-
// for quotes without babel. This does not give perfect results, but
// anybody serious about non-english quotes should use babel (JMarc).
@@ -416,6 +413,14 @@
// japanese package is special
if (lang->encoding()->package() == Encoding::japanese)
require("japanese");
+ // the menu separator needs another definition for RTL languages
+ if (lang->lang() == "arabic" || lang->lang() == "farsi"
+ || lang->lang() == "hebrew")
+ string lyxarrow_def =
+ "\\newcommand{\\lyxarrow}{\\leavevmode\\,$\\triangleleft$\\,\\allowbreak}";
+ else
+ string lyxarrow_def =
+ "\\newcommand{\\lyxarrow}{\\leavevmode\\,$\\triangleright$\\,\\allowbreak}";
}
@@ -726,7 +731,11 @@
macros << noun_def << '\n';
if (mustProvide("lyxarrow"))
+ {
+ Language const * lang;
+ useLanguage(lang);
macros << lyxarrow_def << '\n';
+ }
if (mustProvide("textgreek"))
macros << textgreek_def << '\n';