diff options
author | Karl Berry <karl@freefriends.org> | 2018-08-27 21:41:07 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-08-27 21:41:07 +0000 |
commit | d6f57515b98d2736c1e094a7df0623d0ffd7120a (patch) | |
tree | 5d5706d9d7ddec135b39decdc4d6f9c2493475a6 /Master/texmf-dist/tex | |
parent | f1c2e4e8b45c0e7bbdaca6e345c187375d024f6a (diff) |
tex-locale (27aug18)
git-svn-id: svn://tug.org/texlive/trunk@48500 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
5 files changed, 2828 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/tex-locale/tex-locale.tex b/Master/texmf-dist/tex/generic/tex-locale/tex-locale.tex new file mode 100644 index 00000000000..32785755692 --- /dev/null +++ b/Master/texmf-dist/tex/generic/tex-locale/tex-locale.tex @@ -0,0 +1,1735 @@ +%% +%% This is file `tex-locale.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tex-locale.dtx (with options: `tex-locale.tex,package') +%% +%% tex-locale.dtx +%% Copyright 2018 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files tex-locale.dtx and tex-locale.ins and the derived files tex-locale.sty, tex-locale.tex, tex-locale-scripts-enc.def, tex-locale-encodings.def, tex-locale-support.def. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% arara: xetex: {shell: on} +%% arara: xetex: {shell: on} +\ifnum\catcode`\@=11\relax + \def\@locale@restore@at{}% +\else + \expandafter\edef\csname @locale@restore@at\endcsname{% + \noexpand\catcode`\noexpand\@=\number\catcode`\@\relax + }% + \catcode`\@=11\relax +\fi +\ifx\@locale@parse@query\undefined +\else + \@locale@restore@at + \expandafter\endinput +\fi +\expandafter\def\csname ver@tex-locale.tex\endcsname{2018/08/26 v1.0 +(NLCT) localisation support} +\input tracklang +\input texosquery +\ifx\PackageError\undefined + \def\@locale@err#1#2{% + \errhelp{#2}% + \errmessage{tex-locale: #1}} +\else + \def\@locale@err#1#2{\PackageError{tex-locale}{#1}{#2}} +\fi +\def\@locale@warn{\@tracklang@pkgwarn{tex-locale}} +\ifx\PackageInfo\undefined + \def\@locale@info#1{% + {% + \newlinechar=`\^^J + \def\MessageBreak{^^J}% + \message{^^Jtex-locale Info: #1^^J}% + }% + } +\else + \def\@locale@info#1{\PackageInfo{tex-locale}{#1}} +\fi +\ifx\@tracklang@pkgwarn\undefined + \@locale@err{tracklang version is too old. At least v1.3.4 required} + {You need to update tracklang to at least v1.3.4}% +\fi +\ifx\@texosquery@argquote\undefined + \@locale@err{texosquery version is too old. At least v1.4 required} + {You need to update texosquery to at least v1.4}% +\fi +\ifx\LocaleMain\undefined + \def\LocaleMain{locale} +\fi +\@tracklang@sanitize\LocaleMain +\ifx\LocaleOther\undefined + \def\LocaleOther{} +\else + \@tracklang@sanitize\LocaleOther +\fi +\def\@locale@os@tag{} +\def\@locale@os@default{locale} +\@tracklang@sanitize\@locale@os@default +\def\@locale@unknown@currency{XXX} +\def\@locale@os@region{} +\def\@locale@os@groupsep{} +\def\@locale@os@decsep{} +\def\@locale@os@cursep{} +\def\@locale@os@exp{} +\def\@locale@os@usesgroup{} +\def\@locale@os@currencycode{XXX} +\def\@locale@os@regionalcurrencycode{XXX} +\def\@locale@os@currencysym{} +\def\@locale@os@currencytex{} +\ifx\LocaleMainFile\undefined + \edef\LocaleMainFile{\expandafter\texosquerystripquotes{\jobname}.tex} +\fi +\ifx\LocaleIfDateTimePatternsSupported\undefined + \def\LocaleIfDateTimePatternsSupported#1#2{#2} +\fi +\def\localedatetimefmt#1{#1} +\ifx\LocaleQueryCodesetParam\undefined + \edef\LocaleQueryCodesetParam{\string-C} +\fi +\edef\@locale@query@params{% + \string-o \string-r \string-a + \string-n + \string-N + \LocaleQueryCodesetParam\space +} +\LocaleIfDateTimePatternsSupported +{% + \edef\@locale@query@params{\@locale@query@params \string-M } +} +{} +\ifx\LocaleMainFile\empty +\else + \edef\@locale@query@params{\@locale@query@params + \string-d \@texosquery@argquote{\LocaleMainFile} + } +\fi +\ifx\LocaleMain\@locale@os@default + \LocaleIfDateTimePatternsSupported + {% + \edef\@locale@query@params{\@locale@query@params + \string-D \string-Z + } + } + { + \edef\@locale@query@params{\@locale@query@params + \string-D + } + } +\else + \LocaleIfDateTimePatternsSupported + {% + \edef\@locale@query@params{\@locale@query@params + \string-D \LocaleMain\space\string-Z \LocaleMain\space + } + } + { + \edef\@locale@query@params{\@locale@query@params + \string-D \LocaleMain\space + } + } +\fi +\@tracklang@for\@locale@tag:=\LocaleOther\do{% + \ifx\@locale@tag\@locale@os@default + \LocaleIfDateTimePatternsSupported + {% + \edef\@locale@query@params{\@locale@query@params + \string-D \string-Z + } + } + {% + \edef\@locale@query@params{\@locale@query@params + \string-D + } + } + \else + \LocaleIfDateTimePatternsSupported + {% + \edef\@locale@query@params{\@locale@query@params + \string-D \@locale@tag\space\string-Z \@locale@tag\space + } + } + {% + \edef\@locale@query@params{\@locale@query@params + \string-D \@locale@tag\space + } + } + \fi +} +\csname localeprequery\endcsname +\ifx\LocaleQueryFile\undefined + \TeXOSQuery{\@locale@result}{\@locale@query@params} +\else + \ifx\LocaleQueryFile\empty + \TeXOSQuery{\@locale@result}{\@locale@query@params} + \else + \ifx\TeXOSQueryFromFile\undefined + \@locale@err{texosquery too old to support + \string\LocaleQueryFile. At least v1.4 required} + {You need to update your version of texosquery} + \def\@locale@result{} + \else + \@locale@info{Fetching query results from `\LocaleQueryFile'}% + \TeXOSQueryFromFile{\@locale@result}{\LocaleQueryFile} + \fi + \fi +\fi +\global\let\@locale@result\@locale@result +\csname localepostquery\endcsname +\def\LocaleSetAttribute#1#2#3{% + \expandafter\def\csname locale@#2@#1\endcsname{#3}% +} +\def\LocaleAppToAttribute#1#2#3{% + \LocaleIfHasAttribute{#1}{#2}% + {% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\csname locale@#2@#1\expandafter\endcsname + \expandafter\expandafter\expandafter{\csname locale@#2@#1\endcsname#3}% + }% + {\expandafter\def\csname locale@#2@#1\endcsname{#3}}% +} +\def\LocaleXpAppToAttribute#1#2#3{% + \LocaleIfHasAttribute{#1}{#2}% + {% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\csname locale@#2@#1\expandafter\endcsname + \expandafter\expandafter\expandafter{% + \csname locale@#2@#1\expandafter\endcsname#3}% + }% + {% + \expandafter\def\csname locale@#2@#1\expandafter\endcsname\expandafter{#3}% + }% +} +\def\LocaleAddToAttributeList#1#2#3{% + \LocaleIfHasAttribute{#1}{#2}% + {% + \LocaleIfInAttributeList{#1}{#2}{#3}% + {}% + {\LocaleAppToAttribute{#1}{#2}{,#3}}% + }% + {\LocaleSetAttribute{#1}{#2}{#3}}% +} +\def\LocaleXpAddToAttributeList#1#2#3{% + \LocaleIfHasAttribute{#1}{#2}% + {% + \LocaleIfXpInAttributeList{#1}{#2}{#3}% + {}% + {\LocaleXpAppToAttribute{#1}{#2}{\expandafter,#3}}% + }% + {\expandafter\def\csname locale@#2@#1\expandafter\endcsname\expandafter{#3}}% +} +\def\localeshowattribute#1#2{% + \LocaleIfHasAttribute{#1}{#2}% + {% + \expandafter\show\csname locale@#2@#1\endcsname + }% + {\@locale@err{Attribute `#2' not defined for `#1'}% + {\string\localeshowattribute\space was asked to show this + attribute for the given attribute type, but the + associated command hasn't been defined}}% +} +\def\LocaleProvideAttribute#1#2#3{% + \LocaleIfHasAttribute{#1}{#2}% + {}% + {\LocaleSetAttribute{#1}{#2}{#3}}% +} +\def\LocaleLetAttribute#1#2#3{% + \expandafter\let\csname locale@#2@#1\endcsname#3% +} +\def\LocaleGetAttributeOrDefValue#1#2#3{% + \@tracklang@ifundef{locale@#2@#1}% + {#3\@locale@undef@action{#1}{#2}}% + {\csname locale@#2@#1\endcsname}% +} +\def\LocaleGetAttribute#1#2{% + \LocaleGetAttributeOrDefValue{#1}{#2}{}% +} +\def\@locale@undef@action#1#2{} +\def\LocaleIfHasAttribute#1#2#3#4{% + \@tracklang@ifundef{locale@#2@#1}% + {#4}% + {#3}% +} +\def\LocaleForEachInAttributeList#1#2#3#4{% + \LocaleIfHasAttribute{#1}{#2}% + {% + \expandafter\@tracklang@for\expandafter#3\expandafter:\expandafter + =\csname locale@#2@#1\endcsname\do{#4}% + }% + {}% +} +\def\LocaleIfInAttributeList#1#2#3#4#5{% + \LocaleIfHasAttribute{#1}{#2}% + {% + \expandafter\let\expandafter\@locale@attrlist\csname locale@#2@#1\endcsname + \@tracklang@ifinlist{#3}{\@locale@attrlist}{#4}{#5}% + }% + {#5}% +} +\def\LocaleIfXpInAttributeList#1#2#3#4#5{% + \LocaleIfHasAttribute{#1}{#2}% + {% + \expandafter\let\expandafter\@locale@attrlist\csname locale@#2@#1\endcsname + \expandafter\@tracklang@ifinlist\expandafter{#3}{\@locale@attrlist}{#4}{#5}% + }% + {#5}% +} +\def\LocaleIfHasNonEmptyAttribute#1#2#3#4{% + \@tracklang@ifundef{locale@#2@#1}% + {#4}% + {% + \expandafter\ifx\csname locale@#2@#1\endcsname\empty + #4% + \else + #3% + \fi + }% +} +\def\LocaleIfAttributeEqCs#1#2#3#4#5{% + \expandafter\ifx\csname locale@#2@#1\endcsname#3% + #4% + \else + #5% + \fi +} +\def\LocaleIfAttributeEqCsName#1#2#3#4#5{% + \expandafter\ifx + \csname locale@#2@#1\expandafter\endcsname + \csname #3\endcsname + #4% + \else + #5% + \fi +} +\def\LocaleIfAttributeEqNum#1#2#3#4#5{% + \LocaleIfHasNonEmptyAttribute{#1}{#2}% + {% + \expandafter\ifnum\csname locale@#2@#1\endcsname=#3 + #4% + \else + #5% + \fi + }% + {#5}% +} +\def\LocaleIfSameAttributeValues#1#2#3#4#5{% + \expandafter\ifx + \csname locale@#2@#1\expandafter\endcsname + \csname locale@#3@#1\endcsname + #4% + \else + #5% + \fi +} +\def\localeshowdialectattribute#1#2{% + \localeshowattribute{#1}{dialect@#2}% +} +\def\LocaleSetDialectAttribute#1#2#3{% + \LocaleSetAttribute{#1}{dialect@#2}{#3}% +} +\def\LocaleProvideDialectAttribute#1#2#3{% + \LocaleProvideAttribute{#1}{dialect@#2}{#3}% +} +\def\LocaleLetDialectAttribute#1#2#3{% + \LocaleLetAttribute{#1}{dialect@#2}{#3}% +} +\def\LocaleAppToDialectAttribute#1#2#3{% + \LocaleAppToAttribute{#1}{dialect@#2}{#3}% +} +\def\LocaleXpAppToDialectAttribute#1#2#3{% + \LocaleXpAppToAttribute{#1}{dialect@#2}{#3}% +} +\def\LocaleAddToDialectAttributeList#1#2{% + \LocaleAddToAttributeList{#1}{dialect@#2}% +} +\def\LocaleXpAddToDialectAttributeList#1#2{% + \LocaleXpAddToAttributeList{#1}{dialect@#2}% +} +\def\LocaleGetDialectAttribute#1#2{% + \LocaleGetAttribute{#1}{dialect@#2}% +} +\def\LocaleGetDialectAttributeOrDefValue#1#2{% + \LocaleGetAttributeOrDefValue{#1}{dialect@#2}% +} +\def\LocaleIfHasDialectAttribute#1#2{% + \LocaleIfHasAttribute{#1}{dialect@#2}% +} +\def\LocaleForEachInDialectAttributeList#1#2{% + \LocaleForEachInAttributeList{#1}{dialect@#2}% +} +\def\LocaleIfInDialectAttributeList#1#2{% + \LocaleIfInAttributeList{#1}{dialect@#2}% +} +\def\LocaleIfXpInDialectAttributeList#1#2{% + \LocaleIfXpInAttributeList{#1}{dialect@#2}% +} +\def\LocaleIfHasDialectNonEmptyAttribute#1#2{% + \LocaleIfHasNonEmptyAttribute{#1}{dialect@#2}% +} +\def\LocaleIfDialectAttributeEqCs#1#2#3{% + \LocaleIfAttributeEqCs{#1}{dialect@#2}{#3}% +} +\def\LocaleIfDialectAttributeEqCsName#1#2#3{% + \LocaleIfAttributeEqCsName{#1}{dialect@#2}{#3}% +} +\def\LocaleIfDialectAttributeEqNum#1#2#3{% + \LocaleIfAttributeEqNum{#1}{dialect@#2}{#3}% +} +\def\LocaleIfSameDialectAttributeValues#1#2#3{% + \LocaleIfSameAttributeValues{#1}{dialect@#2}{dialect@#3}% +} +\def\localeshowregionattribute#1#2{% + \localeshowattribute{#1}{region@#2}% +} +\def\LocaleSetRegionAttribute#1#2#3{% + \LocaleSetAttribute{#1}{region@#2}{#3}% +} +\def\LocaleProvideRegionAttribute#1#2#3{% + \LocaleProvideAttribute{#1}{region@#2}{#3}% +} +\def\LocaleLetRegionAttribute#1#2#3{% + \LocaleLetAttribute{#1}{region@#2}{#3}% +} +\def\LocaleAppToRegionAttribute#1#2#3{% + \LocaleAppToAttribute{#1}{region@#2}{#3}% +} +\def\LocaleXpAppToRegionAttribute#1#2#3{% + \LocaleXpAppToAttribute{#1}{region@#2}{#3}% +} +\def\LocaleAddToRegionAttributeList#1#2{% + \LocaleAddToAttributeList{#1}{region@#2}% +} +\def\LocaleXpAddToRegionAttributeList#1#2{% + \LocaleXpAddToAttributeList{#1}{region@#2}% +} +\def\LocaleGetRegionAttribute#1#2{% + \LocaleGetAttribute{#1}{region@#2}% +} +\def\LocaleGetRegionAttributeOrDefValue#1#2{% + \LocaleGetAttributeOrDefValue{#1}{region@#2}% +} +\def\LocaleIfHasRegionAttribute#1#2{% + \LocaleIfHasAttribute{#1}{region@#2}% +} +\def\LocaleForEachInRegionAttributeList#1#2{% + \LocaleForEachInAttributeList{#1}{region@#2}% +} +\def\LocaleIfInRegionAttributeList#1#2{% + \LocaleIfInAttributeList{#1}{region@#2}% +} +\def\LocaleIfXpInRegionAttributeList#1#2{% + \LocaleIfXpInAttributeList{#1}{region@#2}% +} +\def\LocaleIfHasRegionNonEmptyAttribute#1#2{% + \LocaleIfHasNonEmptyAttribute{#1}{region@#2}% +} +\def\LocaleIfRegionAttributeEqCs#1#2#3{% + \LocaleIfAttributeEqCs{#1}{region@#2}{#3}% +} +\def\LocaleIfRegionAttributeEqCsName#1#2#3{% + \LocaleIfAttributeEqCsName{#1}{region@#2}{#3}% +} +\def\LocaleIfRegionAttributeEqNum#1#2#3{% + \LocaleIfAttributeEqNum{#1}{region@#2}{#3}% +} +\def\LocaleIfSameRegionAttributeValues#1#2#3{% + \LocaleIfSameAttributeValues{#1}{region@#2}{region@#3}% +} +\def\localeshowcurrencyattribute#1#2{% + \localeshowattribute{#1}{currency@#2}% +} +\def\LocaleSetCurrencyAttribute#1#2#3{% + \LocaleSetAttribute{#1}{currency@#2}{#3}% +} +\def\LocaleProvideCurrencyAttribute#1#2#3{% + \LocaleProvideAttribute{#1}{currency@#2}{#3}% +} +\def\LocaleLetCurrencyAttribute#1#2#3{% + \LocaleLetAttribute{#1}{currency@#2}{#3}% +} +\def\LocaleAppToCurrencyAttribute#1#2#3{% + \LocaleAppToAttribute{#1}{currency@#2}{#3}% +} +\def\LocaleXpAppToCurrencyAttribute#1#2#3{% + \LocaleXpAppToAttribute{#1}{currency@#2}{#3}% +} +\def\LocaleAddToCurrencyAttributeList#1#2{% + \LocaleAddToAttributeList{#1}{currency@#2}% +} +\def\LocaleXpAddToCurrencyAttributeList#1#2{% + \LocaleXpAddToAttributeList{#1}{currency@#2}% +} +\def\LocaleGetCurrencyAttribute#1#2{% + \LocaleGetAttribute{#1}{currency@#2}% +} +\def\LocaleGetCurrencyAttributeOrDefValue#1#2{% + \LocaleGetAttributeOrDefValue{#1}{currency@#2}% +} +\def\LocaleIfHasCurrencyAttribute#1#2{% + \LocaleIfHasAttribute{#1}{currency@#2}% +} +\def\LocaleForEachInCurrencyAttributeList#1#2{% + \LocaleForEachInAttributeList{#1}{currency@#2}% +} +\def\LocaleIfInCurrencyAttributeList#1#2{% + \LocaleIfInAttributeList{#1}{currency@#2}% +} +\def\LocaleIfXpInCurrencyAttributeList#1#2{% + \LocaleIfXpInAttributeList{#1}{currency@#2}% +} +\def\LocaleIfHasCurrencyNonEmptyAttribute#1#2{% + \LocaleIfHasNonEmptyAttribute{#1}{currency@#2}% +} +\def\LocaleIfCurrencyAttributeEqCs#1#2#3{% + \LocaleIfAttributeEqCs{#1}{currency@#2}{#3}% +} +\def\LocaleIfCurrencyAttributeEqCsName#1#2#3{% + \LocaleIfAttributeEqCsName{#1}{currency@#2}{#3}% +} +\def\LocaleIfCurrencyAttributeEqNum#1#2#3{% + \LocaleIfAttributeEqNum{#1}{currency@#2}{#3}% +} +\def\LocaleIfSameCurrencyAttributeValues#1#2#3{% + \LocaleIfSameAttributeValues{#1}{currency@#2}{currency@#3}% +} +\def\@locale@parse@result#1#2#3#4#5#6{% + \def\LocaleOSname{#1}% + \def\LocaleOSversion{#2}% + \def\LocaleOSarch{#3}% + \def\LocaleNowStamp{#4}% + \@locale@parse@default#5% remove outer group + \def\LocaleOScodeset{#6}% + \LocaleIfDateTimePatternsSupported + {% + \let\@locale@next\@locale@parse@datetimeinfo + }% + {% + \def\LocaleDateTimeInfo{}% + \ifx\LocaleMainFile\empty + \def\LocaleFileMod{}% + \let\@locale@next\@locale@parse@maindata + \else + \let\@locale@next\@locale@parse@filemod + \fi + }% + \@locale@next +} +\def\@locale@parse@datetimeinfo#1{% + \def\LocaleDateTimeInfo{#1}% + \ifx\LocaleMainFile\empty + \def\LocaleFileMod{}% + \let\@locale@next\@locale@parse@maindata + \else + \let\@locale@next\@locale@parse@filemod + \fi + \@locale@next +} +\def\@locale@parse@default#1#2#3#4#5#6#7#8#9{% + \def\LocaleOStag{#1}% + \@tracklang@parselangtag{#1}% + \let\@locale@os@region\@TrackLangEnvTerritory + \def\@locale@os@groupsep{#2}% + \def\@locale@os@decsep{#3}% + \def\@locale@os@exp{#4}% + \def\@locale@os@usesgroup{#5}% + \def\@locale@os@currencycode{#6}% + \def\@locale@os@regionalcurrencycode{#7}% + \def\@locale@os@currencysym{#8}% + \def\@locale@os@currencytex{#9}% + \LocaleSetRegionAttribute{\@locale@os@region}{currency}{#7}% + \LocaleProvideCurrencyAttribute{#7}{official}{#6}% + \LocaleProvideCurrencyAttribute{#7}{sym}{#8}% + \LocaleProvideCurrencyAttribute{#7}{tex}{#9}% + \@locale@parse@default@cursep +} +\def\@locale@parse@default@cursep#1{% + \def\@locale@os@cursep{#1}% +} +\def\@locale@parse@filemod#1{% + \def\LocaleFileMod{#1}% + \@locale@parse@maindata +} +\def\@locale@parse@maindata#1{% + \@locale@parse@maindatablock#1% remove outer group +} +\def\@locale@parse@maindatablock#1{% + \@locale@parse@maindatalocaleblock#1% remove outer group + \@locale@parse@dateblock +} +\def\@locale@parse@maindatalocaleblock#1#2#3#4#5#6#7{% + \def\LocaleMain{#1}% + \TrackLanguageTag{#1}% + \let\LocaleMainDialect\TrackLangLastTrackedDialect + \let\@locale@dialect\TrackLangLastTrackedDialect + \IfTrackedLanguageHasIsoCode{3166-1}{\@locale@dialect}% + {% + \edef\@locale@region{% + \TrackedIsoCodeFromLanguage{3166-1}{\@locale@dialect}}% + }% + {\def\@locale@region{}}% + \let\LocaleMainRegion\@locale@region + \ifx\LocaleMainRegion\empty + \else + \LocaleLetRegionAttribute{\LocaleMainRegion}{dialect}{\@locale@dialect}% + \fi + \LocaleSetDialectAttribute{\@locale@dialect}{langtag}{#1}% + \LocaleLetAttribute{#1}{tagtodialect}{\@locale@dialect}% + \LocaleSetDialectAttribute{\@locale@dialect}{langname}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{nativelangname}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{regionname}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{nativeregionname}{#5}% + \LocaleSetDialectAttribute{\@locale@dialect}{variantname}{#6}% + \LocaleSetDialectAttribute{\@locale@dialect}{nativevariantname}{#7}% +} +\def\@locale@parse@otherdatalocaleblock#1#2#3#4#5#6#7{% + \TrackLanguageTag{#1}% + \let\@locale@dialect\TrackLangLastTrackedDialect + \IfTrackedLanguageHasIsoCode{3166-1}{\@locale@dialect}% + {% + \edef\@locale@region{% + \TrackedIsoCodeFromLanguage{3166-1}{\@locale@dialect}}% + \ifx\@locale@region\empty + \else + \LocaleXpAddToRegionAttributeList + {\@locale@region}{dialect}{\@locale@dialect}% + \fi + }% + {\def\@locale@region{}}% + \LocaleSetDialectAttribute{\@locale@dialect}{langtag}{#1}% + \LocaleLetAttribute{#1}{tagtodialect}{\@locale@dialect}% + \LocaleSetDialectAttribute{\@locale@dialect}{langname}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{nativelangname}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{regionname}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{nativeregionname}{#5}% + \LocaleSetDialectAttribute{\@locale@dialect}{variantname}{#6}% + \LocaleSetDialectAttribute{\@locale@dialect}{nativevariantname}{#7}% +} +\def\@locale@parse@dateblock#1{% + \@locale@parse@dates#1% remove outer group + \@locale@parse@datefmtblock +} +\def\@locale@parse@dates#1#2#3#4#5{% + \LocaleSetDialectAttribute{\@locale@dialect}{fulldate}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{longdate}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{meddate}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortdate}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{firstday}{#5}% +} +\def\@locale@parse@datefmtblock#1{% + \@locale@parse@datefmts#1% remove outer group + \@locale@parse@timeblock +} +\def\@locale@parse@datefmts#1#2#3#4{% + \LocaleSetDialectAttribute{\@locale@dialect}{fulldatefmt}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{longdatefmt}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{meddatefmt}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortdatefmt}{#4}% +} +\def\@locale@parse@timeblock#1{% + \@locale@parse@times#1% remove outer group + \@locale@parse@timefmtblock +} +\def\@locale@parse@times#1#2#3#4{% + \LocaleSetDialectAttribute{\@locale@dialect}{fulltime}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{longtime}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{medtime}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{shorttime}{#4}% +} +\def\@locale@parse@timefmtblock#1{% + \@locale@parse@timefmts#1% remove outer group + \@locale@parse@datetimeblock +} +\def\@locale@parse@timefmts#1#2#3#4{% + \LocaleSetDialectAttribute{\@locale@dialect}{fulltimefmt}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{longtimefmt}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{medtimefmt}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{shorttimefmt}{#3}% +} +\def\@locale@parse@datetimeblock#1{% + \@locale@parse@datetimes#1% remove outer group + \@locale@parse@datetimefmtblock +} +\def\@locale@parse@datetimes#1#2#3#4{% + \LocaleSetDialectAttribute{\@locale@dialect}{fulldatetime}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{longdatetime}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{meddatetime}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortdatetime}{#4}% +} +\def\@locale@parse@datetimefmtblock#1{% + \@locale@parse@datetimefmts#1% remove outer group + \@locale@parse@weekdayblock +} +\def\@locale@parse@datetimefmts#1#2#3#4{% + \LocaleSetDialectAttribute{\@locale@dialect}{fulldatetimefmt}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{longdatetimefmt}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{meddatetimefmt}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortdatetimefmt}{#4}% +} +\def\@locale@parse@weekdayblock#1{% + \@locale@parse@weekdays#1% remove outer group + \@locale@parse@shortweekdayblock +} +\def\@locale@parse@weekdays#1#2#3#4#5#6#7{% + \LocaleSetDialectAttribute{\@locale@dialect}{day.0}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{day.1}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{day.2}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{day.3}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{day.4}{#5}% + \LocaleSetDialectAttribute{\@locale@dialect}{day.5}{#6}% + \LocaleSetDialectAttribute{\@locale@dialect}{day.6}{#7}% +} +\def\@locale@parse@shortweekdayblock#1{% + \@locale@parse@shortweekdays#1% remove outer group + \@locale@parse@monthblock +} +\def\@locale@parse@shortweekdays#1#2#3#4#5#6#7{% + \LocaleSetDialectAttribute{\@locale@dialect}{shortday.0}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortday.1}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortday.2}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortday.3}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortday.4}{#5}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortday.5}{#6}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortday.6}{#7}% +} +\def\@locale@parse@monthblock#1{% + \@locale@parse@months#1% remove outer group + \@locale@parse@shortmonthblock +} +\def\@locale@parse@months#1#2#3#4#5#6#7#8#9{% + \LocaleSetDialectAttribute{\@locale@dialect}{month.1}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{month.2}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{month.3}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{month.4}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{month.5}{#5}% + \LocaleSetDialectAttribute{\@locale@dialect}{month.6}{#6}% + \LocaleSetDialectAttribute{\@locale@dialect}{month.7}{#7}% + \LocaleSetDialectAttribute{\@locale@dialect}{month.8}{#8}% + \LocaleSetDialectAttribute{\@locale@dialect}{month.9}{#9}% + \@locale@parse@endmonths +} +\def\@locale@parse@endmonths#1#2#3{% + \LocaleSetDialectAttribute{\@locale@dialect}{month.10}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{month.11}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{month.12}{#3}% +} +\def\@locale@parse@shortmonthblock#1{% + \@locale@parse@shortmonths#1% remove outer group + \@locale@parse@standalone@weekdayblock +} +\def\@locale@parse@shortmonths#1#2#3#4#5#6#7#8#9{% + \LocaleSetDialectAttribute{\@locale@dialect}{shortmonth.1}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortmonth.2}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortmonth.3}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortmonth.4}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortmonth.5}{#5}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortmonth.6}{#6}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortmonth.7}{#7}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortmonth.8}{#8}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortmonth.9}{#9}% + \@locale@parse@endshortmonths +} +\def\@locale@parse@endshortmonths#1#2#3{% + \LocaleSetDialectAttribute{\@locale@dialect}{shortmonth.10}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortmonth.11}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{shortmonth.12}{#3}% +} +\def\@locale@parse@standalone@weekdayblock#1{% + \@locale@parse@standalone@weekdays#1% remove outer group + \@locale@parse@standalone@shortweekdayblock +} +\def\@locale@parse@standalone@weekdays#1#2#3#4#5#6#7{% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.day.0}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.day.1}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.day.2}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.day.3}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.day.4}{#5}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.day.5}{#6}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.day.6}{#7}% +} +\def\@locale@parse@standalone@shortweekdayblock#1{% + \@locale@parse@standalone@shortweekdays#1% remove outer group + \@locale@parse@standalone@monthblock +} +\def\@locale@parse@standalone@shortweekdays#1#2#3#4#5#6#7{% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortday.0}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortday.1}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortday.2}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortday.3}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortday.4}{#5}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortday.5}{#6}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortday.6}{#7}% +} +\def\@locale@parse@standalone@monthblock#1{% + \@locale@parse@standalone@months#1% remove outer group + \@locale@parse@standalone@shortmonthblock +} +\def\@locale@parse@standalone@months#1#2#3#4#5#6#7#8#9{% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.month.1}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.month.2}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.month.3}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.month.4}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.month.5}{#5}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.month.6}{#6}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.month.7}{#7}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.month.8}{#8}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.month.9}{#9}% + \@locale@parse@endstandalone@months +} +\def\@locale@parse@endstandalone@months#1#2#3{% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.month.10}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.month.11}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.month.12}{#3}% +} +\def\@locale@parse@standalone@shortmonthblock#1{% + \@locale@parse@standalone@shortmonths#1% remove outer group + \@locale@parse@numericblock +} +\def\@locale@parse@standalone@shortmonths#1#2#3#4#5#6#7#8#9{% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortmonth.1}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortmonth.2}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortmonth.3}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortmonth.4}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortmonth.5}{#5}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortmonth.6}{#6}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortmonth.7}{#7}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortmonth.8}{#8}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortmonth.9}{#9}% + \@locale@parse@endstandalone@shortmonths +} +\def\@locale@parse@endstandalone@shortmonths#1#2#3{% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortmonth.10}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortmonth.11}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{standalone.shortmonth.12}{#3}% +} +\def\@locale@parse@numericblock#1{% + \@locale@parse@numeric#1% remove outer group + \@locale@parse@numericfmtblock +} +\def\@locale@parse@numeric#1#2#3#4#5#6#7#8#9{% + \LocaleSetDialectAttribute{\@locale@dialect}{groupsep}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{decsep}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{exp}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{usesgroup}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{currency}{#5}% + \LocaleSetDialectAttribute{\@locale@dialect}{regionalcurrency}{#6}% + \LocaleSetDialectAttribute{\@locale@dialect}{currencysym}{#7}% + \LocaleSetDialectAttribute{\@locale@dialect}{currencytex}{#8}% + \LocaleSetDialectAttribute{\@locale@dialect}{currencysep}{#9}% + \LocaleProvideCurrencyAttribute{#6}{official}{#5}% + \LocaleProvideCurrencyAttribute{#6}{sym}{#7}% + \LocaleProvideCurrencyAttribute{#6}{tex}{#8}% + \LocaleAddToAttributeList{currencies}{official}{#5}% + \LocaleAddToAttributeList{currencies}{regional}{#6}% + \ifx\@locale@region\empty + \else + \LocaleProvideRegionAttribute{\@locale@region}{currency}{#6}% + \LocaleXpAddToCurrencyAttributeList{#5}{region}{\@locale@region}% + \LocaleIfSameDialectAttributeValues{\@locale@dialect}% + {regionalcurrency}{currency}% + {}% + {% + \LocaleXpAddToCurrencyAttributeList{#6}{region}{\@locale@region}% + }% + \fi + \@locale@parse@persym +} +\def\@locale@parse@persym#1#2{% + \LocaleSetDialectAttribute{\@locale@dialect}{percent}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{permill}{#2}% +} +\def\@locale@parse@numericfmtblock#1{% + \@locale@parse@numericfmt#1% remove outer group + \LocaleIfDateTimePatternsSupported + {\@locale@parse@timezones}% + {\@locale@parse@otherdata}% +} +\def\@locale@parse@numericfmt#1#2#3#4{% + \LocaleSetDialectAttribute{\@locale@dialect}{decfmt}{#1}% + \LocaleSetDialectAttribute{\@locale@dialect}{intfmt}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{curfmt}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{perfmt}{#4}% +} +\def\@locale@parse@timezones#1{% + \@locale@parse@timezonemap#1\relax + \@locale@parse@otherdata +} +\def\@locale@parse@timezonemap#1{% + \ifx\relax#1\relax + \let\@locale@next\relax + \else + \@locale@save@timezonemap#1% + \let\@locale@next\@locale@parse@timezonemap + \fi + \@locale@next +}% +\def\@locale@save@timezonemap#1#2#3#4#5{% + \LocaleSetDialectAttribute{\@locale@dialect}{timezone.#1.short}{#2}% + \LocaleSetDialectAttribute{\@locale@dialect}{timezone.#1.long}{#3}% + \LocaleSetDialectAttribute{\@locale@dialect}{timezone.#1.shortdst}{#4}% + \LocaleSetDialectAttribute{\@locale@dialect}{timezone.#1.longdst}{#5}% + \LocaleAddToAttributeList{timezone}{id}{#1}% +} +\def\@locale@endparse@result{} +\def\@locale@parse@otherdata#1{% + \ifx\@locale@endparse@result#1\relax + \let\@locale@next\relax + \else + \def\@locale@next{\@locale@parse@otherdata@localeblock#1}% + \fi + \@locale@next +} +\def\@locale@parse@otherdata@localeblock#1{% + \@locale@parse@otherdatalocaleblock#1% remove outer group + \@locale@parse@dateblock +} +\ifx\@locale@result\empty + \ifTeXOSQueryDryRun + \@locale@warn{Dry run mode on. No data provided by texosquery. Check + TeX's shell escape status}% + \else + \@locale@warn{No data provided by texosquery. Check + TeX's shell escape status and texosquery's setup}% + \fi + \def\LocaleOSname{}% + \def\LocaleOSversion{}% + \def\LocaleOSarch{}% + \def\LocaleNowStamp{}% + \def\LocaleOStag{}% + \def\LocaleOScodeset{}% + \def\LocaleFileMod{}% + \def\LocaleMain{}% + \def\LocaleMainDialect{}% + \def\LocaleMainRegion{}% + \def\LocaleDateTimeInfo{}% +\else + \expandafter\@locale@parse@result\@locale@result\@locale@endparse@result +\fi +\def\LocaleLanguageTag#1{% + \LocaleGetDialectAttribute{#1}{langtag}% +} +\def\LocaleLanguageName#1{% + \LocaleGetDialectAttribute{#1}{langname}% +} +\def\LocaleLanguageNativeName#1{% + \LocaleGetDialectAttribute{#1}{nativelangname}% +} +\def\LocaleRegionName#1{% + \LocaleGetDialectAttribute{#1}{regionname}% +} +\def\LocaleRegionNativeName#1{% + \LocaleGetDialectAttribute{#1}{nativeregionname}% +} +\def\LocaleVariantName#1{% + \LocaleGetDialectAttribute{#1}{variantname}% +} +\def\LocaleVariantNativeName#1{% + \LocaleGetDialectAttribute{#1}{nativevariantname}% +} +\def\LocaleFullDate#1{% + \localedatetimefmt{\LocaleGetDialectAttribute{#1}{fulldate}}% +} +\def\LocaleLongDate#1{% + \localedatetimefmt{\LocaleGetDialectAttribute{#1}{longdate}}% +} +\def\LocaleMediumDate#1{% + \localedatetimefmt{\LocaleGetDialectAttribute{#1}{meddate}}% +} +\def\LocaleShortDate#1{% + \localedatetimefmt{\LocaleGetDialectAttribute{#1}{shortdate}}% +} +\def\LocaleFirstDayIndex#1{% + \LocaleGetDialectAttributeOrDefValue{#1}{firstday}{-1}% +} +\def\dtmMondayIndex{0} +\def\dtmTuesdayIndex{1} +\def\dtmWednesdayIndex{2} +\def\dtmThursdayIndex{3} +\def\dtmFridayIndex{4} +\def\dtmSaturdayIndex{5} +\def\dtmSundayIndex{6} +\def\LocaleDayIndexFromZeroMonToOneSun#1{% + \ifcase#1 + 2% Monday 0 -> 2 + \or + 3% Tuesday 1 -> 3 + \or + 4% Wednesday 2 -> 4 + \or + 5% Thursday 3 -> 5 + \or + 6% Friday 4 -> 6 + \or + 7% Saturday 5 -> 7 + \or + 1% Sunday 6 -> 1 + \else + -1% invalid + \fi +} +\def\LocaleDayIndexFromZeroMonToOneMon#1{% + \ifcase#1 + 1% Monday 0 -> 1 + \or + 2% Tuesday 1 -> 2 + \or + 3% Wednesday 2 -> 3 + \or + 4% Thursday 3 -> 4 + \or + 5% Friday 4 -> 5 + \or + 6% Saturday 5 -> 6 + \or + 7% Sunday 6 -> 7 + \else + -1% invalid + \fi +} +\def\LocaleDayIndexFromOneSunToZeroMon#1{% + \ifcase#1 + % no 0 + \or + 6% Sunday 1 -> 6 + \or + 0% Monday 2 -> 0 + \or + 1% Tuesday 3 -> 1 + \or + 2% Wednesday 4 -> 2 + \or + 3% Thursday 5 -> 3 + \or + 4% Friday 6 -> 4 + \or + 5% Saturday 7 -> 5 + \else + -1% invalid + \fi +} +\def\LocaleDayIndexFromOneMonToZeroMon#1{% + \ifcase#1 + % no 0 + \or + 0% Monday 1 -> 0 + \or + 1% Tuesday 2 -> 1 + \or + 2% Wednesday 3 -> 2 + \or + 3% Thursday 4 -> 3 + \or + 4% Friday 5 -> 4 + \or + 5% Saturday 6 -> 5 + \or + 6% Sunday 7 -> 6 + \else + -1% invalid + \fi +} +\def\LocaleDayIndexFromRegion#1#2{% + \ifcase\LocaleFirstDayIndex{#1} + \LocaleDayIndexFromOneMonToZeroMon{#2}% + \or + \ifnum#2=7 % Monday + 0% + \else + #2% + \fi + \or + \ifcase#1 + % no 0 + \or + 2% Wednesday 1 -> 2 + \or + 3% Thursday 2 -> 3 + \or + 4% Friday 3 -> 4 + \or + 5% Saturday 4 -> 5 + \or + 6% Sunday 5 -> 6 + \or + 0% Monday 6 -> 0 + \or + 1% Tuesday 7 -> 1 + \else + -1% invalid + \fi + \or + \ifcase#1 + % no 0 + \or + 3% Thursday 1 -> 3 + \or + 4% Friday 2 -> 4 + \or + 5% Saturday 3 -> 5 + \or + 6% Sunday 4 -> 6 + \or + 0% Monday 5 -> 0 + \or + 1% Tuesday 6 -> 1 + \or + 2% Wednesday 7 -> 2 + \else + -1% invalid + \fi + \or + \ifcase#1 + % no 0 + \or + 4% Friday 1 -> 4 + \or + 5% Saturday 2 -> 5 + \or + 6% Sunday 3 -> 6 + \or + 0% Monday 4 -> 0 + \or + 1% Tuesday 5 -> 1 + \or + 2% Wednesday 6 -> 2 + \or + 3% Thursday 7 -> 3 + \else + -1% invalid + \fi + \or + \ifcase#1 + % no 0 + \or + 5% Saturday 1 -> 5 + \or + 6% Sunday 2 -> 6 + \or + 0% Monday 3 -> 0 + \or + 1% Tuesday 4 -> 1 + \or + 2% Wednesday 5 -> 2 + \or + 3% Thursday 6 -> 3 + \or + 4% Friday 7 -> 4 + \else + -1% invalid + \fi + \or + \LocaleDayIndexFromOneSunToZeroMon{#2}% + \else + #2% + \fi +} +\def\LocaleDayIndexToRegion#1#2{% + \ifcase\LocaleFirstDayIndex{#1} + \LocaleDayIndexFromZeroMonToOneMon{#2}% + \or + \ifnum#2=0 % Monday + 7% + \else + #2% + \fi + \or + \ifcase#1 + 6% Monday 0 -> 6 + \or + 7% Tuesday 1 -> 7 + \or + 1% Wednesday 2 -> 1 + \or + 2% Thursday 3 -> 2 + \or + 3% Friday 4 -> 3 + \or + 4% Saturday 5 -> 4 + \or + 5% Sunday 6 -> 5 + \else + -1% invalid + \fi + \or + \ifcase#1 + 5% Monday 0 -> 5 + \or + 6% Tuesday 1 -> 6 + \or + 7% Wednesday 2 -> 7 + \or + 1% Thursday 3 -> 1 + \or + 2% Friday 4 -> 2 + \or + 3% Saturday 5 -> 3 + \or + 4% Sunday 6 -> 4 + \else + -1% invalid + \fi + \or + \ifcase#1 + 4% Monday 0 -> 4 + \or + 5% Tuesday 1 -> 5 + \or + 6% Wednesday 2 -> 6 + \or + 7% Thursday 3 -> 7 + \or + 1% Friday 4 -> 1 + \or + 2% Saturday 5 -> 2 + \or + 3% Sunday 6 -> 3 + \else + -1% invalid + \fi + \or + \ifcase#1 + 3% Monday 0 -> 3 + \or + 4% Tuesday 1 -> 4 + \or + 5% Wednesday 2 -> 5 + \or + 6% Thursday 3 -> 6 + \or + 7% Friday 4 -> 7 + \or + 1% Saturday 5 -> 1 + \or + 2% Sunday 6 -> 2 + \else + -1% invalid + \fi + \or + \LocaleDayIndexFromZeroMonToOneSun{#2}% + \else + #2% + \fi +} +\def\LocaleFullTime#1{% + \localedatetimefmt{\LocaleGetDialectAttribute{#1}{fulltime}}% +} +\def\LocaleLongTime#1{% + \localedatetimefmt{\LocaleGetDialectAttribute{#1}{longtime}}% +} +\def\LocaleMediumTime#1{% + \localedatetimefmt{\LocaleGetDialectAttribute{#1}{medtime}}% +} +\def\LocaleShortTime#1{% + \localedatetimefmt{\LocaleGetDialectAttribute{#1}{shorttime}}% +} +\def\LocaleFullDateTime#1{% + \localedatetimefmt{\LocaleGetDialectAttribute{#1}{fulldatetime}}% +} +\def\LocaleLongDateTime#1{% + \localedatetimefmt{\LocaleGetDialectAttribute{#1}{longdatetime}}% +} +\def\LocaleMediumDateTime#1{% + \localedatetimefmt{\LocaleGetDialectAttribute{#1}{meddatetime}}% +} +\def\LocaleShortDateTime#1{% + \localedatetimefmt{\LocaleGetDialectAttribute{#1}{shortdatetime}}% +} +\def\LocaleDayName#1#2{% + \LocaleGetDialectAttribute{#1}{day.\number#2}% +} +\def\LocaleShortDayName#1#2{% + \LocaleGetDialectAttribute{#1}{shortday.\number#2}% +} +\def\LocaleMonthName#1#2{% + \LocaleGetDialectAttribute{#1}{month.\number#2}% +} +\def\LocaleShortMonthName#1#2{% + \LocaleGetDialectAttribute{#1}{shortmonth.\number#2}% +} +\def\LocaleStandaloneDayName#1#2{% + \LocaleGetDialectAttribute{#1}{standalone.day.\number#2}% +} +\def\LocaleStandaloneShortDayName#1#2{% + \LocaleGetDialectAttribute{#1}{standalone.shortday.\number#2}% +} +\def\LocaleStandaloneMonthName#1#2{% + \LocaleGetDialectAttribute{#1}{standalone.month.\number#2}% +} +\def\LocaleStandaloneShortMonthName#1#2{% + \LocaleGetDialectAttribute{#1}{standalone.shortmonth.\number#2}% +} +\def\LocaleNumericGroupSep#1{% + \LocaleGetDialectAttribute{#1}{groupsep}% +} +\def\LocaleNumericDecimalSep#1{% + \LocaleGetDialectAttribute{#1}{decsep}% +} +\def\LocaleNumericMonetarySep#1{% + \LocaleGetDialectAttribute{#1}{currencysep}% +} +\def\LocaleNumericExponent#1{% + \LocaleGetDialectAttribute{#1}{exp}% +} +\def\LocaleCurrencyLabel#1{% + \LocaleIfDialectAttributeEqCs{#1}{currency}{\@locale@unknown@currency}% + {% + \ifx\LocaleMainRegion\empty + \@locale@os@currencycode + \else + \LocaleGetDialectAttributeOrDefValue{\LocaleMainDialect}{currency}% + {\@locale@os@currencycode}% + \fi + }% + {\LocaleGetDialectAttribute{#1}{currency}}% +} +\def\LocaleCurrencyRegionalLabel#1{% + \LocaleIfDialectAttributeEqCs{#1}{regionalcurrency}% + {\@locale@unknown@currency}% + {% + \ifx\LocaleMainRegion\empty + \@locale@os@regionalcurrencycode + \else + \LocaleGetDialectAttributeOrDefValue{\LocaleMainDialect}{regionalcurrency}% + {\@locale@os@regionalcurrencycode}% + \fi + }% + {\LocaleGetDialectAttribute{#1}{regionalcurrency}}% +} +\def\LocaleCurrencySymbol#1{% + \LocaleIfDialectAttributeEqCs{#1}{currency}{\@locale@unknown@currency}% + {% + \ifx\LocaleMainRegion\empty + \ifx\@locale@os@currencysym\empty + \LocaleGetDialectAttribute{#1}{currencysym}% + \else + \@locale@os@currencysym + \fi + \else + \LocaleGetDialectAttributeOrDefValue{\LocaleMainDialect}{currencysym}% + {\LocaleGetDialectAttribute{#1}{currencysym}}% + \fi + }% + {% + \LocaleIfSameDialectAttributeValues{#1}% + {currency}{currencysym}% + {% + \LocaleGetCurrencyAttributeOrDefValue + {\LocaleGetDialectAttribute{#1}{currency}}{sym}% + {\LocaleGetDialectAttribute{#1}{currencysym}}% + }% + {% + \LocaleGetDialectAttribute{#1}{currencysym}% + }% + }% +} +\def\LocaleCurrencyTeXSymbol#1{% + \LocaleIfDialectAttributeEqCs{#1}{currency}{\@locale@unknown@currency}% + {% + \ifx\LocaleMainRegion\empty + \ifx\@locale@os@currencytex\empty + \LocaleGetDialectAttribute{#1}{currencytex}% + \else + \@locale@os@currencytex + \fi + \fi + }% + {% + \LocaleIfSameDialectAttributeValues{#1}% + {currency}{currencytex}% + {% + \LocaleGetCurrencyAttributeOrDefValue + {\LocaleGetDialectAttribute{#1}{currency}}{tex}% + {\LocaleGetDialectAttribute{#1}{currencytex}}% + }% + {% + \LocaleGetDialectAttribute{#1}{currencytex}% + }% + }% +} +\def\LocaleNumericPercent#1{% + \LocaleGetDialectAttribute{#1}{percent}% +} +\def\LocaleNumericPermill#1{% + \LocaleGetDialectAttribute{#1}{permill}% +} +\def\LocaleApplyDateTimePattern#1#2#3{% + \LocaleIfHasDialectNonEmptyAttribute{#1}{#2}% + {% + \ifx\empty#3\empty + \@locale@warn{No date-time data for pattern + (attribute `#2', dialect `#1')}% + \else + \localedatetimefmt + {\expandafter\texosqueryfmtdatetime + \csname locale@dialect@#2@#1\expandafter\endcsname#3}% + \fi + }% + {% + \@locale@warn{No date-time pattern attribute `#2' for dialect `#1'}% + }% +} +\LocaleIfDateTimePatternsSupported +{% + \def\texosqueryfmtpatMMM#1{% + \CurrentLocaleShortMonthName{#1}% + } + \def\texosqueryfmtpatMMMM#1{% + \CurrentLocaleMonthName{#1}% + } + \def\texosqueryfmtpatLLL#1{% + \CurrentLocaleStandaloneShortMonthName{#1}% + } + \def\texosqueryfmtpatLLLL#1{% + \CurrentLocaleStandaloneMonthName{#1}% + } + \def\texosqueryfmtpatEEE#1{% + \CurrentLocaleShortDayName{\LocaleDayIndexFromOneMonToZeroMon{#1}}% + } + \def\texosqueryfmtpatEEEE#1{% + \CurrentLocaleDayName{\LocaleDayIndexFromOneMonToZeroMon{#1}}% + } + \def\texosquerytimezonefmt#1{#1} + \def\texosqueryshorttimezone#1{% + \texosquerytimezonefmt + {\LocaleGetDialectAttribute{\CurrentTrackedDialect}{timezone.#1.short}}% + } + \def\texosqueryshortdstzone#1{% + \texosquerytimezonefmt + {\LocaleGetDialectAttribute{\CurrentTrackedDialect}{timezone.#1.shortdst}}% + } + \def\texosquerylongtimezone#1{% + \texosquerytimezonefmt + {\LocaleGetDialectAttribute{\CurrentTrackedDialect}{timezone.#1.long}}% + } + \def\texosquerylongdstzone#1{% + \texosquerytimezonefmt + {\LocaleGetDialectAttribute{\CurrentTrackedDialect}{timezone.#1.longdst}}% + } +} +{} +\def\texosquerypatfmtgroupsep{\CurrentLocaleNumericGroupSep} +\def\texosquerypatfmtdecsep{\CurrentLocaleDecimalSep} +\def\texosquerypatfmtcurdecsep{\CurrentLocaleMonetarySep} +\def\texosquerypatfmtexp{\CurrentLocaleExponent} +\def\texosquerypatfmtcurrencysign{\CurrentLocaleCurrency} +\def\texosquerypatfmtpercentsign{\CurrentLocalePercent} +\def\texosquerypatfmtpermillsign{\CurrentLocalePermill} +\def\LocaleIfNumericUsesGroup#1{% + \LocaleIfDialectAttributeEqNum{#1}{usesgroup}{1}% +} +\def\LocaleIfHasLanguageName#1{% + \LocaleIfHasDialectNonEmptyAttribute{#1}{langname}% +} +\def\LocaleIfHasRegionName#1{% + \LocaleIfHasDialectNonEmptyAttribute{#1}{regionname}% +} +\def\LocaleIfHasVariantName#1{% + \LocaleIfHasDialectNonEmptyAttribute{#1}{variantname}% +} +\ifx\@locale@postparse@hook\undefined +\else + \@locale@postparse@hook +\fi +\def\CurrentLocaleLanguageName{}% +\def\CurrentLocaleLanguageNativeName{}% +\def\CurrentLocaleRegionName{}% +\def\CurrentLocaleRegionNativeName{}% +\def\CurrentLocaleVariantName{}% +\def\CurrentLocaleVariantNativeName{}% +\def\CurrentLocaleFirstDayIndex{-1}% +\def\CurrentLocaleDayIndexFromRegion{-1}% +\def\CurrentLocaleDayName{}% +\def\CurrentLocaleShortDayName{}% +\def\CurrentLocaleStandaloneDayName{}% +\def\CurrentLocaleStandaloneShortDayName{}% +\def\CurrentLocaleMonthName{}% +\def\CurrentLocaleShortMonthName{}% +\def\CurrentLocaleStandaloneMonthName{}% +\def\CurrentLocaleStandaloneShortMonthName{}% +\def\CurrentLocaleFullDate{}% +\def\CurrentLocaleLongDate{}% +\def\CurrentLocaleMediumDate{}% +\def\CurrentLocaleShortDate{}% +\def\CurrentLocaleFullTime{}% +\def\CurrentLocaleLongTime{}% +\def\CurrentLocaleMediumTime{}% +\def\CurrentLocaleShortTime{}% +\def\CurrentLocaleFullDateTime{}% +\def\CurrentLocaleLongDateTime{}% +\def\CurrentLocaleMediumDateTime{}% +\def\CurrentLocaleShortDateTime{}% +\def\CurrentLocaleDate{}% +\def\CurrentLocaleTime{}% +\def\CurrentLocaleCurrency{}% +\def\CurrentLocaleNumericGroupSep{}% +\def\CurrentLocaleIfNumericUsesGroup{}% +\def\CurrentLocaleDecimalSep{}% +\def\CurrentLocaleMonetarySep{}% +\def\CurrentLocaleExponent{}% +\def\CurrentLocalePercent{}% +\def\CurrentLocalePermill{}% +\def\CurrentLocaleIntegerPattern{}% +\def\CurrentLocaleDecimalPattern{}% +\def\CurrentLocaleCurrencyPattern{}% +\def\CurrentLocalePercentPattern{}% +\def\CurrentLocaleApplyDateTimePattern{}% +\def\CurrentTrackedDialect{}% +\def\@locale@select#1{% + \SetCurrentTrackedDialect{#1}% + \def\CurrentLocaleLanguageName{\LocaleLanguageName{#1}}% + \def\CurrentLocaleLanguageNativeName{\LocaleLanguageNativeName{#1}}% + \def\CurrentLocaleRegionName{\LocaleRegionName{#1}}% + \def\CurrentLocaleRegionNativeName{\LocaleRegionNativeName{#1}}% + \def\CurrentLocaleVariantName{\LocaleVariantName{#1}}% + \def\CurrentLocaleVariantNativeName{\LocaleVariantNativeName{#1}}% + \def\CurrentLocaleFirstDayIndex{\LocaleFirstDayIndex{#1}}% + \def\CurrentLocaleDayIndexFromRegion{\LocaleDayIndexFromRegion{#1}}% + \def\CurrentLocaleDayName{\LocaleDayName{#1}}% + \def\CurrentLocaleShortDayName{\LocaleShortDayName{#1}}% + \def\CurrentLocaleStandaloneDayName{% + \LocaleStandaloneDayName{#1}}% + \def\CurrentLocaleStandaloneShortDayName{% + \LocaleStandaloneShortDayName{#1}}% + \def\CurrentLocaleMonthName{\LocaleMonthName{#1}}% + \def\CurrentLocaleShortMonthName{\LocaleShortMonthName{#1}}% + \def\CurrentLocaleStandaloneMonthName{% + \LocaleStandaloneMonthName{#1}}% + \def\CurrentLocaleStandaloneShortMonthName{% + \LocaleStandaloneShortMonthName{#1}}% + \def\CurrentLocaleFullDate{\LocaleFullDate{#1}}% + \def\CurrentLocaleLongDate{\LocaleLongDate{#1}}% + \def\CurrentLocaleMediumDate{\LocaleMediumDate{#1}}% + \def\CurrentLocaleShortDate{\LocaleShortDate{#1}}% + \def\CurrentLocaleFullTime{\LocaleFullTime{#1}}% + \def\CurrentLocaleLongTime{\LocaleLongTime{#1}}% + \def\CurrentLocaleMediumTime{\LocaleMediumTime{#1}}% + \def\CurrentLocaleShortTime{\LocaleShortTime{#1}}% + \def\CurrentLocaleFullDateTime{\LocaleFullDateTime{#1}}% + \def\CurrentLocaleLongDateTime{\LocaleLongDateTime{#1}}% + \def\CurrentLocaleMediumDateTime{\LocaleMediumDateTime{#1}}% + \def\CurrentLocaleShortDateTime{\LocaleShortDateTime{#1}}% + \def\CurrentLocaleDate{% + \localedatechoice + {\LocaleFullDate{#1}}% + {\LocaleLongDate{#1}}% + {\LocaleMediumDate{#1}}% + {\LocaleShortDate{#1}}% + }% + \def\CurrentLocaleTime{% + \localetimechoice + {\LocaleFullTime{#1}}% + {\LocaleLongTime{#1}}% + {\LocaleMediumTime{#1}}% + {\LocaleShortTime{#1}}% + }% + \def\CurrentLocaleCurrency{% + \localecurrchoice + {\LocaleCurrencyLabel{#1}}% + {\LocaleCurrencyRegionalLabel{#1}}% + {\LocaleCurrencySymbol{#1}}% + {\LocaleCurrencyTeXSymbol{#1}}% + }% + \def\CurrentLocaleNumericGroupSep{% + \LocaleNumericGroupSep{#1}% + }% + \def\CurrentLocaleIfNumericUsesGroup{% + \LocaleIfNumericUsesGroup{#1}% + }% + \def\CurrentLocaleDecimalSep{% + \LocaleNumericDecimalSep{#1}% + }% + \def\CurrentLocaleMonetarySep{% + \LocaleNumericMonetarySep{#1}% + }% + \def\CurrentLocaleExponent{% + \LocaleNumericExponent{#1}% + }% + \def\CurrentLocalePercent{% + \LocaleNumericPercent{#1}% + }% + \def\CurrentLocalePermill{% + \LocaleNumericPermill{#1}% + }% + \def\CurrentLocaleIntegerPattern{% + \LocaleGetDialectAttribute{#1}{intfmt}% + }% + \def\CurrentLocaleDecimalPattern{% + \LocaleGetDialectAttribute{#1}{decfmt}% + }% + \def\CurrentLocaleCurrencyPattern{% + \LocaleGetDialectAttribute{#1}{curfmt}% + }% + \def\CurrentLocalePercentPattern{% + \LocaleGetDialectAttribute{#1}{perfmt}% + }% + \def\CurrentLocaleApplyDateTimePattern{% + \LocaleApplyDateTimePattern{#1}% + }% +} +\ifx\localedatechoice\undefined + \def\localedatechoice#1#2#3#4{#2} +\fi +\ifx\localetimechoice\undefined + \def\localetimechoice#1#2#3#4{#3} +\fi +\ifx\localecurrchoice\undefined + \def\localecurrchoice#1#2#3#4{#2} +\fi +\def\CurrentLocaleDateTime{\CurrentLocaleDate\space\CurrentLocaleTime} +\def\localenumfmt#1#2{% + \@locale@decfmt#2\empty.0E0\relax + \ifnum\@locale@decfmt@int<0 + \let\@localenum@fmt\localenumfmtneg + \else + \ifnum\@locale@decfmt@int=0 + \ifnum\@locale@decfmt@frac=0 + \ifnum\@locale@decfmt@exp=0 + \let\@localenum@fmt\localenumfmtzero + \else + \let\@localenum@fmt\localenumfmtpos + \fi + \else + \let\@localenum@fmt\localenumfmtpos + \fi + \else + \let\@localenum@fmt\localenumfmtpos + \fi + \fi + \@localenum@fmt + {% + \texosqueryfmtnumber{#1}% + {\@locale@decfmt@int}% + {\@locale@decfmt@frac}% + {\@locale@decfmt@exp}% + }% +} +\def\localenumfmtpos#1{#1} +\def\localenumfmtneg#1{#1} +\def\localenumfmtzero#1{#1} +\def\localeint#1{% + \localenumfmt{\CurrentLocaleIntegerPattern}{#1}% +} +\def\localedec#1{% + \localenumfmt{\CurrentLocaleDecimalPattern}{#1}% +} +\def\localecur#1{% + \localenumfmt{\CurrentLocaleCurrencyPattern}{#1}% +} +\def\localeper#1{% + \localenumfmt{\CurrentLocalePercentPattern}{#1}% +} +\def\@locale@decfmt#1.#2E#3\relax{% + \@locale@decfmt@split#1E\empty\relax + \ifx\@locale@decfmt@exp\empty + \edef\@locale@decfmt@frac{\@locale@gobbleemptytorelax#2\empty\relax}% + \edef\@locale@decfmt@exp{\@locale@gobbleemptytorelax#3\empty\relax}% + \else + \def\@locale@decfmt@frac{0}% + \fi +} +\def\@locale@gobbleemptytorelax#1\empty#2\relax{#1} +\def\@locale@decfmt@split#1E#2\empty#3\relax{% + \edef\@locale@decfmt@int{\@locale@gobbleemptytorelax#1\empty\relax}% + \edef\@locale@decfmt@exp{\@locale@gobbleemptytorelax#2\empty\relax}% +} +\ForEachTrackedDialect{\locale@this@dialect}{% + \SetCurrentTrackedDialect{\locale@this@dialect}% + \expandafter\@TrackLangAddToHook\expandafter + {\expandafter\@locale@select\expandafter{\locale@this@dialect}} + {captions}% +} +\def\selectlocale#1{% + \ifx\selectlanguage\undefined + \IfTrackedDialect{#1}% + {\@locale@select{#1}}% + {% + \LocaleIfHasAttribute{#1}{tagtodialect} + {% + \edef\@locale@dialect{\LocaleGetAttribute{#1}{tagtodialect}}% + \expandafter\@locale@select\expandafter{\@locale@dialect}% + }% + {% + \ifTeXOSQueryDryRun + \@locale@warn{Unknown locale `#1'}% + \else + \@locale@err{Unknown locale `#1'}% + {The argument to \string\selectlocale\space must be either a + tracklang dialect label or a tracked dialect language tag}% + \fi + }% + }% + \else + \IfTrackedDialect{#1}% + {% + \@locale@select@dialect{#1}% + }% + {% + \LocaleIfHasAttribute{#1}{tagtodialect} + {\@locale@select@dialect{\LocaleGetAttribute{#1}{tagtodialect}}}% + {% + \ifTeXOSQueryDryRun + \@locale@warn{Unknown locale `#1'}% + \else + \@locale@err{Unknown locale `#1'}% + {The argument to \string\selectlocale\space must be either a + tracklang dialect label or a tracked dialect language tag}% + \fi + }% + }% + \fi +} +\def\@locale@select@dialect#1{% + \IfTrackedDialectHasMapping{#1}% + {\edef\@locale@dialect{\GetTrackedDialectToMapping{#1}}}% + {\edef\@locale@dialect{#1}}% + \@tracklang@ifundef{date\@locale@dialect}% + {% + \edef\@locale@dialect{\TrackedLanguageFromDialect{#1}}% + \@tracklang@ifundef{date\@locale@dialect}% + {% + \@locale@warn{Can't determine correct label for + \string\selectlanguage\space from tracklang dialect `#1'}% + \SetCurrentTrackedDialect{#1}% + }% + {\expandafter\selectlanguage\expandafter{\@locale@dialect}}% + }% + {\expandafter\selectlanguage\expandafter{\@locale@dialect}}% +} +\ifx\LocaleMainDialect\empty +\else + \expandafter\@locale@select\expandafter{\LocaleMainDialect} +\fi +\@locale@restore@at + +\endinput +%% +%% End of file `tex-locale.tex'. diff --git a/Master/texmf-dist/tex/latex/tex-locale/tex-locale-encodings.def b/Master/texmf-dist/tex/latex/tex-locale/tex-locale-encodings.def new file mode 100644 index 00000000000..3e7931bfe0e --- /dev/null +++ b/Master/texmf-dist/tex/latex/tex-locale/tex-locale-encodings.def @@ -0,0 +1,66 @@ +%% +%% This is file `tex-locale-encodings.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tex-locale.dtx (with options: `tex-locale-encodings.def,package') +%% +%% tex-locale.dtx +%% Copyright 2018 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files tex-locale.dtx and tex-locale.ins and the derived files tex-locale.sty, tex-locale.tex, tex-locale-scripts-enc.def, tex-locale-encodings.def, tex-locale-support.def. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% arara: xetex: {shell: on} +%% arara: xetex: {shell: on} +\def\@locale@newencmap#1#2{% + \@tracklang@namedef{@locale@encmap@#1}{#2}} +\def\@locale@ifhasencmap#1#2#3{% + \@tracklang@ifundef{@locale@encmap@#1}{#3}{#2}} +\def\@locale@getencmap#1{% + \@tracklang@nameuse{@locale@encmap@#1}} +\@locale@newencmap{iso88591}{latin1} +\@locale@newencmap{iso88592}{latin2} +\@locale@newencmap{iso88593}{latin3} +\@locale@newencmap{iso88594}{latin4} +\@locale@newencmap{iso88595}{latin5} +\@locale@newencmap{iso88599}{latin9} +\@locale@newencmap{windows1250}{cp1250} +\@locale@newencmap{windows1252}{cp1252} +\@locale@newencmap{windows1257}{cp1257} +\@locale@newencmap{ibm850}{cp850} +\@locale@newencmap{ibm852}{cp852} +\@locale@newencmap{ibm437}{cp437} +\@locale@newencmap{ibm865}{cp865} +\@locale@newencmap{usascii}{ascii} +\@locale@newencmap{xmaccentraleurope}{macce} +\endinput +%% +%% End of file `tex-locale-encodings.def'. diff --git a/Master/texmf-dist/tex/latex/tex-locale/tex-locale-scripts-enc.def b/Master/texmf-dist/tex/latex/tex-locale/tex-locale-scripts-enc.def new file mode 100644 index 00000000000..2e0cdf1a1d1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tex-locale/tex-locale-scripts-enc.def @@ -0,0 +1,79 @@ +%% +%% This is file `tex-locale-scripts-enc.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tex-locale.dtx (with options: `tex-locale-scripts-enc.def,package') +%% +%% tex-locale.dtx +%% Copyright 2018 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files tex-locale.dtx and tex-locale.ins and the derived files tex-locale.sty, tex-locale.tex, tex-locale-scripts-enc.def, tex-locale-encodings.def, tex-locale-support.def. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% arara: xetex: {shell: on} +%% arara: xetex: {shell: on} +\def\@locale@scriptenc@map#1#2{% + \@tracklang@namedef{@locale@scriptenc@map@#1}{#2}% +} +\def\@locale@get@scriptenc@map#1{% + \@tracklang@ifundef{@locale@scriptenc@map@#1}% + {}% + {\csname @locale@scriptenc@map@#1\endcsname}% +} +\def\@locale@if@scriptenc@map#1#2#3{% + \@tracklang@ifundef{@locale@scriptenc@map@#1}% + {#3}% false + {#2}% true +} +\def\@locale@langenc@map#1#2{% + \@tracklang@namedef{@locale@langenc@map@#1}{#2}% +} +\def\@locale@if@langenc@map#1#2#3{% + \@tracklang@ifundef{@locale@langenc@map@#1}% + {#3}% false + {#2}% true +} +\def\@locale@get@langenc@map#1{% + \@tracklang@ifundef{@locale@langenc@map@#1}% + {}% + {\csname @locale@langenc@map@#1\endcsname}% +} +\@locale@scriptenc@map{Latn}{T1} +\@locale@scriptenc@map{Latf}{T1} +\@locale@scriptenc@map{Latg}{T1} +\@locale@scriptenc@map{Cyrl}{T2A,T2B,T2C} +\@locale@langenc@map{vietnamese}{T5} +\@locale@langenc@map{polish}{OT4} +\@locale@langenc@map{armenian}{OT6} +\@locale@langenc@map{greek}{LGR} +\endinput +%% +%% End of file `tex-locale-scripts-enc.def'. diff --git a/Master/texmf-dist/tex/latex/tex-locale/tex-locale-support.def b/Master/texmf-dist/tex/latex/tex-locale/tex-locale-support.def new file mode 100644 index 00000000000..2a8ab8c192c --- /dev/null +++ b/Master/texmf-dist/tex/latex/tex-locale/tex-locale-support.def @@ -0,0 +1,308 @@ +%% +%% This is file `tex-locale-support.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tex-locale.dtx (with options: `tex-locale-support.def,package') +%% +%% tex-locale.dtx +%% Copyright 2018 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files tex-locale.dtx and tex-locale.ins and the derived files tex-locale.sty, tex-locale.tex, tex-locale-scripts-enc.def, tex-locale-encodings.def, tex-locale-support.def. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% arara: xetex: {shell: on} +%% arara: xetex: {shell: on} +\@locale@ifsupportbabelorpoly +{} +{% + \def\@locale@providemap#1#2{% + \IfTrackedDialectHasMapping{#1}% + {}% + {\SetTrackedDialectLabelMap{#1}{#2}}% + }% + \@locale@providemap{bahasa}{bahasa}% + \@locale@providemap{indonesian}{indonesian}% + \@locale@providemap{indon}{indon}% + \@locale@providemap{bahasam}{bahasam}% + \@locale@providemap{malay}{malay}% + \@locale@providemap{melayu}{melayu}% + \@locale@providemap{USenglish}{USenglish}% + \@locale@providemap{american}{american}% + \@locale@providemap{UKenglish}{UKenglish}% + \@locale@providemap{british}{british}% + \@locale@providemap{canadian}{canadian}% + \@locale@providemap{australian}{australian}% + \@locale@providemap{newzealand}{newzealand}% + \@locale@providemap{francais}{francais}% + \@locale@providemap{canadien}{canadien}% + \@locale@providemap{acadian}{acadian}% + \@locale@providemap{austrian}{austrian}% + \@locale@providemap{germanb}{germanb}% + \@locale@providemap{ngerman}{ngerman}% + \@locale@providemap{naustrian}{naustrian}% + \@locale@providemap{nswissgerman}{nswissgerman}% + \@locale@providemap{swissgerman}{swissgerman}% + \@locale@providemap{polutonikogreek}{greek}% + \@locale@providemap{nynorsk}{nynorsk}% + \@locale@providemap{portuguese}{portuguese}% + \@locale@providemap{brazilian}{brazilian}% + \@locale@providemap{brazil}{brazil}% + \def\@locale@bbl@options{}% + \ForEachTrackedDialect{\this@dialect}% + {% + \edef\this@root@lang{% + \TrackedLanguageFromDialect{\this@dialect}}% + \IfFileExists{\this@root@lang.ldf} + {% + \ifdefstring{\this@root@lang}{serbian}% + {% + \@locale@loadscripts + \IfTrackedDialectIsScriptCs{\this@dialect}% + {\TrackLangScriptLatn}% + {\def\locale@bbl@dialect{serbian}}% + {\def\locale@bbl@dialect{serbianc}}% + }% + {% + \IfFileExists{\this@dialect.ldf}% + {% + \let\locale@bbl@dialect\this@dialect + }% + {% + \IfTrackedDialectHasMapping{\this@dialect}% + {% + \edef\locale@bbl@dialect{% + \GetTrackedDialectToMapping{\this@dialect}}% + }% + {% + \let\locale@bbl@dialect\this@root@lang + }% + }% + }% + \SetTrackedDialectLabelMap{\this@dialect}{\locale@bbl@dialect}% + \ifx\this@dialect\LocaleMainDialect + \ifx\@locale@bbl@options\empty + \edef\@locale@bbl@options{main=\locale@bbl@dialect}% + \else + \edef\@locale@bbl@options{\@locale@bbl@options,% + main=\locale@bbl@dialect}% + \fi + \else + \ifx\@locale@bbl@options\empty + \edef\@locale@bbl@options{\locale@bbl@dialect}% + \else + \edef\@locale@bbl@options{\@locale@bbl@options,% + \locale@bbl@dialect}% + \fi + \fi + }% + {}% + }% + \ifx\@locale@bbl@options\@empty + \ifTeXOSQueryDryRun + \@locale@err{Can't determine `babel' package + options\MessageBreak (texosquery's dry run mode is on)}{} + \else + \@locale@err{Can't determine `babel' package + options (perhaps the shell escape failed, check + `\jobname.log')}{} + \fi + \else + \expandafter\PassOptionsToPackage\expandafter + {\@locale@bbl@options}{babel} + \RequirePackage{babel}% + \fi +}% +{% + \def\@set@locale@poly@map@script#1#2#3{% + \@tracklang@namedef{@local@poly@map@script@#1@#2}{#3}% + } + \def\@if@locale@poly@map@script#1#2#3#4{% + \@tracklang@ifundef{@local@poly@map@script@#1@#2}{#4}{#3}% + } + \def\@get@locale@poly@map@script#1#2{% + \@tracklang@nameuse{@local@poly@map@script@#1@#2}% + } + \def\@set@locale@poly@map@region#1#2#3{% + \@tracklang@namedef{@local@poly@map@region@#1@#2}{#3}% + } + \def\@if@locale@poly@map@region#1#2#3#4{% + \@tracklang@ifundef{@local@poly@map@region@#1@#2}{#4}{#3}% + } + \def\@get@locale@poly@map@region#1#2{% + \@tracklang@nameuse{@local@poly@map@region@#1@#2}% + } + \def\@set@locale@poly@map@variant#1#2#3{% + \@tracklang@namedef{@local@poly@map@variant@#1@#2}{#3}% + } + \def\@if@locale@poly@map@variant#1#2#3#4{% + \@tracklang@ifundef{@local@poly@map@variant@#1@#2}{#4}{#3}% + } + \def\@get@locale@poly@map@variant#1#2{% + \@tracklang@nameuse{@local@poly@map@variant@#1@#2}% + } + \def\@set@locale@poly@map@sublang#1#2#3{% + \@tracklang@namedef{@local@poly@map@sublang@#1@#2}{#3}% + } + \def\@if@locale@poly@map@sublang#1#2#3#4{% + \@tracklang@ifundef{@local@poly@map@sublang@#1@#2}{#4}{#3}% + } + \def\@get@locale@poly@map@sublang#1#2{% + \@tracklang@nameuse{@local@poly@map@sublang@#1@#2}% + } + \@set@locale@poly@map@region{arabic}{IQ}{locale=mashriq} + \@set@locale@poly@map@region{arabic}{SY}{locale=mashriq} + \@set@locale@poly@map@region{arabic}{JO}{locale=mashriq} + \@set@locale@poly@map@region{arabic}{LB}{locale=mashriq} + \@set@locale@poly@map@region{arabic}{PS}{locale=mashriq} + \@set@locale@poly@map@region{arabic}{LY}{locale=libya} + \@set@locale@poly@map@region{arabic}{DZ}{locale=algeria} + \@set@locale@poly@map@region{arabic}{TN}{locale=tunisia} + \@set@locale@poly@map@region{arabic}{MA}{locale=morocco} + \@set@locale@poly@map@region{arabic}{MR}{locale=mauritania} + \@set@locale@poly@map@variant{arabic}{islamic}{calendar=islamic} + \@set@locale@poly@map@variant{arabic}{maghrib}{numerals=maghrib} + \@set@locale@poly@map@variant{arabic}{abjad}{abjadjimnotail} + \@set@locale@poly@map@variant{bengali}{western}{numerals=Western} + \@set@locale@poly@map@variant{bengali}{devanagari}{numerals=Devanagari} + \@set@locale@poly@map@variant{bengali}{bengali}{numerals=Bengali} + \@set@locale@poly@map@region{english}{US}{variant=us} + \@set@locale@poly@map@region{english}{GB}{variant=uk} + \@set@locale@poly@map@region{english}{AU}{variant=australian} + \@set@locale@poly@map@region{english}{NZ}{variant=newzealand} + \@set@locale@poly@map@variant{farsi}{western}{numerals=western} + \@set@locale@poly@map@variant{farsi}{eastern}{numerals=eastern} + \@set@locale@poly@map@region{german}{DE}{variant=german} + \@set@locale@poly@map@region{german}{AU}{variant=austrian} + \@set@locale@poly@map@region{german}{CH}{variant=swiss} + \@set@locale@poly@map@variant{german}{1996}{spelling=new} + \@set@locale@poly@map@variant{german}{1901}{spelling=old} + \@set@locale@poly@map@script{german}{Latf}{script=fraktur} + \@set@locale@poly@map@variant{greek}{monoton}{variant=monotonic} + \@set@locale@poly@map@variant{greek}{polyton}{variant=polytonic} + \@set@locale@poly@map@variant{greek}{ancient}{variant=ancient} + \@set@locale@poly@map@variant{greek}{arabic}{numerals=arabic} + \@set@locale@poly@map@variant{hebrew}{arabic}{numerals=arabic} + \@set@locale@poly@map@variant{hebrew}{gregorian}{calendar=gregorian} + \@set@locale@poly@map@variant{hindi}{western}{numerals=Western} + \@set@locale@poly@map@variant{hindi}{devanagari}{numerals=Devanagari} + \@set@locale@poly@map@variant{latin}{classic}{variant=classic} + \@set@locale@poly@map@variant{latin}{modern}{variant=modern} + \@set@locale@poly@map@variant{latin}{medieval}{variant=medieval} + \@set@locale@poly@map@sublang{russian}{orv}{spelling=old} + \@set@locale@poly@map@variant{russian}{luna1918}{spelling=new} + \@set@locale@poly@map@script{serbian}{Latn}{script=Latin} + \@set@locale@poly@map@script{serbian}{Cyrl}{script=Cyrillic} + \@set@locale@poly@map@variant{syriac}{western}{numerals=western} + \@set@locale@poly@map@variant{syriac}{eastern}{numerals=eastern} + \RequirePackage{polyglossia} + \ForEachTrackedDialect{\this@dialect}% + {% + \edef\this@root@lang{% + \TrackedLanguageFromDialect{\this@dialect}}% + \edef\this@sublang{% + \GetTrackedDialectSubLang{\this@dialect}}% + \edef\this@region{% + \TrackedIsoCodeFromLanguage{3166-1}{\this@dialect}}% + \edef\this@script{% + \GetTrackedDialectScript{\this@dialect}}% + \edef\this@variant{% + \GetTrackedDialectVariant{\this@dialect}}% + \def\@locale@poly@options{}% + \ifx\this@script\empty + \else + \@if@locale@poly@map@script{\this@root@lang}{\this@script}% + {% + \edef\@locale@poly@options{% + \@get@locale@poly@map@script + {\this@root@lang}{\this@script}}% + }% + {}% + \fi + \ifx\this@region\empty + \else + \@if@locale@poly@map@region{\this@root@lang}{\this@region}% + {% + \ifx\@locale@poly@options\empty + \edef\@locale@poly@options{% + \@get@locale@poly@map@region{\this@root@lang}{\this@region}}% + \else + \edef\@locale@poly@options{\@locale@poly@options,% + \@get@locale@poly@map@region{\this@root@lang}{\this@region}}% + \fi + }% + {}% + \fi + \ifx\this@sublang\empty + \else + \@if@locale@poly@map@sublang{\this@root@lang}{\this@sublang}% + {% + \ifx\@locale@poly@options\empty + \edef\@locale@poly@options{% + \@get@locale@poly@map@sublang + {\this@root@lang}{\this@sublang}}% + \else + \edef\@locale@poly@options{\@locale@poly@options,% + \@get@locale@poly@map@sublang + {\this@root@lang}{\this@sublang}}% + \fi + }% + {}% + \fi + \ifx\this@subvariant\empty + \else + \@if@locale@poly@map@variant{\this@root@lang}{\this@variant}% + {% + \ifx\@locale@poly@options\empty + \edef\@locale@poly@options{% + \@get@locale@poly@map@variant + {\this@root@lang}{\this@variant}}% + \else + \edef\@locale@poly@options{\@locale@poly@options,% + \@get@locale@poly@map@variant + {\this@root@lang}{\this@variant}}% + \fi + }% + {}% + \fi + \ifx\this@dialect\LocaleMainDialect + \edef\@locale@tmp{\noexpand\setmainlanguage + [\@locale@poly@options]{\this@root@lang}}% + \else + \edef\@locale@tmp{\noexpand\setotherlanguage + [\@locale@poly@options]{\this@root@lang}}% + \fi + \@locale@tmp + }% + \def\localenopolypunct{\@locale@nopolypunct}% +} +\endinput +%% +%% End of file `tex-locale-support.def'. diff --git a/Master/texmf-dist/tex/latex/tex-locale/tex-locale.sty b/Master/texmf-dist/tex/latex/tex-locale/tex-locale.sty new file mode 100644 index 00000000000..10bcb55eb6c --- /dev/null +++ b/Master/texmf-dist/tex/latex/tex-locale/tex-locale.sty @@ -0,0 +1,640 @@ +%% +%% This is file `tex-locale.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% tex-locale.dtx (with options: `tex-locale.sty,package') +%% +%% tex-locale.dtx +%% Copyright 2018 Nicola Talbot +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Nicola Talbot. +%% +%% This work consists of the files tex-locale.dtx and tex-locale.ins and the derived files tex-locale.sty, tex-locale.tex, tex-locale-scripts-enc.def, tex-locale-encodings.def, tex-locale-support.def. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% arara: xetex: {shell: on} +%% arara: xetex: {shell: on} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{tex-locale}[2018/08/26 v1.0 (NLCT) localisation support] +\RequirePackage{etoolbox} +\RequirePackage{xfor} +\RequirePackage{tracklang}[2016/11/03] +\AnyTrackedLanguages +{% + \ForEachTrackedDialect{\locale@this@dialect} + { + \ifx\LocaleMain\undefined + \edef\LocaleMain{\GetTrackedLanguageTag{\locale@this@dialect}} + \let\@locale@trackedmain\LocaleMain + \else + \ifx\LocaleOther\undefined + \edef\LocaleOther{\GetTrackedLanguageTag{\locale@this@dialect}} + \else + \edef\LocaleOther{\LocaleOther,\GetTrackedLanguageTag{\locale@this@dialect}} + \fi + \fi + } +} +{} +\RequirePackage{ifxetex} +\RequirePackage{ifluatex} +\ifxetex + \newcommand*{\@locale@ifxeorlua}[2]{#1} +\else + \ifluatex + \newcommand*{\@locale@ifxeorlua}[2]{#1} + \else + \newcommand*{\@locale@ifxeorlua}[2]{#2} + \fi +\fi +\RequirePackage{xkeyval} +\newcommand*{\@locale@declareoption}[2]{% + \DeclareOptionX{#1}{#2}% + \DeclareOption{#1}{#2}% +} +\define@key{tex-locale.sty}{main}{% + \ifx\@locale@trackedmain\undefined + \else + \ifx\LocaleOther\undefined + \let\LocaleOther\@locale@trackedmain + \else + \edef\LocaleOther{\@locale@trackedmain,\LocaleOther}% + \fi + \let\@locale@trackedmain\undefined + \fi + \def\LocaleMain{#1}% +} +\define@key{tex-locale.sty}{other}{% + \ifx\LocaleOther\undefined + \def\LocaleOther{#1}% + \else + \edef\LocaleOther{\LocaleOther,#1}% + \fi +} +\@locale@ifxeorlua{\def\@locale@symbols{none}}{\def\@locale@symbols{textcomp}} +\define@key{tex-locale.sty}{symbols}{\def\@locale@symbols{#1}} +\newcount\@locale@supportopt +\@ifpackageloaded{polyglossia} +{\@locale@supportopt=0\relax} +{ + \@ifpackageloaded{babel} + {\@locale@supportopt=0\relax} + { + \@ifpackageloaded{CJK} + {\@locale@supportopt=0\relax} + {\@locale@supportopt=1\relax} + } +} +\define@choicekey{tex-locale.sty}{support}% + [\@locale@support@val\@locale@support@nr]% + {none,auto,babel,polyglossia,cjk} +{\@locale@supportopt=\@locale@support@nr\relax} +\define@boolkey{tex-locale.sty}[@locale@]{fontspec}[true]{} +\@locale@ifxeorlua{\@locale@fontspectrue}{\@locale@fontspecfalse} +\define@key{tex-locale.sty}{fontenc}{% + \edef\@locale@fontenc{#1}% + \ifdefstring{\@locale@fontenc}{false}{\def\@locale@fontenc{none}}{}% +} +\@ifpackageloaded{fontenc} +{\def\@locale@fontenc{none}} +{\def\@locale@fontenc{auto}} +\define@key{tex-locale.sty}{inputenc}{% + \edef\@locale@inputenc{#1}% + \ifdefstring{\@locale@inputenc}{false}{\def\@locale@inputenc{none}}{}% +} +\@ifpackageloaded{inputenc} +{\def\@locale@inputenc{none}} +{\def\@locale@inputenc{auto}} +\@ifpackageloaded{datetime2} +{ + \newcommand\@locale@load@dtm{} +} +{ + \newcommand\@locale@load@dtm{% + \IfFileExists{datetime2.sty}% + {\@locale@load@regional@dtm}% + {\@locale@set@today}% + }% +} +\newcommand\@locale@load@regional@dtm{% + \localedatechoice + {%full + \PassOptionsToPackage{showdow}{datetime2}% + \PassOptionsToPackage{useregional=text}{datetime2}% + }% + {%long + \PassOptionsToPackage{useregional=text}{datetime2}% + }% + {%medium + \PassOptionsToPackage{useregional=text}{datetime2}% + }% + {%short + \PassOptionsToPackage{useregional=numeric}{datetime2}% + }% + \RequirePackage{datetime2}% + \localedatechoice{}{}{\DTMlangsetup*{abbr}}{}% +}% +\newcommand*{\@locale@set@today}{% + \ifdefempty\CurrentLocaleDate + {}% + {% + \renewcommand{\today}{\CurrentLocaleDate}% + \ForEachTrackedDialect{\locale@this@dialect} + {% + \SetCurrentTrackedDialect{\locale@this@dialect}% + \@TrackLangAddToHook + {\renewcommand{\today}{\CurrentLocaleDate}} + {date}% + }% + }% +} +\define@choicekey{tex-locale.sty}{datetime}% + [\@locale@datetime@val\@locale@datetime@nr]% + {false,iso,text,num,numeric,locale} +{% + \ifcase\@locale@datetime@nr + \def\@locale@load@dtm{}% + \or + \def\@locale@load@dtm{% + \PassOptionsToPackage{useregional=false}{datetime2}% + \RequirePackage{datetime2}% + \DTMsetstyle{iso}% + }% + \or + \def\@locale@load@dtm{% + \@locale@load@regional@dtm + }% + \or + \def\@locale@load@dtm{% + \PassOptionsToPackage{useregional=numeric}{datetime2}% + \RequirePackage{datetime2}% + }% + \or + \def\@locale@load@dtm{% + \PassOptionsToPackage{useregional=numeric}{datetime2}% + \RequirePackage{datetime2}% + }% + \or + \def\@locale@load@dtm{\@locale@set@today}% + \fi +} +\@locale@declareoption{iso}{% + \def\@locale@load@dtm{% + \PassOptionsToPackage{useregional=false}{datetime2}% + \RequirePackage{datetime2}% + \DTMsetstyle{iso}% + }% +} +\define@choicekey{tex-locale.sty}{date}% +[\@locale@date@val\@locale@date@nr]{full,long,medium,short} +{% + \ifcase\@locale@date@nr + \def\localedatechoice##1##2##3##4{##1}% + \or + \def\localedatechoice##1##2##3##4{##2}% + \or + \def\localedatechoice##1##2##3##4{##3}% + \or + \def\localedatechoice##1##2##3##4{##4}% + \fi +} +\newcommand*{\localedatechoice}[4]{#2}% +\define@choicekey{tex-locale.sty}{time}% +[\@locale@time@val\@locale@time@nr]{full,long,medium,short} +{% + \ifcase\@locale@time@nr + \def\localetimechoice##1##2##3##4{##1}% + \or + \def\localetimechoice##1##2##3##4{##2}% + \or + \def\localetimechoice##1##2##3##4{##3}% + \or + \def\localetimechoice##1##2##3##4{##4}% + \fi +} +\newcommand*{\localetimechoice}[4]{#3}% +\define@choicekey{tex-locale.sty}{timedata}% +[\@locale@timedata@val\@locale@timedata@nr]{true,false}[true] +{% + \ifcase\@locale@timedata@nr + \def\LocaleIfDateTimePatternsSupported##1##2{##1}% + \or + \def\LocaleIfDateTimePatternsSupported##1##2{##2}% + \fi +} +\define@choicekey{tex-locale.sty}{currency}% +[\@locale@currency@val\@locale@currency@nr]% +{official,unofficial,sym,tex} +{% + \ifcase\@locale@currency@nr + \def\localecurrchoice##1##2##3##4{##1}% + \or + \def\localecurrchoice##1##2##3##4{##2}% + \or + \def\localecurrchoice##1##2##3##4{##3}% + \or + \def\localecurrchoice##1##2##3##4{##4}% + \fi +} +\@locale@ifxeorlua + {\newcommand*{\localecurrchoice}[4]{#3}} + {\newcommand*{\localecurrchoice}[4]{#4}} +\@for\CurrentOption:=\@declaredoptions\do{% + \ifx\CurrentOption\@empty + \else + \@expandtwoargs + \in@{,\CurrentOption,}{,\@classoptionslist,\@curroptions,}% + \ifin@ + \@use@ption + \expandafter\let\csname ds@\CurrentOption\endcsname\@empty + \fi + \fi +} +\ProcessOptionsX +\@ifpackageloaded{babel} +{% + \@locale@supportopt=0\relax +} +{} +\ifx\LocaleMain\undefined + \def\LocaleMain{locale} +\fi +\ifx\LocaleOther\undefined + \def\LocaleOther{} +\fi +\newcommand*{\@locale@postparse@hook}{% + \input{tex-locale-support.def}% +} +\ifdefstring{\@locale@symbols}{none} +{} +{\RequirePackage{\@locale@symbols}} +\RequirePackage{texosquery} +\newcommand\@locale@trackall{% + \ifdefstring\LocaleMain{locale}% + {% + \ifx\LocaleOStag\empty + \PackageWarning{tex-locale}{Unable to determine locale + (check shell escape)}% + \else + \TrackLanguageTag{\LocaleOStag}% + \fi + }% + {\TrackLanguageTag{\LocaleMain}}% + \@for\locale@this@dialect:=\LocaleOther\do{% + \ifdefstring\locale@this@dialect{locale} + {% + \ifx\LocaleOStag\empty + \PackageWarning{tex-locale}{Unable to determine locale + (check shell escape)}% + \else + \TrackLanguageTag{\LocaleOStag}% + \fi + }% + {\TrackLanguageTag{\locale@this@dialect}}% + }% + \let\@locale@trackall\relax +} +\newcommand{\@locale@loadinputenc}{} +\newcommand*\@locale@pre@query@params{}% +\newcommand*\@locale@pre@query@parsetag{% + \ifx\LocaleStyQueryFile\undefined + \TeXOSQuery{\@locale@result}{\@locale@pre@query@params}% + \else + \ifx\LocaleStyQueryFile\empty + \TeXOSQuery{\@locale@result}{\@locale@pre@query@params}% + \else + \ifx\TeXOSQueryFromFile\undefined + \PackageError{locale}{texosquery too old to support + \string\LocaleStyQueryFile. At least v1.4 required} + {You need to update your version of texosquery} + \def\@locale@result{}% + \else + \PackageInfo{locale}{Fetching query results from `\LocaleStyQueryFile'}% + \TeXOSQueryFromFile{\@locale@result}{\LocaleStyQueryFile}% + \fi + \fi + \fi + \edef\LocaleOStag{\@locale@result}% +}% +\newcommand*\@locale@pre@query@parsecodeset{% + \TeXOSQuery{\@locale@result}{\@locale@pre@query@params}% + \edef\LocaleOScodeset{\@locale@result}% +}% +\newcommand*\@locale@pre@query@parsetagcodeset{% + \def\LocaleOStag{}% + \def\LocaleOScodeset{}% + \TeXOSQuery{\@locale@result}{\@locale@pre@query@params}% + \ifx\@locale@result\@empty + \else + \edef\LocaleOStag{\expandafter\@firstoftwo\@locale@result}% + \edef\LocaleOScodeset{\expandafter\@secondoftwo\@locale@result}% + \fi +}% +\let\@locale@pre@query@parse\relax +\@locale@ifxeorlua +{% + \if@locale@fontspec\RequirePackage{fontspec}\fi + \ifnum\@locale@supportopt=1\relax + \ifdefstring\LocaleMain{locale} + {% + \def\@locale@pre@query@params{\string-b }% + \let\@locale@pre@query@parse\@locale@pre@query@parsetag + }% + {% + \@for\locale@this@dialect:=\LocaleOther\do{% + \ifdefstring\locale@this@dialect{locale} + {% + \def\@locale@pre@query@params{\string-b }% + \let\@locale@pre@query@parse\@locale@pre@query@parsetag + \@endfortrue + }% + {}% + }% + }% + \@locale@pre@query@parse + \fi +} +{% + \ifdefstring{\@locale@fontenc}{auto} + {% + \ifdefstring\LocaleMain{locale} + {% + \def\@locale@pre@query@params{\string-b }% + \let\@locale@pre@query@parse\@locale@pre@query@parsetag + }% + {% + \@for\locale@this@dialect:=\LocaleOther\do{% + \ifdefstring\locale@this@dialect{locale} + {% + \def\@locale@pre@query@params{\string-b }% + \let\@locale@pre@query@parse\@locale@pre@query@parsetag + \@endfortrue + }% + {}% + }% + }% + }% + {}% + \ifdefstring{\@locale@inputenc}{auto} + {% + \ifx\@locale@pre@query@params\@empty + \let\@locale@pre@query@parse\@locale@pre@query@parsecodeset + \else + \let\@locale@pre@query@parse\@locale@pre@query@parsetagcodeset + \fi + \edef\@locale@pre@query@params{\@locale@pre@query@params\string-C}% + }% + {}% + \@locale@pre@query@parse + \ifdefstring{\@locale@fontenc}{none} + {} + {% + \ifdefstring{\@locale@fontenc}{auto} + {% + \input{tex-locale-scripts-enc.def}% + \@locale@trackall + \ForEachTrackedDialect{\locale@this@dialect}% + { + \edef\@locale@lang{\TrackedLanguageFromDialect{\locale@this@dialect}}% + \@locale@if@langenc@map{\locale@this@dialect}% + {% + \edef\@locale@fontenc@opt{% + \@locale@get@langenc@map{\locale@this@dialect}}% + \expandafter\PassOptionsToPackage\expandafter + {\@locale@fontenc@opt}{fontenc}% + }% + {% + \@locale@if@langenc@map{\@locale@lang}% + {% + \edef\@locale@fontenc@opt{% + \@locale@get@langenc@map{\@locale@lang}}% + \expandafter\PassOptionsToPackage\expandafter + {\@locale@fontenc@opt}{fontenc}% + }% + {% + \edef\@locale@script{\GetTrackedDialectScript{\locale@this@dialect}}% + \ifx\@locale@script\empty + \edef\@locale@script{\TrackLangGetDefaultScript{\@locale@lang}}% + \fi + \@locale@if@scriptenc@map{\@locale@script}% + {% + \edef\@locale@fontenc@opt{% + \@locale@get@scriptenc@map{\@locale@script}}% + \expandafter\PassOptionsToPackage\expandafter + {\@locale@fontenc@opt}{fontenc}% + }% + {}% + }% + }% + }% + \ifx\@locale@fontenc@opt\empty + \PackageWarning{tex-locale}{Option `fontenc=auto' failed. + Can't determine an appropriate font encoding for dialect(s). + (Dialect list: \@tracklang@dialects.) + Either set the encoding explicitly or switch to XeLaTeX% + }% + \else + \RequirePackage{fontenc}% + \fi + } + {% + \expandafter\PassOptionsToPackage\expandafter{\@locale@fontenc}{fontenc}% + \RequirePackage{fontenc}% + } + } + \ifdefstring{\@locale@inputenc}{none} + {} + {% + \ifdefstring{\@locale@inputenc}{auto} + {% + \ifx\LocaleOScodeset\empty + \PackageWarning{tex-locale}{Option `inputenc=auto' failed. + (Check shell escape.) Default file encoding unavailable} + \else + \IfFileExists{\LocaleOScodeset.def}% + {% + \renewcommand{\@locale@loadinputenc}{% + \RequirePackage{inputenc}% + \inputencoding{\LocaleOScodeset}% + } + \let\@locale@inputenc\LocaleOScodeset + }% + {% + \input{tex-locale-encodings.def}% + \@locale@ifhasencmap{\LocaleOScodeset} + { + \edef\@locale@inputenc{\@locale@getencmap\LocaleOScodeset} + \renewcommand{\@locale@loadinputenc}{% + \RequirePackage{inputenc}% + \inputencoding{\@locale@inputenc}% + } + } + {% + \PackageWarning{tex-locale}{Option `inputenc=auto' failed. + Don't know how to interpret codeset `\LocaleOScodeset'}% + }% + } + \fi + } + {% + \renewcommand{\@locale@loadinputenc}{% + \RequirePackage{inputenc}% + \inputencoding{\@locale@inputenc}% + } + } + } +} +\newcommand{\@locale@loadscripts}{% + \RequirePackage{tracklang-scripts}% + \let\@locale@loadscripts\relax +} +\providecommand*{\@secondofthree}[3]{#2} +\newcommand*{\@locale@ifsupportbabelorpoly}[3]{#1} +\newcommand*{\@locale@ifsupportcjk}[2]{#2} +\newcommand*{\@locale@ifsupportpinyin}[2]{#2} +\newcommand*{\@locale@cjklist}{} +\listadd{\@locale@cjklist}{chinese} +\listadd{\@locale@cjklist}{japanese} +\listadd{\@locale@cjklist}{korean} +\listadd{\@locale@cjklist}{thai} +\newcommand*{\@locale@ifcjk}[1]{% + \xifinlist{#1}{\@locale@cjklist}% +} +\newcommand*{\@locale@iflatinscript}[1]{% + \ifcsstring{@tracklang@script@#1}{Latn}% +} +\ifcase\@locale@supportopt +\or + \@locale@trackall + \ForEachTrackedDialect{\locale@this@dialect}% + {% + \edef\this@root@lang{\TrackedLanguageFromDialect{\locale@this@dialect}}% + \@locale@ifcjk{\this@root@lang}% + { + \let\@locale@ifsupportcjk\@firstoftwo + \@locale@iflatinscript{\locale@this@dialect}% + {\let\@locale@ifsupportpinyin\@firstoftwo}% + {} + } + {} + \@locale@ifxeorlua + { + \@locale@ifsupportbabelorpoly + { + \IfFileExists{gloss-\this@root@lang.ldf} + { + \let\@locale@ifsupportbabelorpoly\@thirdofthree + } + { + \IfFileExists{\this@root@lang.ldf} + {\let\@locale@ifsupportbabelorpoly\@secondofthree} + {} + } + } + {} + { + \IfFileExists{gloss-\this@root@lang.ldf} + {} + { + \IfFileExists{\this@root@lang.ldf} + {\let\@locale@ifsupportbabelorpoly\@secondofthree} + {} + } + } + } + { + \IfFileExists{\this@root@lang.ldf} + {\let\@locale@ifsupportbabelorpoly\@secondofthree} + {} + } + } +\or + \let\@locale@ifsupportbabelorpoly\@secondofthree +\or + \let\@locale@ifsupportbabelorpoly\@thirdofthree +\or + \let\@locale@currentiscjk\@secondoftwo + \ForEachTrackedDialect{\locale@this@dialect}% + {% + \edef\this@root@lang{\TrackedLanguageFromDialect{\locale@this@dialect}}% + \@locale@ifcjk{\this@root@lang}% + { + \@locale@iflatinscript{\locale@this@dialect}% + {\let\@locale@ifsupportpinyin\@firstoftwo}% + {} + } + {} + } +\fi +\@locale@ifsupportcjk +{ + \@locale@ifxeorlua + { + \RequirePackage{xeCJK}% + } + { + \ifdefstring\@locale@inputenc{utf8}% + {% + \RequirePackage{CJKutf8}% + \renewcommand{\@locale@loadinputenc}{}% + \newcommand*{\localeprequery}{\begin{CJK}{UTF8}{}\makeatletter} + \newcommand*{\localepostquery}{\end{CJK}} + }% + {% + \RequirePackage{CJK}% + \PackageWarning{tex-locale}{Unsupported encoding `\@locale@loadinputenc'}% + }% + } + \@locale@ifsupportpinyin + {\RequirePackage{pinyin}}% + {}% +} +{} + +\@locale@loadinputenc +\newcommand{\localenopolypunct}[1]{{#1}} +\newrobustcmd{\@locale@nopolypunct}[1]{% + {% + \@tracklang@ifundef{no\languagename @punctuation}{}% + {\csname no\languagename @punctuation\endcsname}% + #1% + }% +} +\input{tex-locale} +\@locale@load@dtm +\@ifpackageloaded{polyglossia} +{\newcommand{\LocaleSupportPackageCase}[3]{#2}} +{% + \@ifpackageloaded{babel} + {\newcommand{\LocaleSupportPackageCase}[3]{#1}}% + {\newcommand{\LocaleSupportPackageCase}[3]{#3}}% +} +\endinput +%% +%% End of file `tex-locale.sty'. |