]> git.lyx.org Git - features.git/commitdiff
* Fix bug #2144: Merge the two identical classes g-brief-de and g-brief-en into one...
authorJürgen Spitzmüller <spitz@lyx.org>
Mon, 7 Dec 2009 11:53:25 +0000 (11:53 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Mon, 7 Dec 2009 11:53:25 +0000 (11:53 +0000)
The German layouts are replaced by the English ones.
German localization is now done as it is supposed to be: via gettext.

A file format change was needed to do this.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32406 a592a061-630c-0410-9148-cb99ea01b6c8

development/FORMAT
development/scons/scons_manifest.py
lib/Makefile.am
lib/layouts/g-brief-de.layout [deleted file]
lib/layouts/g-brief-en.layout [deleted file]
lib/layouts/g-brief.layout [new file with mode: 0644]
lib/lyx2lyx/lyx_2_0.py
src/Buffer.cpp

index d15b4ce3d5bcd48552f299ec2a341db597a45c22..557b47fe028ac2f7d185788002b1b4a553dd1bc2 100644 (file)
@@ -1,6 +1,12 @@
 LyX file-format changes
 -----------------------
 
+2009-12-07 Jürgen Spitzmüller <spitz@lyx.org>
+       * Format incremented to 373: merge g-brief-de and g-brief-en
+         classes into one g-brief class.
+         All German layout names are replaced by English ones, the
+         two classes are renamed to g-brief.
+
 2009-11-29 Jürgen Spitzmüller <spitz@lyx.org>
        * Format incremented to 372: new buffer param fontencoding.
          This param holds a buffer-specific fontencoding (argument
index 482d3c0500c776dfa9694bcba48592c61e501048..2d6dc55e221193047ec40e469a8a61716ed3e4d8 100644 (file)
@@ -2699,8 +2699,7 @@ lib_layouts_files = Split('''
     extletter.layout
     extreport.layout
     foils.layout
-    g-brief-de.layout
-    g-brief-en.layout
+    g-brief.layout
     g-brief2.layout
     heb-article.layout
     heb-letter.layout
index 2f17a04e7b546163aac419688478871637a29c71..ffceb537b42c5845599f5a75d4a89baea8efcb33 100644 (file)
@@ -1056,8 +1056,7 @@ dist_layouts_DATA =\
        layouts/figs-within-sections.module \
        layouts/foils.layout \
        layouts/foottoend.module \
-       layouts/g-brief-de.layout \
-       layouts/g-brief-en.layout \
+       layouts/g-brief.layout \
        layouts/g-brief2.layout \
        layouts/hanging.module \
        layouts/heb-article.layout \
diff --git a/lib/layouts/g-brief-de.layout b/lib/layouts/g-brief-de.layout
deleted file mode 100644 (file)
index c1d0153..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-#% Do not delete he line below; configure depends on this
-#  \DeclareLaTeXClass[g-brief]{letter (g-brief, German)}
-# Letter textclass definition file.
-# Author : Thomas Hartkens <thomas@hartkens.de>
-
-Format 19
-Input stdinsets.inc
-Input stdfloats.inc
-Input stdcounters.inc
-
-Columns                 1
-Sides                   1
-PageStyle               Empty
-DefaultStyle            Brieftext
-
-
-Style Brieftext
-       Margin                Static
-       LatexType             Environment
-       LatexName             g-brief
-       ParSkip               0.4
-       KeepEmpty             1
-       Align                 Block
-       AlignPossible         Block, Left, Right, Center
-       LabelType             Top_Environment
-       LabelString           "Letter:"
-       LabelFont
-         Series              Bold
-         Shape               Italic
-         Color               Blue
-       EndFont
-End
-
-
-Style Name
-       Margin                Static
-       LatexType             Command
-       LatexName             Name
-       LeftMargin            RetourAdresse:xx
-       LabelSep              xx
-       KeepEmpty             1
-       Align                 Block
-       AlignPossible         Block, Left
-       LabelType             Static
-       LabelString           "Name:"
-       LabelFont
-         Series              Bold
-         Shape               Italic
-         Color               Blue
-       EndFont
-End
-
-
-Style Unterschrift
-       CopyStyle             Name
-       LatexName             Unterschrift
-       LabelString           "Signature:"
-End
-
-
-Style Strasse
-       CopyStyle             Name
-       LatexName             Strasse
-       LabelString           "Street:"
-End
-
-
-Style Zusatz
-       CopyStyle             Name
-       LatexName             Zusatz
-       LabelString           "Addition:"
-End
-
-
-Style Ort
-       CopyStyle             Name
-       LatexName             Ort
-       LabelString           "Town:"
-End
-
-
-Style Land
-       CopyStyle             Name
-       LatexName             Land
-       LabelString           "State:"
-End
-
-
-Style RetourAdresse
-       CopyStyle             Name
-       LatexName             RetourAdresse
-       LabelString           "ReturnAddress:"
-End
-
-
-Style MeinZeichen
-       CopyStyle             Name
-       LatexName             MeinZeichen
-       LabelString           "MyRef:"
-End
-
-
-Style IhrZeichen
-       CopyStyle             Name
-       LatexName             IhrZeichen
-       LabelString           "YourRef:"
-End
-
-
-Style IhrSchreiben
-       CopyStyle             Name
-       LatexName             IhrSchreiben
-       LabelString           "YourMail:"
-End
-
-
-Style Telefon
-       CopyStyle             Name
-       LatexName             Telefon
-       LabelString           "Phone:"
-End
-
-
-Style Telefax
-       CopyStyle             Name
-       LatexName             Telefax
-       LabelString           "Telefax:"
-End
-
-
-Style Telex
-       CopyStyle             Name
-       LatexName             Telex
-       LabelString           "Telex:"
-End
-
-
-Style EMail
-       CopyStyle             Name
-       LatexName             EMail
-       LabelString           "EMail:"
-End
-
-
-Style HTTP
-       CopyStyle             Name
-       LatexName             HTTP
-       LabelString           "HTTP:"
-End
-
-
-Style Bank
-       CopyStyle             Name
-       LatexName             Bank
-       LabelString           "Bank:"
-End
-
-
-Style BLZ
-       CopyStyle             Name
-       LatexName             BLZ
-       LabelString           "BankCode:"
-End
-
-
-Style Konto
-       CopyStyle             Name
-       LatexName             Konto
-       LabelString           "BankAccount:"
-End
-
-
-Style Postvermerk
-       CopyStyle             Name
-       LatexName             Postvermerk
-       LabelString           "PostalComment:"
-End
-
-
-Style Adresse
-       CopyStyle             Name
-       LatexName             Adresse
-       TopSep                1.5
-       KeepEmpty             1
-       LabelString           "Address:"
-End
-
-
-Style Datum
-       CopyStyle             Name
-       LatexName             Datum
-       LabelString           "Date:"
-End
-
-
-Style Betreff
-       CopyStyle             Name
-       LatexName             Betreff
-       TopSep                1.5
-       ParSep                0.4
-       LabelString           "Reference:"
-End
-
-
-Style Anrede
-       CopyStyle             Name
-       LatexName             Anrede
-       TopSep                1.5
-       ParSep                0.4
-       LabelString           "Opening:"
-End
-
-
-Style Anlagen
-       CopyStyle             Name
-       LatexName             Anlagen
-       ParSep                0.4
-       LabelString           "Encl.:"
-End
-
-
-Style Verteiler
-       CopyStyle             Name
-       LatexName             Verteiler
-       KeepEmpty             1
-       ParSep                0.4
-       LabelString           "cc:"
-End
-
-
-Style Gruss
-       CopyStyle             Name
-       LatexName             LyxGruss
-       BottomSep             1.5
-       ParSep                0.4
-       LabelString           "Closing:"
-       Preamble
-               \newcommand{\LyxGruss}[1]{\Gruss{#1}{0.5cm}}
-       EndPreamble
-End
diff --git a/lib/layouts/g-brief-en.layout b/lib/layouts/g-brief-en.layout
deleted file mode 100644 (file)
index 9ca2d26..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-#% Do not delete he line below; configure depends on this
-#  \DeclareLaTeXClass[g-brief]{letter (g-brief)}
-# Letter textclass definition file.
-# Author : Thomas Hartkens <thomas@hartkens.de>
-
-Format 19
-Input stdinsets.inc
-Input stdfloats.inc
-Input stdcounters.inc
-
-Columns                 1
-Sides                   1
-PageStyle               Empty
-DefaultStyle            Letter
-
-
-Style Letter
-       Margin                Static
-       LatexType             Environment
-       LatexName             g-brief
-       ParSkip               0.4
-       KeepEmpty             1
-       Align                 Block
-       AlignPossible         Block, Left, Right, Center
-       LabelType             Top_Environment
-       LabelString           "Letter:"
-       LabelFont
-         Series              Bold
-         Shape               Italic
-         Color               Blue
-       EndFont
-End
-
-
-Style Name
-       Margin                Static
-       LatexType             Command
-       LatexName             Name
-       LeftMargin            PostalComment:xx
-       LabelSep              xx
-       KeepEmpty             1
-       Align                 Block
-       AlignPossible         Block, Left
-       LabelType             Static
-       LabelString           "Name:"
-       LabelFont
-         Series              Bold
-         Shape               Italic
-         Color               Blue
-       EndFont
-End
-
-
-Style Signature
-       CopyStyle             Name
-       LatexName             Unterschrift
-       LabelString           "Signature:"
-End
-
-
-Style Street
-       CopyStyle             Name
-       LatexName             Strasse
-       LabelString           "Street:"
-End
-
-
-Style Addition
-       CopyStyle             Name
-       LatexName             Zusatz
-       LabelString           "Addition:"
-End
-
-
-Style Town
-       CopyStyle             Name
-       LatexName             Ort
-       LabelString           "Town:"
-End
-
-
-Style State
-       CopyStyle             Name
-       LatexName             Land
-       LabelString           "State:"
-End
-
-
-Style ReturnAddress
-       CopyStyle             Name
-       LatexName             RetourAdresse
-       LabelString           "ReturnAddress:"
-End
-
-
-Style MyRef
-       CopyStyle             Name
-       LatexName             MeinZeichen
-       LabelString           "MyRef:"
-End
-
-
-Style YourRef
-       CopyStyle             Name
-       LatexName             IhrZeichen
-       LabelString           "YourRef:"
-End
-
-
-Style YourMail
-       CopyStyle             Name
-       LatexName             IhrSchreiben
-       LabelString           "YourMail:"
-End
-
-
-Style Phone
-       CopyStyle             Name
-       LatexName             Telefon
-       LabelString           "Phone:"
-End
-
-
-Style Telefax
-       CopyStyle             Name
-       LatexName             Telefax
-       LabelString           "Telefax:"
-End
-
-
-Style Telex
-       CopyStyle             Name
-       LatexName             Telex
-       LabelString           "Telex:"
-End
-
-
-Style EMail
-       CopyStyle             Name
-       LatexName             EMail
-       LabelString           "EMail:"
-End
-
-
-Style HTTP
-       CopyStyle             Name
-       LatexName             HTTP
-       LabelString           "HTTP:"
-End
-
-
-Style Bank
-       CopyStyle             Name
-       LatexName             Bank
-       LabelString           "Bank:"
-End
-
-
-Style BankCode
-       CopyStyle             Name
-       LatexName             BLZ
-       LabelString           "BankCode:"
-End
-
-
-Style BankAccount
-       CopyStyle             Name
-       LatexName             Konto
-       LabelString           "BankAccount:"
-End
-
-
-Style PostalComment
-       CopyStyle             Name
-       LatexName             Postvermerk
-       LabelString           "PostalComment:"
-End
-
-
-Style Address
-       CopyStyle             Name
-       LatexName             Adresse
-       TopSep                1.5
-       KeepEmpty             1
-       LabelString           "Address:"
-End
-
-
-Style Date
-       CopyStyle             Name
-       LatexName             Datum
-       LabelString           "Date:"
-End
-
-
-Style Reference
-       CopyStyle             Name
-       LatexName             Betreff
-       TopSep                1.5
-       ParSep                0.4
-       LabelString           "Reference:"
-End
-
-
-Style Opening
-       CopyStyle             Name
-       LatexName             Anrede
-       TopSep                1.5
-       ParSep                0.4
-       LabelString           "Opening:"
-End
-
-
-Style Encl.
-       CopyStyle             Name
-       LatexName             Anlagen
-       ParSep                0.4
-       LabelString           "Encl.:"
-End
-
-
-Style cc
-       CopyStyle             Name
-       LatexName             Verteiler
-       KeepEmpty             1
-       ParSep                0.4
-       LabelString           "cc:"
-End
-
-
-Style Closing
-       CopyStyle             Name
-       LatexName             LyxGruss
-       BottomSep             1.5
-       ParSep                0.4
-       LabelString           "Closing:"
-       Preamble
-               \newcommand{\LyxGruss}[1]{\Gruss{#1}{0.5cm}}
-       EndPreamble
-End
diff --git a/lib/layouts/g-brief.layout b/lib/layouts/g-brief.layout
new file mode 100644 (file)
index 0000000..953e7c3
--- /dev/null
@@ -0,0 +1,240 @@
+#% Do not delete the line below; configure depends on this
+#  \DeclareLaTeXClass[g-brief]{letter (g-brief)}
+# Letter textclass definition file.
+# Author : Thomas Hartkens <thomas@hartkens.de>
+
+Format 19
+Input stdinsets.inc
+Input stdfloats.inc
+Input stdcounters.inc
+
+Columns                 1
+Sides                   1
+PageStyle               Empty
+DefaultStyle            Letter
+
+
+Style Letter
+       Margin                Static
+       LatexType             Environment
+       LatexName             g-brief
+       ParSkip               0.4
+       KeepEmpty             1
+       Align                 Block
+       AlignPossible         Block, Left, Right, Center
+       LabelType             Top_Environment
+       LabelString           "Letter:"
+       LabelFont
+         Series              Bold
+         Shape               Italic
+         Color               Blue
+       EndFont
+End
+
+
+Style Name
+       Margin                Static
+       LatexType             Command
+       LatexName             Name
+       LeftMargin            Rucksende-Adresse:xx
+       LabelSep              xx
+       KeepEmpty             1
+       Align                 Block
+       AlignPossible         Block, Left
+       LabelType             Static
+       LabelString           "Name:"
+       LabelFont
+         Series              Bold
+         Shape               Italic
+         Color               Blue
+       EndFont
+End
+
+
+Style Signature
+       CopyStyle             Name
+       LatexName             Unterschrift
+       LabelString           "Signature:"
+End
+
+
+Style Street
+       CopyStyle             Name
+       LatexName             Strasse
+       LabelString           "Street:"
+End
+
+
+Style Addition
+       CopyStyle             Name
+       LatexName             Zusatz
+       LabelString           "Addition:"
+End
+
+
+Style Town
+       CopyStyle             Name
+       LatexName             Ort
+       LabelString           "Town:"
+End
+
+
+Style State
+       CopyStyle             Name
+       LatexName             Land
+       LabelString           "State:"
+End
+
+
+Style ReturnAddress
+       CopyStyle             Name
+       LatexName             RetourAdresse
+       LabelString           "ReturnAddress:"
+End
+
+
+Style MyRef
+       CopyStyle             Name
+       LatexName             MeinZeichen
+       LabelString           "MyRef:"
+End
+
+
+Style YourRef
+       CopyStyle             Name
+       LatexName             IhrZeichen
+       LabelString           "YourRef:"
+End
+
+
+Style YourMail
+       CopyStyle             Name
+       LatexName             IhrSchreiben
+       LabelString           "YourMail:"
+End
+
+
+Style Phone
+       CopyStyle             Name
+       LatexName             Telefon
+       LabelString           "Phone:"
+End
+
+
+Style Telefax
+       CopyStyle             Name
+       LatexName             Telefax
+       LabelString           "Telefax:"
+End
+
+
+Style Telex
+       CopyStyle             Name
+       LatexName             Telex
+       LabelString           "Telex:"
+End
+
+
+Style EMail
+       CopyStyle             Name
+       LatexName             EMail
+       LabelString           "EMail:"
+End
+
+
+Style HTTP
+       CopyStyle             Name
+       LatexName             HTTP
+       LabelString           "HTTP:"
+End
+
+
+Style Bank
+       CopyStyle             Name
+       LatexName             Bank
+       LabelString           "Bank:"
+End
+
+
+Style BankCode
+       CopyStyle             Name
+       LatexName             BLZ
+       LabelString           "BankCode:"
+End
+
+
+Style BankAccount
+       CopyStyle             Name
+       LatexName             Konto
+       LabelString           "BankAccount:"
+End
+
+
+Style PostalComment
+       CopyStyle             Name
+       LatexName             Postvermerk
+       LabelString           "PostalComment:"
+End
+
+
+Style Address
+       CopyStyle             Name
+       LatexName             Adresse
+       TopSep                1.5
+       KeepEmpty             1
+       LabelString           "Address:"
+End
+
+
+Style Date
+       CopyStyle             Name
+       LatexName             Datum
+       LabelString           "Date:"
+End
+
+
+Style Reference
+       CopyStyle             Name
+       LatexName             Betreff
+       TopSep                1.5
+       ParSep                0.4
+       LabelString           "Reference:"
+End
+
+
+Style Opening
+       CopyStyle             Name
+       LatexName             Anrede
+       TopSep                1.5
+       ParSep                0.4
+       LabelString           "Opening:"
+End
+
+
+Style Encl.
+       CopyStyle             Name
+       LatexName             Anlagen
+       ParSep                0.4
+       LabelString           "Encl.:"
+End
+
+
+Style cc
+       CopyStyle             Name
+       LatexName             Verteiler
+       KeepEmpty             1
+       ParSep                0.4
+       LabelString           "cc:"
+End
+
+
+Style Closing
+       CopyStyle             Name
+       LatexName             LyxGruss
+       BottomSep             1.5
+       ParSep                0.4
+       LabelString           "Closing:"
+       Preamble
+               \newcommand{\LyxGruss}[1]{\Gruss{#1}{0.5cm}}
+       EndPreamble
+End
index f375a02d0de7ea12f14d7d2bbfc817678d5e4a43..cd665bfd1db782f0738ec8ad84db2df33306de5d 100644 (file)
@@ -1078,6 +1078,59 @@ def revert_fontenc(document):
     del document.header[i]
 
 
+def merge_gbrief(document):
+    " Merge g-brief-en and g-brief-de to one class "
+
+    if document.textclass != "g-brief-de":
+        if document.textclass == "g-brief-en":
+            document.textclass = "g-brief"
+            document.set_textclass()
+        return
+
+    obsoletedby = { "Brieftext":       "Letter",
+                    "Unterschrift":    "Signature",
+                    "Strasse":         "Street",
+                    "Zusatz":          "Addition",
+                    "Ort":             "Town",
+                    "Land":            "State",
+                    "RetourAdresse":   "ReturnAddress",
+                    "MeinZeichen":     "MyRef",
+                    "IhrZeichen":      "YourRef",
+                    "IhrSchreiben":    "YourMail",
+                    "Telefon":         "Phone",
+                    "BLZ":             "BankCode",
+                    "Konto":           "BankAccount",
+                    "Postvermerk":     "PostalComment",
+                    "Adresse":         "Address",
+                    "Datum":           "Date",
+                    "Betreff":         "Reference",
+                    "Anrede":          "Opening",
+                    "Anlagen":         "Encl.",
+                    "Verteiler":       "cc",
+                    "Gruss":           "Closing"}
+    i = 0
+    while 1:
+        i = find_token(document.body, "\\begin_layout", i)
+        if i == -1:
+            break
+
+        layout = document.body[i][14:]
+        if layout in obsoletedby:
+            document.body[i] = "\\begin_layout " + obsoletedby[layout]
+
+        i += 1
+        
+    document.textclass = "g-brief"
+    document.set_textclass()
+
+
+def revert_gbrief(document):
+    " Revert g-brief to g-brief-en "
+    if document.textclass == "g-brief":
+        document.textclass = "g-brief-en"
+        document.set_textclass()
+
+
 ##
 # Conversion hub
 #
@@ -1109,10 +1162,12 @@ convert = [[346, []],
            [369, [convert_author_id]],
            [370, []],
            [371, []],
-           [372, []]
+           [372, []],
+           [373, [merge_gbrief]]
           ]
 
-revert =  [[371, [revert_fontenc]],
+revert =  [[372, [revert_gbrief]],
+           [371, [revert_fontenc]],
            [370, [revert_mhchem]],
            [369, [revert_suppress_date]],
            [368, [revert_author_id]],
index 1a416d68c063c34d0c9e95369f66374968c80ae8..57ce529c738c827211d4fa21f2a1cdf2d92387a8 100644 (file)
@@ -127,7 +127,7 @@ namespace {
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-int const LYX_FORMAT = 372; // jspitzm: buffer param fontenc
+int const LYX_FORMAT = 373; // jspitzm: merge g-brief class
 
 typedef map<string, bool> DepClean;
 typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;