commit f179173e423469eb95cab6a5c7dd6ac317d4831b
Author: Uwe Stöhr <uwesto...@lyx.org>
Date:   Sun Oct 16 15:33:23 2016 +0200

    support for the languages Bosnian, Friulian, Macedonian, Piedmontese and 
Romansh
    
    - file format change
    - note that I could not update the tex2lyx test files because of bug #10440
---
 development/FORMAT       |    7 +++
 lib/languages            |   49 +++++++++++++++++++++++
 lib/lyx2lyx/lyx_2_3.py   |   99 +++++++++++++++++++++++++++++++++++++++++++++-
 src/tex2lyx/Preamble.cpp |   35 ++++++++--------
 src/version.h            |    4 +-
 5 files changed, 174 insertions(+), 20 deletions(-)

diff --git a/development/FORMAT b/development/FORMAT
index 902c145..58a58e1 100644
--- a/development/FORMAT
+++ b/development/FORMAT
@@ -11,6 +11,13 @@ adjustments are made to tex2lyx and bugs are fixed in 
lyx2lyx.
 
 -----------------------
 
+2016-10-16 Uwe Stöhr <uwesto...@web.de>
+       * Format incremented to 513: support for Piedmontese etc.:
+         \lang bosnian
+         \lang macedonian
+         \lang piedmontese
+         \lang romansh
+
 2016-08-04 Jürgen Spitzmüller <sp...@lyx.org>
        * Format incremented to 512
          Added inclusion of styles from [scr]article to the [scr]article-beamer
diff --git a/lib/languages b/lib/languages
index d56d030..08cf331 100644
--- a/lib/languages
+++ b/lib/languages
@@ -256,6 +256,15 @@ Language belarusian
        AsBabelOptions   true
 End
 
+# not yet supported by polyglossia
+Language bosnian
+       GuiName          "Bosnian"
+       BabelName        bosnian
+       QuoteStyle       polish
+       Encoding         iso8859-2
+       LangCode         bs_BA
+End
+
 Language brazilian
        GuiName          "Portuguese (Brazil)"
        HasGuiSupport    true
@@ -480,6 +489,16 @@ Language french
        EndPostBabelPreamble
 End
 
+Language friulan
+       GuiName          "Friulian"
+       HasGuiSupport    true
+       BabelName        friulan
+       PolyglossiaName  friulan
+       QuoteStyle       french
+       Encoding         iso8859-15
+       LangCode         fur_IT
+End
+
 Language galician
        GuiName          "Galician"
        HasGuiSupport    true
@@ -768,6 +787,16 @@ Language magyar
        LangCode         hu_HU
 End
 
+# not yet supported by polyglossia
+Language macedonian
+       GuiName          "Macedonian"
+       BabelName        macedonian
+       QuoteStyle       german
+       Encoding         cp1251
+       FontEncoding     T2A
+       LangCode         mk_MK
+End
+
 # not supported by babel
 Language marathi
        GuiName          "Marathi"
@@ -837,6 +866,16 @@ End
 #      LangCode         ru_petr1708
 # End
 
+Language piedmontese
+       GuiName          "Piedmontese"
+       HasGuiSupport    true
+       BabelName        piedmontese
+       PolyglossiaName  piedmontese
+       QuoteStyle       french
+       Encoding         iso8859-15
+       LangCode         pms_IT
+End
+
 Language polish
        GuiName          "Polish"
        HasGuiSupport    true
@@ -868,6 +907,16 @@ Language romanian
        LangCode         ro_RO
 End
 
+Language romansh
+       GuiName          "Romansh"
+       HasGuiSupport    true
+       BabelName        romansh
+       PolyglossiaName  romansh
+       QuoteStyle       german
+       Encoding         iso8859-15
+       LangCode         rm_CH
+End
+
 Language russian
        GuiName          "Russian"
        HasGuiSupport    true
diff --git a/lib/lyx2lyx/lyx_2_3.py b/lib/lyx2lyx/lyx_2_3.py
index 001c1cb..93bf0f6 100644
--- a/lib/lyx2lyx/lyx_2_3.py
+++ b/lib/lyx2lyx/lyx_2_3.py
@@ -261,6 +261,101 @@ def convert_beamer_article_styles(document):
         return
 
 
+def revert_bosnian(document):
+    "Set the document language to English but assure Bosnian output"
+
+    if document.language == "bosnian":
+        document.language = "english"
+        i = find_token(document.header, "\\language bosnian", 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 babel"
+        k = find_token(document.header, "\\options", 0)
+        if k != -1:
+           document.header[k] = document.header[k].replace("\\options", 
"\\options bosnian,")
+        else:
+           l = find_token(document.header, "\\use_default_options", 0)
+           document.header.insert(l + 1, "\\options bosnian")
+
+
+def revert_friulan(document):
+    "Set the document language to English but assure Friulan output"
+
+    if document.language == "friulan":
+        document.language = "english"
+        i = find_token(document.header, "\\language friulan", 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 babel"
+        k = find_token(document.header, "\\options", 0)
+        if k != -1:
+           document.header[k] = document.header[k].replace("\\options", 
"\\options friulan,")
+        else:
+           l = find_token(document.header, "\\use_default_options", 0)
+           document.header.insert(l + 1, "\\options friulan")
+
+
+def revert_macedonian(document):
+    "Set the document language to English but assure Macedonian output"
+
+    if document.language == "macedonian":
+        document.language = "english"
+        i = find_token(document.header, "\\language macedonian", 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 babel"
+        k = find_token(document.header, "\\options", 0)
+        if k != -1:
+           document.header[k] = document.header[k].replace("\\options", 
"\\options macedonian,")
+        else:
+           l = find_token(document.header, "\\use_default_options", 0)
+           document.header.insert(l + 1, "\\options macedonian")
+
+
+def revert_piedmontese(document):
+    "Set the document language to English but assure Piedmontese output"
+
+    if document.language == "piedmontese":
+        document.language = "english"
+        i = find_token(document.header, "\\language piedmontese", 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 babel"
+        k = find_token(document.header, "\\options", 0)
+        if k != -1:
+           document.header[k] = document.header[k].replace("\\options", 
"\\options piedmontese,")
+        else:
+           l = find_token(document.header, "\\use_default_options", 0)
+           document.header.insert(l + 1, "\\options piedmontese")
+
+
+def revert_romansh(document):
+    "Set the document language to English but assure Romansh output"
+
+    if document.language == "romansh":
+        document.language = "english"
+        i = find_token(document.header, "\\language romansh", 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 babel"
+        k = find_token(document.header, "\\options", 0)
+        if k != -1:
+           document.header[k] = document.header[k].replace("\\options", 
"\\options romansh,")
+        else:
+           l = find_token(document.header, "\\use_default_options", 0)
+           document.header.insert(l + 1, "\\options romansh")
+
+
 ##
 # Conversion hub
 #
@@ -270,10 +365,12 @@ convert = [
            [509, [convert_microtype]],
            [510, [convert_dateinset]],
            [511, [convert_ibranches]],
-           [512, [convert_beamer_article_styles]]
+           [512, [convert_beamer_article_styles]],
+           [513, []]
           ]
 
 revert =  [
+           [512, [revert_bosnian, revert_friulan, revert_macedonian, 
revert_piedmontese, revert_romansh]],
            [511, [revert_beamer_article_styles]],
            [510, [revert_ibranches]],
            [509, []],
diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index a52927f..9709cf0 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -52,17 +52,17 @@ namespace {
  */
 const char * const known_languages[] = {"acadian", "afrikaans", "albanian",
 "american", "arabic", "arabtex", "australian", "austrian", "bahasa", "bahasai",
-"bahasam", "basque", "belarusian", "brazil", "brazilian", "breton", "british",
+"bahasam", "basque", "belarusian", "bosnian", "brazil", "brazilian", "breton", 
"british",
 "bulgarian", "canadian", "canadien", "catalan", "croatian", "czech", "danish",
 "dutch", "english", "esperanto", "estonian", "farsi", "finnish", "francais",
-"french", "frenchb", "frenchle", "frenchpro", "galician", "german", "germanb",
+"french", "frenchb", "frenchle", "frenchpro", "friulan", "galician", "german", 
"germanb",
 "georgian", "greek", "hebrew", "hungarian", "icelandic", "indon", "indonesian",
 "interlingua", "irish", "italian", "japanese", "kazakh", "kurmanji", "latin",
-"latvian", "lithuanian", "lowersorbian", "lsorbian", "magyar", "malay", 
"meyalu",
+"latvian", "lithuanian", "lowersorbian", "lsorbian", "macedonian", "magyar", 
"malay", "meyalu",
 "mongolian", "naustrian", "newzealand", "ngerman", "ngermanb", "norsk", 
"nswissgerman",
-"nynorsk", "polutonikogreek", "polish", "portuges", "portuguese", "romanian", 
"russian",
-"russianb", "samin", "scottish", "serbian", "serbian-latin", "slovak",
-"slovene", "spanish", "swedish", "swissgerman", "thai", "turkish", "turkmen",
+"nynorsk", "piedmontese", "polutonikogreek", "polish", "portuges", 
"portuguese",
+"romanian", "romansh", "russian", "russianb", "samin", "scottish", "serbian", 
"serbian-latin",
+"slovak", "slovene", "spanish", "swedish", "swissgerman", "thai", "turkish", 
"turkmen",
 "ukraineb", "ukrainian", "uppersorbian", "UKenglish", "USenglish", "usorbian",
 "vietnam", "welsh",
 0};
@@ -73,17 +73,17 @@ const char * const known_languages[] = {"acadian", 
"afrikaans", "albanian",
  */
 const char * const known_coded_languages[] = {"french", "afrikaans", 
"albanian",
 "american", "arabic_arabi", "arabic_arabtex", "australian", "austrian", 
"bahasa", "bahasa",
-"bahasam", "basque", "belarusian", "brazilian", "brazilian", "breton", 
"british",
+"bahasam", "basque", "belarusian", "bosnian", "brazilian", "brazilian", 
"breton", "british",
 "bulgarian", "canadian", "canadien", "catalan", "croatian", "czech", "danish",
 "dutch", "english", "esperanto", "estonian", "farsi", "finnish", "french",
-"french", "french", "french", "french", "galician", "german", "german",
+"french", "french", "french", "french", "friulan", "galician", "german", 
"german",
 "georgian", "greek", "hebrew", "magyar", "icelandic", "bahasa", "bahasa",
 "interlingua", "irish", "italian", "japanese", "kazakh", "kurmanji", "latin",
-"latvian", "lithuanian", "lowersorbian", "lowersorbian", "magyar", "bahasam", 
"bahasam",
+"latvian", "lithuanian", "lowersorbian", "lowersorbian", "macedonian", 
"magyar", "bahasam", "bahasam",
 "mongolian", "naustrian", "newzealand", "ngerman", "ngerman", "norsk", 
"german-ch",
-"nynorsk", "polutonikogreek", "polish", "portuguese", "portuguese", 
"romanian", "russian",
-"russian", "samin", "scottish", "serbian", "serbian-latin", "slovak",
-"slovene", "spanish", "swedish", "german-ch-old", "thai", "turkish", "turkmen",
+"nynorsk", "piedmontese", "polutonikogreek", "polish", "portuguese", 
"portuguese",
+"romanian", "romansh", "russian", "russian", "samin", "scottish", "serbian", 
"serbian-latin",
+"slovak", "slovene", "spanish", "swedish", "german-ch-old", "thai", "turkish", 
"turkmen",
 "ukrainian", "ukrainian", "uppersorbian", "english", "english", "uppersorbian",
 "vietnamese", "welsh",
 0};
@@ -99,18 +99,19 @@ const char * const known_english_quotes_languages[] = 
{"american", "australian",
 
 /// languages with french quotes (.lyx names)
 const char * const known_french_quotes_languages[] = {"albanian",
-"arabic_arabi", "arabic_arabtex", "basque", "canadien", "catalan", "french",
-"galician", "greek", "italian", "norsk", "nynorsk", "polutonikogreek",
+"arabic_arabi", "arabic_arabtex", "basque", "canadien", "catalan", "french", 
"friulan",
+"galician", "greek", "italian", "norsk", "nynorsk", "piedmontese", 
"polutonikogreek",
 "russian", "spanish", "spanish-mexico", "turkish", "turkmen", "ukrainian",
 "vietnamese", 0};
 
 /// languages with german quotes (.lyx names)
 const char * const known_german_quotes_languages[] = {"austrian", "bulgarian",
-"czech", "german", "georgian", "icelandic", "lithuanian", "lowersorbian", 
"naustrian",
-"ngerman", "serbian", "serbian-latin", "slovak", "slovene", "uppersorbian", 0};
+"czech", "german", "georgian", "icelandic", "lithuanian", "lowersorbian", 
"macedonian",
+"naustrian", "ngerman", "romansh", "serbian", "serbian-latin", "slovak", 
"slovene",
+"uppersorbian", 0};
 
 /// languages with polish quotes (.lyx names)
-const char * const known_polish_quotes_languages[] = {"afrikaans", "croatian",
+const char * const known_polish_quotes_languages[] = {"afrikaans", "bosnian", 
"croatian",
 "dutch", "estonian", "magyar", "polish", "romanian", 0};
 
 /// languages with swedish quotes (.lyx names)
diff --git a/src/version.h b/src/version.h
index 561f3ec..a3b7ef1 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 512 // spitz: beamer article extension
-#define LYX_FORMAT_TEX2LYX 512
+#define LYX_FORMAT_LYX 513 // uwestoehr: support for Bosnian, Friulan, 
Piedmontese, Romansh and Macedonian
+#define LYX_FORMAT_TEX2LYX 513
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER

Reply via email to