From 0c3b88e3cb817cd030163c534db91ec94f886953 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 5 Jul 2014 13:38:55 +0200 Subject: [PATCH] Support for Swiss German (old spelling) --- lib/languages | 23 ++++++++++++----------- lib/lyx2lyx/LyX.py | 2 +- lib/lyx2lyx/lyx_2_2.py | 19 +++++++++++++++++++ src/version.h | 4 ++-- 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/lib/languages b/lib/languages index 92387a989c..e4c0dd5c94 100644 --- a/lib/languages +++ b/lib/languages @@ -491,17 +491,18 @@ Language german-ch LangCode de_CH End -# This is now supported, but requires a file format change -# Language german-ch-old -# GuiName "German (Switzerland, old spelling)" -# BabelName swissgerman -# PolyglossiaName german -# PolyglossiaOpts "spelling=old,babelshorthands=true" -## PolyglossiaOpts "variant=swiss,spelling=old,babelshorthands=true" -# QuoteStyle danish -# Encoding iso8859-15 -# LangCode de_CH -# End +# In Babel, this is supported since release 2.7 of babel-german (Dec 2013) +# Polyglossia does not yet support Swiss German. We use german for now. +Language german-ch-old + GuiName "German (Switzerland, old spelling)" + BabelName swissgerman + PolyglossiaName german + PolyglossiaOpts "spelling=old,babelshorthands=true" +# PolyglossiaOpts "variant=swiss,spelling=old,babelshorthands=true" + QuoteStyle danish + Encoding iso8859-15 + LangCode de_CH +End Language greek GuiName "Greek" diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index eb0b079355..63645245d5 100644 --- a/lib/lyx2lyx/LyX.py +++ b/lib/lyx2lyx/LyX.py @@ -85,7 +85,7 @@ format_relation = [("0_06", [200], minor_versions("0.6" , 4)), ("1_6", range(277,346), minor_versions("1.6" , 10)), ("2_0", range(346,414), minor_versions("2.0", 8)), ("2_1", range(414,475), minor_versions("2.1", 0)), - ("2_2", range(475,477), minor_versions("2.2", 0)) + ("2_2", range(475,478), minor_versions("2.2", 0)) ] #################################################################### diff --git a/lib/lyx2lyx/lyx_2_2.py b/lib/lyx2lyx/lyx_2_2.py index c263c832e0..f15b0c6e9e 100644 --- a/lib/lyx2lyx/lyx_2_2.py +++ b/lib/lyx2lyx/lyx_2_2.py @@ -275,6 +275,23 @@ def revert_smash(document): j = k +def revert_swissgerman(document): + " Set language german-ch-old to german " + i = 0 + if document.language == "german-ch-old": + document.language = "german" + i = find_token(document.header, "\\language", 0) + if i != -1: + document.header[i] = "\\language german" + j = 0 + while True: + j = find_token(document.body, "\\lang german-ch-old", j) + if j == -1: + return + document.body[j] = document.body[j].replace("\\lang german-ch-old", "\\lang german") + j = j + 1 + + ## # Conversion hub # @@ -286,9 +303,11 @@ convert = [ # did not load amsmath automatically for these commands, and do not # want to hardcode amsmath off. [476, []], + [477, []], ] revert = [ + [476, [revert_swissgerman]], [475, [revert_smash]], [474, [revert_separator]] ] diff --git a/src/version.h b/src/version.h index 22713f6993..f7eb1e1fd4 100644 --- a/src/version.h +++ b/src/version.h @@ -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 476 // gb: \smash[t], \smash[b] and \notag -#define LYX_FORMAT_TEX2LYX 476 +#define LYX_FORMAT_LYX 477 // spitz: support for swissgerman +#define LYX_FORMAT_TEX2LYX 477 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX #ifndef _MSC_VER -- 2.39.5