]> git.lyx.org Git - features.git/blobdiff - lib/languages
Load inputenc after babel with Thai.
[features.git] / lib / languages
index 7b91b57b8cdecdfb6cf96362ea540871dc2ebd52..9e6731f4693d7b43b4111a94ee0bafcf11fc5aae 100644 (file)
@@ -17,7 +17,6 @@
 #      FontEncoding       <font encoding|font encoding|...>
 #      InternalEncoding   <true|false>
 #      RTL                <true|false>
-#      AsBabelOptions     <true|false>
 #      LangCode           <language_code>
 #      LangVariety        <language_variety>
 #      PreBabelPreamble
 #   If True, LyX takes care for characters/macros that do not exist in
 #   some font encodings ("<", ">", "|" and straight quote).
 #   It is not required for standard encodings like T2A. See bug #5091.
-# * AsBabelOptions advices LyX to pass the languages locally to babel, not
-#   globally to the class. In the old days, some languages (basically those
-#   not natively supported by babel) needed this.
-#   FIXME: in this case, we might still need to pass the other languages
-#          globally, for the use of other packages (such as varioref).
 # * LangCode is also used for spellchecking and thesaurus, where the
 #   dictionaries are named accordingly. Thus, check this when introducing/
 #   changing language codes (especially aspell, thesaurus).
@@ -415,6 +409,7 @@ End
 
 Language bulgarian
        GuiName          "Bulgarian"
+       HasGuiSupport    true
        BabelName        bulgarian
        PolyglossiaName  bulgarian
        QuoteStyle       german
@@ -780,10 +775,14 @@ Language hebrew
        QuoteStyle       english
        InternalEncoding true
        # babel-hebrew expects the encoding for *other* languages last:
-       # FontEncoding    HE8
-       # Define the font encoding the babel-hebrew way and
+       # FontEncoding    HE8|LHE
+       ## Use font encoding HE8 if the Culmus fonts are installed and
        # work around too simple test for article-like classes in rlbabel.def.
        PreBabelPreamble
+         %\IfFileExists{he8david.fd}{%
+         %  \providecommand{\HeblatexEncoding}{HE8}
+         %  \providecommand{\HeblatexEncodingFile}{he8enc}%
+         %}{}
          \providecommand{\l@chapter}{\relax}
        EndPreBabelPreamble
        DateFormats      "d MMMM yyyy|d MMM yyyy|dd/MM/yyyy"
@@ -985,6 +984,7 @@ Language lithuanian
          % restore \coyright definition corrupted by l7xenc.def
           \DeclareRobustCommand{\copyright}{%
             \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}
+           \addto\noextraslithuanian{\latintext}
        EndPostBabelPreamble
        DateFormats      "yyyy 'm.' MMMM d 'd.'|yyyy 'm.' MMMM d 'd.'|yyyy-MM-dd"
        LangCode         lt_LT
@@ -1355,7 +1355,8 @@ Language telugu
        LangCode         te_IN
 End
 
-# alternative support with CJK package and Babel name "thaicjk"
+# There is an alternative support with CJK package and Babel name "thaicjk".
+
 Language thai
        GuiName          "Thai"
        BabelName        thai
@@ -1365,18 +1366,25 @@ Language thai
        FontEncoding     LTH
        DateFormats      "dd MMMM yyyy|d MMM yyyy|dd/MM/yyyy"
        LangCode         th_TH
+       # The first workaround requires loading inputenc after babel
+       # (cf. BufferParams.cpp):
        PostBabelPreamble
-         % restore \coyright definition corrupted by lthenc.def
-          \DeclareRobustCommand{\copyright}{%
-            \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}
+         % Restore catcodes changed by thai.ldf (active characters required for inputenc)
+         \@tempcnta=161%
+         \@whilenum\@tempcnta<252\do{%
+           \catcode\@tempcnta=13
+           \advance\@tempcnta\@ne
+         }%      
+         % Restore \coyright definition corrupted by lthenc.def
+         \DeclareRobustCommand{\copyright}{%
+           \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}
          \DeclareTextSymbol{\textcopyright}{LTH}{8}
+          % set up Thai fonts as substitue for the default families
+          \usepackage{substitutefont}
+          \substitutefont{LTH}{\rmdefault}{norasi}
+          \substitutefont{LTH}{\sfdefault}{garuda}
+          \substitutefont{LTH}{\ttdefault}{ttypist}
        EndPostBabelPreamble
-       # Fixme: load font package?
-       # +1 support for font attributes in thai emphasizing etc.
-       # -1 forces ComputerModern as "non-thai" font
-       # PostBabelPreamble
-       #   \usepackage{fonts-tlwg}
-       # EndPostBabelPreamble
 End
 
 # not supported by babel