Am 07.01.2010 00:37, schrieb Uwe Stöhr:

This is the fourth and final one:

- recognize the correct type of quotes. Information to do this is taken from
http://en.wikipedia.org/wiki/Quotation_mark,_non-English_usage
(I extended this Wikipedia list with infos I found by googling the net.)

regards Uwe
Index: preamble.cpp
===================================================================
--- preamble.cpp	(revision 32820)
+++ preamble.cpp	(working copy)
@@ -75,6 +75,27 @@
 const char * const known_russian_languages[] = {"russian", "russianb", 0};
 const char * const known_ukrainian_languages[] = {"ukrainian", "ukraineb", 0};
 
+//add these to known_english_quotes_languages when updating to lyxformat 268:
+//"chinese-simplified", "korean"
+const char * const known_english_quotes_languages[] = {"american", "canadian",
+"english", "esperanto", "hebrew", "irish", "scottish", "thai", 0};
+
+//add this to known_french_quotes_languages when updating to lyxformat 327:
+//"spanish-mexico"
+const char * const known_french_quotes_languages[] = {"albanian", "arabic",
+"basque", "canadien", "catalan", "galician", "greek", "italian", "norsk",
+"nynorsk", "spanish", "turkish", 0};
+
+const char * const known_german_quotes_languages[] = {"austrian", "bulgarian",
+"czech", "icelandic", "lithuanian", "lsorbian", "naustrian", "serbian",
+"serbian-latin", "slovak", "slovene", "usorbian",  0};
+
+const char * const known_polish_quotes_languages[] = {"afrikaans", "croatian",
+"dutch", "estonian", "magyar", "polish", "romanian", 0};
+
+const char * const known_swedish_quotes_languages[] = {"bahasa", "finnish", 
+"swedish", 0};
+
 char const * const known_fontsizes[] = { "10pt", "11pt", "12pt", 0 };
 
 const char * const known_roman_fonts[] = { "ae", "bookman", "charter",
@@ -455,6 +476,40 @@
 
 void end_preamble(ostream & os, TextClass const & /*textclass*/)
 {
+	// set the quote language
+	// LyX only knows the following quotes languages:
+	// english, swedish, german, polish, french and danish
+	// (quotes for "japanese" and "chinese-traditional" are missing because
+	//  they wouldn't be useful: http://www.lyx.org/trac/ticket/6383)
+	// conversion list taken from
+	// http://en.wikipedia.org/wiki/Quotation_mark,_non-English_usage
+	// (quotes for kazakh and interlingua are unknown)
+	// danish
+	if (h_language == "danish")
+		h_quotes_language = "danish";
+	// french
+	else if (is_known(h_language, known_french_quotes_languages)
+		|| is_known(h_language, known_french_languages)
+		|| is_known(h_language, known_russian_languages)
+		|| is_known(h_language, known_ukrainian_languages))
+		h_quotes_language = "french";
+	// german
+	else if (is_known(h_language, known_german_quotes_languages)
+		|| is_known(h_language, known_german_languages)
+		|| is_known(h_language, known_ngerman_languages))
+		h_quotes_language = "german";
+	// polish
+	else if (is_known(h_language, known_polish_quotes_languages))
+		h_quotes_language = "polish";
+	// swedish
+	else if (is_known(h_language, known_swedish_quotes_languages))
+		h_quotes_language = "swedish";
+	//english
+	else if (is_known(h_language, known_english_quotes_languages)
+		|| is_known(h_language, known_brazilian_languages)
+		|| is_known(h_language, known_portuguese_languages))
+		h_quotes_language = "english";
+
 	os << "#LyX file created by tex2lyx " << PACKAGE_VERSION << "\n"
 	   << "\\lyxformat 264\n"
 	   << "\\begin_document\n"

Reply via email to