I made some changes. I don't know the changes I made to lib/lyx2lyx/lyx_2_3.py is correct. Please help me to complete the changes please.
Please find the patches.
~ Joice


21.02.2019, 07:38, "Richard Kimberly Heck" <rikih...@lyx.org>:

On 2/20/19 12:43 PM, Jean-Marc Lasgouttes wrote:

 Le 20/02/2019 à 16:23, Pavel Sanda a écrit :
 On Wed, Feb 20, 2019 at 09:04:59AM +0000, Joice Joseph wrote:
 Hi, last day. I had send a patch file which introduced language support
 for Malayalam - an Indic language like Tamil and Telugu. I didn't
 placed
 the definition in the correct (alphabetic order) place. So I had
 changed
 the patch placing it correctly. babel have support for Malayalam now.
 So, I have included that as well.

 Please merge with the main code base and make it available for everyone
 please.

 Please find the attached patch with this email.

 Hello and welcome here!

 I am afraid this patch is not enough, see e.g. this commit which
 introduces different
 langauge support:
 https://www.lyx.org/trac/changeset/d9c52c7a3f06ec892cd2e36d0d20998bc99b2fd8/lyxgit


 Uwe is not much around these days, but maybe someone else could give
 you a helping hand
 if the hint above is too difficult...

 I am not a specialist either but the changes boil down to three parts:

 1/ Introduce a new LyX document version (because older versions of LyX
 will not be able to read a document in malayalam. We increase version
 number at each change.

 Note that this means that the new language will only be available with
 LyX 2.4.0. This is annoying, but we do not add new language sto stable
 releases.

 Concerns: src/version.h

 2/ update the mechanism that converts old documents to new format
 (trivial, nothing to do) and to revert documents using malayalam to
 older format. This is the ugly part in the commit shown by Pavel, and
 unfortunately I do not know how to do it

 Concerns: stuff in lib/lyx2lyx


I can probably find time to do these parts on Thursday.


 3/ implement LaTeX importation. In proactice, one just has to add the
 language names to some array. This shouid probably use the
 lib/language file, but it is not done currently.


I can also figure that part out, but for now it could be left as TODO.

Riki


From 550d89a05ae076520c9d1e8748dd00c19ea8914e Mon Sep 17 00:00:00 2001
From: Joice <josuku...@outlook.com>
Date: Thu, 21 Feb 2019 09:55:50 +0530
Subject: [PATCH 2/2] Support for malayalam language

---
 development/FORMAT     |  3 +++
 lib/lyx2lyx/lyx_2_3.py | 25 ++++++++++++++++++++++++-
 lib/lyx2lyx/lyx_2_4.py |  2 ++
 src/version.h          |  4 ++--
 4 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/development/FORMAT b/development/FORMAT
index b87d395bc3..a568b44bc5 100644
--- a/development/FORMAT
+++ b/development/FORMAT
@@ -7,6 +7,9 @@ changes happened in particular if possible. A good example would be
 
 -----------------------
 
+2019-02-21 Joice Joseph <josuku...@outlook.com>
+    * Format incremented to 567: Support for Malayalam:
+        \lang malayalam
 
 2018-10-29  Guy Rutenberg <guyrutenb...@gmail.com>
 	* format incremeneted to 566: Fix direction of Hebrew parentheses in the LyX file.
diff --git a/lib/lyx2lyx/lyx_2_3.py b/lib/lyx2lyx/lyx_2_3.py
index ef79484f96..3569e702b9 100644
--- a/lib/lyx2lyx/lyx_2_3.py
+++ b/lib/lyx2lyx/lyx_2_3.py
@@ -319,6 +319,26 @@ def revert_asturian(document):
                                 "resetdefaultlanguage{asturian}",
                                 "\\end_layout", "", "\\end_inset", "", "",
                                 "\\end_layout", ""]
+def revert_malayalam(document):
+    "Set the document language to English but assure Malayalam output"
+
+    if document.language == "malayalam":
+        document.language = "english"
+        i = find_token(document.header, "\\language malayalam", 0)
+        if i != -1:
+            document.header[i] = "\\language english"
+        j = find_token(document.header, "\\language_package default", 0)
+        if j != -1:
+            document.header[j] = "\\language_package default"
+        add_to_preamble(document, ["\\AtBeginDocument{\setotherlanguage{malayalam}}"])
+        document.body[2 : 2] = ["\\begin_layout Standard",
+                                "\\begin_inset ERT", "status open", "",
+                                "\\begin_layout Plain Layout", "", "",
+                                "\\backslash",
+                                "resetdefaultlanguage{malayalam}",
+                                "\\end_layout", "", "\\end_inset", "", "",
+                                "\\end_layout", ""]
+
 
 
 def revert_kannada(document):
@@ -2233,10 +2253,13 @@ convert = [
            [541, [convert_allowbreak]],
            [542, [convert_mathnumberpos]],
            [543, [convert_mathnumberingname]],
-           [544, [convert_minted]]
+           [544, [convert_minted]],
+           [567, []]
+
           ]
 
 revert =  [
+           [567, [revert_malayalam]],
            [543, [revert_minted, revert_longtable_lscape]],
            [542, [revert_mathnumberingname]],
            [541, [revert_mathnumberpos]],
diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py
index 6c0b1c707f..7fb17300b9 100644
--- a/lib/lyx2lyx/lyx_2_4.py
+++ b/lib/lyx2lyx/lyx_2_4.py
@@ -997,6 +997,7 @@ def revert_dateinfo(document):
         "lowersorbian" : ["%A, %d. %B %Y", "%d.%m.%y", "%d %B %Y", "%d %b %Y", "%d.%m.%Y"],
         "macedonian" : ["%A, %d %B %Y", "%d.%m.%y", "%d %B %Y", "%d %b %Y", "%d.%m.%Y"],
         "magyar" : ["%Y. %B %d., %A", "%Y. %m. %d.", "%Y. %B %d.", "%Y. %b %d.", "%Y.%m.%d."],
+        "malayalam" : ["%A, %d %B, %Y", "%d/%m/%y", "%d %B %Y", "%d %b %Y", "%d-%m-%Y"],
         "marathi" : ["%A, %d %B, %Y", "%d/%m/%y", "%d %B %Y", "%d %b %Y", "%d-%m-%Y"],
         "mongolian" : ["%A, %Y оны %m сарын %d", "%Y-%m-%d", "%Y оны %m сарын %d", "%d-%m-%Y", "%d-%m-%Y"],
         "naustrian" : ["%A, %d. %B %Y", "%d.%m.%y", "%d. %B %Y", "%d. %b %Y", "%d.%m.%Y"],
@@ -1179,6 +1180,7 @@ def revert_timeinfo(document):
         "lowersorbian" : ["%H:%M:%S %Z", "%H:%M"],
         "macedonian" : ["%H:%M:%S %Z", "%H:%M"],
         "magyar" : ["%H:%M:%S %Z", "%H:%M"],
+        "malayalam" : ["%p %I:%M:%S %Z", "%p %I:%M"],
         "marathi" : ["%I:%M:%S %p %Z", "%I:%M %p"],
         "mongolian" : ["%H:%M:%S %Z", "%H:%M"],
         "naustrian" : ["%H:%M:%S %Z", "%H:%M"],
diff --git a/src/version.h b/src/version.h
index 09d0ddc487..9ded82120d 100644
--- a/src/version.h
+++ b/src/version.h
@@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 566 // guyru: Fix parentheses in Hebrew
-#define LYX_FORMAT_TEX2LYX 566
+#define LYX_FORMAT_LYX 567 // Joice : Added support for malayalam. 
+#define LYX_FORMAT_TEX2LYX 567
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER
-- 
2.20.1

From f5041d5f5325709bb8b126bbdde9aa6ce96e2143 Mon Sep 17 00:00:00 2001
From: Joice <josuku...@outlook.com>
Date: Wed, 20 Feb 2019 14:28:24 +0530
Subject: [PATCH 1/2] Added Malayalam language support.

---
 lib/languages | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/languages b/lib/languages
index d409ce0ba5..261728cb9d 100644
--- a/lib/languages
+++ b/lib/languages
@@ -1002,6 +1002,16 @@ Language macedonian
 	Provides         textcyrillic
 End
 
+Language malayalam
+	GuiName          "Malayalam"
+	BabelName        malayalam
+    PolyglossiaName  malayalam
+	Encoding         utf8
+    QuoteStyle       english
+	DateFormats      "dd MMMM yyyy|d MMM yyyy|dd-MM-yyyy"
+	LangCode         ml_IN
+End
+
 # not supported by babel
 Language marathi
 	GuiName          "Marathi"
-- 
2.20.1

Reply via email to