Hi,
In order to fix bug 1627 and to reduce the number of ancient bugs I propose
the patch attached.
It renames portuges to portuguese and brazil to brazilian. This removes the
heritage of babel's original (and weird) name.
Any objection?
--
José Abílio
Index: src/buffer.C
===================================================================
--- src/buffer.C (revision 17300)
+++ src/buffer.C (working copy)
@@ -141,7 +141,7 @@
namespace {
-int const LYX_FORMAT = 262;
+int const LYX_FORMAT = 263;
} // namespace anon
Index: lib/lyx2lyx/LyX.py
===================================================================
--- lib/lyx2lyx/LyX.py (revision 17300)
+++ lib/lyx2lyx/LyX.py (working copy)
@@ -74,7 +74,7 @@
("1_2", [220], generate_minor_versions("1.2" , 4)),
("1_3", [221], generate_minor_versions("1.3" , 7)),
("1_4", range(222,246), generate_minor_versions("1.4" , 3)),
- ("1_5", range(246,263), generate_minor_versions("1.5" , 0))]
+ ("1_5", range(246,264), generate_minor_versions("1.5" , 0))]
def formats_list():
Index: lib/lyx2lyx/lyx_1_5.py
===================================================================
--- lib/lyx2lyx/lyx_1_5.py (revision 17300)
+++ lib/lyx2lyx/lyx_1_5.py (working copy)
@@ -1222,6 +1222,26 @@
document.inputencoding = get_value(document.header, "\\inputencoding", 0)
+def normalize_language_name(document):
+ lang = { "brazil": "brazilian",
+ "portuges": "portuguese"}
+
+ if document.language in lang:
+ document.language = lang[document.language]
+ i = find_token(document.header, "\\language", 0)
+ document.header[i] = "\\language %s" % document.language
+
+
+def revert_language_name(document):
+ lang = { "brazilian": "brazil",
+ "portuguese": "portuges"}
+
+ if document.language in lang:
+ document.language = lang[document.language]
+ i = find_token(document.header, "\\language", 0)
+ document.header[i] = "\\language %s" % document.language
+
+
##
# Conversion hub
#
@@ -1243,9 +1263,11 @@
[259, [convert_accent, normalize_font_whitespace]],
[260, []],
[261, [convert_changes]],
- [262, []]]
+ [262, []],
+ [263, [normalize_language_name]]]
-revert = [[261, [revert_ascii]],
+revert = [[262, [revert_language_name]],
+ [261, [revert_ascii]],
[260, []],
[259, [revert_utf8x]],
[258, []],
Index: lib/languages
===================================================================
--- lib/languages (revision 17300)
+++ lib/languages (working copy)
@@ -7,7 +7,7 @@
bahasa bahasa "Bahasa" false iso8859-15 in_ID ""
belarusian belarusian "Belarusian" false cp1251 be_BY ""
basque basque "Basque" false iso8859-15 eu_ES ""
-brazil brazil "Portuguese (Brazil)" false iso8859-15 pt_BR ""
+brazilian brazil "Portuguese (Brazil)" false iso8859-15 pt_BR ""
breton breton "Breton" false iso8859-15 br_FR ""
british british "British" false iso8859-15 en_GB ""
bulgarian bulgarian "Bulgarian" false cp1251 bg_BG ""
@@ -45,7 +45,7 @@
norsk norsk "Norsk" false iso8859-15 nb_NO ""
nynorsk nynorsk "Nynorsk" false iso8859-15 nn_NO ""
polish polish "Polish" false iso8859-2 pl_PL ""
-portuges portuges "Portugese" false iso8859-15 pt_PT ""
+portuguese portuges "Portuguese" false iso8859-15 pt_PT ""
romanian romanian "Romanian" false iso8859-2 ro_RO ""
russian russian "Russian" false koi8 ru_RU ""
scottish scottish "Scottish" false iso8859-15 gd_GB ""
Index: development/FORMAT
===================================================================
--- development/FORMAT (revision 17300)
+++ development/FORMAT (working copy)
@@ -1,6 +1,11 @@
LyX file-format changes
-----------------------§
+2007-02-22 José Matos <[EMAIL PROTECTED]>
+ * format incremented to 263: changes in the language names (overdue):
+ brazil -> brazilian
+ portuges -> portuguese
+
2007-02-16 Georg Baum <[EMAIL PROTECTED]>
* format incremented to 262: Allow ascii \inputencoding