(Again, resending because it didn't arrive the first time; sorry if you got it twice)

Uwe Stöhr wrote:
Dov Feldstern schrieb:

The question is, should we really go to all this trouble? (Well, not so much, but (a) should we separate between ArabTeX and Arabi, and (b) should we update lyx2lyx to deal with the language change, for backwards compatibility with something which we don't know whether or not it exists?) Or maybe you're right --- we should just stick with Arabi, that will be the only Arabic support that LyX provides.

Sorry about all this mess :( .

What do you say?

Mostafa said he will investigate further and that he needs some time for it. I propose we postpone this after LyX 1.5.0. When no fileformat change is needed, this can be also implemented to Lyx 1.5.1. If not we can so it in LyX 1.6.0.

regards Uwe

I am in favor of applying the attached patch, and then applying Uwe's
changes on top of the arabic_arabi language. The idea being that we
support ArabTeX as much as it is currently supported (but not full
support, by any means); and we're beginning to support Arabi for Arabic,
too, but there's still work to be done. Hopefully, this will be good
enough to draw some real Arabic users in, and they'll be able to help
out with how best to continue. And if not, then there's no point in
putting any more work into it. But the basis will be in.

I don't think that a format change is needed, because  we're using new
languages, not changing the interpretation of existing ones. If there
are users out there who have existing documents in ArabTeX, they'll have
to replace all "\lang arabic" with "\lang arabic_arabtex", but that's
all. I think this is reasonable.

BTW, there's one more stage that I left out of the ArabTeX instructions,
which may  be why you were having trouble, Uwe. With this, it works,
including chapters, etc. (copied straight from Dekel's instructions):

4. Get the file http://cs.haifa.ac.il/~dekelts/lyx/arab-article.layout
and put it in ~/.lyx/layouts/
Run LyX and select the edit->reconfigure menu, and exit from LyX

5. Now you are ready to start writing Arabic documents:
Start a new document, open the document layout popup (layout->document
menu) Select article(Arabic) as the document class, default as the
encoding, and English as the language (not Arabic!), and press OK.
Use the F12 key to switch between Arabic and English.

Index: src/insets/InsetTabular.cpp
===================================================================
--- src/insets/InsetTabular.cpp (revision 18851)
+++ src/insets/InsetTabular.cpp (working copy)
@@ -2286,6 +2286,9 @@
                        if (par.getParLanguage(buf.params())->lang() ==
                        "farsi")
                                os << "\\textFR{";
+                       else if (par.getParLanguage(buf.params())->lang() == 
"arabic_arabi")
+                               os << "\\textAR{";
+                       // currently, remaning RTL languages are arabic_arabtex 
and hebrew
                        else
                                os << "\\R{";
                }
Index: src/Font.cpp
===================================================================
--- src/Font.cpp        (revision 18851)
+++ src/Font.cpp        (working copy)
@@ -752,10 +752,18 @@
                if (language()->lang() == "farsi") {
                        os << "\\textFR{";
                        count += 8;
+               } else if (language()->lang() == "arabic_arabi") {
+                       os << "\\textAR{";
+                       count += 8;
                } else if (!isRightToLeft() &&
+                               base.language()->lang() == "arabic_arabi") {
+                       os << "\\textLR{";
+                       count += 8;
+               } else if (!isRightToLeft() &&
                            base.language()->lang() == "farsi") {
                        os << "\\textLR{";
                        count += 8;
+               // currently the remaining RTL languages are arabic_arabtex and 
hebrew
                } else if (isRightToLeft() != prev.isRightToLeft()) {
                        if (isRightToLeft()) {
                                os << "\\R{";
Index: src/Text.cpp
===================================================================
--- src/Text.cpp        (revision 18851)
+++ src/Text.cpp        (working copy)
@@ -369,7 +369,8 @@
        if (isPrintable(c)) {
                Language const * language = font.language();
                if (language->rightToLeft()) {
-                       if (language->lang() == "arabic" ||
+                       if (language->lang() == "arabic_arabtex" ||
+                               language->lang() == "arabic_arabi" ||
                            language->lang() == "farsi") {
                                if (Encodings::isComposeChar_arabic(c))
                                        return 0;
Index: src/rowpainter.cpp
===================================================================
--- src/rowpainter.cpp  (revision 18851)
+++ src/rowpainter.cpp  (working copy)
@@ -429,7 +429,8 @@
        // special case languages
        std::string const & lang = orig_font.language()->lang();
        bool const hebrew = lang == "hebrew";
-       bool const arabic = lang == "arabic" || lang == "farsi";        
+       bool const arabic = lang == "arabic_arabtex" || lang == "arabic_arabi" 
|| 
+                                               lang == "farsi";
 
        // draw as many chars as we can
        if ((!hebrew && !arabic)
Index: lib/languages
===================================================================
--- lib/languages       (revision 18851)
+++ lib/languages       (working copy)
@@ -1,7 +1,8 @@
 # name      babel name GUI name        RTL?   encoding   code  latex options
 afrikaans   afrikaans  "Afrikaans"     false  iso8859-15 af_ZA  ""
 american    american   "American"      false  iso8859-15 en_US  ""
-arabic      arabic     "Arabic"        true   cp1256     ar_SA  ""
+arabic_arabtex arabic   "Arabic (ArabTeX)" true  cp1256 ar_SA ""
+arabic_arabi arabic     "Arabic (Arabi)"   true  cp1256 ar_SA ""
 armenian    ""         "Armenian"      false  armscii8   hy_AM  ""
 austrian    austrian   "Austrian"      false  iso8859-15 de_AT  ""
 naustrian   naustrian  "Austrian (new spelling)" false  iso8859-15  de_AT      
 ""

Reply via email to