From 108d74bc1aa7182150860029d1616973f5db30e4 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 7 Jul 2005 10:51:58 +0000 Subject: [PATCH] clean up french language handling git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10145 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/ChangeLog | 4 ++++ development/FORMAT | 6 ++++++ lib/ChangeLog | 6 ++++++ lib/languages | 6 +++--- lib/lyx2lyx/ChangeLog | 5 +++++ lib/lyx2lyx/LyX.py | 2 +- lib/lyx2lyx/lyx_1_4.py | 13 +++++++++++-- src/ChangeLog | 6 ++++++ src/buffer.C | 2 +- src/insets/ChangeLog | 6 ++++++ src/insets/insetquotes.C | 8 +------- src/outputparams.h | 5 +++-- src/paragraph.C | 2 +- 13 files changed, 54 insertions(+), 17 deletions(-) diff --git a/development/ChangeLog b/development/ChangeLog index 8150bd05be..6697dc44ca 100644 --- a/development/ChangeLog +++ b/development/ChangeLog @@ -1,3 +1,7 @@ +2005-07-07 Jean-Marc Lasgouttes + + * FORMAT: document change to format 242. + 2005-05-20 Michael Schmitt * Win32/fakeconfig/lyxrc.defaults: rename "ASCII" diff --git a/development/FORMAT b/development/FORMAT index 2a21857e30..4fd292e82f 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,6 +1,12 @@ LyX file-format changes ----------------------- +2005-06-21 Jean-Marc Lasgouttes + + * format incremented to 242. There is no file format per + se, but the "frenchb" language has been removed from lib/language + and has to be translated to "french" by lyx2lyx. + 2005-02-03 Georg Baum * format incremented to 241. diff --git a/lib/ChangeLog b/lib/ChangeLog index 205ee16286..ddefafb366 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2005-06-16 Jean-Marc Lasgouttes + + * languages: remove language "frenchb"; with language "french" + provide default values for \og and \fg if needed; use babel option + "canadien" for French Canadian + 2005-06-30 Georg Baum * reLyX/syntax.default: recognize optional argument of \frame diff --git a/lib/languages b/lib/languages index 5bd660fec4..653e775a9a 100644 --- a/lib/languages +++ b/lib/languages @@ -11,7 +11,7 @@ breton breton "Breton" false iso8859-1 br_FR "" british british "British" false iso8859-1 en_GB "" bulgarian bulgarian "Bulgarian" false cp1251 bg_BG "" canadian canadian "Canadian" false iso8859-1 en_CA "" -canadien frenchb "French Canadian" false iso8859-1 fr_CA "" +canadien canadien "French Canadian" false iso8859-1 fr_CA "" catalan catalan "Catalan" false iso8859-1 ca_ES "" croatian croatian "Croatian" false iso8859-2 hr_HR "" czech czech "Czech" false iso8859-2 cs_CZ "" @@ -22,8 +22,8 @@ esperanto esperanto "Esperanto" false iso8859-3 eo "" #and what country code should esperanto have?? (Garst) estonian estonian "Estonian" false iso8859-1 et_EE "" finnish finnish "Finnish" false iso8859-1 fi_FI "" -frenchb frenchb "French" false iso8859-1 fr_FR "" -french french "French (GUTenberg)" false iso8859-1 fr_FR "" +# We redefine \og and \fg (guillemets) for older french language definitions +french french "French" false iso8859-1 fr_FR "\addto\extrasfrench{\providecommand{\og}{\leavevmode\flqq~}\providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}}" galician galician "Galician" false iso8859-1 gl_ES "" # There are two Galicia's one in Spain one in E.Europe. Because of # the font encoding I am assuming this is the one in Spain. (Garst) diff --git a/lib/lyx2lyx/ChangeLog b/lib/lyx2lyx/ChangeLog index ca573b5d07..aa294eb98b 100644 --- a/lib/lyx2lyx/ChangeLog +++ b/lib/lyx2lyx/ChangeLog @@ -1,3 +1,8 @@ +2005-06-21 Georg Baum + + * lyx_1_4.py (convert_french): change language frenchb to french + for format 242. + 2005-07-07 José Matos * LyX.py (read): Ignore whitelines on header. Fix reading the diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index 85f2c8339f..7647dc8304 100644 --- a/lib/lyx2lyx/LyX.py +++ b/lib/lyx2lyx/LyX.py @@ -46,7 +46,7 @@ format_relation = [("0_10", [210], ["0.10.7","0.10"]), ("1_1_6fix3", [218], ["1.1.6fix3","1.1.6fix4","1.1"]), ("1_2", [220], ["1.2.0","1.2.1","1.2.3","1.2.4","1.2"]), ("1_3", [221], ["1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3"]), - ("1_4", range(223,242), ["1.4.0cvs","1.4"])] + ("1_4", range(223,243), ["1.4.0cvs","1.4"])] def formats_list(): diff --git a/lib/lyx2lyx/lyx_1_4.py b/lib/lyx2lyx/lyx_1_4.py index 10ef26acf0..ca253df85c 100644 --- a/lib/lyx2lyx/lyx_1_4.py +++ b/lib/lyx2lyx/lyx_1_4.py @@ -1844,6 +1844,13 @@ def revert_ert_paragraphs(file): i = i + 1 +def convert_french(file): + regexp = re.compile(r'^\\language\s+frenchb') + i = find_re(file.header, regexp, 0) + if i != -1: + file.header[i] = "\\language french" + + ## # Convertion hub # @@ -1869,9 +1876,11 @@ convert = [[223, [insert_tracking_changes, add_end_header, remove_color_default, [238, [update_latexaccents]], [239, [normalize_paragraph_params]], [240, [convert_output_changes]], - [241, [convert_ert_paragraphs]]] + [241, [convert_ert_paragraphs]], + [242, [convert_french]]] -revert = [[240, [revert_ert_paragraphs]], +revert = [[241, []], + [240, [revert_ert_paragraphs]], [239, [revert_output_changes]], [238, []], [237, []], diff --git a/src/ChangeLog b/src/ChangeLog index 498dedaa62..736a50d3bb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-06-21 Jean-Marc Lasgouttes + + * buffer.C: format incremented to 242. There is no file format per + se, but the "frenchb" language has been removed from lib/language + and has to be translated to "french" by lyx2lyx. + 2005-07-06 Georg Baum * cursor_slice.h, dociterator.h: add some documentation diff --git a/src/buffer.C b/src/buffer.C index ca87c4c425..808dc4b013 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -143,7 +143,7 @@ extern BufferList bufferlist; namespace { -int const LYX_FORMAT = 241; +int const LYX_FORMAT = 242; } // namespace anon diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 99c4b8e026..fbefd62675 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,9 @@ +2005-06-16 Jean-Marc Lasgouttes + + * insetquotes.C (latex): always use \og/\fg for the french + languages; test against the language code instead of the babel + name. + 2005-07-06 Georg Baum * insettabular.C (tabularFeatures): adjust cursor after adding a column diff --git a/src/insets/insetquotes.C b/src/insets/insetquotes.C index 03a96c50f3..4cd7bd5bf4 100644 --- a/src/insets/insetquotes.C +++ b/src/insets/insetquotes.C @@ -270,17 +270,11 @@ int InsetQuotes::latex(Buffer const &, ostream & os, string qstr; if (language_ == FrenchQ && times_ == DoubleQ - && runparams.local_language == "frenchb") { + && prefixIs(runparams.local_language->code(), "fr")) { if (side_ == LeftQ) qstr = "\\og "; //the spaces are important here else qstr = " \\fg{}"; //and here - } else if (language_ == FrenchQ && times_ == DoubleQ - && runparams.local_language == "french") { - if (side_ == LeftQ) - qstr = "<< "; //the spaces are important here - else - qstr = " >>"; //and here } else if (lyxrc.fontenc == "T1") { qstr = latex_quote_t1[times_][quoteind]; #ifdef DO_USE_DEFAULT_LANGUAGE diff --git a/src/outputparams.h b/src/outputparams.h index 0e3ae8c481..d3974fd325 100644 --- a/src/outputparams.h +++ b/src/outputparams.h @@ -19,6 +19,7 @@ class ExportData; +class Language; class OutputParams { @@ -57,9 +58,9 @@ public: */ bool intitle; - /** the babel name of the language at the point where the inset is + /** the language at the point where the inset is */ - std::string local_language; + Language const * local_language; /** Document language babel name */ diff --git a/src/paragraph.C b/src/paragraph.C index dc5205a9e5..24942fc32b 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -1034,7 +1034,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf, if (output || running_change != Change::DELETED) { OutputParams rp = runparams; rp.free_spacing = style->free_spacing; - rp.local_language = font.language()->babel(); + rp.local_language = font.language(); rp.intitle = style->intitle; pimpl_->simpleTeXSpecialChars(buf, bparams, os, texrow, rp, -- 2.39.5