support for the languages Latin and North Sami

- fileformat change

(I wonder why support for them was removed (must be before LyX 1.3), because the old reLyX script listed them as supported)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21783 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2007-11-25 21:09:01 +00:00
parent 49e028db9b
commit 9608e4971b
5 changed files with 50 additions and 8 deletions

View File

@ -1,6 +1,9 @@
LyX file-format changes
-----------------------
2007-11-25 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 302: support for Latin and North Sami
2007-11-24 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 301: support for \linebreak

View File

@ -41,6 +41,7 @@ hebrew hebrew "Hebrew" true cp1255 he_IL ""
# "hungarian" is a synonym for the "magyar" babel language option
# "hungarian" might be used for special purposes, see http://www.math.bme.hu/latex/magyar_pre_tug2004.pdf
#hungarian hungarian "Hungarian" false iso8859-2 hu_HU ""
icelandic icelandic "Icelandic" false iso8859-15 is_IS ""
irish irish "Irish" false iso8859-15 ga_IE ""
italian italian "Italian" false iso8859-15 it_IT ""
japanese "" "Japanese" false euc-jp ja_JP ""
@ -48,10 +49,11 @@ japanese-plain "" "Japanese (non-CJK)" false euc-jp-plain ja_JP ""
kazakh kazakh "Kazakh" false pt154 kk_KZ ""
# there is no country code for Korean because ko_KR is the same as ko_KI
korean "" "Korean" false euc-kr ko ""
lowersorbian lowersorbian "Lower Sorbian" false iso8859-2 dsb_DE ""
lithuanian lithuanian "Lithuanian" false iso8859-13 lt_LT ""
# there is no country code for Latin because it is a dead language
latin latin "Latin" false iso8859-15 la ""
latvian latvian "Latvian" false iso8859-13 lv_LV ""
icelandic icelandic "Icelandic" false iso8859-15 is_IS ""
lithuanian lithuanian "Lithuanian" false iso8859-13 lt_LT ""
lowersorbian lowersorbian "Lower Sorbian" false iso8859-2 dsb_DE ""
magyar magyar "Hungarian" false iso8859-2 hu_HU ""
norsk norsk "Norsk" false iso8859-15 nb_NO ""
nynorsk nynorsk "Nynorsk" false iso8859-15 nn_NO ""
@ -59,12 +61,13 @@ polish polish "Polish" false iso8859-2 pl_PL ""
portuguese portuges "Portuguese" false iso8859-15 pt_PT ""
romanian romanian "Romanian" false iso8859-2 ro_RO ""
russian russian "Russian" false koi8 ru_RU ""
samin samin "North Sami" false iso8859-15 se_NO ""
scottish scottish "Scottish" false iso8859-15 gd_GB ""
serbian croatian "Serbian" false iso8859-5 sr_HR ""
serbocroatian croatian "Serbo-Croatian" false iso8859-2 sh_HR ""
spanish spanish "Spanish" false iso8859-15 es_ES "\deactivatetilden\renewcommand\shorthandsspanish{}"
slovak slovak "Slovak" false iso8859-2 sk_SK ""
slovene slovene "Slovene" false iso8859-2 sl_SI ""
spanish spanish "Spanish" false iso8859-15 es_ES "\deactivatetilden\renewcommand\shorthandsspanish{}"
swedish swedish "Swedish" false iso8859-15 sv_SE ""
thai thai "Thai" false tis620-0 th_TH "\usepackage{thswitch}"
turkish turkish "Turkish" false iso8859-9 tr_TR ""

View File

@ -80,7 +80,7 @@ format_relation = [("0_06", [200], minor_versions("0.6" , 4)),
("1_3", [221], minor_versions("1.3" , 7)),
("1_4", range(222,246), minor_versions("1.4" , 5)),
("1_5", range(246,277), minor_versions("1.5" , 2)),
("1_6", range(277,302), minor_versions("1.6" , 0))] # Uwe: \linebreak
("1_6", range(277,303), minor_versions("1.6" , 0))] # Uwe: Latin and North Sami
def formats_list():

View File

@ -810,6 +810,40 @@ def revert_linebreak(document):
i = i + 1
def revert_latin(document):
"Set language Latin to English"
i = 0
if document.language == "latin":
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 latin", j)
if j == -1:
return
document.body[j] = document.body[j].replace("\\lang latin", "\\lang english")
j = j + 1
def revert_samin(document):
"Set language North Sami to English"
i = 0
if document.language == "samin":
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 samin", j)
if j == -1:
return
document.body[j] = document.body[j].replace("\\lang samin", "\\lang english")
j = j + 1
##
# Conversion hub
#
@ -839,10 +873,12 @@ convert = [[277, [fix_wrong_tables]],
[298, []],
[299, []],
[300, []],
[301, []]
[301, []],
[302, []]
]
revert = [[300, [revert_linebreak]],
revert = [[301, [revert_latin, revert_samin]],
[300, [revert_linebreak]],
[299, [revert_pagebreak]],
[298, [revert_hyperlinktype]],
[297, [revert_macro_optional_params]],

View File

@ -153,7 +153,7 @@ namespace os = support::os;
namespace {
int const LYX_FORMAT = 301; // Uwe: \linebreak
int const LYX_FORMAT = 302; // Uwe: Latin and North Sami
} // namespace anon