summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/babel/babel.def
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-07-07 21:14:15 +0000
committerKarl Berry <karl@freefriends.org>2020-07-07 21:14:15 +0000
commit36c4eea55754443b823136f84cfcd6cb51ece0bf (patch)
tree2c88196cb8513a4c6cbd33ce53b344e274486fe5 /Master/texmf-dist/tex/generic/babel/babel.def
parentcbd59dbab4fb9c2903c44e15ba79b41b53ac0387 (diff)
babel (7jul20)
git-svn-id: svn://tug.org/texlive/trunk@55774 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/babel.def')
-rw-r--r--Master/texmf-dist/tex/generic/babel/babel.def205
1 files changed, 117 insertions, 88 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def
index da5a58ba7ce..3fd75d82914 100644
--- a/Master/texmf-dist/tex/generic/babel/babel.def
+++ b/Master/texmf-dist/tex/generic/babel/babel.def
@@ -39,7 +39,7 @@
\wlog{File: #1 #4 #3 <#2>}%
\let\ProvidesFile\@undefined}
\fi
-\ProvidesFile{babel.def}[2020/06/10 3.45 Babel common definitions]
+\ProvidesFile{babel.def}[2020/07/07 3.46 Babel common definitions]
\ifx\AtBeginDocument\@undefined % TODO. change test.
% == Code for plain ==
\def\@empty{}
@@ -340,13 +340,9 @@
\reserved@a @%
}%
}
-\def\UseTextSymbol#1#2{%
- #2%
-}
-\def\UseTextAccent#1#2#3{%
-}
-\def\@use@text@encoding#1{%
-}
+\def\UseTextSymbol#1#2{#2}
+\def\UseTextAccent#1#2#3{}
+\def\@use@text@encoding#1{}
\def\DeclareTextSymbolDefault#1#2{%
\DeclareTextCommandDefault#1{\UseTextSymbol{#2}#1}%
}
@@ -401,8 +397,8 @@
\fi
\countdef\last@language=19 % TODO. why? remove?
\def\addlanguage{\csname newlanguage\endcsname}
-\def\bbl@version{3.45}
-\def\bbl@date{2020/06/10}
+\def\bbl@version{3.46}
+\def\bbl@date{2020/07/07}
\def\adddialect#1#2{%
\global\chardef#1#2\relax
\bbl@usehooks{adddialect}{{#1}{#2}}%
@@ -2244,7 +2240,8 @@
\let\bbl@KVP@onchar\@nil
\let\bbl@KVP@alph\@nil
\let\bbl@KVP@Alph\@nil
- \let\bbl@KVP@info\@nil % Ignored with import? Or error/warning?
+ \let\bbl@KVP@labels\@nil
+ \bbl@csarg\let{KVP@labels*}\@nil
\bbl@forkv{#1}{% TODO - error handling
\in@{/}{##1}%
\ifin@
@@ -2258,7 +2255,7 @@
{\ifx\bbl@initoload\relax
\begingroup
\def\BabelBeforeIni##1##2{\gdef\bbl@KVP@import{##1}\endinput}%
- \InputIfFileExists{babel-#2.tex}{}{}%
+ \bbl@input@ini{#2}%
\endgroup
\else
\xdef\bbl@KVP@import{\bbl@initoload}%
@@ -2291,36 +2288,8 @@
\\\bbl@toglobal\<bbl@ensure@\languagename\space>}%
% At this point all parameters are defined if 'import'. Now we
% execute some code depending on them. But what about if nothing was
- % imported? We just load the very basic parameters: ids and a few
- % more.
- \bbl@ifunset{bbl@lname@#2}% TODO. Duplicated
- {\def\BabelBeforeIni##1##2{%
- \begingroup
- \catcode`\[=12 \catcode`\]=12 \catcode`\==12
- \catcode`\;=12 \catcode`\|=12 %
- \let\bbl@ini@captions@aux\@gobbletwo
- \def\bbl@inidate ####1.####2.####3.####4\relax ####5####6{}%
- \bbl@read@ini{##1}{basic data}%
- \bbl@exportkey{chrng}{characters.ranges}{}%
- \bbl@exportkey{dgnat}{numbers.digits.native}{}%
- \bbl@exportkey{prehc}{typography.prehyphenchar}{}%
- \bbl@exportkey{lnbrk}{typography.linebreaking}{h}%
- \bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}%
- \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}%
- \bbl@exportkey{hyphr}{typography.hyphenrules}{}%
- \bbl@exportkey{hyotl}{typography.hyphenate.other.locale}{}%
- \bbl@exportkey{hyots}{typography.hyphenate.other.script}{}%
- \bbl@exportkey{intsp}{typography.intraspace}{}%
- \ifx\bbl@initoload\relax\endinput\fi
- \endgroup}%
- \begingroup % boxed, to avoid extra spaces:
- \ifx\bbl@initoload\relax
- \setbox\z@\hbox{\InputIfFileExists{babel-#2.tex}{}{}}%
- \else
- \setbox\z@\hbox{\BabelBeforeIni{\bbl@initoload}{}}%
- \fi
- \endgroup}%
- {}%
+ % imported? We just load the very basic parameters.
+ \bbl@load@basic{#2}%
% == script, language ==
% Override the values from ini or defines them
\ifx\bbl@KVP@script\@nil\else
@@ -2528,7 +2497,7 @@
\let\BabelBeforeIni\@gobbletwo
\chardef\atcatcode=\catcode`\@
\catcode`\@=11\relax
- \InputIfFileExists{babel-\bbl@cs{rqtex@\languagename}.tex}{}{}%
+ \bbl@input@ini{\bbl@cs{rqtex@\languagename}}%
\catcode`\@=\atcatcode
\let\atcatcode\relax
\fi}%
@@ -2584,9 +2553,9 @@
\expandafter\bbl@tempb\bbl@captionslist\@empty
\else
\ifx\bbl@initoload\relax
- \bbl@read@ini{\bbl@KVP@captions}{data}% Here letters cat = 11
+ \bbl@read@ini{\bbl@KVP@captions}0% Here letters cat = 11
\else
- \bbl@read@ini{\bbl@initoload}{data}% Here all letters cat = 11
+ \bbl@read@ini{\bbl@initoload}0% Here all letters cat = 11
\fi
\bbl@after@ini
\bbl@savestrings
@@ -2600,33 +2569,7 @@
\bbl@savedate
\fi
\bbl@endcommands
- \bbl@ifunset{bbl@lname@#1}% TODO. Duplicated
- {\def\BabelBeforeIni##1##2{%
- \begingroup
- \catcode`\[=12 \catcode`\]=12 \catcode`\==12
- \catcode`\;=12 \catcode`\|=12 %
- \let\bbl@ini@captions@aux\@gobbletwo
- \def\bbl@inidate ####1.####2.####3.####4\relax ####5####6{}%
- \bbl@read@ini{##1}{basic data}%
- \bbl@exportkey{prehc}{typography.prehyphenchar}{}%
- \bbl@exportkey{lnbrk}{typography.linebreaking}{h}%
- \bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}%
- \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}%
- \bbl@exportkey{hyotl}{typography.hyphenate.other.locale}{}%
- \bbl@exportkey{hyots}{typography.hyphenate.other.script}{}%
- \bbl@exportkey{intsp}{typography.intraspace}{}%
- \bbl@exportkey{chrng}{characters.ranges}{}%
- \bbl@exportkey{dgnat}{numbers.digits.native}{}%
- \ifx\bbl@initoload\relax\endinput\fi
- \endgroup}%
- \begingroup % boxed, to avoid extra spaces:
- \ifx\bbl@initoload\relax
- \setbox\z@\hbox{\InputIfFileExists{babel-#1.tex}{}{}}%
- \else
- \setbox\z@\hbox{\BabelBeforeIni{\bbl@initoload}{}}%
- \fi
- \endgroup}%
- {}%
+ \bbl@load@basic{#1}%
\bbl@exp{%
\gdef\<#1hyphenmins>{%
{\bbl@ifunset{bbl@lfthm@#1}{2}{\bbl@cs{lfthm@#1}}}%
@@ -2638,7 +2581,7 @@
\def\bbl@provide@renew#1{%
\ifx\bbl@KVP@captions\@nil\else
\StartBabelCommands*{#1}{captions}%
- \bbl@read@ini{\bbl@KVP@captions}{data}% Here all letters cat = 11
+ \bbl@read@ini{\bbl@KVP@captions}0% Here all letters cat = 11
\bbl@after@ini
\bbl@savestrings
\EndBabelCommands
@@ -2651,6 +2594,40 @@
\fi
% == hyphenrules ==
\bbl@provide@hyphens{#1}}
+\def\bbl@load@basic#1{%
+ \bbl@ifunset{bbl@inidata@\languagename}{}%
+ {\getlocaleproperty\bbl@tempa{\languagename}{identification/load.level}%
+ \ifcase\bbl@tempa\else
+ \bbl@csarg\let{lname@\languagename}\relax
+ \fi}%
+ \bbl@ifunset{bbl@lname@#1}%
+ {\def\BabelBeforeIni##1##2{%
+ \begingroup
+ \catcode`\[=12 \catcode`\]=12 \catcode`\==12
+ \catcode`\;=12 \catcode`\|=12 %
+ \let\bbl@ini@captions@aux\@gobbletwo
+ \def\bbl@inidate ####1.####2.####3.####4\relax ####5####6{}%
+ \bbl@read@ini{##1}0%
+ \bbl@exportkey{prehc}{typography.prehyphenchar}{}%
+ \bbl@exportkey{lnbrk}{typography.linebreaking}{h}%
+ \bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}%
+ \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}%
+ \bbl@exportkey{hyphr}{typography.hyphenrules}{}%
+ \bbl@exportkey{hyotl}{typography.hyphenate.other.locale}{}%
+ \bbl@exportkey{hyots}{typography.hyphenate.other.script}{}%
+ \bbl@exportkey{intsp}{typography.intraspace}{}%
+ \bbl@exportkey{chrng}{characters.ranges}{}%
+ \bbl@exportkey{dgnat}{numbers.digits.native}{}%
+ \ifx\bbl@initoload\relax\endinput\fi
+ \endgroup}%
+ \begingroup % boxed, to avoid extra spaces:
+ \ifx\bbl@initoload\relax
+ \bbl@input@ini{#1}%
+ \else
+ \setbox\z@\hbox{\BabelBeforeIni{\bbl@initoload}{}}%
+ \fi
+ \endgroup}%
+ {}}
\def\bbl@provide@hyphens#1{%
\let\bbl@tempa\relax
\ifx\bbl@KVP@hyphenrules\@nil\else
@@ -2689,6 +2666,8 @@
\ifx\bbl@readstream\@undefined
\csname newread\endcsname\bbl@readstream
\fi
+\def\bbl@input@ini#1{%
+ \bbl@exp{\lowercase{\\\InputIfFileExists{babel-#1.tex}{}{}}}}
\def\bbl@inipreread#1=#2\@@{%
\bbl@trim@def\bbl@tempa{#1}% Redundant below !!
\bbl@trim\toks@{#2}%
@@ -2709,14 +2688,18 @@
is not complete.}%
{Fix the name or reinstall babel.}%
\else
- \bbl@exp{\def\\\bbl@inidata{\\\bbl@elt{identificacion}{tag.ini}{#1}}}%
+ \bbl@exp{\def\\\bbl@inidata{%
+ \\\bbl@elt{identification}{tag.ini}{#1}%
+ \\\bbl@elt{identification}{load.level}{#2}}}%
\let\bbl@section\@empty
\let\bbl@savestrings\@empty
\let\bbl@savetoday\@empty
\let\bbl@savedate\@empty
\let\bbl@inireader\bbl@iniskip
- \bbl@info{Importing #2 for \languagename\\%
- from babel-#1.ini. Reported}%
+ \bbl@info{Importing
+ \ifcase#2 \or font and identification \or basic \fi
+ data for \languagename\\%
+ from babel-#1.ini. Reported}%
\loop
\if T\ifeof\bbl@readstream F\fi T\relax % Trick, because inside \loop
\endlinechar\m@ne
@@ -2819,13 +2802,16 @@
\bbl@exportkey{elname}{identification.name.english}{}%
\bbl@exp{\\\bbl@exportkey{lname}{identification.name.opentype}%
{\csname bbl@elname@\languagename\endcsname}}%
- \bbl@exportkey{lbcp}{identification.tag.bcp47}{}%
+ \bbl@exportkey{lbcp}{identification.tag.bcp47}{}% TODO
\bbl@exportkey{lotf}{identification.tag.opentype}{dflt}%
\bbl@exportkey{esname}{identification.script.name}{}%
\bbl@exp{\\\bbl@exportkey{sname}{identification.script.name.opentype}%
{\csname bbl@esname@\languagename\endcsname}}%
\bbl@exportkey{sbcp}{identification.script.tag.bcp47}{}%
- \bbl@exportkey{sotf}{identification.script.tag.opentype}{DFLT}}
+ \bbl@exportkey{sotf}{identification.script.tag.opentype}{DFLT}%
+ \ifbbl@bcptoname
+ \bbl@csarg\xdef{bcp@map@\bbl@cl{lbcp}}{\languagename}%
+ \fi}
\let\bbl@inikv@typography\bbl@inikv
\let\bbl@inikv@characters\bbl@inikv
\let\bbl@inikv@numbers\bbl@inikv
@@ -2949,7 +2935,7 @@
{}}}
\let\bbl@calendar\@empty
\newcommand\BabelDateSpace{\nobreakspace}
-\newcommand\BabelDateDot{.\@}
+\newcommand\BabelDateDot{.\@} % TODO. \let instead of repeating
\newcommand\BabelDated[1]{{\number#1}}
\newcommand\BabelDatedd[1]{{\ifnum#1<10 0\fi\number#1}}
\newcommand\BabelDateM[1]{{\number#1}}
@@ -2986,7 +2972,8 @@
\bbl@replace\bbl@toreplace{[m|}{\bbl@datecntr[####2|}%
\bbl@replace\bbl@toreplace{[d|}{\bbl@datecntr[####3|}%
\bbl@replace@finish@iii\bbl@toreplace}
-\def\bbl@datecntr[#1|#2]{\localenumeral{#2}{#1}}
+\def\bbl@datecntr{\expandafter\bbl@xdatecntr\expandafter}
+\def\bbl@xdatecntr[#1|#2]{\localenumeral{#2}{#1}}
\def\bbl@provide@lsys#1{%
\bbl@ifunset{bbl@lname@#1}%
{\bbl@ini@basic{#1}}%
@@ -3001,19 +2988,50 @@
\bbl@ifunset{bbl@prehc@#1}{}%
{\bbl@exp{\\\bbl@ifblank{\bbl@cs{prehc@#1}}}%
{}%
- {\bbl@csarg\bbl@add@list{lsys@#1}{HyphenChar="200B}}}%
+ {\ifx\bbl@xenohyph\@undefined
+ \let\bbl@xenohyph\bbl@xenohyph@d
+ \ifx\AtBeginDocument\@notprerr
+ \expandafter\@secondoftwo % to execute right now
+ \fi
+ \AtBeginDocument{%
+ \expandafter\bbl@add
+ \csname selectfont \endcsname{\bbl@xenohyph}%
+ \expandafter\selectlanguage\expandafter{\languagename}%
+ \expandafter\bbl@toglobal\csname selectfont \endcsname}%
+ \fi}}%
\fi
\bbl@csarg\bbl@toglobal{lsys@#1}}
+\def\bbl@ifset#1#2#3{% TODO. Move to the correct place.
+ \bbl@ifunset{#1}{#3}{\bbl@exp{\\\bbl@ifblank{#1}}{#3}{#2}}}
+\def\bbl@xenohyph@d{%
+ \bbl@ifset{bbl@prehc@\languagename}%
+ {\ifnum\hyphenchar\font=\defaulthyphenchar
+ \iffontchar\font\bbl@cl{prehc}\relax
+ \hyphenchar\font\bbl@cl{prehc}\relax
+ \else\iffontchar\font"200B
+ \hyphenchar\font"200B
+ \else
+ \bbl@error
+ {Neither 0 nor ZERO WIDTH SPACE are available\\%
+ in the current font, and therefore the hyphen\\%
+ will be printed. Try with 'HyphenChar', but be\\%
+ aware this setting is not safe (see the manual).}%
+ {See the manual.}%
+ \hyphenchar\font\defaulthyphenchar
+ \fi\fi
+ \fi}%
+ {\hyphenchar\font\defaulthyphenchar}}
+ % \fi}
\def\bbl@ini@basic#1{%
\def\BabelBeforeIni##1##2{%
\begingroup
\bbl@add\bbl@secpost@identification{\closein\bbl@readstream }%
\catcode`\[=12 \catcode`\]=12 \catcode`\==12
\catcode`\;=12 \catcode`\|=12 %
- \bbl@read@ini{##1}{font and identification data}%
+ \bbl@read@ini{##1}1%
\endinput % babel- .tex may contain onlypreamble's
\endgroup}% boxed, to avoid extra spaces:
- {\setbox\z@\hbox{\InputIfFileExists{babel-#1.tex}{}{}}}}
+ {\bbl@input@ini{#1}}}
\def\bbl@buildifcase#1 {% Returns \bbl@tempa, requires \toks@={}
\ifx\\#1% % \\ before, in case #1 is multiletter
\bbl@exp{%
@@ -3062,7 +3080,7 @@
\@namedef{bbl@info@tag.ini}{lini}
\@namedef{bbl@info@name.english}{elname}
\@namedef{bbl@info@name.opentype}{lname}
-\@namedef{bbl@info@tag.bcp47}{lbcp}
+\@namedef{bbl@info@tag.bcp47}{lbcp} % TODO
\@namedef{bbl@info@tag.opentype}{lotf}
\@namedef{bbl@info@script.name}{esname}
\@namedef{bbl@info@script.name.opentype}{sname}
@@ -3070,10 +3088,13 @@
\@namedef{bbl@info@script.tag.opentype}{sotf}
\let\bbl@ensureinfo\@gobble
\newcommand\BabelEnsureInfo{%
- \def\bbl@ensureinfo##1{%
- \ifx\InputIfFileExists\@undefined\else % not in plain
- \bbl@ifunset{bbl@lname@##1}{\bbl@ini@basic{##1}}{}%
- \fi}}
+ \ifx\InputIfFileExists\@undefined\else
+ \def\bbl@ensureinfo##1{%
+ \bbl@ifunset{bbl@lname@##1}{\bbl@ini@basic{##1}}{}}%
+ \fi
+ \bbl@foreach\bbl@loaded{{%
+ \def\languagename{##1}%
+ \bbl@ensureinfo{##1}}}}
\newcommand\getlocaleproperty[3]{%
\let#1\relax
\def\bbl@elt##1##2##3{%
@@ -3089,6 +3110,7 @@
\string#1 will be set to \relax}%
{Perhaps you misspelled it.}%
\fi}
+\let\bbl@ini@loaded\@empty
\newcommand\LocaleForEach{\bbl@foreach\bbl@ini@loaded}
\newcommand\babeladjust[1]{% TODO. Error handling.
\bbl@forkv{#1}{%
@@ -3157,6 +3179,13 @@
\let\bbl@autoload@bcpoptions\@empty
\@namedef{bbl@ADJ@autoload.bcp47.options}#1{%
\def\bbl@autoload@bcpoptions{#1}}
+\newif\ifbbl@bcptoname
+\@namedef{bbl@ADJ@bcp47.toname@on}{%
+ \bbl@bcptonametrue
+ \BabelEnsureInfo
+ }
+\@namedef{bbl@ADJ@bcp47.toname@off}{%
+ \bbl@bcptonamefalse}
\ifx\directlua\@undefined\else
\ifx\bbl@luapatterns\@undefined
\input luababel.def