texlive[47704] Master/texmf-dist: tracklang (13may18)

commits+karl at tug.org commits+karl at tug.org
Sun May 13 23:53:51 CEST 2018


Revision: 47704
          http://tug.org/svn/texlive?view=revision&revision=47704
Author:   karl
Date:     2018-05-13 23:53:50 +0200 (Sun, 13 May 2018)
Log Message:
-----------
tracklang (13may18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/tracklang/CHANGES
    trunk/Master/texmf-dist/doc/generic/tracklang/README
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals-babel.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals-de-poly.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals-de.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals-poly.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals2-de.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals2-de2.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals2-de3.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals2-de4.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals2-poly.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals2.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions2-manx.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions2-map.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions2-map2.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions2-map3.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions2-nomap.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions2.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/sample-tracklang.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/sample-tracklang2.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/sample-tracklang3.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/sample-tracklang4.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/sample-tracklang5.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/samples/sample-tracklang6.pdf
    trunk/Master/texmf-dist/doc/generic/tracklang/tracklang.pdf
    trunk/Master/texmf-dist/source/latex/tracklang/tracklang.dtx
    trunk/Master/texmf-dist/source/latex/tracklang/tracklang.ins
    trunk/Master/texmf-dist/tex/generic/tracklang/tracklang-region-codes.tex
    trunk/Master/texmf-dist/tex/generic/tracklang/tracklang-scripts.tex
    trunk/Master/texmf-dist/tex/generic/tracklang/tracklang.tex
    trunk/Master/texmf-dist/tex/latex/tracklang/tracklang-scripts.sty
    trunk/Master/texmf-dist/tex/latex/tracklang/tracklang.sty

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/CHANGES
===================================================================
--- trunk/Master/texmf-dist/doc/generic/tracklang/CHANGES	2018-05-13 21:53:15 UTC (rev 47703)
+++ trunk/Master/texmf-dist/doc/generic/tracklang/CHANGES	2018-05-13 21:53:50 UTC (rev 47704)
@@ -1,3 +1,8 @@
+v1.3.6 (2018-05-13):
+
+  * \GetTrackedDialectFromLanguageTag now sets
+    \TrackedDialectClosestSubMatch.
+
 v1.3.5 (2018-02-21):
 
   * Added check for polyglossia's \xpg at loaded

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/README
===================================================================
--- trunk/Master/texmf-dist/doc/generic/tracklang/README	2018-05-13 21:53:15 UTC (rev 47703)
+++ trunk/Master/texmf-dist/doc/generic/tracklang/README	2018-05-13 21:53:50 UTC (rev 47704)
@@ -1,6 +1,6 @@
-Generic TeX Bundle : tracklang v1.3.5 
+Generic TeX Bundle : tracklang v1.3.6 
 
-Last Modified      : 2018-02-21
+Last Modified      : 2018-05-13
 
 Author             : Nicola Talbot
 

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals-babel.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals-de-poly.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals-de.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals-poly.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals2-de.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals2-de2.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals2-de3.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals2-de4.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals2-poly.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/sample-animals2.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions2-manx.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions2-map.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions2-map2.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions2-map3.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions2-nomap.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/regions/sample-regions2.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/sample-tracklang.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/sample-tracklang2.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/sample-tracklang3.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/sample-tracklang4.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/sample-tracklang5.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/sample-tracklang6.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/tracklang.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/tracklang/tracklang.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tracklang/tracklang.dtx	2018-05-13 21:53:15 UTC (rev 47703)
+++ trunk/Master/texmf-dist/source/latex/tracklang/tracklang.dtx	2018-05-13 21:53:50 UTC (rev 47704)
@@ -2,7 +2,6 @@
 % tracklang.dtx generated using makedtx version 1.2 (c) Nicola Talbot
 % Command line args:
 %   -section "chapter"
-%   -doc "tracklang-manual.tex"
 %   -author "Nicola Talbot"
 %   -src "tracklang.sty\Z=>tracklang.sty"
 %   -src "tracklang.tex\Z=>tracklang.tex"
@@ -9,8 +8,9 @@
 %   -src "tracklang-region-codes.tex\Z=>tracklang-region-codes.tex"
 %   -src "tracklang-scripts.sty\Z=>tracklang-scripts.sty"
 %   -src "tracklang-scripts.tex\Z=>tracklang-scripts.tex"
+%   -doc "tracklang-manual.tex"
 %   tracklang
-% Created on 2018/2/21 13:08
+% Created on 2018/5/13 13:19
 %\fi
 %\iffalse
 %<*package>
@@ -59,7 +59,7 @@
             pdfauthor={Nicola L.C. Talbot},
             pdftitle={tracklang: tracking language options}]{hyperref}
 
-\CheckSum{3914}
+\CheckSum{3961}
 
 \appto\MacroFont{\scriptsize}
 \renewcommand*{\usage}[1]{\textit{\hyperpage{#1}}}
@@ -278,11 +278,11 @@
 %
 %\MakeShortVerb{"}
 %
-%\title{tracklang v1.3.5:
+%\title{tracklang v1.3.6:
 %tracking language options}
 %\author{Nicola L. C. Talbot\\\url{http://www.dickimaw-books.com/}}
 %
-%\date{2018-02-21}
+%\date{2018-05-13}
 %\maketitle
 %
 %\begin{abstract}
@@ -1351,14 +1351,26 @@
 %to the tracked language list, if it's not already present.)
 %
 %If you want to find out if any of the tracked dialects
-%match a particular language tag, you can use:
+%matches a particular language tag, you can use:
 %\begin{definition}[\DescribeMacro\GetTrackedDialectFromLanguageTag]
-%\cs{GetTrackedDialectFromLanguageTag}\marg{tag}\marg{cs}
+%\ics{GetTrackedDialectFromLanguageTag}\marg{tag}\marg{cs}
 %\end{definition}
 %If successful, the supplied control sequence \meta{cs} is set to the
-%dialect label, otherwise \meta{cs} is set to empty. Note that the
-%extension (that is, the option part that may occur at the end of
-%the tag) isn't used in the comparison.
+%dialect label, otherwise \meta{cs} is set to empty. The test is for an exact
+%match on the root language, script, sub-language, variant and
+%region. The control sequence \meta{cs} will be empty if none of the
+%tracked dialects matches all five of those elements. (If the script
+%isn't given explicitly, the default for that language is assumed.)
+%In the event that \meta{cs} is empty, you can now (as from v1.3.6)
+%get the closest match with
+%\begin{definition}[\DescribeMacro\TrackedDialectClosestSubMatch]
+%\ics{TrackedDialectClosestSubMatch}
+%\end{definition}
+%(which is set by \cs{GetTrackedDialectFromLanguageTag}).
+%This will be empty if no tracked dialects match on the root
+%language or if there's a tracked dialect label that exactly matches
+%the label formed by concatenating the language code, sub-language,
+%script, region, modifier and variant.
 %
 %For example (Plain \TeX):
 %\begin{verbatim}
@@ -1381,6 +1393,30 @@
 %It also works if the dialect has been tracked using other commands,
 %such as \cs{TrackLocale}.
 %
+%Here's an example that doesn't have an exact match, but does have a
+%partial match:
+%\begin{verbatim}
+%\input tracklang
+%\TrackLanguageTag{de-CH-1996}
+%Has de-DE-1996 been tracked?
+%\GetTrackedDialectFromLanguageTag{de-DE-1996}{\thisdialect}%
+%\ifx\thisdialect\empty
+% No!
+%  \ifx\TrackedDialectClosestSubMatch\empty
+%    No match on root language.
+%  \else
+%    Closest match: \TrackedDialectClosestSubMatch.
+%  \fi
+%\else
+% Yes! Dialect label: \thisdialect.
+%\fi
+%\bye
+%\end{verbatim}
+%In this case the result is:
+%\begin{quote}
+%Has de-DE-1996 been tracked? No! Closest match: nswissgerman.
+%\end{quote}
+%
 %You can iterate through each tracked dialect using:
 %\begin{definition}[\DescribeMacro\ForEachTrackedDialect]
 %\cs{ForEachTrackedDialect}\marg{cs}\marg{code}
@@ -3214,7 +3250,7 @@
 % packages such as \styfmt{etoolbox}.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tracklang}[2018/02/21 v1.3.5 (NLCT) Track Languages]
+\ProvidesPackage{tracklang}[2018/05/13 v1.3.6 (NLCT) Track Languages]
 %    \end{macrocode}
 %\begin{macro}{\@tracklang at declareoption}
 % Set up package options.
@@ -3492,7 +3528,7 @@
 % Version info.
 %    \begin{macrocode}
 \expandafter\def\csname ver at tracklang.tex\endcsname{%
- 2018/02/21 v1.3.5 (NLCT) Track Languages Generic Code}
+ 2018/05/13 v1.3.6 (NLCT) Track Languages Generic Code}
 %    \end{macrocode}
 % Define a long command for determining the existence of a control
 % sequence by its name. (\cs{relax} is considered undefined.)
@@ -6012,10 +6048,18 @@
 %\end{definition}
 %Find the tracked dialect that matches the given language tag and
 %stores the dialect label in \meta{cs}. If no match found, \meta{cs}
-%will be empty. Doesn't check the additional information
+%will be empty. Just tests the root language, script, variant, 
+%sub-language and region. Doesn't check the additional information. 
+%As from v1.3.6, this sets \cs{TrackedDialectClosestSubMatch} to the
+%closest sub-match.
 %    \begin{macrocode}
 \def\GetTrackedDialectFromLanguageTag#1#2{%
+%    \end{macrocode}
+%Initialise default values (in case of no match).
+%\changes{1.3.6}{2018-05-13}{added \cs{TrackedDialectClosestSubMatch}}
+%    \begin{macrocode}
   \def#2{}%
+  \def\TrackedDialectClosestSubMatch{}%
   \@tracklang at parselangtag{#1}%
   \edef\@tracklang at dialect{%
    \@TrackLangEnvLang
@@ -6027,14 +6071,14 @@
 %    \end{macrocode}
 % Has this dialect label been tracked?
 %    \begin{macrocode}
-   \IfTrackedDialect{\@tracklang at dialect}%
-   {%
+  \IfTrackedDialect{\@tracklang at dialect}%
+  {%
 %    \end{macrocode}
 % Found it. All done.
 %    \begin{macrocode}
       \let#2\@tracklang at dialect
-   }%
-   {%
+  }%
+  {%
 %    \end{macrocode}
 % Get the root language label.
 %    \begin{macrocode}
@@ -6044,6 +6088,10 @@
 %    \begin{macrocode}
       \edef\@tracklang at defscript{\TrackLangGetDefaultScript\@tracklang at lang}%
 %    \end{macrocode}
+% Keep track of best match.
+%    \begin{macrocode}
+     \def\@tracklang at bestmatch{0}%
+%    \end{macrocode}
 % Get the list of tracked dialects for this language.
 %    \begin{macrocode}
       \edef\@tracklang at dialects{\TrackedDialectsFromLanguage\@tracklang at lang}%
@@ -6051,54 +6099,110 @@
 % For each dialect in this list, check if it matches. 
 %    \begin{macrocode}
       \@tracklang at for\@tracklang at dialect:=\@tracklang at dialects\do{%
+%    \end{macrocode}
+% Does the script match? (Initialise to no.)
+%    \begin{macrocode}
+        \def\@tracklang at currentmatch{0}%
         \edef\@tracklang at tmp{%
-          \TrackedIsoCodeFromLanguage{3166-1}{\@tracklang at dialect}}%
-        \ifx\@tracklang at tmp\@TrackLangEnvTerritory
+          \GetTrackedDialectScript{\@tracklang at dialect}}%
+        \ifx\@tracklang at tmp\@TrackLangEnvScript
 %    \end{macrocode}
-% Region matches. 
+% Script matches.
 %    \begin{macrocode}
-          \edef\@tracklang at tmp{%
-            \GetTrackedDialectSubLang{\@tracklang at dialect}}%
-          \ifx\@tracklang at tmp\@TrackLangEnvSubLang
+          \def\@tracklang at currentmatch{1}%
+        \else
 %    \end{macrocode}
+% Script doesn't match. If no script has been provided, does this
+% dialect's script match the default for this language? 
+%    \begin{macrocode}
+          \ifx\@TrackLangEnvScript\empty
+            \ifx\@tracklang at tmp\@tracklang at defscript
+%    \end{macrocode}
+% Default script matches. 
+%    \begin{macrocode}
+              \def\@tracklang at currentmatch{1}%
+            \fi
+          \fi
+        \fi
+%    \end{macrocode}
+% Does the sub-language match?
+%    \begin{macrocode}
+        \edef\@tracklang at tmp{%
+          \GetTrackedDialectSubLang{\@tracklang at dialect}}%
+        \ifx\@tracklang at tmp\@TrackLangEnvSubLang
+%    \end{macrocode}
 % Sub-language matches. 
 %    \begin{macrocode}
-            \edef\@tracklang at tmp{%
-              \GetTrackedDialectVariant{\@tracklang at dialect}}%
-            \ifx\@tracklang at tmp\@TrackLangEnvVariant
+          \edef\@tracklang at currentmatch{\@tracklang at currentmatch 1}%
+        \else
 %    \end{macrocode}
+% Sub-language doesn't match. 
+%    \begin{macrocode}
+          \edef\@tracklang at currentmatch{\@tracklang at currentmatch 0}%
+        \fi
+%    \end{macrocode}
+% Does the variant match?
+%    \begin{macrocode}
+        \edef\@tracklang at tmp{%
+          \GetTrackedDialectVariant{\@tracklang at dialect}}%
+        \ifx\@tracklang at tmp\@TrackLangEnvVariant
+%    \end{macrocode}
 % Variant matches. 
 %    \begin{macrocode}
-              \edef\@tracklang at tmp{%
-                \GetTrackedDialectScript{\@tracklang at dialect}}%
-              \ifx\@tracklang at tmp\@TrackLangEnvScript
+          \edef\@tracklang at currentmatch{\@tracklang at currentmatch 1}%
+        \else
 %    \end{macrocode}
-% Script matches. Found it.
+% Variant doesn't match. 
 %    \begin{macrocode}
-                \let#2\@tracklang at dialect
-              \else
+          \edef\@tracklang at currentmatch{\@tracklang at currentmatch 0}%
+        \fi
 %    \end{macrocode}
-% Script doesn't match. If no script has been provided, does this
-% dialect's script match the default for this language? 
+% Does the region match?
 %    \begin{macrocode}
-                \ifx\@TrackLangEnvScript\empty
-                  \ifx\@tracklang at tmp\@tracklang at defscript
+        \edef\@tracklang at tmp{%
+          \TrackedIsoCodeFromLanguage{3166-1}{\@tracklang at dialect}}%
+        \ifx\@tracklang at tmp\@TrackLangEnvTerritory
 %    \end{macrocode}
-% Default script matches. Found it.
+% Region matches. 
 %    \begin{macrocode}
-                    \let#2\@tracklang at dialect
-                  \fi
-                \fi
-              \fi
-            \fi
+          \edef\@tracklang at currentmatch{\@tracklang at currentmatch 1}%
+        \else
+%    \end{macrocode}
+% Region doesn't match. 
+%    \begin{macrocode}
+          \edef\@tracklang at currentmatch{\@tracklang at currentmatch 0}%
+        \fi
+%    \end{macrocode}
+% Do all four match? 
+%    \begin{macrocode}
+        \ifx\@tracklang at currentmatch\@tracklang at fullmatch
+%    \end{macrocode}
+% Found it. 
+%    \begin{macrocode}
+          \let#2\@tracklang at dialect
+        \else
+%    \end{macrocode}
+% Not a complete match. Is this the best match so far? 
+%    \begin{macrocode}
+          \ifnum\@tracklang at currentmatch>\@tracklang at bestmatch\relax
+            \let\TrackedDialectClosestSubMatch\@tracklang at dialect
+            \let\@tracklang at bestmatch\@tracklang at currentmatch
           \fi
         \fi
-      }%
-   }%
+     }%
+  }%
 }
 %    \end{macrocode}
 %\end{macro}
 %
+%\begin{macro}{\@tracklang at fullmatch}
+%\changes{1.3.6}{2018-05-13}{new}
+%(Used to identify a full match for script, sub-language, variant
+%and region.)
+%    \begin{macrocode}
+\def\@tracklang at fullmatch{1111}
+%    \end{macrocode}
+%\end{macro}
 %
 %\begin{macro}{\TrackLangFromEnv}
 %\changes{1.3}{2016-10-07}{new}
@@ -9956,7 +10060,7 @@
 % Version info.
 %    \begin{macrocode}
 \expandafter\def\csname ver at tracklang-region-codes.tex\endcsname{%
- 2018/02/21 v1.3.5 (NLCT) Track Languages Regions}%
+ 2018/05/13 v1.3.6 (NLCT) Track Languages Regions}%
 %    \end{macrocode}
 %
 %\begin{macro}{\TrackLangRegionMap}
@@ -10345,7 +10449,7 @@
 %\changes{1.3}{2016-10-07}{added tracklang-scripts.sty}
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tracklang-scripts}[2018/02/21 v1.3.5 (NLCT) Track
+\ProvidesPackage{tracklang-scripts}[2018/05/13 v1.3.6 (NLCT) Track
 Language Scripts (LaTeX)]
 \RequirePackage{tracklang}
 \input{tracklang-scripts}
@@ -10387,7 +10491,7 @@
 % Version info.
 %    \begin{macrocode}
 \expandafter\def\csname ver at tracklang-scripts.tex\endcsname{%
- 2018/02/21 v1.3.5 (NLCT) Track Languages Scripts (Generic)}%
+ 2018/05/13 v1.3.6 (NLCT) Track Languages Scripts (Generic)}%
 %    \end{macrocode}
 %
 %\begin{macro}{\TrackLangScriptsMap}

Modified: trunk/Master/texmf-dist/source/latex/tracklang/tracklang.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/tracklang/tracklang.ins	2018-05-13 21:53:15 UTC (rev 47703)
+++ trunk/Master/texmf-dist/source/latex/tracklang/tracklang.ins	2018-05-13 21:53:50 UTC (rev 47704)
@@ -1,4 +1,4 @@
-% tracklang.ins generated using makedtx version 1.2 2018/2/21 13:08
+% tracklang.ins generated using makedtx version 1.2 2018/5/13 13:19
 \input docstrip
 
 \preamble

Modified: trunk/Master/texmf-dist/tex/generic/tracklang/tracklang-region-codes.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tracklang/tracklang-region-codes.tex	2018-05-13 21:53:15 UTC (rev 47703)
+++ trunk/Master/texmf-dist/tex/generic/tracklang/tracklang-region-codes.tex	2018-05-13 21:53:50 UTC (rev 47704)
@@ -64,7 +64,7 @@
   \expandafter\endinput
 \fi
 \expandafter\def\csname ver at tracklang-region-codes.tex\endcsname{%
- 2018/02/21 v1.3.5 (NLCT) Track Languages Regions}%
+ 2018/05/13 v1.3.6 (NLCT) Track Languages Regions}%
 \def\TrackLangRegionMap#1#2#3{%
   \@tracklang at enamedef{@tracklang at region@numtoalphaii@#1}{#2}%
   \@tracklang at enamedef{@tracklang at region@numtoalphaiii@#1}{#3}%

Modified: trunk/Master/texmf-dist/tex/generic/tracklang/tracklang-scripts.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tracklang/tracklang-scripts.tex	2018-05-13 21:53:15 UTC (rev 47703)
+++ trunk/Master/texmf-dist/tex/generic/tracklang/tracklang-scripts.tex	2018-05-13 21:53:50 UTC (rev 47704)
@@ -64,7 +64,7 @@
   \expandafter\endinput
 \fi
 \expandafter\def\csname ver at tracklang-scripts.tex\endcsname{%
- 2018/02/21 v1.3.5 (NLCT) Track Languages Scripts (Generic)}%
+ 2018/05/13 v1.3.6 (NLCT) Track Languages Scripts (Generic)}%
 \def\TrackLangScriptMap#1#2#3#4#5{%
   \@tracklang at enamedef{TrackLangScript#1}{#1}%
   \@tracklang at enamedef{@tracklang at script@numtoalpha@#2}{#1}%

Modified: trunk/Master/texmf-dist/tex/generic/tracklang/tracklang.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tracklang/tracklang.tex	2018-05-13 21:53:15 UTC (rev 47703)
+++ trunk/Master/texmf-dist/tex/generic/tracklang/tracklang.tex	2018-05-13 21:53:50 UTC (rev 47704)
@@ -64,7 +64,7 @@
   \expandafter\endinput
 \fi
 \expandafter\def\csname ver at tracklang.tex\endcsname{%
- 2018/02/21 v1.3.5 (NLCT) Track Languages Generic Code}
+ 2018/05/13 v1.3.6 (NLCT) Track Languages Generic Code}
 \long\def\@tracklang at ifundef#1#2#3{%
   \ifcsname#1\endcsname
     \expandafter\ifx\csname #1\endcsname\relax
@@ -1334,6 +1334,7 @@
 }%
 \def\GetTrackedDialectFromLanguageTag#1#2{%
   \def#2{}%
+  \def\TrackedDialectClosestSubMatch{}%
   \@tracklang at parselangtag{#1}%
   \edef\@tracklang at dialect{%
    \@TrackLangEnvLang
@@ -1342,41 +1343,61 @@
    \@TrackLangEnvTerritory
    \@TrackLangEnvModifier
    \@TrackLangEnvVariant}%
-   \IfTrackedDialect{\@tracklang at dialect}%
-   {%
+  \IfTrackedDialect{\@tracklang at dialect}%
+  {%
       \let#2\@tracklang at dialect
-   }%
-   {%
+  }%
+  {%
       \edef\@tracklang at lang{\TrackLangGetKnownLangFromIso\@TrackLangEnvLang}%
       \edef\@tracklang at defscript{\TrackLangGetDefaultScript\@tracklang at lang}%
+     \def\@tracklang at bestmatch{0}%
       \edef\@tracklang at dialects{\TrackedDialectsFromLanguage\@tracklang at lang}%
       \@tracklang at for\@tracklang at dialect:=\@tracklang at dialects\do{%
+        \def\@tracklang at currentmatch{0}%
         \edef\@tracklang at tmp{%
+          \GetTrackedDialectScript{\@tracklang at dialect}}%
+        \ifx\@tracklang at tmp\@TrackLangEnvScript
+          \def\@tracklang at currentmatch{1}%
+        \else
+          \ifx\@TrackLangEnvScript\empty
+            \ifx\@tracklang at tmp\@tracklang at defscript
+              \def\@tracklang at currentmatch{1}%
+            \fi
+          \fi
+        \fi
+        \edef\@tracklang at tmp{%
+          \GetTrackedDialectSubLang{\@tracklang at dialect}}%
+        \ifx\@tracklang at tmp\@TrackLangEnvSubLang
+          \edef\@tracklang at currentmatch{\@tracklang at currentmatch 1}%
+        \else
+          \edef\@tracklang at currentmatch{\@tracklang at currentmatch 0}%
+        \fi
+        \edef\@tracklang at tmp{%
+          \GetTrackedDialectVariant{\@tracklang at dialect}}%
+        \ifx\@tracklang at tmp\@TrackLangEnvVariant
+          \edef\@tracklang at currentmatch{\@tracklang at currentmatch 1}%
+        \else
+          \edef\@tracklang at currentmatch{\@tracklang at currentmatch 0}%
+        \fi
+        \edef\@tracklang at tmp{%
           \TrackedIsoCodeFromLanguage{3166-1}{\@tracklang at dialect}}%
         \ifx\@tracklang at tmp\@TrackLangEnvTerritory
-          \edef\@tracklang at tmp{%
-            \GetTrackedDialectSubLang{\@tracklang at dialect}}%
-          \ifx\@tracklang at tmp\@TrackLangEnvSubLang
-            \edef\@tracklang at tmp{%
-              \GetTrackedDialectVariant{\@tracklang at dialect}}%
-            \ifx\@tracklang at tmp\@TrackLangEnvVariant
-              \edef\@tracklang at tmp{%
-                \GetTrackedDialectScript{\@tracklang at dialect}}%
-              \ifx\@tracklang at tmp\@TrackLangEnvScript
-                \let#2\@tracklang at dialect
-              \else
-                \ifx\@TrackLangEnvScript\empty
-                  \ifx\@tracklang at tmp\@tracklang at defscript
-                    \let#2\@tracklang at dialect
-                  \fi
-                \fi
-              \fi
-            \fi
+          \edef\@tracklang at currentmatch{\@tracklang at currentmatch 1}%
+        \else
+          \edef\@tracklang at currentmatch{\@tracklang at currentmatch 0}%
+        \fi
+        \ifx\@tracklang at currentmatch\@tracklang at fullmatch
+          \let#2\@tracklang at dialect
+        \else
+          \ifnum\@tracklang at currentmatch>\@tracklang at bestmatch\relax
+            \let\TrackedDialectClosestSubMatch\@tracklang at dialect
+            \let\@tracklang at bestmatch\@tracklang at currentmatch
           \fi
         \fi
-      }%
-   }%
+     }%
+  }%
 }
+\def\@tracklang at fullmatch{1111}
 \def\TrackLangFromEnv{%
  \def\TrackLangEnvLang{}%
  \def\TrackLangEnvTerritory{}%

Modified: trunk/Master/texmf-dist/tex/latex/tracklang/tracklang-scripts.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tracklang/tracklang-scripts.sty	2018-05-13 21:53:15 UTC (rev 47703)
+++ trunk/Master/texmf-dist/tex/latex/tracklang/tracklang-scripts.sty	2018-05-13 21:53:50 UTC (rev 47704)
@@ -51,7 +51,7 @@
 %% do code now to initialise
 %% Pass all options to tracklang:
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tracklang-scripts}[2018/02/21 v1.3.5 (NLCT) Track
+\ProvidesPackage{tracklang-scripts}[2018/05/13 v1.3.6 (NLCT) Track
 Language Scripts (LaTeX)]
 \RequirePackage{tracklang}
 \input{tracklang-scripts}

Modified: trunk/Master/texmf-dist/tex/latex/tracklang/tracklang.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tracklang/tracklang.sty	2018-05-13 21:53:15 UTC (rev 47703)
+++ trunk/Master/texmf-dist/tex/latex/tracklang/tracklang.sty	2018-05-13 21:53:50 UTC (rev 47704)
@@ -51,7 +51,7 @@
 %% do code now to initialise
 %% Pass all options to tracklang:
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tracklang}[2018/02/21 v1.3.5 (NLCT) Track Languages]
+\ProvidesPackage{tracklang}[2018/05/13 v1.3.6 (NLCT) Track Languages]
 \providecommand*{\@tracklang at declareoption}[1]{%
   \DeclareOption{#1}{\TrackPredefinedDialect{#1}}%
 }



More information about the tex-live-commits mailing list