LyX file-format changes
-----------------------
+2007-10-04 Uwe Stöhr Uwe Stöhr <uwestoehr@web.de>
+ * Format incremented to 291: Support for Vietnamese.
+
2007-10-03 Uwe Stöhr Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 290: Add table wrap floats.
-
+
2007-10-03 Martin Vermeer <martin.vermeer@tkk.fi>
* Format incremented to 289: make Index a collapsable inset.
turkish turkish "Turkish" false iso8859-9 tr_TR ""
ukrainian ukrainian "Ukrainian" false koi8-u uk_UA ""
usorbian usorbian "Upper Sorbian" false iso8859-2 hsb_DE ""
+vietnamese vietnam "Vietnamese" false utf8 vi_VN ""
welsh welsh "Welsh" false iso8859-15 cy_GB ""
("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" , 1)),
- ("1_6", range(277,291), minor_versions("1.6" , 0))] # Uwe Stöhr, wrap table
+ ("1_6", range(277,292), minor_versions("1.6" , 0))] # Uwe Stöhr, Vietnamese
def formats_list():
i = i + 1
+def revert_vietnamese(document):
+ "Set language Vietnamese to English"
+ # Set document language from Vietnamese to English
+ i = 0
+ if document.language == "vietnamese":
+ 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 vietnamese", j)
+ if j == -1:
+ return
+ document.body[j] = document.body[j].replace("\\lang vietnamese", "\\lang english")
+ j = j + 1
+
+
##
# Conversion hub
#
[287, [convert_wrapfig_options]],
[288, [convert_inset_command]],
[289, [convert_latexcommand_index]],
- [290, []]
+ [290, []],
+ [291, []]
]
-revert = [[289, [revert_wraptable]],
+revert = [[290, [revert_vietnamese]],
+ [289, [revert_wraptable]],
[288, [revert_latexcommand_index]],
[287, [revert_inset_command]],
[286, [revert_wrapfig_options]],
namespace {
-int const LYX_FORMAT = 290; //Uwe Stöhr, wrap table
+int const LYX_FORMAT = 291; //Uwe Stöhr, Vietnamese
} // namespace anon
using std::count;
using std::endl;
+using std::find;
using std::string;
using std::istringstream;
using std::ostream;
language_options << ',';
language_options << language->babel();
}
- if (lyxrc.language_global_options && !language_options.str().empty())
+ // when Vietnamese is used, babel must directly be loaded with the
+ // language options, not in the class options
+ int viet = language_options.str().find("vietnam");
+ // viet = string::npos when not found
+ if (lyxrc.language_global_options && !language_options.str().empty()
+ && viet == string::npos)
clsoptions << language_options.str() << ',';
}
// other languages are used (lang_opts is then empty)
if (lang_opts.empty())
return string();
- if (!lyxrc.language_global_options)
+ // when Vietnamese is used, babel must directly be loaded with the
+ // language options
+ int viet = lang_opts.find("vietnam");
+ // viet = string::npos when not found
+ if (!lyxrc.language_global_options || viet != string::npos)
return "\\usepackage[" + lang_opts + "]{babel}";
return lang_pack;
}