]> git.lyx.org Git - features.git/blobdiff - lib/languages
Update language support documentation and comments.
[features.git] / lib / languages
index 42625846de7adf7c830a96af31c47d298c6d41ba..583ed89ed6244cc7a074f44a2b6d7920b02d8f0e 100644 (file)
@@ -81,7 +81,8 @@
 #   * yyyy     the year as four digit number
 # * Encoding is the default encoding used with TeX fonts.
 #   It is only used if Document > Settings > Language > Encoding
-#   is set to "Language Default" and "use non-TeX fonts" is FALSE.
+#   is set to "Language Default" or "Language Default (no inputenc)"
+#   and "use non-TeX fonts" is FALSE.
 #   Encoding "inherit" means: keep encoding of the context (used by
 #   latex_language).
 # * FontEncoding is a bar-separated list of font encodings.
 #   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. Some languages (basically those not directly
-#   supported by babel) need this.
+#   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
@@ -160,6 +161,14 @@ End
 Language albanian
        GuiName          "Albanian"
        BabelName        albanian
+       # babel-albanian (albanian.ldf) (re-)defines the functions
+       # \sh \ch \th \cth \arsh \arch \arth \arcth \tg \ctg \arctg
+       # as math operators. This clashes with \th == letter thorn
+       # in font encoding T1
+       PostBabelPreamble
+         % fix albanian: restore \th as LATIN LETTER THORN
+         \@ifl@aded{def}{t1enc}{\DeclareTextSymbol{\th}{T1}{254}}{}
+       EndPostBabelPreamble
        PolyglossiaName  albanian
        QuoteStyle       swiss
        Encoding         iso8859-2
@@ -231,7 +240,11 @@ Language arabic_arabi
        FontEncoding     LAE
        DateFormats      "d MMMM، yyyy|dd/MM/yyyy|d/M/yyyy"
        RTL              true
-       AsBabelOptions   true
+       PostBabelPreamble
+         % arabi + hyperref redefines \noboundary as local textcommand
+         \let\orig@noboundary\noboundary
+         \DeclareTextCommandDefault{\noboundary}{\orig@noboundary}
+       EndPostBabelPreamble
        LangCode         ar_SA
 End
 
@@ -336,6 +349,8 @@ Language basque
 End
 
 # not yet supported by polyglossia
+# Up to 2018-08-25 (babel-belarusian 1.4), the babel option is "belarusianb"
+# but the language name "belarusian" (without trailing "b").
 Language belarusian
        GuiName          "Belarusian"
        BabelName        belarusian
@@ -344,10 +359,10 @@ Language belarusian
        FontEncoding     T2A
        DateFormats      "dd MMMM yyyy|d MMM yyyy|d.M.yyyy"
        LangCode         be_BY
-       AsBabelOptions   true
 End
 
 # not yet supported by polyglossia
+# The (rarely used) Cyrillic script is not supported (try serbian).
 Language bosnian
        GuiName          "Bosnian"
        BabelName        bosnian
@@ -756,9 +771,13 @@ Language hebrew
        Encoding          cp1255
        QuoteStyle        english
        InternalEncoding  true
-# Hebrew babel loads the font encodings
-# itself in the appropriate order
-#      FontEncoding      LHE
+       # babel-hebrew expects the encoding for *other* languages last:
+       # FontEncoding      HE8
+       # Define the font encoding the babel-hebrew way and
+       # work around too simple test for article-like classes in rlbabel.def.
+       PreBabelPreamble
+         \providecommand{\l@chapter}{\relax}
+       EndPreBabelPreamble
        DateFormats      "d MMMM yyyy|d MMM yyyy|dd/MM/yyyy"
        RTL               true
        LangCode          he_IL
@@ -834,21 +853,16 @@ Language italian
        LangCode         it_IT
 End
 
-# japanese must be loaded locally with babel options,
-# not globally via class options
-# http://www.lyx.org/trac/ticket/4597#c4
-# Since japanese does not load fontenc, we set
-# InternalEncoding to true.
+# Since 2016-12-18, babel-japanese works with non-TeX fonts (Xe/LuaTeX), too
+# (use with "Japanese (bxjs)" or standard document classes)
 Language japanese
        GuiName          "Japanese"
        HasGuiSupport    true
        BabelName        japanese
        Encoding         jis-platex
        LangCode         ja_JP
-       AsBabelOptions   true
        Requires         japanese
-       InternalEncoding true
-       FontEncoding     None
+       FontEncoding     ASCII
        DateFormats      "yyyy年M月d日|yyyy/MM/dd|yy/MM/dd"
        QuoteStyle       cjk
 End
@@ -877,13 +891,9 @@ End
 Language kazakh
        GuiName          "Kazakh"
        Encoding         ascii
-       FontEncoding     T2A
+       # FontEncoding   T2A # not set (no Babel support)
        DateFormats      "dd MMMM yyyy|dd MMMM yyyy|yyyy-dd-MM"
        LangCode         kk_KZ
-       PostBabelPreamble
-       \input{t2aenc.def}
-       \AtBeginDocument{\fontencoding{T2A}\selectfont}
-       EndPostBabelPreamble
 End
 
 # not supported by babel
@@ -895,8 +905,10 @@ Language khmer
        LangCode         km_KH
 End
 
+# Fixme: activate Polyglossia support (file format change)
 Language korean
        GuiName         "Korean"
+       #PolyglossiaName  korean
        Encoding        euc-kr
        QuoteStyle      cjkangle
        DateFormats     "yyyy년 M월 d일|yyyy. M. d.|yy. M. d."
@@ -912,7 +924,6 @@ Language kurmanji
        FontEncoding     T1|OT1
        DateFormats      "d. MMMM yyyy|d. M. yyyy|yyyy-MM-dd"
        LangCode         kmr
-       AsBabelOptions   true
 End
 
 # not supported by babel
@@ -948,7 +959,6 @@ Language latvian
        FontEncoding     L7x|T1|OT1
        DateFormats      "yyyy. 'gada' d. MMMM|yyyy. 'gada' d. MMM|dd.MM.yyyy"
        LangCode         lv_LV
-       AsBabelOptions   true
 End
 
 # lithuanian must be loaded locally with babel options,
@@ -961,9 +971,15 @@ Language lithuanian
        QuoteStyle       german
        Encoding         iso8859-13
        FontEncoding     L7x
+       # L7x defines \copyright as TextSymbol which leads to an endless loop 
+        # when it is used in other font encodings.
+       PostBabelPreamble
+         % restore \coyright definition corrupted by l7xenc.def
+          \DeclareRobustCommand{\copyright}{%
+            \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}
+       EndPostBabelPreamble
        DateFormats      "yyyy 'm.' MMMM d 'd.'|yyyy 'm.' MMMM d 'd.'|yyyy-MM-dd"
        LangCode         lt_LT
-       AsBabelOptions   true
 End
 
 Language lowersorbian
@@ -1001,6 +1017,16 @@ Language macedonian
        Provides         textcyrillic
 End
 
+# not supported by babel
+Language malayalam
+       GuiName          "Malayalam"
+       PolyglossiaName  malayalam
+       Encoding         utf8
+       QuoteStyle       english
+       DateFormats      "dd MMMM yyyy|d MMM yyyy|dd-MM-yyyy"
+       LangCode         ml_IN
+End
+
 # not supported by babel
 Language marathi
        GuiName          "Marathi"
@@ -1020,7 +1046,6 @@ Language mongolian
        FontEncoding     T2A
        DateFormats      "yyyy оны M сарын d|d-M-yyyy|dd-MM-yyyy"
        LangCode         mn_MN
-       AsBabelOptions   true
        Provides         textcyrillic
 End
 
@@ -1190,20 +1215,24 @@ Language scottish
        LangCode         gd_GB
 End
 
-# Note: script option is uppercase, even if the polyglossia
-#       manual states otherwise.
+# Serbian with Cyrillic script.
+# Up to Version 3.0 (2019-01-12), input encoding and
+# font encoding were set document-wide to "utf8x" and "T2A" respectively
+# by "babel-serbianc", overriding LyX settings and leading to errors
+# in mulit-lingual documents.
 Language serbian
        GuiName          "Serbian"
        HasGuiSupport    true
        BabelName        serbianc
        PolyglossiaName  serbian
        PolyglossiaOpts  "script=Cyrillic"
+       # Note: script option is uppercase, even if the polyglossia
+       #       manual states otherwise.
        QuoteStyle       polish
        Encoding         utf8
        FontEncoding     T2A
        DateFormats      "d. MMMM yyyy|d. MMM yyyy|dd.MM.yyyy"
        LangCode         sr_RS
-       AsBabelOptions   true
 End
 
 # Note: script option is uppercase, even if the polyglossia
@@ -1313,6 +1342,7 @@ Language telugu
        LangCode         te_IN
 End
 
+# alternative support with CJK package and Babel name "thaicjk"
 Language thai
        GuiName          "Thai"
        BabelName        thai
@@ -1323,8 +1353,17 @@ Language thai
        DateFormats      "dd MMMM yyyy|d MMM yyyy|dd/MM/yyyy"
        LangCode         th_TH
        PostBabelPreamble
-       \usepackage{thswitch}
+         % restore \coyright definition corrupted by lthenc.def
+          \DeclareRobustCommand{\copyright}{%
+            \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}
+         \DeclareTextSymbol{\textcopyright}{LTH}{8}
        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
@@ -1362,7 +1401,6 @@ Language turkmen
        FontEncoding     T1|OT1
        DateFormats      "yyyy ý. MMMM d|dd.MM.yyyy ý.|dd.MM.yy ý."
        LangCode         tk_TM
-       AsBabelOptions   true
 End
 
 Language ukrainian