]> git.lyx.org Git - features.git/commit
Set CJK document language instead of adding a note.
authorGeorg Baum <baum@lyx.org>
Sat, 6 Oct 2012 07:38:14 +0000 (09:38 +0200)
committerGeorg Baum <baum@lyx.org>
Sat, 6 Oct 2012 07:38:14 +0000 (09:38 +0200)
commit23d7d6449feffd72bce486e19f0dfbd429fe9301
treece7ef80924259620a190de9c64380b5b28117549
parent8863ac62aa25ea11dc9ac78c525d01aee3defc23
Set CJK document language instead of adding a note.

Instead of annoying the user with an automatically created note in the output
document which she needs to delete manually, determine the document language
automatically for documents that use CJK. This is done using a heuristic which
roughly counts the number of characters in each language and sets the one that
is used most often. This is not perfect, but it works for the two major use
cases: A document with only some CJK parts (in this case the babel language is
used), and a document which is mainly written in one CJK language. It is only
a minor problem if the heuristic is wrong, since the TeX export is still
correct, and there is no spell checking support for CJK anyway.
Now all regression tests do pass except for some relative path issues
depending on the location of the build directory.
src/tex2lyx/Preamble.cpp
src/tex2lyx/Preamble.h
src/tex2lyx/tex2lyx.cpp
src/tex2lyx/tex2lyx.h
src/tex2lyx/text.cpp