]> git.lyx.org Git - lyx.git/commitdiff
support for Australian and Newzealand as document language; fileformat change
authorUwe Stöhr <uwestoehr@web.de>
Thu, 8 Dec 2011 23:58:30 +0000 (23:58 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Thu, 8 Dec 2011 23:58:30 +0000 (23:58 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40452 a592a061-630c-0410-9148-cb99ea01b6c8

development/FORMAT
lib/languages
lib/lyx2lyx/lyx_2_1.py
src/tex2lyx/Preamble.cpp
src/version.h

index 4120616256c22c86dd895e36f1d60022f321d1f4..965dfd8fe3a490b1e793afc37cc727b5ab6d5175 100644 (file)
@@ -11,6 +11,10 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
 
 -----------------------
 
+2011-12-09 Uwe Stöhr <uwestoehr@web.de>
+       * Format incremented to 419 (r40452)
+         support for the document languages australian and newzealand
+
 2011-12-08 Richard Heck <rgheck@lyx.org>
        * Format incremented to 418 (r40427)
          Introduce justification preference.
index 51e5f26b1fc8abcea35fc02e60a4b56e0506439e..350bc533b91528149d8c3016865768cf68dd47d4 100644 (file)
@@ -134,6 +134,15 @@ Language armenian
        LangCode         hy_AM
 End
 
+Language australian
+       GuiName          "English (Australia)"
+       BabelName        australian
+       PolyglossiaName  english
+       PolyglossiaOpts  "variant=australian"
+       Encoding         iso8859-15
+       LangCode         en_AU
+End
+
 Language austrian
        GuiName          "German (Austria, old spelling)"
        BabelName        austrian
@@ -595,6 +604,15 @@ Language mongolian
        AsBabelOptions   true
 End
 
+Language newzealand
+       GuiName          "English (New Zealand)"
+       BabelName        newzealand
+       PolyglossiaName  english
+       PolyglossiaOpts  "variant=newzealand"
+       Encoding         iso8859-15
+       LangCode         en_NZ
+End
+
 Language norsk
        GuiName          "Norwegian (Bokmaal)"
        BabelName        norsk
index 064b938ad1bb5e862a4a6fbe57c663603c419a8e..15e02ca8f858fbfd7922687d556ba763f0fe750f 100644 (file)
@@ -198,6 +198,28 @@ def revert_justification(document):
     if not del_token(document.header, '\\justification', 0):
         document.warning("Malformed LyX document: Missing \\justification.")
 
+
+def revert_australian(document):
+    "Set English language variants Australian and Newzealand to English" 
+
+    if document.language == "australian" or document.language == "newzealand": 
+        document.language = "english" 
+        i = find_token(document.header, "\\language", 0) 
+        if i != -1: 
+            document.header[i] = "\\language english" 
+
+    j = 0 
+    while True: 
+        j = find_token(document.body, "\\lang australian", j) 
+        if j == -1: 
+            j = find_token(document.body, "\\lang newzealand", 0)
+            if j == -1:
+                return
+            else:
+                document.body[j] = document.body[j].replace("\\lang newzealand", "\\lang english")
+        else:
+            document.body[j] = document.body[j].replace("\\lang australian", "\\lang english") 
+        j += 1
     
 
 ##
@@ -211,9 +233,11 @@ convert = [
            [416, []],
            [417, [convert_japanese_encodings]],
            [418, []],
+           [419, []]
           ]
 
 revert =  [
+           [418, [revert_australian]],
            [417, [revert_justification]],
            [416, [revert_japanese_encodings]],
            [415, [revert_negative_space,revert_math_spaces]],
index f0e0f7ae9a14f8d43a065887a51f116d0c96c019..dcda4a0f80ba833d59ca907a172ccf153aefcd7d 100644 (file)
@@ -57,12 +57,12 @@ namespace {
  * please keep this in sync with known_coded_languages line by line!
  */
 const char * const known_languages[] = {"acadian", "afrikaans", "albanian",
-"american", "arabic", "arabtex", "austrian", "bahasa", "bahasai", "bahasam",
-"basque", "belarusian", "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", "greek",
-"hebrew", "hungarian", "icelandic", "indon", "indonesian", "interlingua",
+"american", "arabic", "arabtex", "australian", "austrian", "bahasa", "bahasai",
+"bahasam", "basque", "belarusian", "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",
+"greek", "hebrew", "hungarian", "icelandic", "indon", "indonesian", "interlingua",
 "irish", "italian", "kazakh", "latin", "latvian", "lithuanian", "lowersorbian",
 "lsorbian", "magyar", "malay", "meyalu", "mongolian", "naustrian", "newzealand",
 "ngerman", "ngermanb", "norsk", "nynorsk", "polutonikogreek", "polish",
@@ -77,14 +77,14 @@ const char * const known_languages[] = {"acadian", "afrikaans", "albanian",
  * please keep this in sync with known_languages line by line!
  */
 const char * const known_coded_languages[] = {"french", "afrikaans", "albanian",
-"american", "arabic_arabi", "arabic_arabtex", "austrian", "bahasa", "bahasa", "bahasam",
-"basque", "belarusian", "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", "greek",
-"hebrew", "magyar", "icelandic", "bahasa", "bahasa", "interlingua",
+"american", "arabic_arabi", "arabic_arabtex", "australian", "austrian", "bahasa", "bahasa",
+"bahasam", "basque", "belarusian", "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",
+"greek", "hebrew", "magyar", "icelandic", "bahasa", "bahasa", "interlingua",
 "irish", "italian", "kazakh", "latin", "latvian", "lithuanian", "lowersorbian",
-"lowersorbian", "magyar", "bahasam", "bahasam", "mongolian", "naustrian", "english",
+"lowersorbian", "magyar", "bahasam", "bahasam", "mongolian", "naustrian", "newzealand",
 "ngerman", "ngerman", "norsk", "nynorsk", "polutonikogreek", "polish",
 "portuguese", "portuguese", "romanian", "russian", "russian", "samin",
 "scottish", "serbian", "serbian-latin", "slovak", "slovene", "spanish",
@@ -93,9 +93,10 @@ const char * const known_coded_languages[] = {"french", "afrikaans", "albanian",
 0};
 
 /// languages with english quotes (.lyx names)
-const char * const known_english_quotes_languages[] = {"american", "bahasa",
-"bahasam", "brazilian", "canadian", "chinese-simplified", "english",
-"esperanto", "hebrew", "irish", "korean", "portuguese", "scottish", "thai", 0};
+const char * const known_english_quotes_languages[] = {"american", "australian",
+"bahasa", "bahasam", "brazilian", "canadian", "chinese-simplified", "english",
+"esperanto", "hebrew", "irish", "korean", "newzealand", "portuguese", "scottish",
+"thai", 0};
 
 /// languages with french quotes (.lyx names)
 const char * const known_french_quotes_languages[] = {"albanian",
index dc94ee4f7afdd7447a302e53cb386e022668f205..3beaf9c4aaddc5517b419cf88b2c20d07211035a 100644 (file)
@@ -30,8 +30,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 418 // rgh: justification option
-#define LYX_FORMAT_TEX2LYX 418
+#define LYX_FORMAT_LYX 419 // uwestoehr: support for the languages australian and newzealand
+#define LYX_FORMAT_TEX2LYX 419
 
 #if LYX_FORMAT_FOR_TEX2LYX != LYX_FORMAT_FOR_LYX
 #warning "tex2lyx produces an out of date file format."