diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/tracklang/tracklang.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tracklang/tracklang.sty | 296 |
1 files changed, 160 insertions, 136 deletions
diff --git a/Master/texmf-dist/tex/latex/tracklang/tracklang.sty b/Master/texmf-dist/tex/latex/tracklang/tracklang.sty index fdc2c98e038..e68e2ee7bf1 100644 --- a/Master/texmf-dist/tex/latex/tracklang/tracklang.sty +++ b/Master/texmf-dist/tex/latex/tracklang/tracklang.sty @@ -7,7 +7,7 @@ %% tracklang.dtx (with options: `tracklang.sty,package') %% %% tracklang.dtx -%% Copyright 2022 Nicola Talbot +%% Copyright 2025 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -39,176 +39,200 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tracklang}[2022/12/13 v1.6.1 (NLCT) Track Languages] +\ProvidesPackage{tracklang}[2025/01/26 v1.6.4 (NLCT) Track Languages] \providecommand*{\@tracklang@declareoption}[1]{% \DeclareOption{#1}{\TrackPredefinedDialect{#1}}% } \input{tracklang} \let\@tracklang@declaredoptions\@declaredoptions +\DeclareOption{verbose}{\TrackLangShowVerbosetrue} +\DeclareOption{noverbose}{\TrackLangShowVerbosefalse} \ProcessOptions \let\@tracklang@declareoption\@gobble \csname @tracklang@prelangpkgcheck@hook\endcsname \ifx\@tracklang@languages\@empty - \@ifundefined{bbl@loaded}% - {% - \@ifundefined{trans@languages} + \ifx\LocaleForEach\undefined + \@ifundefined{bbl@loaded}% {% - \@ifpackageloaded{ngerman}% - {% - \@tracklang@add@ngerman - }% - {% - \@ifpackageloaded{german}% + \@ifundefined{trans@languages} + {% + \@ifpackageloaded{ngerman}% {% - \@tracklang@add@german + \@tracklang@add@ngerman }% {% - \@ifpackageloaded{polyglossia} + \@ifpackageloaded{german}% + {% + \@tracklang@add@german + }% {% - \@ifundefined{xpg@bcp@loaded}% + \@ifpackageloaded{polyglossia} {% - \@ifundefined{xpg@loaded}% + \@ifundefined{xpg@bcp@loaded}% {% - \PackageInfo{tracklang}{polyglossia loaded but - \string\xpg@loaded\space not defined. Will attempt - to track known languages.}% - \@for\this@language:=\@tracklang@declaredoptions\do{% - \@ifundefined{\this@language @loaded}% - {}% - {\@nameuse{@tracklang@add@\this@language}}% - }% - }% + \@ifundefined{xpg@loaded}% {% - \@for\this@language:=\xpg@loaded\do{% - \@ifundefined{@tracklang@add@\this@language}% - {% - \PackageWarning{tracklang}% - {Adding unknown polyglossia language `\this@language'}% - \AddTrackedLanguage{\this@language}% + \PackageInfo{tracklang}{polyglossia loaded but + \string\xpg@loaded\space not defined. Will attempt + to track known languages.}% + \@for\this@language:=\@tracklang@declaredoptions\do{% + \@ifundefined{\this@language @loaded}% + {}% + {\@nameuse{@tracklang@add@\this@language}}% }% - {\@nameuse{@tracklang@add@\this@language}}% - }% - }% - }% - {% - \@for\this@language:=\xpg@bcp@loaded\do{% - \expandafter\TrackLanguageTag{\this@language}% - }% - }% - \@ifundefined{mainbabelname}{}% - {% - \let\@org@tracklang@add@latex\@tracklang@add@latex - \def\@tracklang@add@latex{% - \PackageWarning{tracklang}% - {Can't detect polyglossia main language. It may - not have been set yet}% + }% + {% + \@for\this@language:=\xpg@loaded\do{% + \@ifundefined{@tracklang@add@\this@language}% + {% + \PackageWarning{tracklang}% + {Adding unknown polyglossia language `\this@language'}% + \AddTrackedLanguage{\this@language}% + }% + {\@nameuse{@tracklang@add@\this@language}}% + }% + }% }% - \@ifundefined{@tracklang@add@\mainbabelname}% {% - \PackageWarning{tracklang}% - {Adding unknown polyglossia main babel name `\mainbabelname'}% - \expandafter\AddTrackedLanguage{\mainbabelname}% + \@for\this@language:=\xpg@bcp@loaded\do{% + \expandafter\TrackLanguageTag{\this@language}% + }% }% + \@ifundefined{mainbabelname}{}% {% - \@nameuse{@tracklang@add@\mainbabelname}% + \let\@org@tracklang@add@latex\@tracklang@add@latex + \def\@tracklang@add@latex{% + \PackageWarning{tracklang}% + {Can't detect polyglossia main language. It may + not have been set yet}% + }% + \@ifundefined{@tracklang@add@\mainbabelname}% + {% + \PackageWarning{tracklang}% + {Adding unknown polyglossia main babel name `\mainbabelname'}% + \expandafter\AddTrackedLanguage{\mainbabelname}% + }% + {% + \@nameuse{@tracklang@add@\mainbabelname}% + }% + \let\@tracklang@add@latex\@org@tracklang@add@latex }% - \let\@tracklang@add@latex\@org@tracklang@add@latex }% - }% - {% - \@ifpackageloaded{babel} {% - \PackageInfo{tracklang}{babel loaded but - \string\bbl@loaded\space not defined. Will attempt - to track known languages.}% - \@for\this@language:=\@tracklang@declaredoptions\do{% - \@ifundefined{captions\this@language}% - {}% - {\@nameuse{@tracklang@add@\this@language}}% + \@ifpackageloaded{babel} + {% + \PackageInfo{tracklang}{babel loaded but + \string\bbl@loaded\space not defined. Will attempt + to track known languages.}% + \@for\this@language:=\@tracklang@declaredoptions\do{% + \@ifundefined{captions\this@language}% + {}% + {\@nameuse{@tracklang@add@\this@language}}% + }% }% + {}% }% - {}% }% }% - }% + }% + {% + \let\@tracklang@add@Acadian\@tracklang@add@acadian + \let\@tracklang@add@French\@tracklang@add@french + \let\@tracklang@add@Afrikaans\@tracklang@add@afrikaans + \let\@tracklang@add@Dutch\@tracklang@add@dutch + \let\@tracklang@add@AmericanEnglish\@tracklang@add@american + \let\@tracklang@add@Austrian\@tracklang@add@austrian + \@namedef{@tracklang@add@Austrian1997}{\@tracklang@add@naustrian}% + \let\@tracklang@add@Bahasa\@tracklang@add@bahasa + \let\@tracklang@add@Basque\@tracklang@add@basque + \let\@tracklang@add@Brazilian\@tracklang@add@brazil + \let\@tracklang@add@Portuguese\@tracklang@add@portuguese + \let\@tracklang@add@Breton\@tracklang@add@breton + \let\@tracklang@add@BritishEnglish\@tracklang@add@british + \let\@tracklang@add@Bulgarian\@tracklang@add@bulgarian + \let\@tracklang@add@Canadian\@tracklang@add@canadian + \let\@tracklang@add@Canadien\@tracklang@add@canadien + \let\@tracklang@add@Catalan\@tracklang@add@catalan + \let\@tracklang@add@Croatian\@tracklang@add@croatian + \let\@tracklang@add@Czech\@tracklang@add@czech + \let\@tracklang@add@Danish\@tracklang@add@danish + \let\@tracklang@add@Dutch\@tracklang@add@dutch + \let\@tracklang@add@English\@tracklang@add@english + \let\@tracklang@add@Esperanto\@tracklang@add@esperanto + \let\@tracklang@add@Estonian\@tracklang@add@estonian + \let\@tracklang@add@Finnish\@tracklang@add@finnish + \let\@tracklang@add@French\@tracklang@add@french + \let\@tracklang@add@Galician\@tracklang@add@galician + \let\@tracklang@add@German\@tracklang@add@german + \@namedef{@tracklang@add@German1997}{\@tracklang@add@ngerman}% + \let\@tracklang@add@Greek\@tracklang@add@greek + \let\@tracklang@add@Polutoniko\@tracklang@add@polutoniko + \let\@tracklang@add@Hebrew\@tracklang@add@hebrew + \let\@tracklang@add@Hungarian\@tracklang@add@hungarian + \let\@tracklang@add@Icelandic\@tracklang@add@icelandic + \let\@tracklang@add@Irish\@tracklang@add@irish + \let\@tracklang@add@Italian\@tracklang@add@italian + \let\@tracklang@add@Latin\@tracklang@add@latin + \let\@tracklang@add@LowerSorbian\@tracklang@add@lowersorbian + \let\@tracklang@add@Magyar\@tracklang@add@magyar + \let\@tracklang@add@Nynorsk\@tracklang@add@nynorsk + \let\@tracklang@add@Norsk\@tracklang@add@norsk + \let\@tracklang@add@Polish\@tracklang@add@polish + \let\@tracklang@add@Portuguese\@tracklang@add@portuguese + \let\@tracklang@add@Romanian\@tracklang@add@romanian + \let\@tracklang@add@Russian\@tracklang@add@russian + \let\@tracklang@add@Scottish\@tracklang@add@scottish + \let\@tracklang@add@Serbian\@tracklang@add@serbian + \let\@tracklang@add@Slovak\@tracklang@add@slovak + \let\@tracklang@add@Slovene\@tracklang@add@slovene + \let\@tracklang@add@Spanish\@tracklang@add@spanish + \let\@tracklang@add@Swedish\@tracklang@add@swedish + \let\@tracklang@add@Turkish\@tracklang@add@turkish + \let\@tracklang@add@Ukrainian\@tracklang@add@ukrainian + \let\@tracklang@add@UpperSorbian\@tracklang@add@uppersorbian + \let\@tracklang@add@Welsh\@tracklang@add@welsh + \@for\this@language:=\trans@languages\do{% + \@ifundefined{@tracklang@add@\this@language}{}% + {\@nameuse{@tracklang@add@\this@language}}% + }% + }% }% {% - \let\@tracklang@add@Acadian\@tracklang@add@acadian - \let\@tracklang@add@French\@tracklang@add@french - \let\@tracklang@add@Afrikaans\@tracklang@add@afrikaans - \let\@tracklang@add@Dutch\@tracklang@add@dutch - \let\@tracklang@add@AmericanEnglish\@tracklang@add@american - \let\@tracklang@add@Austrian\@tracklang@add@austrian - \@namedef{@tracklang@add@Austrian1997}{\@tracklang@add@naustrian} - \let\@tracklang@add@Bahasa\@tracklang@add@bahasa - \let\@tracklang@add@Basque\@tracklang@add@basque - \let\@tracklang@add@Brazilian\@tracklang@add@brazil - \let\@tracklang@add@Portuguese\@tracklang@add@portuguese - \let\@tracklang@add@Breton\@tracklang@add@breton - \let\@tracklang@add@BritishEnglish\@tracklang@add@british - \let\@tracklang@add@Bulgarian\@tracklang@add@bulgarian - \let\@tracklang@add@Canadian\@tracklang@add@canadian - \let\@tracklang@add@Canadien\@tracklang@add@canadien - \let\@tracklang@add@Catalan\@tracklang@add@catalan - \let\@tracklang@add@Croatian\@tracklang@add@croatian - \let\@tracklang@add@Czech\@tracklang@add@czech - \let\@tracklang@add@Danish\@tracklang@add@danish - \let\@tracklang@add@Dutch\@tracklang@add@dutch - \let\@tracklang@add@English\@tracklang@add@english - \let\@tracklang@add@Esperanto\@tracklang@add@esperanto - \let\@tracklang@add@Estonian\@tracklang@add@estonian - \let\@tracklang@add@Finnish\@tracklang@add@finnish - \let\@tracklang@add@French\@tracklang@add@french - \let\@tracklang@add@Galician\@tracklang@add@galician - \let\@tracklang@add@German\@tracklang@add@german - \@namedef{@tracklang@add@German1997}{\@tracklang@add@ngerman} - \let\@tracklang@add@Greek\@tracklang@add@greek - \let\@tracklang@add@Polutoniko\@tracklang@add@polutoniko - \let\@tracklang@add@Hebrew\@tracklang@add@hebrew - \let\@tracklang@add@Hungarian\@tracklang@add@hungarian - \let\@tracklang@add@Icelandic\@tracklang@add@icelandic - \let\@tracklang@add@Irish\@tracklang@add@irish - \let\@tracklang@add@Italian\@tracklang@add@italian - \let\@tracklang@add@Latin\@tracklang@add@latin - \let\@tracklang@add@LowerSorbian\@tracklang@add@lowersorbian - \let\@tracklang@add@Magyar\@tracklang@add@magyar - \let\@tracklang@add@Nynorsk\@tracklang@add@nynorsk - \let\@tracklang@add@Norsk\@tracklang@add@norsk - \let\@tracklang@add@Polish\@tracklang@add@polish - \let\@tracklang@add@Portuguese\@tracklang@add@portuguese - \let\@tracklang@add@Romanian\@tracklang@add@romanian - \let\@tracklang@add@Russian\@tracklang@add@russian - \let\@tracklang@add@Scottish\@tracklang@add@scottish - \let\@tracklang@add@Serbian\@tracklang@add@serbian - \let\@tracklang@add@Slovak\@tracklang@add@slovak - \let\@tracklang@add@Slovene\@tracklang@add@slovene - \let\@tracklang@add@Spanish\@tracklang@add@spanish - \let\@tracklang@add@Swedish\@tracklang@add@swedish - \let\@tracklang@add@Turkish\@tracklang@add@turkish - \let\@tracklang@add@Ukrainian\@tracklang@add@ukrainian - \let\@tracklang@add@UpperSorbian\@tracklang@add@uppersorbian - \let\@tracklang@add@Welsh\@tracklang@add@welsh - \@for\this@language:=\trans@languages\do{% - \@ifundefined{@tracklang@add@\this@language}{}% + \@for\this@language:=\bbl@loaded\do{% + \@ifundefined{@tracklang@add@\this@language}% + {% + \PackageWarning{tracklang}% + {Adding unknown babel language `\this@language'}% + \AddTrackedLanguage{\this@language}% + }% {\@nameuse{@tracklang@add@\this@language}}% - }% + }% + \ifx\captionsserbian\undefined + \else + \SetTrackedDialectScript{serbian}{Latn}% + \fi }% - }% - {% - \@for\this@language:=\bbl@loaded\do{% - \@ifundefined{@tracklang@add@\this@language}% + \else + \LocaleForEach + {% + \@tracklang@ifundef{@tracklang@add@#1}% + { + \getlocaleproperty\tracklang@propresult{#1}{identification/tag.bcp47}% + \expandafter\TrackLanguageTag\expandafter{\tracklang@propresult}% + \edef\@tracklang@tmp{#1}% + \ifx\TrackLangLastTrackedDialect\@tracklang@tmp + \else + \@tracklang@info + {Adding mapping `\TrackLangLastTrackedDialect' -> `#1'}% + \expandafter\SetTrackedDialectLabelMap\expandafter + {\TrackLangLastTrackedDialect}{#1}% + \fi + }% {% - \PackageWarning{tracklang}% - {Adding unknown babel language `\this@language'}% - \AddTrackedLanguage{\this@language}% + \@nameuse{@tracklang@add@#1}% }% - {\@nameuse{@tracklang@add@\this@language}}% - }% - \ifx\captionsserbian\undefined - \else - \SetTrackedDialectScript{serbian}{Latn}% - \fi - } + }% + \fi \fi \endinput %% |