texlive[52991] Master/texmf-dist: tracklang (1dec19)

commits+karl at tug.org commits+karl at tug.org
Sun Dec 1 22:36:02 CET 2019


Revision: 52991
          http://tug.org/svn/texlive?view=revision&revision=52991
Author:   karl
Date:     2019-12-01 22:36:02 +0100 (Sun, 01 Dec 2019)
Log Message:
-----------
tracklang (1dec19)

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/animals.sty
    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	2019-12-01 21:35:44 UTC (rev 52990)
+++ trunk/Master/texmf-dist/doc/generic/tracklang/CHANGES	2019-12-01 21:36:02 UTC (rev 52991)
@@ -1,3 +1,22 @@
+v1.4 (2019-11-30):
+
+  * tracklang.tex:
+
+    - Changed \TrackLangIfFileExists to also include script and
+      variant in file search (search order has changed slightly).
+
+    - Added \TrackLangRedefHook
+
+    - New commands provided to assist integration with language
+      packages:
+
+      \TrackLangAddExtraRegionFile
+      \TrackLangAddExtraScriptFile
+      \TrackLangProvidePredefinedLanguage
+      \TrackLangProvidePredefinedDialect
+
+    - New switch \ifTrackLangShowVerbose for debugging
+
 v1.3.9 (2019-11-11):
 
   * tracklang.tex:

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/README
===================================================================
--- trunk/Master/texmf-dist/doc/generic/tracklang/README	2019-12-01 21:35:44 UTC (rev 52990)
+++ trunk/Master/texmf-dist/doc/generic/tracklang/README	2019-12-01 21:36:02 UTC (rev 52991)
@@ -1,6 +1,6 @@
-Generic TeX Bundle : tracklang v1.3.9 
+Generic TeX Bundle : tracklang v1.4 
 
-Last Modified      : 2019-11-11
+Last Modified      : 2019-11-30
 
 Author             : Nicola Talbot
 

Modified: trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/animals.sty
===================================================================
--- trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/animals.sty	2019-12-01 21:35:44 UTC (rev 52990)
+++ trunk/Master/texmf-dist/doc/generic/tracklang/samples/animals/animals.sty	2019-12-01 21:36:02 UTC (rev 52991)
@@ -1,9 +1,17 @@
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{animals}[2016/10/06 v1.2 (NLCT) Sample package to test tracklang.sty]
+\ProvidesPackage{animals}[2019/11/30 v1.2.1 (NLCT) Sample package to test tracklang.sty]
 
-\RequirePackage{tracklang}[2016/10/07]
+\RequirePackage{tracklang}[2019/11/30]
 
-\DeclareOption*{\TrackLanguageTag{\CurrentOption}}
+\DeclareOption*{%
+ \TrackIfKnownLanguage{\CurrentOption}%
+ {\PackageInfo{animals}{Tracking language `\CurrentOption'}}% successful
+ {% failed
+   \PackageError{animals}%
+   {Unknown language specification `\CurrentOption'}%
+   {You need to supply either a known dialect label or a valid language tag}%
+ }%
+}
 \ProcessOptions
 
 

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	2019-12-01 21:35:44 UTC (rev 52990)
+++ trunk/Master/texmf-dist/source/latex/tracklang/tracklang.dtx	2019-12-01 21:36:02 UTC (rev 52991)
@@ -1,16 +1,16 @@
 %\iffalse
 % tracklang.dtx generated using makedtx version 1.2 (c) Nicola Talbot
 % Command line args:
-%   -section "chapter"
+%   -doc "tracklang-manual.tex"
 %   -author "Nicola Talbot"
-%   -doc "tracklang-manual.tex"
 %   -src "tracklang.sty\Z=>tracklang.sty"
 %   -src "tracklang.tex\Z=>tracklang.tex"
 %   -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"
+%   -section "chapter"
 %   tracklang
-% Created on 2019/11/11 16:00
+% Created on 2019/12/1 17:41
 %\fi
 %\iffalse
 %<*package>
@@ -59,7 +59,7 @@
             pdfauthor={Nicola L.C. Talbot},
             pdftitle={tracklang: tracking language options}]{hyperref}
 
-\CheckSum{3986}
+\CheckSum{6156}
 
 \appto\MacroFont{\scriptsize}
 \renewcommand*{\usage}[1]{\textit{\hyperpage{#1}}}
@@ -278,11 +278,11 @@
 %
 %\MakeShortVerb{"}
 %
-%\title{tracklang v1.3.9:
+%\title{tracklang v1.4:
 %tracking language options}
 %\author{Nicola L. C. Talbot\\\url{http://www.dickimaw-books.com/}}
 %
-%\date{2019-11-11}
+%\date{2019-11-30}
 %\maketitle
 %
 %\begin{abstract}
@@ -326,9 +326,14 @@
 %hard-coding the various language labels used by different language
 %packages.
 %
-%Related article: \qt{Localisation of \TeX\ documents: 
+%Related articles: \qt{Localisation of \TeX\ documents: 
 %\styfmt{tracklang}.} TUGBoat, Volume~37 (2016), No.~3
-%(\url{http://www.tug.org/TUGboat/tb37-3/tb117talbot.pdf}).
+%(\url{http://www.tug.org/TUGboat/tb37-3/tb117talbot.pdf}),
+%\href{https://www.dickimaw-books.com/latex/tracklang}{Localisation
+%with \texttt{tracklang.tex}},
+%and
+%\href{https://www.dickimaw-books.com/faq.php?action=view&category=tracklang}{\texttt{tracklang}
+%FAQ}.
 %
 %\clearpage
 %\tableofcontents
@@ -381,10 +386,15 @@
 %which is suboptimal but at least provides some information.
 %(\sty{polyglossia} now provides \cs{xpg at loaded}, which
 %\sty{tracklang} uses to track the root languages, but the language variant
-%command \cs{xpg at vloaded} only seems to be set when the language
+%command \cs{xpg at loaded} only seems to be set when the language
 %changes, which doesn't occur until the start of the \env{document}
 %environment.)
 %
+%I also can't find any way of detecting a list of languages loaded
+%through \sty{babel}'s new \ics{babelprovide} command. As far as I
+%can tell, the only stored list is in \cs{bbl at loaded} which only
+%contains the languages loaded through package options.
+%
 %If the \sty{ngerman} package has been loaded, \styfmt{tracklang}
 %effectively does
 %\begin{verbatim}
@@ -484,11 +494,11 @@
 %operating system:
 %\begin{verbatim}
 %\input texosquery
-%\input tracklang %v1.3
+%\input tracklang % v1.3
 %\TrackLangFromEnv
 %% load packages that use tracklang for localisation
 %\end{verbatim}
-%Or (\sty{texosquery} v1.2 currently pending)
+%Or (\sty{texosquery} v1.2)
 %\begin{verbatim}
 %\input texosquery % v1.2
 %\input tracklang % v1.3
@@ -497,9 +507,10 @@
 %\TrackLanguageTag{\langtag}
 %% load packages that use tracklang for localisation
 %\end{verbatim}
-%Anticipate the release of \styfmt{texosquery} v1.2:
+%Linux user who may or may not have \app{texosquery} setup to run in the
+%shell escape:
 %\begin{verbatim}
-%\input texosquery
+%\input texosquery 
 %\input tracklang % v1.3
 %
 %\ifx\TeXOSQueryLangTag\undefined
@@ -620,7 +631,9 @@
 %
 %Let's suppose you are developing a package called 
 %\texttt{mypackage.sty} or \texttt{mypackage.tex} and you want
-%to find out what languages the document author has requested.
+%to find out what languages the document author has requested. (See also:
+%\href{https://www.dickimaw-books.com/latex/tracklang/otherpkg.shtml}{Using
+%\texttt{tracklang.tex} in Packages with Localisation Features}.)
 %
 %Generic use:
 %\begin{verbatim}
@@ -627,13 +640,14 @@
 %\input tracklang 
 %\end{verbatim}
 %(Most of the commands used in this section require at least
-%\styfmt{tracklang} version 1.3.)
+%\styfmt{tracklang} version 1.3 but 1.4 is better if you want to
+%include the script tag in the ldf files.)
 %Note that \texttt{tracklang.tex} has a check to determine if
 %it's already been loaded, so you don't need to worry about that.
 %
 %\LaTeX\ use:
 %\begin{verbatim}
-%\RequirePackage{tracklang}[2016/10/07]% at least v1.3
+%\RequirePackage{tracklang}[2019/11/30]% at least v1.4
 %\end{verbatim}
 %This will picked up any language options supplied in the document
 %class options and will also detect if \sty{babel} or
@@ -648,6 +662,19 @@
 %\begin{verbatim}
 %\usepackage[hy-Latn-IT-arevela]{mypackage}
 %\end{verbatim}
+%With at least version 1.4, it's better to use \ics{TrackIfKnownLanguage}:
+%\begin{verbatim}
+%\DeclareOption*{%
+% \TrackIfKnownLanguage{\CurrentOption}%
+% {\PackageInfo{mypackage}{Tracking language `\CurrentOption'}}% successful
+% {% failed
+%   \PackageError{mypackage}%
+%   {Unknown language specification `\CurrentOption'}%
+%   {You need to supply either a known dialect label or a valid language tag}%
+% }%
+%}
+%\end{verbatim}
+%
 %The rest of the example package in this section uses generic code.
 %
 %If you want to fetch the locale information from the operating
@@ -685,11 +712,14 @@
 %\end{verbatim}
 %
 %Each resource file has the naming scheme \meta{prefix}\texttt{-}
-%\meta{tag}\texttt{.ldf}. In this example, the \meta{prefix} is
-%\texttt{mypackage}. The \meta{tag} may be the language or dialect label
+%\meta{localeid}\texttt{.ldf}. In this example, the \meta{prefix} is
+%\texttt{mypackage}. The \meta{localeid} part may be the language or dialect label
 %(for example, \texttt{english} or \texttt{british}) or a combination of the ISO
 %language and region codes (for example, \texttt{en-GB} or 
-%\texttt{en} or \texttt{GB}).
+%\texttt{en} or \texttt{GB}). As from version 1.4, \meta{localeid} may
+%also include the script or variant. (See the definition of
+%\ics{IfTrackedLanguageFileExists} on page~\pageref{pg:filesearch}
+%for further details.)
 %
 %The simplest scheme is to use the root language label (not the
 %dialect label) for the base language settings and use the ISO
@@ -708,6 +738,11 @@
 %found). For other hooks, such as \cs{date\ldots}, use 
 %\ics{TrackLangAddToHook}\marg{code}\marg{hook type} instead.
 %
+%With pre-v1.4 versions of \sty{tracklang}, the script isn't included
+%in the file search. If it's needed then either require at least v1.4
+%or have a base ldf file that tries to load a version for the
+%particular script (which can be accessed with
+%\cs{CurrentTrackedScript}).
 %Here's an example for a language with different writing systems.
 %The resource file for Serbian \texttt{mypackage-serbian.ldf}:
 %\begin{verbatim}
@@ -737,6 +772,9 @@
 %}
 %\end{verbatim}
 %
+%With v1.4+ you would just need \texttt{mypackage-sr-Latn.ldf},
+%\texttt{mypackage-sr-Cyrl.ldf} for the regionless versions.
+%
 %\section{Language Packages}
 %\label{sec:summary-langpkg}
 %
@@ -747,7 +785,9 @@
 %the document author has requested. You can use the
 %\styfmt{tracklang} package to identify this information
 %by tracking the requested localisation, so that other packages
-%can have a consistent way of querying it.
+%can have a consistent way of querying it. (See also:
+%\href{https://www.dickimaw-books.com/latex/tracklang/langpkg.shtml}{Integrating
+%\texttt{tracklang.tex} into Language Packages}.)
 %
 %Generic use:
 %\begin{verbatim}
@@ -755,7 +795,7 @@
 %\end{verbatim}
 %Alternative \LaTeX\ use:
 %\begin{verbatim}
-%\RequirePackage{tracklang}[2016/10/07] % v1.3
+%\RequirePackage{tracklang}[2019/11/30] % v1.4
 %\end{verbatim}
 %Unlike \cs{input}, \cs{RequirePackage} will allow \styfmt{tracklang}
 %to pick up the document class options, but using \cs{RequirePackage}
@@ -795,9 +835,8 @@
 %\texttt{british}, but the above method will change that mapping
 %to \texttt{UKenglish}.)
 %
-%This now means that \cs{TrackLangAddToCaptions} command used
-%at the end of \sectionref{sec:summary-localepkg} above can
-%find your caption hook. You don't need the map if your dialect
+%This now means that \cs{TrackLangAddToHook} and \cs{TrackLangRedefHook} commands can
+%find your language hooks. You don't need the map if your dialect
 %label is the same as \styfmt{tracklang}'s root language label
 %for that locale. For example:
 %\begin{verbatim}
@@ -820,11 +859,13 @@
 %tracked with that language. For example:
 %\begin{verbatim}
 %\def\selectlanguage#1{%
+%  \SetCurrentTrackedDialect{#1}%
 %  % set up hyphenation patterns etc
-%  \SetCurrentTrackedDialect{#1}%
 %}
 %\end{verbatim}
-%See the example in \sectionref{sec:summary-doc}.
+%See the example in \sectionref{sec:summary-doc} or the example in 
+%\href{https://www.dickimaw-books.com/latex/tracklang/langpkg.shtml}{Integrating
+%\texttt{tracklang.tex} into Language Packages}.
 %
 %\chapter{Generic Use}
 %\label{sec:generic}
@@ -1342,9 +1383,9 @@
 %\end{verbatim}
 %will add a new dialect with the label \texttt{xxYYmod} and 
 %\begin{verbatim}
-%\TrackLanguageTag{xx-YY-Latn}
+%\TrackLanguageTag{xx-Latn-YY}
 %\end{verbatim}
-%will add a new dialect with the label \texttt{xxYYLatn}.
+%will add a new dialect with the label \texttt{xxLatnYY}.
 %
 %\begin{important}
 %If \cs{TrackLocale} or \cs{TrackLangFromEnv} find a modifier, the 
@@ -1412,8 +1453,8 @@
 %\begin{verbatim}
 %\input tracklang
 %\TrackLanguageTag{en-826}
-%Has en-GB-Latn been tracked?
-%\GetTrackedDialectFromLanguageTag{en-GB-Latn}{\thisdialect}%
+%Has en-Latn-GB been tracked?
+%\GetTrackedDialectFromLanguageTag{en-Latn-GB}{\thisdialect}%
 %\ifx\thisdialect\empty
 % No!
 %\else
@@ -1834,22 +1875,22 @@
 %that each language module has a different maintainer will the
 %maintainers know what tag to use for their language?
 %
-%To help with this, \styfmt{tracklang} provides:
+%\label{pg:filesearch}To help with this, \styfmt{tracklang} provides:
 %\begin{definition}
 %\ics{IfTrackedLanguageFileExists}\marg{dialect}\marg{prefix}\marg{suffix}\marg{true part}\marg{false part}
 %\end{definition}
 %This attempts to find the file called
-%\meta{prefix}\meta{tag}\meta{suffix} where \meta{tag} is determined
-%from \meta{dialect}. If the file is found
+%\meta{prefix}\meta{localeid}\meta{suffix} where \meta{localeid} is determined
+%from \meta{dialect} (see below). If the file is found
 %\begin{definition}
 %\ics{CurrentTrackedTag}
 %\end{definition}
-%is set to \meta{tag} and \meta{true part} is done, otherwise
+%is set to \meta{localeid} and \meta{true part} is done, otherwise
 %\meta{false part} is done.  If this command
 %is empty, then the dialect hasn't been detected. If the dialect
 %has been detected, but no file can be found, then
 %\ics{CurrentTrackedTag} is set to the final attempt at determining
-%\meta{tag}.
+%\meta{localeid}.
 %
 %There's a convenient shortcut command new to version 1.3:
 %\begin{definition}[\DescribeMacro\TrackLangRequireDialect]
@@ -1908,12 +1949,11 @@
 %Otherwise it may be empty or it may expand to the
 %ISO~639-1 or ISO~639-2 or ISO~639-3 code.
 %
-%As from version 1.3, the following are also available, but
-%don't contribute to the tag.
 %\begin{definition}
 %\ics{CurrentTrackedDialectModifier}
 %\end{definition}
-%The dialect's modifier or empty if not set.
+%The dialect's modifier or empty if not set. (This is set but not
+%used in the set of possible \meta{localeid} values.)
 %
 %\begin{definition}
 %\ics{CurrentTrackedDialectVariant}
@@ -1939,83 +1979,110 @@
 %\begin{definition}
 %\ics{CurrentTrackedDialectScript}
 %\end{definition}
-%The dialect's script. If the
-%dialect doesn't have the script set, the default script
-%is used instead. For example, the file \texttt{foo-serbian.ldf}
-%could test for the existence of the file
-%\begin{verbatim}
-%foo-serbian-\CurrentTrackedDialectScript.ldf
-%\end{verbatim}
-%and load it if it exists. The most convenient way is to
-%use \cs{TrackLangRequestResource} (described below):
-%\begin{verbatim}
-%\TrackLangRequestResource
-% {serbian-\CurrentTrackedDialectScript}
-% {}% not found, set default code here
-%\end{verbatim}
-%The Cyrillic settings could then be placed in 
-%\texttt{foo-serbian-Cyrl.ldf} and the Latin settings in
-%\texttt{foo-serbian-Latn.ldf}.
+%The dialect's script. If the dialect doesn't have the script set,
+%the default script for the language is used instead.
 %
-%The \meta{tag} is determined as follows:
-%\begin{enumerate}
+%\cs{IfTrackedLanguageFileExists} behaves as follows:
+%\begin{itemize}
 % \item If no dialect with the given label has been
 %  detected, the condition evaluates to \emph{false} and
 % \ics{CurrentTrackedTag} is empty.
+% \item If a dialect with the given label has been detected, then:
+% \begin{itemize}
+% \item For each possible \meta{localeid} in an ordered set of tags determined by
+%   the dialect label (see below), the first file matching
+%   \meta{prefix}\meta{localeid}\meta{suffix} that's found on
+%   \TeX's path results in the condition evaluating to \emph{true} and
+%   \ics{CurrentTrackedTag} is set to the current \meta{localeid} in the
+%   set. The rest of the set of possible values of \meta{localeid} is skipped.
+% \item If no file matching \meta{prefix}\meta{localeid}\meta{suffix} is
+%   found on \TeX's path, then the condition evaluates to \emph{false}
+%   and \ics{CurrentTrackedTag} is set to the final \meta{localeid} in the
+%   set (the language label).
+% \end{itemize}
+%\end{itemize}
 %
-% \item If there is no language code (ISO~639-1 or 639-2 or 639-3):
+%The ordered set of possible values of \meta{localeid} is determined from
+%the given dialect.
+%\begin{important}
+%The ordering has changed in version 1.4, which now also includes the
+%script and variant. This new ordering should typically make the more
+%common combinations closer to the start of the search.
+%\end{important}
+%The possible values of \meta{localeid} are listed below in the order of priority used
+%by \cs{IfTrackedLanguageFileExists}. Note that the set may contain
+%repetitions (for example, if the dialect label is the same as the
+%root language label). If an item contains an element that hasn't
+%been set (such as the ISO~639-3 code or a sub-language \meta{sublang} or variant) then
+%that item is skipped.
+%\begin{enumerate}
+%\item \meta{localeid} is just the value of \ics{CurrentTrackedLanguageTag}.
+%\item \meta{localeid} is just the dialect label.
 %
-%  \begin{enumerate}
-%  \item If there's also no ISO~3166-1 code (\ics{CurrentTrackedRegion}
-%  is empty), then \meta{tag} (\ics{CurrentTrackedTag}) is set to the
-%  root language (\ics{CurrentTrackedLanguage}). If the file
-%  \meta{prefix}\meta{tag}\meta{suffix} exists, the condition will evaluate to
-%  \emph{true} otherwise it will evaluate to \emph{false}.
+%\item \meta{localeid} is
+%\meta{ISO~639-1}\texttt{-}\meta{sublang}\texttt{-}\meta{script}\texttt{-}\meta{region}.
+%\item \meta{localeid} is
+%\meta{ISO~639-1}\texttt{-}\meta{script}\texttt{-}\meta{region}.
+%\item \meta{localeid} is
+%\meta{ISO~639-1}\texttt{-}\meta{sublang}\texttt{-}\meta{region} (if there's no script or if
+%the script is the default for the given language).
+%\meta{ISO~639-1}\texttt{-}\meta{region} (if there's no script or if
+%the script is the default for the given language).
+%\item \meta{localeid} is
+%\meta{ISO~639-1}\texttt{-}\meta{sublang}\texttt{-}\meta{script}.
+%\item \meta{localeid} is
+%\meta{ISO~639-1}\texttt{-}\meta{script}.
+%\item \meta{localeid} is \meta{ISO~639-1}\texttt{-}\meta{sublang}.
+%\item \meta{localeid} is just \meta{ISO~639-1}.
 %
-%  \item If there is an ISO~3166-1 code, then \meta{tag}
-% (\ics{CurrentTrackedTag}) will be set to \ics{CurrentTrackedRegion}
-% and if the file \meta{prefix}\meta{tag}\meta{suffix} exists,
-% the condition will evaluate to \emph{true} otherwise it will evaluate
-% to \emph{false}.
-%  \end{enumerate}
+%\item \meta{localeid} is
+%\meta{ISO~639-2}\texttt{-}\meta{sublang}\texttt{-}\meta{script}\texttt{-}\meta{region}.
+%\item \meta{localeid} is
+%\meta{ISO~639-2}\texttt{-}\meta{script}\texttt{-}\meta{region}.
+%\item \meta{localeid} is
+%\meta{ISO~639-2}\texttt{-}\meta{sublang}\texttt{-}\meta{region} (if there's no script or if
+%the script is the default for the given language).
+%\meta{ISO~639-2}\texttt{-}\meta{region} (if there's no script or if
+%the script is the default for the given language).
+%\item \meta{localeid} is
+%\meta{ISO~639-2}\texttt{-}\meta{sublang}\texttt{-}\meta{script}.
+%\item \meta{localeid} is
+%\meta{ISO~639-2}\texttt{-}\meta{script}.
+%\item \meta{localeid} is \meta{ISO~639-2}\texttt{-}\meta{sublang}.
+%\item \meta{localeid} is just \meta{ISO~639-2}.
 %
-% \item If \ics{CurrentTrackedRegion} is empty (no ISO~3166-1
-% territory code)
-% then the \meta{tag} (\ics{CurrentTrackedTag}) is set to just
-% \ics{CurrentTrackedIsoCode}.
+%\item \meta{localeid} is
+%\meta{ISO~639-3}\texttt{-}\meta{sublang}\texttt{-}\meta{script}\texttt{-}\meta{region}.
+%\item \meta{localeid} is
+%\meta{ISO~639-3}\texttt{-}\meta{script}\texttt{-}\meta{region}.
+%\item \meta{localeid} is
+%\meta{ISO~639-3}\texttt{-}\meta{sublang}\texttt{-}\meta{region} (if there's no script or if
+%the script is the default for the given language).
+%\meta{ISO~639-3}\texttt{-}\meta{region} (if there's no script or if
+%the script is the default for the given language).
+%\item \meta{localeid} is
+%\meta{ISO~639-3}\texttt{-}\meta{sublang}\texttt{-}\meta{script}.
+%\item \meta{localeid} is
+%\meta{ISO~639-3}\texttt{-}\meta{script}.
+%\item \meta{localeid} is \meta{ISO~639-3}\texttt{-}\meta{sublang}.
+%\item \meta{localeid} is just \meta{ISO~639-3}.
 %
-% If the file \meta{prefix}\meta{tag}\meta{suffix} exists, the condition will
-% evaluate to \emph{true}. If the file doesn't exist and
-% there are additional ISO language codes available (639-2 or 639-3)
-% then the test will be repeated for the next code. 
-% If the test still fails, then the condition evaluates to \emph{false}.
+%\item \meta{localeid} is just \meta{region}.
 %
-% \item\label{itm:lang-country} The \meta{tag} (\ics{CurrentTrackedTag}) is then set to
-%\begin{verbatim}
-%\CurrentTrackedIsoCode-\CurrentTrackedRegion
-%\end{verbatim}
-% and if the file \meta{prefix}\meta{tag}\meta{suffix} exists,
-% the condition evaluates to \emph{true}.
+%\item \meta{localeid} is
+%\meta{ISO~639-1}\texttt{-}\meta{sublang}\texttt{-}\meta{variant}
+%or \meta{ISO~639-1}\texttt{-}\meta{variant} if \meta{sublang} is missing.
 %
-% \item The \meta{tag} (\ics{CurrentTrackedTag}) is then set to
-% just \ics{CurrentTrackedIsoCode}, and if the file 
-% \meta{prefix}\meta{tag}\meta{suffix} exists,
-% the condition evaluates to \emph{true}. If the file doesn't exist
-% and there are other ISO codes (639-2 or 639-3),
-% then \ics{CurrentTrackedIsoCode} is set to the next available
-% language code and step~\ref{itm:lang-country} is retried.
+%\item \meta{localeid} is
+%\meta{ISO~639-2}\texttt{-}\meta{sublang}\texttt{-}\meta{variant}
+%or \meta{ISO~639-2}\texttt{-}\meta{variant} if \meta{sublang} is missing.
 %
-% \item If there is an ISO~3166-1 region code, the 
-% \meta{tag} (\ics{CurrentTrackedTag}) is then set to
-% \ics{CurrentTrackedRegion},
-% and if the file \meta{prefix}\meta{tag}\meta{suffix} exists,
-% the condition evaluates to \emph{true}.
+%\item \meta{localeid} is
+%\meta{ISO~639-3}\texttt{-}\meta{sublang}\texttt{-}\meta{variant}
+%or \meta{ISO~639-3}\texttt{-}\meta{variant} if \meta{sublang} is missing.
 %
-% \item Finally, the \meta{tag} (\ics{CurrentTrackedTag}) is set to
-% the root language label and if the file
-% \meta{prefix}\meta{tag}\meta{suffix} exist the condition
-% evaluates to \emph{true} otherwise it evaluates to \emph{false}.
-%
+%\item \meta{localeid} is just the value of \ics{CurrentTrackedLanguage}
+%(the root language label).
 %\end{enumerate}
 %
 %For example (pre v1.3):
@@ -2055,22 +2122,57 @@
 %If, for example, \ics{ThisDialect} is \texttt{british}, then the file search will
 %be in the order:
 %\begin{enumerate}
-%\item \texttt{mypackage-british.ldf}
-%\item \texttt{mypackage-en-GB.ldf}
-%\item \texttt{mypackage-eng-GB.ldf}
-%\item \texttt{mypackage-en.ldf}
-%\item \texttt{mypackage-eng.ldf}
-%\item \texttt{mypackage-GB.ldf}
-%\item \texttt{mypackage-english.ldf}
+%\item \texttt{mypackage-en-GB.ldf} (language tag)
+%\item \texttt{mypackage-british.ldf} (dialect label)
+%
+%\item \texttt{mypackage-en-Latn-GB.ldf} (639-1 language code, script, region)
+%\item \texttt{mypackage-en-GB.ldf} (639-1 language code, region)
+%\item \texttt{mypackage-en-Latn.ldf} (639-1 language code, script)
+%\item \texttt{mypackage-en.ldf} (639-1 language code)
+%
+%\item \texttt{mypackage-eng-Latn-GB.ldf} (639-2 language code, script, region)
+%\item \texttt{mypackage-eng-GB.ldf} (639-2 language code, region)
+%\item \texttt{mypackage-eng-Latn.ldf} (639-2 language code, script)
+%\item \texttt{mypackage-eng.ldf} (639-2 language code)
+%
+%\item \texttt{mypackage-GB.ldf} (region)
+%\item \texttt{mypackage-english.ldf} (language label)
 %\end{enumerate}
 %
+%If, for example, \ics{ThisDialect} is \texttt{naustrian}, then the file search will
+%be in the order:
+%\begin{enumerate}
+%\item \texttt{mypackage-de-AT-1996.ldf} (language tag)
+%\item \texttt{mypackage-naustrian.ldf} (dialect label)
+%
+%\item \texttt{mypackage-de-Latn-AT.ldf} (639-1 language code, script, region)
+%\item \texttt{mypackage-de-AT.ldf} (639-1 language code, region)
+%\item \texttt{mypackage-de-Latn.ldf} (639-1 language code, script)
+%\item \texttt{mypackage-de.ldf} (639-1 language code)
+%
+%\item \texttt{mypackage-deu-Latn-AT.ldf} (639-2 language code, script, region)
+%\item \texttt{mypackage-deu-AT.ldf} (639-2 language code, region)
+%\item \texttt{mypackage-deu-Latn.ldf} (639-2 language code, script)
+%\item \texttt{mypackage-deu.ldf} (639-2 language code)
+%
+%\item \texttt{mypackage-AT.ldf} (region)
+%
+%\item \texttt{mypackage-de-1996.ldf} (639-1 language code, variant)
+%\item \texttt{mypackage-deu-1996.ldf} (639-2 language code, variant)
+%
+%\item \texttt{mypackage-german.ldf} (language label)
+%\end{enumerate}
+%
 %If, for example, \ics{ThisDialect} is \texttt{francais}, then the file search will
 %be in the order: 
 %\begin{enumerate}
-%\item \texttt{mypackage-francais.ldf}
-%\item \texttt{mypackage-fr.ldf}
-%\item \texttt{mypackage-fra.ldf}
-%\item \texttt{mypackage-french.ldf}
+%\item \texttt{mypackage-fr.ldf} (language tag)
+%\item \texttt{mypackage-francais.ldf} (dialect label)
+%\item \texttt{mypackage-fr-Latn.ldf} (639-1 language code, script)
+%\item \texttt{mypackage-fr.ldf} (639-1 language code)
+%\item \texttt{mypackage-fra-Latn.ldf} (639-2 language code, script)
+%\item \texttt{mypackage-fra.ldf} (639-2 language code)
+%\item \texttt{mypackage-french.ldf} (language)
 %\end{enumerate}
 %This is because the predefined \texttt{francais} option has no
 %region assigned to it. Be careful if the dialect label is the actual
@@ -2077,14 +2179,26 @@
 %root language. For example, if \cs{ThisDialect} is \texttt{french},
 %then the file search will be in the order:
 %\begin{enumerate}
-%\item \texttt{mypackage-french.ldf}
-%\item \texttt{mypackage-fr.ldf}
-%\item \texttt{mypackage-fra.ldf}
-%\item \texttt{mypackage-french.ldf}
+%\item \texttt{mypackage-fr.ldf} (language tag)
+%\item \texttt{mypackage-french.ldf} (dialect label)
+%\item \texttt{mypackage-fr-Latn.ldf} (639-1 language code, script)
+%\item \texttt{mypackage-fr.ldf} (639-1 language code)
+%\item \texttt{mypackage-fra-Latn.ldf} (639-2 language code, script)
+%\item \texttt{mypackage-fra.ldf} (639-2 language code)
+%\item \texttt{mypackage-french.ldf} (language)
 %\end{enumerate}
 %Note that the last try will always fail in this case since if the
-%file exists, it will be found on the first try.
+%file exists, it will be found on the second try.
 %
+%If the dialect label is identical to the root language label then it
+%means that all associated information is the default
+%for that language. For example, in the above case of \texttt{french},
+%the script is \texttt{Latn} and the region is unspecified. The root
+%language label can therefore be used as the fallback in the event of
+%no other match but for the specific case where the dialect is
+%identical to the root language then all unnecessary file name checks
+%can be skipped.
+%
 %If you're only providing support for the root languages (pre v1.3):
 %\begin{verbatim}
 %\AnyTrackedLanguages
@@ -2128,7 +2242,7 @@
 %input through some other method.
 %
 %Within the resource file
-%\meta{pkgname}\texttt{-}\meta{tag}\texttt{.ldf}, 
+%\meta{pkgname}\texttt{-}\meta{localeid}\texttt{.ldf}, 
 %you can identify the file using (new to version 1.3):
 %\begin{definition}[\DescribeMacro\TrackLangProvidesResource]
 %\cs{TrackLangProvidesResource}\marg{tag}\oarg{version info}
@@ -2139,10 +2253,10 @@
 %suitable for other \TeX\ formats.
 %
 %The resource file can load another resource file 
-%\meta{pkgname}\texttt{-}\meta{tag2}\texttt{.ldf}, 
+%\meta{pkgname}\texttt{-}\meta{localeid2}\texttt{.ldf}, 
 %using (new to version 1.3):
 %\begin{definition}[\DescribeMacro\TrackLangRequireResource]
-%\cs{TrackLangRequireResource}\marg{tag2}
+%\cs{TrackLangRequireResource}\marg{localeid2}
 %\end{definition}
 %For example, the dialect file \texttt{foo-en-GB.ldf} might need to
 %load the root language resource file \texttt{foo-english.ldf}:
@@ -2158,13 +2272,13 @@
 %\meta{code1} if it's loaded at this point or \meta{code2} if it's
 %already been loaded then you can use (new to version 1.3):
 %\begin{definition}[\DescribeMacro\TrackLangRequireResourceOrDo]
-%\cs{TrackLangRequireResourceOrDo}\marg{tag2}\marg{code1}\marg{code2}
+%\cs{TrackLangRequireResourceOrDo}\marg{localeid2}\marg{code1}\marg{code2}
 %\end{definition}
 %
 %If you want to load a resource file if it exists (without an
 %error if it doesn't exist), then you can use
 %\begin{definition}[\DescribeMacro\TrackLangRequestResource]
-%\cs{TrackLangRequestResource}\marg{tag2}\marg{not found code}
+%\cs{TrackLangRequestResource}\marg{localeid2}\marg{not found code}
 %\end{definition}
 %If the file doesn't exist, \meta{not found code} is done.
 %
@@ -2235,7 +2349,17 @@
 %This is equivalent to
 %\cs{TrackLangAddToHook}\marg{code}\verb|{captions}|.
 %
+%There may be some hooks, such as \cs{date}\meta{label}, that need
+%redefining rather than appending to.  As from v1.4, there's an
+%analogous command:
+%\begin{definition}[\DescribeMacro\TrackLangRedefHook]
+%\cs{TrackLangRedefHook}\marg{code}\marg{type}
+%\end{definition}
+%which will redefined the hook to do \meta{code}.
 %
+%Note that no expansion is performed on \meta{code} when appending or
+%redefining a hook.
+%
 %\section{Examples}
 %\label{sec:examples}
 %
@@ -2258,10 +2382,20 @@
 % \NeedsTeXFormat{LaTeX2e}
 % \ProvidesPackage{animals}
 %
-% \RequirePackage{tracklang}[2016/10/07] %v1.3
+% \RequirePackage{tracklang}[2019/11/30] %v1.4
 %
 % % Any undeclared options are language settings:
-% \DeclareOption*{\TrackLanguageTag{\CurrentOption}}
+%
+% \DeclareOption*{%
+%  \TrackIfKnownLanguage{\CurrentOption}%
+%  {\PackageInfo{animals}{Tracking language `\CurrentOption'}}% successful
+%  {% failed
+%    \PackageError{animals}%
+%    {Unknown language specification `\CurrentOption'}%
+%    {You need to supply either a known dialect label or a valid language tag}%
+%  }%
+% }
+%
 % \ProcessOptions
 %
 % % Default definitions
@@ -2496,12 +2630,12 @@
 %
 %Earlier, I~mentioned the search order for
 %\ics{IfTrackedLanguageFileExists} where if, for example, the dialect
-%is \texttt{british}, the file search will be:
+%is \texttt{british}, the file search (v1.4+) will be:
 %\begin{enumerate}
 %\item \texttt{mypackage-british.ldf}
 %\item \texttt{mypackage-en-GB.ldf}
+%\item \texttt{mypackage-en.ldf}
 %\item \texttt{mypackage-eng-GB.ldf}
-%\item \texttt{mypackage-en.ldf}
 %\item \texttt{mypackage-eng.ldf}
 %\item \texttt{mypackage-GB.ldf}
 %\item \texttt{mypackage-english.ldf}
@@ -2511,7 +2645,7 @@
 %countries have multiple official languages, which means that the country code on its
 %own may not indicate the language.
 %
-%The reason for including just the country code as the \meta{tag} in the 
+%The reason for including just the country code as the \meta{localeid} in the 
 %file search is to allow for region rather than language dependent
 %settings. For example, suppose I~want to write a package that needs
 %to know whether to use imperial or metric measurements in the
@@ -2524,7 +2658,7 @@
 %
 %\cs{TrackLangRequireDialect} has an optional argument for adjusting
 %the way the resource files are loaded. Suppose I have
-%\texttt{regions-}\meta{tag}\texttt{.ldf} resource files, then
+%\texttt{regions-}\meta{localeid}\texttt{.ldf} resource files, then
 %\begin{verbatim}
 %\TrackLangRequireDialect{regions}{\this at dialect}
 %\end{verbatim}
@@ -2699,7 +2833,7 @@
 %\end{document}
 %\end{verbatim}
 %
-%This works because the \meta{tag} search looks for the
+%This works because the \meta{localeid} search looks for the
 %country code before the root language label. However, this will fail if 
 %the dialect label is the same as a root language label that has an
 %associated territory, marked with \fnregion\ in
@@ -2913,7 +3047,9 @@
 %than a package that provides multilingual support if the user has
 %already loaded a language package) then you can load \styfmt{tracklang}
 %and use the commands below to help other packages track your
-%provided languages.
+%provided languages. (See also:
+%\href{https://www.dickimaw-books.com/latex/tracklang/langpkg.shtml}{Integrating
+%\texttt{tracklang.tex} into Language Packages}.)
 %
 %The \styfmt{tracklang} package can be loaded using
 %\begin{verbatim}
@@ -2927,7 +3063,7 @@
 %When using \LaTeX, there's a difference between the two.
 %The first case prevents \styfmt{tracklang} from picking up
 %the document class options but skips the check for known
-%language packages. This check is redundant since this is
+%language packages. This check is redundant since your package is
 %the language package, so you need to decide is whether or
 %not to allow the user to set up the localisation information
 %through the document class options.
@@ -2945,12 +3081,96 @@
 %
 %If you just use \cs{input}, there's a test at the start of
 %\texttt{tracklang.tex} to determine if it's already been loaded, so
-%you don't need to worry if the user has already loaded it.
+%you don't need to worry if the document has already loaded it.
 %
-%When the language is set (using commands like \cs{selectlanguage}
-%)
-%it would be convenient to users and other packages if the 
-%following command is also used:
+%To integrate \sty{tracklang} into your language package, you need to consider the following
+%steps:
+%\begin{enumerate}
+%\item Does \sty{tracklang} define your supported ISO~15924 language
+%scripts in the \texttt{tracklang-scripts.tex} file?
+%
+%If yes, then skip this step. Otherwise create a file with the
+%relevant \ics{TrackLangScriptMap} command for each unknown script and identify
+%this new file with \ics{TrackLangAddExtraScriptFile} (see
+%\sectionref{sec:newscripts}). This usually
+%won't be necessary unless you have a custom script or a child script
+%(a script that's a sub-category of another script).
+%
+%\item Does \sty{tracklang} recognise the root language?
+%
+%If yes, then skip this step.
+%
+%If your package is setting up a language that \sty{tracklang}
+%doesn't recognise then you will need to define the root language
+%using \cs{TrackLangNewLanguage} (see \sectionref{sec:newlanguages}).
+%
+%This usually won't be the case as \sty{tracklang} should support all
+%languages that have an official ISO~639-1 alpha-2 code.
+%
+%If you simply have a different label from \sty{tracklang} identifying the root language,
+%then you can just set up your label as a dialect using
+%\cs{TrackLangProvidePredefinedDialect} (see \sectionref{sec:predefinedlabels}).
+%
+%\item Does \sty{tracklang} define the relevant ISO~3166 region codes
+%in the \texttt{tracklang-region-codes.tex} file?
+%
+%If yes, then skip this step. Otherwise create a file with the
+%relevant \ics{TrackLangRegionMap} command for each new region and
+%identify this new file with \ics{TrackLangAddExtraRegionFile} (see
+%\sectionref{sec:newregions}). This usually won't be necessary as
+%\sty{tracklang} should recognise all countries that have an alpha-2
+%region code, but you may require it if you need a broader region,
+%such as EU.
+%
+%\item Do you want to define some convenient dialect labels that can
+%be used with \ics{TrackPredefinedDialect}?
+%
+%If no, then skip this step. Otherwise you can use
+%\ics{TrackLangProvidePredefinedLanguage} for root languages
+%and \ics{TrackLangProvidePredefinedDialect} for dialects with
+%additional information, such as a region, sub-language or script
+%(see \sectionref{sec:predefinedlabels}).
+%
+%\item In your language initialisation code, add the \sty{tracklang}
+%code to track the particular dialect (for example, use
+%\cs{TrackPredefinedDialect} for recognised dialect labels or
+%use the \cs{AddTracked}\ldots\ set of commands). See
+%\sectionref{sec:initnewlang}.
+%
+%\item In your language selection code (such as \cs{selectlanguage}), add
+%\cs{SetCurrentTrackedDialect}\marg{label} to allow the document
+%author to easily query the current localisation settings (such as
+%the region). See \sectionref{sec:selectlanguage}.
+%\end{enumerate}
+%
+%\section{Initialising a New Language or Dialect}
+%\label{sec:initnewlang}
+%
+%When the user requests a particular dialect through your language
+%package, you can notify \styfmt{tracklang} of this choice using
+%\begin{definition}
+%\cs{TrackPredefinedDialect}\marg{dialect}
+%\end{definition}
+%provided the dialect label is recognised by \styfmt{tracklang} (all those
+%listed in \refoptstables).
+%
+%If there's no matching dialect predefined by \styfmt{tracklang}, you
+%can just use \cs{TrackLocale} or \cs{TrackLanguageTag} 
+%(described in \sectionref{sec:generic}) 
+%with the appropriate ISO codes \emph{if you're not providing caption
+%hooks}.
+%
+%If you are providing a captions hook mechanism
+%in the form \ics{captions\meta{dialect}}, then if \meta{dialect}
+%doesn't match the corresponding \styfmt{tracklang} dialect label,
+%you can provide a mapping using
+%\cs{SetTrackedDialectLabelMap}, described below.
+%
+%\section{Switching Language or Dialect}
+%\label{sec:selectlanguage}
+%
+%When the document author switches to a different language or
+%dialect, the current localisation information can be set with:
 %\begin{definition}[\DescribeMacro\SetCurrentTrackedDialect]
 %\cs{SetCurrentTrackedDialect}\marg{dialect}
 %\end{definition}
@@ -2994,26 +3214,119 @@
 %to \meta{dialect}. See the accompanying sample file
 %\texttt{sample-setlang.tex} for an example.)
 %
-%When the user requests a particular dialect through your language
-%package, you can notify \styfmt{tracklang} of this choice using
-%\begin{definition}
-%\cs{TrackPredefinedDialect}\marg{dialect}
+%\section{Defining New Scripts}
+%\label{sec:newscripts}
+%
+%The \texttt{tracklang-scripts.tex} file isn't automatically loaded,
+%but if it is then, as from v1.4, it contains a hook at the end of
+%the file that can be used to load additional files that define
+%supplementary scripts. This entails creating a file called, say,
+%\texttt{mypackage-scripts.tex} that contains:
+%\begin{definition}[\DescribeMacro\TrackLangScriptMap]
+%\cs{TrackLangScriptMap}\marg{alpha code}\marg{numeric
+%code}\marg{name}\marg{direction}\marg{parent}
 %\end{definition}
-%if the dialect label is recognised by \styfmt{tracklang} (all those
-%listed in \refoptstables).
+%The first argument \meta{alpha code} is the four-letter ISO~15924 code (such as
+%\texttt{Latn}), the second argument is the numeric code (such as
+%215), the third argument \meta{name} is the name of the script (such
+%as \texttt{Latin}), the fourth argument is the direction (such as
+%\texttt{LR} for left-to-right) and the final argument is the parent
+%script (leave blank if there's no parent). Note that this command will override any previous
+%mapping for those codes. No check is performed to determine if they
+%have already been defined.
 %
-%If there's no matching dialect predefined by \styfmt{tracklang}, you
-%can just use \cs{TrackLocale} or \cs{TrackLanguageTag} 
-%(described in \sectionref{sec:generic}) 
-%with the appropriate ISO codes \emph{if you're not providing caption
-%hooks}.
+%The supplementary file should be identified with:
+%\begin{definition}[\DescribeMacro\TrackLangAddExtraScriptFile]
+%\cs{TrackLangAddExtraScriptFile}\marg{filename}
+%\end{definition}
 %
-%If you are providing a captions hook mechanism
-%in the form \ics{captions\meta{dialect}}, then if \meta{dialect}
-%doesn't match the corresponding \styfmt{tracklang} dialect label,
-%you can provide a mapping using
-%\cs{SetTrackedDialectLabelMap}, described below.
+%\section{Defining New Regions}
+%\label{sec:newregions}
 %
+%The \texttt{tracklang-region-codes.tex} file isn't automatically loaded,
+%but if it is then, as from v1.4, it contains a hook at the end of
+%the file that can be used to load additional files that define
+%supplementary regions. This entails creating a file called, say,
+%\texttt{mypackage-regions.tex} that contains:
+%\begin{definition}[\DescribeMacro\TrackLangRegionMap]
+%\cs{TrackLangRegionMap}\marg{numeric code}\marg{alpha-2 code}\marg{alpha-3 code}
+%\end{definition}
+%where the first argument is the numeric region code (such as 826),
+%the second argument is the alpha-2 region code (such as \texttt{GB})
+%and the third argument is the alpha-3 region code (such as
+%\texttt{GBR}). Note that this command will override any previous
+%mapping for those codes. No check is performed to determine if they
+%have already been defined.
+%
+%The supplementary file should be identified with:
+%\begin{definition}[\DescribeMacro\TrackLangAddExtraRegionFile]
+%\cs{TrackLangAddExtraRegionFile}\marg{filename}
+%\end{definition}
+%
+%\section{Defining a New Language}
+%\label{sec:newlanguages}
+%
+%(New to version 1.3.)
+%If the root language isn't recognised by \styfmt{tracklang}
+%(not listed in \tableref{tab:rootlangopts}), then
+%it can be defined (but not tracked at this point) using:
+%\begin{definition}[\DescribeMacro\TrackLangNewLanguage]
+%\cs{TrackLangNewLanguage}\marg{language name}\marg{639-1
+%code}\marg{639-2 (T)}\marg{639-2 (B)}\marg{639-3}\marg{3166-1}\marg{default
+%script}
+%\end{definition}
+%where \meta{language name} is the root language name, 
+%\meta{639-1 code} is the ISO 639-1 code for that language (may be
+%empty if there isn't one), \meta{639-2 (T)} is the ISO 639-2 (T)
+%code for that language (may be empty if there isn't one),
+%\meta{639-2 (B)} is the ISO 639-2 (B) code for that language (may be
+%empty if it's the same as \meta{639-2 (T)}), \meta{639-3} is the ISO
+%639-3 code for that language (empty if the same as the 639-2
+%code), \meta{3166-1} is the territory ISO code for languages that are only spoken in one
+%territory (should be empty if the language is spoken in multiple
+%territories), and \meta{default script} is the default script (empty
+%if disputed or varies according to region).
+%
+%You can then track this language using \cs{AddTrackedDialect} for
+%dialects or, if no regional variant is needed, you can instead use:
+%\begin{definition}[\DescribeMacro\AddTrackedLanguage]
+%\cs{AddTrackedLanguage}\marg{root language label}
+%\end{definition}
+%This is equivalent to \ics{AddTrackedDialect}\marg{root language
+%label}\marg{root language label}.
+%
+%
+%\section{Defining New \styfmt{tracklang} Labels}
+%\label{sec:predefinedlabels}
+%
+%A dialect label may be predefined with associated information that
+%allows that particular combination to be easily tracked with
+%\cs{TrackPredefinedDialect}. In the case of a dialect label that
+%only requires the information provided in \cs{TrackLangNewLanguage}
+%you can use:
+%\begin{definition}[\DescribeMacro\TrackLangProvidePredefinedLanguage]
+%\cs{TrackLangProvidePredefinedLanguage}\marg{label}
+%\end{definition}
+%where \meta{label} corresponds to the language label used in
+%\cs{TrackLangNewLanguage}. This allows
+%\cs{TrackPredefinedDialect}\marg{label} to not only track the root
+%language but also the associated ISO codes.
+%
+%If the dialect label doesn't match the root language label then use:
+%\begin{definition}[\DescribeMacro\TrackLangProvidePredefinedDialect]
+%\cs{TrackLangProvidePredefinedDialect}\marg{dialect}\marg{language}\marg{region}\marg{modifier}\marg{variant}\marg{map}\marg{script}
+%\end{definition}
+%where \meta{dialect} is the new \sty{tracklang} dialect label,
+%\marg{language} is the \sty{tracklang} root language label,
+%\meta{region} is the ISO~3166-1 region code (may be empty),
+%\meta{modifier} is the modifier (may be empty), \meta{variant}
+%is the variant information (may be empty), \meta{map} is your
+%package's language label that corresponds to the \sty{tracklang}
+%dialect label supplied in the first argument (may be empty if
+%identical), and \meta{script} is the ISO~15914 alpha-4 script code
+%(may be empty if it's the same as the default script for the root
+%language).
+%
 %For compatibility with pre version 1.3, 
 %if the dialect isn't predefined by
 %\styfmt{tracklang}, then you can use:
@@ -3153,35 +3466,8 @@
 %where \meta{dialect} is the dialect label and \meta{value} is the
 %additional information.
 %
-%(New to version 1.3.)
-%If the root language isn't recognised by \styfmt{tracklang}
-%(not listed in \tableref{tab:rootlangopts}), then
-%it can be defined (but not tracked at this point) using:
-%\begin{definition}[\DescribeMacro\TrackLangNewLanguage]
-%\cs{TrackLangNewLanguage}\marg{language name}\marg{639-1
-%code}\marg{639-2 (T)}\marg{639-2 (B)}\marg{639-3}\marg{3166-1}\marg{default
-%script}
-%\end{definition}
-%where \meta{language name} is the root language name, 
-%\meta{639-1 code} is the ISO 639-1 code for that language (may be
-%empty if there isn't one), \meta{639-2 (T)} is the ISO 639-2 (T)
-%code for that language (may be empty if there isn't one),
-%\meta{639-2 (B)} is the ISO 639-2 (B) code for that language (may be
-%empty if it's the same as \meta{639-2 (T)}), \meta{639-3} is the ISO
-%639-3 code for that language (empty if the same as the 639-2
-%code), \meta{3166-1} is the territory ISO code for languages that are only spoken in one
-%territory (should be empty if the language is spoken in multiple
-%territories), and \meta{default script} is the default script (empty
-%if disputed or varies according to region).
+%\section{Example}
 %
-%You can then track this language using \cs{AddTrackedDialect} for
-%dialects or, if no regional variant is needed, you can instead use:
-%\begin{definition}[\DescribeMacro\AddTrackedLanguage]
-%\cs{AddTrackedLanguage}\marg{root language label}
-%\end{definition}
-%This is equivalent to \ics{AddTrackedDialect}\marg{root language
-%label}\marg{root language label}.
-%
 %Suppose I want to create a language package \texttt{alien.sty} that defines the
 %\texttt{martian} language with regional dialects
 %\texttt{lowermartian} and \texttt{uppermartian}. First, let's
@@ -3227,7 +3513,7 @@
 % }
 %\end{verbatim}
 %The caption commands and language set up are in the files
-%\texttt{alien-}\meta{tag}\texttt{.ldf} as in the examples from
+%\texttt{alien-}\meta{localeid}\texttt{.ldf} as in the examples from
 %\sectionref{sec:examples}. This allows for the user having already
 %loaded \styfmt{tracklang} before \styfmt{alien} and used \cs{TrackLangFromEnv} to pick up
 %the locale from the operating system's environment variables.
@@ -3297,7 +3583,7 @@
 % packages such as \styfmt{etoolbox}.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tracklang}[2019/11/11 v1.3.9 (NLCT) Track Languages]
+\ProvidesPackage{tracklang}[2019/11/30 v1.4 (NLCT) Track Languages]
 %    \end{macrocode}
 %\begin{macro}{\@tracklang at declareoption}
 % Set up package options.
@@ -3593,7 +3879,7 @@
 % Version info.
 %    \begin{macrocode}
 \expandafter\def\csname ver at tracklang.tex\endcsname{%
- 2019/11/11 v1.3.9 (NLCT) Track Languages Generic Code}
+ 2019/11/30 v1.4 (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.)
@@ -3729,6 +4015,29 @@
 %    \end{macrocode}
 %\end{macro}
 %
+%\begin{macro}{\@tracklang at ifcseqcsname}
+%\changes{1.4}{2019-11-30}{new}
+%\begin{definition}
+%\cs{@tracklang at ifcseqcsname}\marg{cs}\marg{csname}\marg{true}\marg{false}
+%\end{definition}
+%Compares two commands, the first is reference as a control sequence
+%the second is referenced as a control sequence name. Condition is
+%false if the second isn't defined (no check for the existence of
+%the first).
+%    \begin{macrocode}
+\def\@tracklang at ifcseqcsname#1#2#3#4{%
+  \@tracklang at ifundef{#2}{#4}%
+  {%
+    \expandafter\ifx\expandafter#1\csname#2\endcsname
+      #3%
+    \else
+      #4%
+    \fi
+  }%
+}
+%    \end{macrocode}
+%\end{macro}
+%
 %\begin{macro}{\@tracklang at sanitize}
 %\changes{1.3}{2016-10-07}{new}
 %    \begin{macrocode}
@@ -3745,15 +4054,17 @@
 %
 %\begin{macro}{\@tracklang at firstoftwo}
 %\changes{1.3}{2016-10-07}{new}
+%\changes{1.4}{2019-11-30}{made long}
 %    \begin{macrocode}
-\def\@tracklang at firstoftwo#1#2{#1}
+\long\def\@tracklang at firstoftwo#1#2{#1}
 %    \end{macrocode}
 %\end{macro}
 %
 %\begin{macro}{\@tracklang at secondoftwo}
 %\changes{1.3}{2016-10-07}{new}
+%\changes{1.4}{2019-11-30}{made long}
 %    \begin{macrocode}
-\def\@tracklang at secondoftwo#1#2{#2}
+\long\def\@tracklang at secondoftwo#1#2{#2}
 %    \end{macrocode}
 %\end{macro}
 %
@@ -3842,6 +4153,28 @@
 %    \end{macrocode}
 %\end{macro}
 %
+%\begin{macro}{\ifTrackLangShowVerbose}
+%\changes{1.4}{2019-11-30}{new}
+% Allow user to switch verbose (debugging) information messages on or off.
+% Note that verbose information will be off regardless of this
+% switch if the info switch is off.
+%    \begin{macrocode}
+\newif\ifTrackLangShowVerbose
+\TrackLangShowVerbosefalse
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at verbose}
+%\changes{1.4}{2019-11-30}{new}
+%    \begin{macrocode}
+\def\@tracklang at verbose#1{%
+  \ifTrackLangShowVerbose
+    \@tracklang at info{#1}%
+  \fi
+}%
+%    \end{macrocode}
+%\end{macro}
+%
 %\begin{macro}{\@tracklang at IfFileExists}
 %    \begin{macrocode}
 \ifx\IfFileExists\undefined
@@ -5201,9 +5534,11 @@
 %    \begin{macrocode}
 \def\SetCurrentTrackedDialect#1{%
   \edef\CurrentTrackedDialect{#1}%
+  \@tracklang at verbose{Setting current tracked dialect `\CurrentTrackedDialect'}%
   \IfTrackedDialect{\CurrentTrackedDialect}%
   {}%
   {%
+    \@tracklang at verbose{Not a recognised tracklang label}%
 %    \end{macrocode}
 % Has a mapping from this dialect to a tracklang dialect been supplied?
 %    \begin{macrocode}
@@ -5213,6 +5548,7 @@
       {%
         \edef\CurrentTrackedDialect{\GetTrackedDialectFromMapping
           {\CurrentTrackedDialect}}%
+        \@tracklang at verbose{Mapping found to tracklang label `\CurrentTrackedDialect'}%
       }%
       {%
 %    \end{macrocode}
@@ -5220,32 +5556,41 @@
 %    \begin{macrocode}
         \IfTrackedLanguage{#1}%
         {%
+          \@tracklang at verbose{Supplied label is a root language.
+             Finding last tracked dialect for language `#1'}%
 %    \end{macrocode}
 % Get the last dialect to be tracked with this language.
-%  \begin{macrocode}
+%    \begin{macrocode}
           \edef\@tracklang at dialects{\TrackedDialectsFromLanguage{#1}}%
           \@tracklang at for\@tracklang at dialect:=\@tracklang at dialects\do{%
             \let\CurrentTrackedDialect\@tracklang at dialect
           }%
         }%
-        {}%
+        {%
+          \@tracklang at verbose{No tracklang dialect found for label `#1'}%
+        }%
       }%
     }%
     {%
+      \@tracklang at verbose{No mapping found}%
 %    \end{macrocode}
 % Has the root language name been supplied?
 %    \begin{macrocode}
       \IfTrackedLanguage{#1}%
       {%
+        \@tracklang at verbose{Supplied label is a root language.
+           Finding last tracked dialect for language `#1'}%
 %    \end{macrocode}
 % Get the last dialect to be tracked with this language.
-%  \begin{macrocode}
+%    \begin{macrocode}
         \edef\@tracklang at dialects{\TrackedDialectsFromLanguage{#1}}%
         \@tracklang at for\@tracklang at dialect:=\@tracklang at dialects\do{%
           \let\CurrentTrackedDialect\@tracklang at dialect
         }%
       }%
-      {}%
+      {%
+        \@tracklang at verbose{No tracklang dialect found for label `#1'}%
+      }%
     }%
   }%
   \IfTrackedDialect{\CurrentTrackedDialect}%
@@ -5308,6 +5653,17 @@
         }%
       }%
     }%
+   \@tracklang at verbose{Current tracked dialect: `\CurrentTrackedDialect'.\MessageBreak
+     Language: `\CurrentTrackedLanguage'.\MessageBreak
+     ISO code: `\CurrentTrackedIsoCode'.\MessageBreak
+     Sub-lang: `\CurrentTrackedDialectSubLang'.\MessageBreak
+     Modifier: `\CurrentTrackedDialectModifier'.\MessageBreak
+     Variant: `\CurrentTrackedDialectVariant'.\MessageBreak
+     Script: `\CurrentTrackedDialectScript'.\MessageBreak
+     Region: `\CurrentTrackedRegion'.\MessageBreak
+     Additional: `\CurrentTrackedDialectAdditional'.\MessageBreak
+     Tag: `\CurrentTrackedLanguageTag'.
+    }%
   }%
   {%
     \@tracklang at warn{Unknown dialect label `#1' passed to 
@@ -6157,6 +6513,86 @@
 %    \end{macrocode}
 %\end{macro}
 %
+%\begin{macro}{\@tracklang at input@extra at region@filelist}
+%\changes{1.4}{2019-11-30}{new}
+%    \begin{macrocode}
+\def\@tracklang at extra@region at filelist{}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\TrackLangAddExtraRegionFile}
+%\changes{1.4}{2019-11-30}{new}
+% Add a file name to the list of extra region code files that should
+% be input by tracklang-regions-codes.tex
+%    \begin{macrocode}
+\def\TrackLangAddExtraRegionFile#1{% 
+ \ifx\TrackLangRegionMap\undefined
+ \else
+%    \end{macrocode}
+% tracklang-region-codes.tex has already been loaded so input the file
+% now.
+%    \begin{macrocode}
+    \@tracklang at input #1\relax
+ \fi
+ \@tracklang at add{#1}{\@tracklang at extra@region at filelist}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at input@extra at region@files}
+%\changes{1.4}{2019-11-30}{new}
+% Iterate through list of extra region files to allow other packages
+% to define new regions.
+%    \begin{macrocode}
+\def\@tracklang at input@extra at region@files{%
+  \@tracklang at for\@tracklang at currfile:=\@tracklang at extra@region at filelist\do
+  {%
+    \@tracklang at input\@tracklang at currfile
+  }%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at input@extra at script@filelist}
+%\changes{1.4}{2019-11-30}{new}
+%    \begin{macrocode}
+\def\@tracklang at extra@script at filelist{}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\TrackLangAddExtraScriptFile}
+%\changes{1.4}{2019-11-30}{new}
+% Add the given file name to the list of files that should be
+% automatically loaded by tracklang-scripts.tex
+%    \begin{macrocode}
+\def\TrackLangAddExtraScriptFile#1{% 
+ \ifx\TrackLangScriptMap\undefined
+ \else
+%    \end{macrocode}
+% tracklang-scripts.tex has already been loaded so input the file
+% now.
+%    \begin{macrocode}
+    \@tracklang at input #1\relax
+ \fi
+ \@tracklang at add{#1}{\@tracklang at extra@script at filelist}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at input@extra at script@files}
+%\changes{1.4}{2019-11-30}{new}
+% Iterate through list of extra script files to allow other packages
+% to define new scripts.
+%    \begin{macrocode}
+\def\@tracklang at input@extra at script@files{%
+  \@tracklang at for\@tracklang at currfile:=\@tracklang at extra@script at filelist\do
+  {%
+    \@tracklang at input\@tracklang at currfile
+  }%
+}
+%    \end{macrocode}
+%\end{macro}
+%
 %\begin{macro}{\GetTrackedDialectFromLanguageTag}
 %\changes{1.3}{2016-10-07}{new}
 %\begin{definition}
@@ -6589,6 +7025,21 @@
 %    \end{macrocode}
 %\end{macro}
 %
+%\begin{macro}{\TrackLangProvidePredefinedLanguage}
+%\changes{1.4}{2019-11-30}{new}
+% Set up a language label for use with \cs{TrackPredefinedDialect}.
+% Note that this doesn't check if already defined.
+%    \begin{macrocode}
+\def\TrackLangProvidePredefinedLanguage#1{%
+  \@tracklang at namedef{@tracklang at add@#1}{%
+    \AddTrackedLanguage{#1}%
+    \AddTrackedLanguageIsoCodes{#1}%
+    \AddTrackedCountryIsoCode{#1}%
+  }%
+}
+%    \end{macrocode}
+%\end{macro}
+%
 %\begin{macro}{\TrackLangDeclareLanguageOption}
 %\changes{1.3}{2016-10-07}{new}
 %\begin{definition}
@@ -6605,11 +7056,7 @@
   \@tracklang at ifundef{@tracklang at add@#1}%
   {%
     \TrackLangNewLanguage{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
-    \@tracklang at namedef{@tracklang at add@#1}{%
-      \AddTrackedLanguage{#1}%
-      \AddTrackedLanguageIsoCodes{#1}%
-      \AddTrackedCountryIsoCode{#1}%
-    }%
+    \TrackLangProvidePredefinedLanguage{#1}%
     \@tracklang at declareoption{#1}%
   }%
   {%
@@ -7949,21 +8396,20 @@
 %\subsection{Predefined Dialects}\label{sec:predefined}
 %
 % Provide some predefined dialects.
-%\begin{macro}{\TrackLangDeclareDialectOption}
-%\changes{1.3}{2016-10-07}{new}
+%\begin{macro}{\TrackLangProvidePredefinedDialect}
+%\changes{1.4}{2019-11-30}{new}
 %\begin{definition}
-%\cs{TrackLangDeclareDialectOption}\marg{dialect}\marg{root
+%\cs{TrackLangProvidePredefinedDialect}\marg{dialect}\marg{root
 %language}\marg{3166-1
 %code}\marg{modifier}\marg{variant}\marg{map}\marg{script}
 %\end{definition}
-%The option name is the same as the dialect name. The arguments
+%This defines a predefined dialect label that can be used
+%by \cs{TrackPredefinedDialect}. The arguments
 %must be expanded before use. The final argument \meta{map} is the
 %mapping from \meta{dialect} to the closest \styfmt{babel} dialect
-%label. May be empty if no relevant mapping.
+%label.
 %    \begin{macrocode}
-\def\TrackLangDeclareDialectOption#1#2#3#4#5#6#7{%
-  \@tracklang at ifundef{@tracklang at add@#1}%
-  {%
+\def\TrackLangProvidePredefinedDialect#1#2#3#4#5#6#7{
     \ifx\relax#3\relax
 %    \end{macrocode}
 % No region.
@@ -8108,6 +8554,26 @@
       \expandafter\def\csname @tracklang at add@#1\expandafter\endcsname
         \expandafter{\@tracklang at tmp\SetTrackedDialectScript{#1}{#7}}%
     \fi
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\TrackLangDeclareDialectOption}
+%\changes{1.3}{2016-10-07}{new}
+%\begin{definition}
+%\cs{TrackLangDeclareDialectOption}\marg{dialect}\marg{root
+%language}\marg{3166-1
+%code}\marg{modifier}\marg{variant}\marg{map}\marg{script}
+%\end{definition}
+%The option name is the same as the dialect name. The arguments
+%must be expanded before use. The final argument \meta{map} is the
+%mapping from \meta{dialect} to the closest \styfmt{babel} dialect
+%label. May be empty if no relevant mapping.
+%    \begin{macrocode}
+\def\TrackLangDeclareDialectOption#1#2#3#4#5#6#7{%
+  \@tracklang at ifundef{@tracklang at add@#1}%
+  {%
+    \TrackLangProvidePredefinedDialect{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
     \@tracklang at declareoption{#1}%
   }%
   {%
@@ -9369,21 +9835,20 @@
 %part}\marg{false part}
 %\end{definition}
 % Determines if the file \meta{prefix}\meta{tag}\meta{suffix}
-% exists, where \meta{tag} is an ISO code or ISO codes identifying
+% exists, where \meta{tag} is an ISO code or ISO codes or label identifying
 % the language. If \meta{dialect} hasn't been identified
 % as a tracked dialect, this just does \meta{false part},
-% otherwise this first tries with \meta{tag} set to
-% \meta{dialect}, then tries with \meta{tag} set to the root
-% language label for \meta{dialect}, then tries with \meta{tag} set to \meta{ISO
-% 639-1 code}\texttt{-}\meta{ISO 3166-1 code}, then tries with
-% \meta{tag} set to \meta{ISO 639-1 code}, then tries with
-% \meta{tag} set to \meta{ISO 639-2 code}\texttt{-}\meta{ISO 3166-1
-% code}, then tries with \meta{tag} set to \meta{ISO 639-2 code}.
+% otherwise this tries various different combinations for \meta{tag}.
 % If the file \meta{prefix}\meta{tag}\meta{suffix} exists, 
 % \cs{CurrentTrackedTag} is set to \meta{tag} and \meta{true part}
 % is performed, otherwise \meta{false part} is performed.
+% The order of priority has changed with version 1.4 and now
+% includes a check for variations that include the script. If the
+% original ordering is specifically required, the old behaviour can
+% be obtained with \cs{IfTrackedLanguageFileExists at orig}.
 %    \begin{macrocode}
 \long\def\IfTrackedLanguageFileExists#1#2#3#4#5{%
+   \@tracklang at verbose{Finding file for dialect `#1'}%
 %    \end{macrocode}
 %Initialise.
 %    \begin{macrocode}
@@ -9395,16 +9860,1756 @@
    \IfTrackedDialect{#1}%
    {%
 %    \end{macrocode}
-% Try just the dialect label.
+% Save the three types of language codes to for reference.
 %    \begin{macrocode}
+     \edef\CurrentTrackedIsoCodeI{\TrackedIsoCodeFromLanguage
+         {639-1}{\CurrentTrackedLanguage}}%
+     \edef\CurrentTrackedIsoCodeII{\TrackedIsoCodeFromLanguage
+         {639-2}{\CurrentTrackedLanguage}}%
+     \edef\CurrentTrackedIsoCodeIII{\TrackedIsoCodeFromLanguage
+         {639-3}{\CurrentTrackedLanguage}}%
+%    \end{macrocode}
+%\changes{1.4}{2019-11-30}{added check for scripts}
+% Earlier versions of this had too many nested conditionals, which
+% was confusing and hard to follow. This is a rewrite that removes
+% the nesting and adds extra checks for dialect scripts.
+%    \begin{macrocode}
+     \@tracklang at test@if at file@exists at for@tag{#1}{#2}{#3}%
+     \@tracklang at if@file at exists{#4}{#5}%
+   }%
+   {#5}% unknown dialect
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at noop}
+%\changes{1.4}{2019-11-30}{new}
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at noop#1#2#3{}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@tag}
+%\changes{1.4}{2019-11-30}{new}
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@tag#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedLanguageTag
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at secondoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@dialect
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@dialect}
+%\changes{1.4}{2019-11-30}{new}
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@dialect#1#2#3{%
+  \edef\CurrentTrackedTag{#1}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \IfTrackedLanguageHasIsoCode{639-1}{\CurrentTrackedLanguage}%
+    {%
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIscriptregion
+    }%
+    {%
+      \IfTrackedLanguageHasIsoCode{639-2}{\CurrentTrackedLanguage}%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscriptregion
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode{639-3}{\CurrentTrackedLanguage}%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptregion
+        }%
+        {%
+          \let\CurrentTrackedIsoCode\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@scriptregion
+        }%
+      }%
+    }%
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIscriptregion}
+%\changes{1.4}{2019-11-30}{new}
+% Test \meta{639-1}-\meta{sublang}-\meta{script}-\meta{region} combination.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIscriptregion#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeI
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \ifx\CurrentTrackedDialectScript\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \fi
+  \ifx\CurrentTrackedRegion\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedRegion}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedRegion\empty
+      \ifx\CurrentTrackedDialectScript\empty
+%    \end{macrocode}
+%No script or region set. If there's a sub-language code then try
+%again without it.
+%    \begin{macrocode}
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langII
+        \else
+          \let\CurrentTrackedTag\CurrentTrackedIsoCode
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langII
+          }%
+        \fi
+      \else
+%    \end{macrocode}
+%No region set. If there's a sub-language code then try
+%again without it.
+%    \begin{macrocode}
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipscript
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipscript
+          }%
+        \fi
+      \fi
+    \else
+      \ifx\CurrentTrackedDialectScript\empty
+%    \end{macrocode}
+% Region is set but no script. If there's a sub-language code
+% then try again without it.
+%    \begin{macrocode}
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipregion
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipregion
+          }%
+        \fi
+      \else
+%    \end{macrocode}
+% Region and script set. If there's a sub-language code
+% then try again without it.
+%    \begin{macrocode}
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipscriptregion
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript
+            -\CurrentTrackedRegion}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipscriptregion
+          }%
+        \fi
+      \fi
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIscriptregion}
+%\changes{1.4}{2019-11-30}{new}
+% Test \meta{639-2}-\meta{sublang}-\meta{script}-\meta{region} combination.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIscriptregion#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \ifx\CurrentTrackedDialectScript\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \fi
+  \ifx\CurrentTrackedRegion\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedRegion}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedRegion\empty
+      \ifx\CurrentTrackedDialectScript\empty
+%    \end{macrocode}
+%No script or region set. If there's a sub-language code then try
+%again without it.
+%    \begin{macrocode}
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIII
+        \else
+          \let\CurrentTrackedTag\CurrentTrackedIsoCode
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIII
+          }%
+        \fi
+      \else
+%    \end{macrocode}
+%No region set. If there's a sub-language code then try
+%again without it.
+%    \begin{macrocode}
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscript
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscript
+          }%
+        \fi
+      \fi
+    \else
+      \ifx\CurrentTrackedDialectScript\empty
+%    \end{macrocode}
+% Region is set but no script. If there's a sub-language code
+% then try again without it.
+%    \begin{macrocode}
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+          }%
+        \fi
+      \else
+%    \end{macrocode}
+% Both region and script are set. If there's a sub-language code
+% then try again without it.
+%    \begin{macrocode}
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscriptregion
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript
+            -\CurrentTrackedRegion}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscriptregion
+          }%
+        \fi
+      \fi
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIIscriptregion}
+%\changes{1.4}{2019-11-30}{new}
+% Test \meta{639-3}-\meta{sublang}-\meta{script}-\meta{region} combination.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIIscriptregion#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \ifx\CurrentTrackedDialectScript\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \fi
+  \ifx\CurrentTrackedRegion\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedRegion}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedRegion\empty
+      \ifx\CurrentTrackedDialectScript\empty
+%    \end{macrocode}
+%No script or region set. If there's a sub-language code then try
+%again without it.
+%    \begin{macrocode}
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+        \else
+          \let\CurrentTrackedTag\CurrentTrackedIsoCode
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+          }%
+        \fi
+      \else
+%    \end{macrocode}
+%No region set. If there's a sub-language code then try
+%again without it.
+%    \begin{macrocode}
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscript
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscript
+          }%
+        \fi
+      \fi
+    \else
+      \ifx\CurrentTrackedDialectScript\empty
+%    \end{macrocode}
+% Region is set but no script. If there's a sub-language code
+% then try again without it.
+%    \begin{macrocode}
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipregion
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipregion
+          }%
+        \fi
+      \else
+%    \end{macrocode}
+% Both region and script are set. If there's a sub-language code
+% then try again without it.
+%    \begin{macrocode}
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscriptregion
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript
+            -\CurrentTrackedRegion}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscriptregion
+          }%
+        \fi
+      \fi
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIskipscript}
+%\changes{1.4}{2019-11-30}{new}
+%No region. Has a script but already tested with 639-1 and script.
+%Just test language code alone.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIskipscript#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \IfTrackedLanguageHasIsoCode
+      {639-2}{\CurrentTrackedLanguage}
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscript
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode
+        {639-3}{\CurrentTrackedLanguage}
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscript
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+        }%
+      }%
+    \else
+%    \end{macrocode}
+% Try without sub-language code.
+%    \begin{macrocode}
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode
+        {639-2}{\CurrentTrackedLanguage}
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscript
+        }%
+        {%
+          \IfTrackedLanguageHasIsoCode
+          {639-3}{\CurrentTrackedLanguage}
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscript
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+          }%
+        }%
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIscript}
+%\changes{1.4}{2019-11-30}{new}
+%No region but has a script.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIscript#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscript
+    \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscript
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIskipscript}
+%\changes{1.4}{2019-11-30}{new}
+%No region. Has a script but already checked.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIskipscript#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \IfTrackedLanguageHasIsoCode
+      {639-3}{\CurrentTrackedLanguage}
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscript
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+      }%
+    \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode
+        {639-3}{\CurrentTrackedLanguage}
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscript
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+        }%
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIIscript}
+%\changes{1.4}{2019-11-30}{new}
+%No region but has a script.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIIscript#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscript
+    \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscript
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIIskipscript}
+%\changes{1.4}{2019-11-30}{new}
+%No region. Has a script but already checked.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIIskipscript#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+    \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIskipregion}
+%\changes{1.4}{2019-11-30}{new}
+%No script. Has a region but already tested with 639-1 and script.
+%Just test language code alone.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \IfTrackedLanguageHasIsoCode
+      {639-2}{\CurrentTrackedLanguage}
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIregion
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode
+        {639-3}{\CurrentTrackedLanguage}
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIregion
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+        }%
+      }%
+    \else
+%    \end{macrocode}
+% Try without sub-language code.
+%    \begin{macrocode}
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode
+        {639-2}{\CurrentTrackedLanguage}
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIregion
+        }%
+        {%
+          \IfTrackedLanguageHasIsoCode
+          {639-3}{\CurrentTrackedLanguage}
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIregion
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+          }%
+        }%
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIregion}
+%\changes{1.4}{2019-11-30}{new}
+%No script but has a region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIregion#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+    \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIskipregion}
+%\changes{1.4}{2019-11-30}{new}
+%No script. Has a region but already tested with 639-2 and region.
+%Just test language code alone.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \IfTrackedLanguageHasIsoCode
+      {639-3}{\CurrentTrackedLanguage}
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIregion
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+      }%
+    \else
+%    \end{macrocode}
+% Try without sub-language code.
+%    \begin{macrocode}
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode
+        {639-3}{\CurrentTrackedLanguage}
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIregion
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+        }%
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIregion}
+%\changes{1.4}{2019-11-30}{new}
+%No script but has a region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIregion#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+    \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIIskipregion}
+%\changes{1.4}{2019-11-30}{new}
+%No script. Has a region but already tested with 639-3 and region.
+%Just test language code alone.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+    \else
+%    \end{macrocode}
+% Try without sub-language code.
+%    \begin{macrocode}
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIIregion}
+%\changes{1.4}{2019-11-30}{new}
+%No script but has a region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIIregion#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+    \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipregion
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIskipscriptregion}
+%\changes{1.4}{2019-11-30}{new}
+%Already tested script and region. Test without script if the script
+%is the default then without region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIskipscriptregion#1#2#3{%
+%    \end{macrocode}
+% Is the script the default for this dialect?
+%    \begin{macrocode}
+  \@tracklang at ifcseqcsname\CurrentTrackedDialectScript
+     {@tracklang at knowniso@script@\CurrentTrackedLanguage}%
+  {%
+%    \end{macrocode}
+% Try just language code and region.
+%    \begin{macrocode}
+    \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \ifx\CurrentTrackedDialectSubLang\empty
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+    \fi
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedRegion}%
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+      \ifx\CurrentTrackedDialectSubLang\empty
+%    \end{macrocode}
+% Try just language code and script.
+%    \begin{macrocode}
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIscriptskipregion
+      \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+        \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+        \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+        {%
+          \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIscriptskipregion
+        }%
+      \fi
+    }%
+  }%
+  {%
+%    \end{macrocode}
+% Script isn't the default.
+%    \begin{macrocode}
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIscriptskipregion
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIscriptskipregion}
+%\changes{1.4}{2019-11-30}{new}
+%Test with script and without region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIscriptskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+%    \end{macrocode}
+% Try just language code.
+%    \begin{macrocode}
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipscriptskipregion
+    \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipscriptskipregion
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIskipscriptskipregion}
+%\changes{1.4}{2019-11-30}{new}
+%Test without script and without region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIskipscriptskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+%    \end{macrocode}
+% Try other language codes with script and region.
+%    \begin{macrocode}
+      \IfTrackedLanguageHasIsoCode
+      {639-2}{\CurrentTrackedLanguage}
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscriptregion
+      }%
+      {%
+         \IfTrackedLanguageHasIsoCode
+         {639-3}{\CurrentTrackedLanguage}
+         {%
+           \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+           \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptregion
+         }%
+         {%
+%    \end{macrocode}
+% No other language codes. Try just the region.
+%    \begin{macrocode}
+           \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@region
+         }%
+      }%
+    \else
+%    \end{macrocode}
+% Try just language code.
+%    \begin{macrocode}
+    \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+%    \end{macrocode}
+% Try other language codes with script and region.
+%    \begin{macrocode}
+      \IfTrackedLanguageHasIsoCode
+      {639-2}{\CurrentTrackedLanguage}
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscriptregion
+      }%
+      {%
+         \IfTrackedLanguageHasIsoCode
+         {639-3}{\CurrentTrackedLanguage}
+         {%
+           \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+           \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptregion
+         }%
+         {%
+%    \end{macrocode}
+% No other language codes. Try just the region.
+%    \begin{macrocode}
+           \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@region
+         }%
+      }%
+    }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIskipscriptregion}
+%\changes{1.4}{2019-11-30}{new}
+%Already tested script and region. Test without script if the script
+%is the default then without region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIskipscriptregion#1#2#3{%
+%    \end{macrocode}
+% Is the script the default for this dialect?
+%    \begin{macrocode}
+  \@tracklang at ifcseqcsname\CurrentTrackedDialectScript
+     {@tracklang at knowniso@script@\CurrentTrackedLanguage}%
+  {%
+%    \end{macrocode}
+% Try just language code and region.
+%    \begin{macrocode}
+    \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \ifx\CurrentTrackedDialectSubLang\empty
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+    \fi
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedRegion}%
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+      \ifx\CurrentTrackedDialectSubLang\empty
+%    \end{macrocode}
+% Try just language code and script.
+%    \begin{macrocode}
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscriptskipregion
+      \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+        \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+        \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+        {%
+          \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscriptskipregion
+        }%
+      \fi
+    }%
+  }%
+  {%
+%    \end{macrocode}
+% Script isn't the default.
+%    \begin{macrocode}
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscriptskipregion
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIscriptskipregion}
+%\changes{1.4}{2019-11-30}{new}
+%Test with script and without region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIscriptskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+%    \end{macrocode}
+% Try just language code.
+%    \begin{macrocode}
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscriptskipregion
+    \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscriptskipregion
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIskipscriptskipregion}
+%\changes{1.4}{2019-11-30}{new}
+%Test without script and without region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIskipscriptskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+%    \end{macrocode}
+% Try other language code with script and region.
+%    \begin{macrocode}
+      \IfTrackedLanguageHasIsoCode
+      {639-3}{\CurrentTrackedLanguage}
+      {%
+        \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptregion
+      }%
+      {%
+%    \end{macrocode}
+% No other language codes. Try just the region.
+%    \begin{macrocode}
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@region
+      }%
+    \else
+%    \end{macrocode}
+% Try just language code.
+%    \begin{macrocode}
+    \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+%    \end{macrocode}
+% Try other language codes with script and region.
+%    \begin{macrocode}
+       \IfTrackedLanguageHasIsoCode
+       {639-3}{\CurrentTrackedLanguage}
+       {%
+         \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+         \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptregion
+       }%
+       {%
+%    \end{macrocode}
+% No other language codes. Try just the region.
+%    \begin{macrocode}
+         \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@region
+       }%
+    }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIIskipscriptregion}
+%\changes{1.4}{2019-11-30}{new}
+%Already tested script and region. Test without script if the script
+%is the default then without region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIIskipscriptregion#1#2#3{%
+%    \end{macrocode}
+% Is the script the default for this dialect?
+%    \begin{macrocode}
+  \@tracklang at ifcseqcsname\CurrentTrackedDialectScript
+     {@tracklang at knowniso@script@\CurrentTrackedLanguage}%
+  {%
+%    \end{macrocode}
+% Try just language code and region.
+%    \begin{macrocode}
+    \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \ifx\CurrentTrackedDialectSubLang\empty
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+    \fi
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedRegion}%
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+      \ifx\CurrentTrackedDialectSubLang\empty
+%    \end{macrocode}
+% Try just language code and script.
+%    \begin{macrocode}
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptskipregion
+      \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+        \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+        \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+        {%
+          \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptskipregion
+        }%
+      \fi
+    }%
+  }%
+  {%
+%    \end{macrocode}
+% Script isn't the default.
+%    \begin{macrocode}
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptskipregion
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIIscriptskipregion}
+%\changes{1.4}{2019-11-30}{new}
+%Test with script and without region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIIscriptskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+%    \end{macrocode}
+% Try just language code.
+%    \begin{macrocode}
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscriptskipregion
+    \else
+%    \end{macrocode}
+% Try without sub-language.
+%    \begin{macrocode}
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscriptskipregion
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIIskipscriptskipregion}
+%\changes{1.4}{2019-11-30}{new}
+%Test without script and without region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIIskipscriptskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+%    \end{macrocode}
+% No other language codes. Try just the region.
+%    \begin{macrocode}
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@region
+    \else
+%    \end{macrocode}
+% Try just language code.
+%    \begin{macrocode}
+    \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+%    \end{macrocode}
+% No other language codes. Try just the region.
+%    \begin{macrocode}
+       \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@region
+    }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langII}
+%\changes{1.4}{2019-11-30}{new}
+%No region or script.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langII#1#2#3{%
+  \IfTrackedLanguageHasIsoCode{639-2}{\CurrentTrackedLanguage}%
+  {%
+    \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeII
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectSubLang}%
+    \fi
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+      \ifx\CurrentTrackedDialectSubLang\empty
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIII
+      \else
+        \let\CurrentTrackedTag\CurrentTrackedIsoCode
+        \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+        \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+        {%
+          \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIII
+        }%
+      \fi
+    }%
+    {%
+      \fi
+    }%
+  }%
+  {%
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIII
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIII}
+%\changes{1.4}{2019-11-30}{new}
+%No region or script.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIII#1#2#3{%
+  \IfTrackedLanguageHasIsoCode{639-3}{\CurrentTrackedLanguage}%
+  {%
+    \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectSubLang}%
+    \fi
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+      \ifx\CurrentTrackedDialectSubLang\empty
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+      \else
+        \let\CurrentTrackedTag\CurrentTrackedIsoCode
+        \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+        \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+        {%
+          \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+        }%
+      \fi
+    }%
+  }%
+  {%
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@region}
+%\changes{1.4}{2019-11-30}{new}
+%Test just the region.
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@region#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedRegion
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langvariant}
+%\changes{1.4}{2019-11-30}{new}
+%Test language code and variant
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langvariant#1#2#3{%
+  \ifx\CurrentTrackedDialectVariant\empty
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@rootlang
+  \else
+    \IfTrackedLanguageHasIsoCode{639-1}{\CurrentTrackedLanguage}%
+    {%
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIvariant
+    }%
+    {%
+      \IfTrackedLanguageHasIsoCode{639-2}{\CurrentTrackedLanguage}%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIvariant
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode{639-3}{\CurrentTrackedLanguage}%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIvariant
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@rootlang
+        }%
+      }%
+    }%
+  \fi
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIvariant}
+%\changes{1.4}{2019-11-30}{new}
+%Test 639-1 code and variant
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIvariant#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeI
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectVariant}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \IfTrackedLanguageHasIsoCode{639-2}{\CurrentTrackedLanguage}%
+    {%
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIvariant
+    }
+    {%
+      \IfTrackedLanguageHasIsoCode{639-3}{\CurrentTrackedLanguage}%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIvariant
+      }
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@rootlang
+      }%
+    }%
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIvariant}
+%\changes{1.4}{2019-11-30}{new}
+%Test 639-2 code and variant
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIvariant#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectVariant}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \IfTrackedLanguageHasIsoCode{639-3}{\CurrentTrackedLanguage}%
+    {%
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIvariant
+    }
+    {%
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@rootlang
+    }%
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@langIIIvariant}
+%\changes{1.4}{2019-11-30}{new}
+%Test 639-3 code and variant
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@langIIIvariant#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectVariant}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@rootlang
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at test@if at file@exists at for@rootlang}
+%\changes{1.4}{2019-11-30}{new}
+%Test the root language label. (Final test.)
+%    \begin{macrocode}
+\def\@tracklang at test@if at file@exists at for@rootlang#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedLanguage
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+  }%
+  {}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\IfTrackedLanguageFileExists at orig}
+%\changes{1.4}{2019-11-30}{new}
+%The new definition of \cs{IfTrackedLanguageFileExists} has a
+%different order of priority. If the original behaviour is
+%specifically required, this has the pre version 1.4 definition.
+%    \begin{macrocode}
+\long\def\IfTrackedLanguageFileExists at orig#1#2#3#4#5{%
+   \def\CurrentTrackedTag{}%
+   \SetCurrentTrackedDialect{#1}%
+   \IfTrackedDialect{#1}%
+   {%
      \edef\CurrentTrackedTag{#1}%
      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
      {#4}%
      {%
-%    \end{macrocode}
-% No file found for dialect label, try \meta{ISO 639-1}-\meta{ISO
-% 3166-1} next.
-%    \begin{macrocode}
        \IfTrackedLanguageHasIsoCode
          {639-1}{\CurrentTrackedLanguage}
        {%
@@ -9412,17 +11617,10 @@
              \TrackedIsoCodeFromLanguage
                {639-1}{\CurrentTrackedLanguage}}%
           \ifx\CurrentTrackedRegion\empty
-%    \end{macrocode}
-% No region, just try ISO 639-1 code
-%    \begin{macrocode}
             \let\CurrentTrackedTag\CurrentTrackedIsoCode
             \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
             {#4}
             {%
-%    \end{macrocode}
-% No region and file for just \meta{ISO 639-1 code}. Try ISO 639-2 code.
-% (No check for 639-3 since it has 639-1 code.)
-%    \begin{macrocode}
               \IfTrackedLanguageHasIsoCode
                 {639-2}{\CurrentTrackedLanguage}
               {%
@@ -9433,35 +11631,21 @@
                  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
                  {#4}%
                  {%
-%    \end{macrocode}
-% Try root language.
-%    \begin{macrocode}
                    \let\CurrentTrackedTag\CurrentTrackedLanguage
                    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
                  }%
               }%
               {%
-%    \end{macrocode}
-% No region, no ISO 639-1 code and no ISO 639-2 code.
-% No file found for dialect label, try root language label next.
-%    \begin{macrocode}
                \let\CurrentTrackedTag\CurrentTrackedLanguage
                \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
               }%
             }%
           \else
-%    \end{macrocode}
-% Has a region so try \meta{ISO 639-1 code}\texttt{-}\meta{region}
-%    \begin{macrocode}
             \edef\CurrentTrackedTag{%
               \CurrentTrackedIsoCode-\CurrentTrackedRegion}%
             \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
             {#4}
             {%
-%    \end{macrocode}
-% Has a region but \meta{ISO 639-1 code}\texttt{-}\meta{region}
-% not found, so try \meta{ISO 639-2 code}\texttt{-}\meta{region}
-%    \begin{macrocode}
               \IfTrackedLanguageHasIsoCode
               {639-2}{\CurrentTrackedLanguage}
               {%
@@ -9474,11 +11658,6 @@
                 \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
                 {#4}%
                 {%
-%    \end{macrocode}
-% Has a region but \meta{ISO 639-1 code}\texttt{-}\meta{region} not
-% found and \meta{ISO 639-2 code}\texttt{-}\meta{region} not found,
-% so try just \meta{ISO 639-1 code}
-%    \begin{macrocode}
                   \let\CurrentTrackedTag\org at currenttrackedisocode
                   \let\org at currenttrackedisocode\CurrentTrackedIsoCode
                   \let\CurrentTrackedIsoCode\CurrentTrackedTag
@@ -9485,24 +11664,15 @@
                   \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
                   {#4}
                   {%
-%    \end{macrocode}
-% Try just the ISO 639-2 code.
-%    \begin{macrocode}
                     \let\CurrentTrackedIsoCode\org at currenttrackedisocode
                     \let\CurrentTrackedTag\CurrentTrackedIsoCode
                     \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
                     {#4}%
                     {%
-%    \end{macrocode}
-% Try just the region.
-%    \begin{macrocode}
                       \let\CurrentTrackedTag\CurrentTrackedRegion
                       \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
                       {#4}%
                       {%
-%    \end{macrocode}
-% Try the root language.
-%    \begin{macrocode}
                         \let\CurrentTrackedTag\CurrentTrackedLanguage
                         \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
                       }%
@@ -9511,24 +11681,14 @@
                 }%
               }%
               {%
-%    \end{macrocode}
-% Has a region but \meta{ISO 639-1 code}\texttt{-}\meta{region}
-% not found, and no ISO 639-2 code so just try \meta{ISO 639-1 code}
-%    \begin{macrocode}
                 \let\CurrentTrackedTag\CurrentTrackedIsoCode
                 \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
                 {#4}%
                 {%
-%    \end{macrocode}
-% Just try the region
-%    \begin{macrocode}
                   \let\CurrentTrackedTag\CurrentTrackedRegion
                   \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
                   {#4}%
                   {%
-%    \end{macrocode}
-% Try the root language.
-%    \begin{macrocode}
                     \let\CurrentTrackedTag\CurrentTrackedLanguage
                     \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
                   }%
@@ -9538,9 +11698,6 @@
           \fi
        }%
        {%
-%    \end{macrocode}
-% No ISO 639-1 code. Try ISO 639-2 code.
-%    \begin{macrocode}
          \IfTrackedLanguageHasIsoCode
            {639-2}{\CurrentTrackedLanguage}
          {%
@@ -9549,9 +11706,6 @@
                {639-2}{\CurrentTrackedLanguage}}%
          }%
          {%
-%    \end{macrocode}
-% No ISO 639-1 code or ISO 639-2 code. Try 639-3 code.
-%    \begin{macrocode}
            \IfTrackedLanguageHasIsoCode
              {639-3}{\CurrentTrackedLanguage}
            {%
@@ -9564,78 +11718,41 @@
            }%
          }%
          \ifx\CurrentTrackedIsoCode\empty
-%    \end{macrocode}
-% No ISO 639-1 code or ISO 639-2 code. Try just the region.
-%    \begin{macrocode}
            \ifx\CurrentTrackedRegion\empty
-%    \end{macrocode}
-% No region. Try the root language.
-%    \begin{macrocode}
              \let\CurrentTrackedTag\CurrentTrackedLanguage
              \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
            \else
-%    \end{macrocode}
-% Try the region.
-%    \begin{macrocode}
              \let\CurrentTrackedTag\CurrentTrackedRegion
              \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
              {#4}%
              {%
-%    \end{macrocode}
-% Try the root language.
-%    \begin{macrocode}
                \let\CurrentTrackedTag\CurrentTrackedLanguage
                \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
              }%
            \fi
          \else
-%    \end{macrocode}
-% Has ISO 639-2 or 639-3 code.
-%    \begin{macrocode}
             \ifx\CurrentTrackedRegion\empty
-%    \end{macrocode}
-% Has ISO 639-2 or 639-3 code but no region.
-%    \begin{macrocode}
               \let\CurrentTrackedTag\CurrentTrackedIsoCode
               \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
               {#4}%
               {%
-%    \end{macrocode}
-% Try the root language.
-%    \begin{macrocode}
                 \let\CurrentTrackedTag\CurrentTrackedLanguage
                 \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
               }%
             \else
-%    \end{macrocode}
-% Has ISO 639-2 or 639-3 code and a region. Try \meta{ISO
-% 639-2 or 639-3}\texttt{-}\meta{region} first.
-%    \begin{macrocode}
               \edef\CurrentTrackedTag{%
                 \CurrentTrackedIsoCode-\CurrentTrackedRegion}%
               \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
               {#4}%
               {%
-%    \end{macrocode}
-% Has ISO 639-2 or 639-3 code and a region but \meta{ISO
-% 639-2 or 639-3}\texttt{-}\meta{region} doesn't exist. Try just \meta{ISO
-% 639-2 or 639-3}
-%    \begin{macrocode}
                 \let\CurrentTrackedTag\CurrentTrackedIsoCode
                 \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
                 {#4}%
                 {%
-%    \end{macrocode}
-% Has ISO 639-2 or 639-3 code and a region but \meta{ISO
-% 639-2 or 639-3} doesn't exist. Try just \meta{region}
-%    \begin{macrocode}
                   \let\CurrentTrackedTag\CurrentTrackedRegion
                   \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
                   {#4}%
                   {%
-%    \end{macrocode}
-% Try the root language.
-%    \begin{macrocode}
                     \let\CurrentTrackedTag\CurrentTrackedLanguage
                     \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
                   }%
@@ -9838,6 +11955,102 @@
 %    \end{macrocode}
 %\end{macro}
 %
+%\begin{macro}{\TrackLangRedefHook}
+%\changes{1.4}{2019-11-30}{new}
+%\begin{definition}
+%\cs{TrackLangRedefHook}\marg{code}\marg{type}
+%\end{definition}
+% Similar to \cs{TrackLangAddToHook} but redefines the hook rather
+% than appending to it.
+% This command is not permitted outside resource files.
+%    \begin{macrocode}
+\def\TrackLangRedefHook{\noop at TrackLangRedefHook}
+%    \end{macrocode}
+%\end{macro}
+%\begin{macro}{\noop at TrackLangRedefHook}
+%    \begin{macrocode}
+\def\noop at TrackLangRedefHook#1#2{%
+  \@tracklang at err{\string\TrackLangRedefHook\space
+  only permitted within resource files}
+}
+%    \end{macrocode}
+%\end{macro}
+%\begin{macro}{\@TrackLangRedefHook}
+%    \begin{macrocode}
+\def\@TrackLangRedefHook#1#2{%
+%    \end{macrocode}
+% \sty{babel} check first.
+%    \begin{macrocode}
+  \@tracklang at ifundef{#2\CurrentTrackedDialect}%
+  {%
+%    \end{macrocode}
+% Does the dialect label have a mapping?
+%    \begin{macrocode}
+    \IfTrackedDialectHasMapping{\CurrentTrackedDialect}%
+    {%
+%    \end{macrocode}
+% Try the mapping label next.
+%    \begin{macrocode}
+      \edef\@tracklang at tmp{%
+        \csname @tracklang at dialectmap@tohook@\CurrentTrackedDialect\endcsname}%
+      \@tracklang at ifundef{#2\@tracklang at tmp}%
+      {%
+%    \end{macrocode}
+% No captions hook. Try \sty{polyglossia}.
+%    \begin{macrocode}
+        \@tracklang at ifundef{#2\CurrentTrackedLanguage}%
+        {%
+%    \end{macrocode}
+% No captions hook. Do the code now.
+%    \begin{macrocode}
+          #1%
+        }%
+        {%
+          \@tracklang at redefhook{#2}{\CurrentTrackedLanguage}{#1}%
+        }%
+      }%
+      {%
+        \@tracklang at redefhook{#2}{\@tracklang at tmp}{#1}%
+      }%
+    }%
+    {%
+%    \end{macrocode}
+% \sty{polyglossia} check next.
+%    \begin{macrocode}
+      \@tracklang at ifundef{#2\CurrentTrackedLanguage}%
+      {%
+%    \end{macrocode}
+% No captions hook.
+%    \begin{macrocode}
+      }%
+      {%
+        \@tracklang at redefhook{#2}{\CurrentTrackedLanguage}{#1}%
+      }%
+    }%
+  }%
+  {%
+     \@tracklang at redefhook{#2}{\CurrentTrackedDialect}{#1}%
+  }%
+%    \end{macrocode}
+% Do the code now in case the hook has already been used.
+%    \begin{macrocode}
+  #1%
+}
+%    \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang at redefhook}
+%\changes{1.4}{2019-11-30}{new}
+%\begin{definition}
+%\cs{@tracklang at redefhook}\marg{type}\marg{label}\marg{code}
+%\end{definition}
+%    \begin{macrocode}
+\def\@tracklang at redefhook#1#2#3{%
+ \expandafter\gdef\csname#1#2\endcsname{#3}%
+}
+%    \end{macrocode}
+%\end{macro}
+%
 %\begin{macro}{\SetTrackedDialectLabelMap}
 %\changes{1.3}{2016-10-07}{new}
 %\begin{definition}
@@ -10193,7 +12406,7 @@
 % Version info.
 %    \begin{macrocode}
 \expandafter\def\csname ver at tracklang-region-codes.tex\endcsname{%
- 2019/11/11 v1.3.9 (NLCT) Track Languages Regions}%
+ 2019/11/30 v1.4 (NLCT) Track Languages Regions}%
 %    \end{macrocode}
 %
 %\begin{macro}{\TrackLangRegionMap}
@@ -10560,6 +12773,10 @@
 \TrackLangRegionMap{894}{ZM}{ZMB}%
 \TrackLangRegionMap{716}{ZW}{ZWE}%
 %    \end{macrocode}
+%\changes{1.4}{2019-11-30}{input extra regions if provided}
+%    \begin{macrocode}
+\@tracklang at input@extra at region@files
+%    \end{macrocode}
 %
 %Restore category code of \texttt{@}.
 %    \begin{macrocode}
@@ -10582,7 +12799,7 @@
 %\changes{1.3}{2016-10-07}{added tracklang-scripts.sty}
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tracklang-scripts}[2019/11/11 v1.3.9 (NLCT) Track
+\ProvidesPackage{tracklang-scripts}[2019/11/30 v1.4 (NLCT) Track
 Language Scripts (LaTeX)]
 \RequirePackage{tracklang}
 \input{tracklang-scripts}
@@ -10624,7 +12841,7 @@
 % Version info.
 %    \begin{macrocode}
 \expandafter\def\csname ver at tracklang-scripts.tex\endcsname{%
- 2019/11/11 v1.3.9 (NLCT) Track Languages Scripts (Generic)}%
+ 2019/11/30 v1.4 (NLCT) Track Languages Scripts (Generic)}%
 %    \end{macrocode}
 %
 %\begin{macro}{\TrackLangScriptsMap}
@@ -10785,203 +13002,198 @@
 %\end{macro}
 %
 %Define mappings. The parent information is currently missing.
+%\changes{1.4}{2019-11-30}{removed some spurious empty braces and commented
+%out EOL}
 %    \begin{macrocode}
-\TrackLangScriptMap{Adlm}{166}{Adlam}{RL}{}
-\TrackLangScriptMap{Afak}{439}{Afaka}{varies}{}
-\TrackLangScriptMap{Aghb}{239}{Caucasian Albanian}{LR}{}
-\TrackLangScriptMap{Ahom}{338}{Ahom, Tai Ahom}{LR}{}
-\TrackLangScriptMap{Arab}{160}{Arabic}{RL}{}
-\TrackLangScriptMap{Aran}{161}{Arabic (Nastaliq variant)}{RL}{}
-\TrackLangScriptMap{Armi}{124}{Imperial Aramaic}{RL}{}
-\TrackLangScriptMap{Armn}{230}{Armenian}{LR}{}
-\TrackLangScriptMap{Avst}{134}{Avestan}{RL}{}
-\TrackLangScriptMap{Bali}{360}{Balinese}{LR}{}
-\TrackLangScriptMap{Bamu}{435}{Bamum}{LR}{}
-\TrackLangScriptMap{Bass}{259}{Bassa Vah}{LR}{}
-\TrackLangScriptMap{Batk}{365}{Batak}{LR}{}
-\TrackLangScriptMap{Beng}{334}{Bhaiksuki}{LR}{}
-\TrackLangScriptMap{Blis}{550}{Blissymbols}{varies}{}
-\TrackLangScriptMap{Bopo}{285}{Bopomofo}{LR}{}
-\TrackLangScriptMap{Brah}{300}{Brahmi}{LR}{}
-\TrackLangScriptMap{Brai}{570}{Braille}{LR}{}
-\TrackLangScriptMap{Bugi}{367}{Buginese}{LR}{}
-\TrackLangScriptMap{Buhd}{372}{Buhid}{LR}{}
-\TrackLangScriptMap{Cakm}{349}{Chakma}{LR}{}
-\TrackLangScriptMap{Cans}{440}{Unified Canadian Aboriginal Syllabics}{LR}{}
-\TrackLangScriptMap{Cari}{201}{Carian}{LR}{}
-\TrackLangScriptMap{Cham}{358}{Cham}{LR}{}
-\TrackLangScriptMap{Cher}{445}{Cherokee}{LR}{}
-\TrackLangScriptMap{Cirt}{291}{Cirth}{varies}{}
-\TrackLangScriptMap{Copt}{204}{Coptic}{LR}{}
-\TrackLangScriptMap{Cprt}{403}{Cypriot}{RL}{}
-\TrackLangScriptMap{Cyrl}{220}{Cyrillic}{LR}{}
-\TrackLangScriptMap{Cyrs}{221}{Cyrillic (Old Church Slavonic{}
-variant)}{varies}{}
-\TrackLangScriptMap{Deva}{315}{Devanagari (Nagari)}{LR}{}
-\TrackLangScriptMap{Dsrt}{250}{Deseret (Mormon)}{LR}{}
-\TrackLangScriptMap{Dupl}{755}{Duployan shorthand, Duployan{}
-stenography}{LR}{}
-\TrackLangScriptMap{Egyd}{070}{Egyptian demotic}{RL}{}
-\TrackLangScriptMap{Egyh}{060}{Egyptian hieratic}{RL}{}
-\TrackLangScriptMap{Egyp}{050}{Egyptian hieroglyphs}{LR}{}
-\TrackLangScriptMap{Elba}{226}{Elbasan}{LR}{}
-\TrackLangScriptMap{Ethi}{430}{Ethiopic (Ge'ez)}{LR}{}
-\TrackLangScriptMap{Geok}{241}{Khutsuri (Asomtavruli and{}
-Nuskhuri)}{LR}{}
-\TrackLangScriptMap{Geor}{240}{Georgian (Mkhedruli)}{LR}{}
-\TrackLangScriptMap{Glag}{225}{Glagolitic}{LR}{}
-\TrackLangScriptMap{Goth}{206}{Gothic}{LR}{}
-\TrackLangScriptMap{Gran}{343}{Grantha}{LR}{}
-\TrackLangScriptMap{Grek}{200}{Greek}{LR}{}
-\TrackLangScriptMap{Gujr}{320}{Gujarati}{LR}{}
-\TrackLangScriptMap{Guru}{310}{Gurmukhi}{LR}{}
-\TrackLangScriptMap{Hanb}{503}{Han with Bopomofo (alias for Han +{}
-Bopomofo)}{LR}{}
-\TrackLangScriptMap{Hang}{286}{Hangul}{LR}{}
-\TrackLangScriptMap{Hani}{500}{Han (Hanzi, Kanji, Hanja)}{LR}{}
-\TrackLangScriptMap{Hano}{371}{Hanunoo}{LR}{}
-\TrackLangScriptMap{Hans}{501}{Han (Simplified variant)}{varies}{}
-\TrackLangScriptMap{Hant}{502}{Han (Traditional variant)}{varies}{}
-\TrackLangScriptMap{Hatr}{127}{Hatran}{RL}{}
-\TrackLangScriptMap{Hebr}{125}{Hebrew}{RL}{}
-\TrackLangScriptMap{Hira}{410}{Hiragana}{LR}{}
-\TrackLangScriptMap{Hluw}{080}{Anatolian Hieroglyphs (Luwian{}
-Hieroglyphs, Hittite Hieroglyphs)}{LR}{}
-\TrackLangScriptMap{Hmng}{450}{Pahawh Hmong}{LR}{}
-\TrackLangScriptMap{Hrkt}{412}{Japanese syllabaries (alias for{}
-Hiragana + Katakana)}{varies}{}
-\TrackLangScriptMap{Hung}{176}{Old Hungarian (Hungarian Runic)}{RL}{}
-\TrackLangScriptMap{Inds}{610}{Indus (Harappan)}{RL}{}
-\TrackLangScriptMap{Ital}{210}{Old Italic (Etruscan, Oscan, etc.)}{LR}{}
-\TrackLangScriptMap{Jamo}{284}{Jamo (alias for Jamo subset of{}
-Hangul)}{LR}{}
-\TrackLangScriptMap{Java}{361}{Javanese}{LR}{}
-\TrackLangScriptMap{Jpan}{413}{Japanese (alias for Han + Hiragana +{}
-Katakana)}{varies}{}
-\TrackLangScriptMap{Jurc}{510}{Jurchen}{LR}{}
-\TrackLangScriptMap{Kali}{357}{Kayah Li}{LR}{}
-\TrackLangScriptMap{Kana}{411}{Katakana}{LR}{}
-\TrackLangScriptMap{Khar}{305}{Kharoshthi}{RL}{}
-\TrackLangScriptMap{Khmr}{355}{Khmer}{LR}{}
-\TrackLangScriptMap{Khoj}{322}{Khojki}{LR}{}
-\TrackLangScriptMap{Kitl}{505}{Khitan large script}{LR}{}
-\TrackLangScriptMap{Kits}{288}{Khitan small script}{TB}{}
-\TrackLangScriptMap{Knda}{345}{Kannada}{LR}{}
-\TrackLangScriptMap{Kore}{287}{Korean (alias for Hangul + Han)}{LR}{}
-\TrackLangScriptMap{Kpel}{436}{Kpelle}{LR}{}
-\TrackLangScriptMap{Kthi}{317}{Kaithi}{LR}{}
-\TrackLangScriptMap{Lana}{351}{Tai Tham (Lanna)}{LR}{}
-\TrackLangScriptMap{Laoo}{356}{Lao}{LR}{}
-\TrackLangScriptMap{Latf}{217}{Latin (Fraktur variant)}{varies}{}
-\TrackLangScriptMap{Latg}{216}{Latin (Gaelic variant)}{LR}{}
-\TrackLangScriptMap{Latn}{215}{Latin}{LR}{}
-\TrackLangScriptMap{Leke}{364}{Leke}{LR}{}
-\TrackLangScriptMap{Lepc}{335}{Lepcha}{LR}{}
-\TrackLangScriptMap{Limb}{336}{Limbu}{LR}{}
-\TrackLangScriptMap{Lina}{400}{Linear A}{LR}{}
-\TrackLangScriptMap{Linb}{401}{Linear B}{LR}{}
-\TrackLangScriptMap{Lisu}{399}{Lisu (Fraser)}{LR}{}
-\TrackLangScriptMap{Loma}{437}{Loma}{LR}{}
-\TrackLangScriptMap{Lyci}{202}{Lycian}{LR}{}
-\TrackLangScriptMap{Lydi}{116}{Lydian}{RL}{}
-\TrackLangScriptMap{Mahj}{314}{Mahajani}{LR}{}
-\TrackLangScriptMap{Mand}{140}{Mandaic, Mandaean}{RL}{}
-\TrackLangScriptMap{Mani}{139}{Manichaean}{RL}{}
-\TrackLangScriptMap{Marc}{332}{Marchen}{LR}{}
-\TrackLangScriptMap{Maya}{090}{Mayan hieroglyphs}{varies}{}
-\TrackLangScriptMap{Mend}{438}{Mende Kikakui}{RL}{}
-\TrackLangScriptMap{Merc}{101}{Meroitic Cursive}{RL}{}
-\TrackLangScriptMap{Mero}{100}{Meroitic Hieroglyphs}{RL}{}
-\TrackLangScriptMap{Mlym}{347}{Malayalam}{LR}{}
-\TrackLangScriptMap{Modi}{324}{Modi}{LR}{}
-\TrackLangScriptMap{Mong}{145}{Mongolian}{TB}{}
-\TrackLangScriptMap{Moon}{218}{Moon (Moon code, Moon script, Moon{}
-type)}{varies}{}
-\TrackLangScriptMap{Mroo}{199}{Mro, Mru}{LR}{}
-\TrackLangScriptMap{Mtei}{337}{Meitei Mayek (Meithei, Meetei)}{LR}{}
-\TrackLangScriptMap{Mult}{323}{Multani}{LR}{}
-\TrackLangScriptMap{Mymr}{350}{Myanmar (Burmese)}{LR}{}
-\TrackLangScriptMap{Narb}{106}{Old North Arabian (Ancient North{}
-Arabian)}{RL}{}
-\TrackLangScriptMap{Nbat}{159}{Nabataean}{RL}{}
-\TrackLangScriptMap{Newa}{333}{Newa, Newar, Newari}{LR}{}
-\TrackLangScriptMap{Nkgb}{420}{Nakhi Geba}{LR}{}
-\TrackLangScriptMap{Nkoo}{165}{N'Ko}{RL}{}
-\TrackLangScriptMap{Nshu}{499}{Nushu}{LR}{}
-\TrackLangScriptMap{Ogam}{212}{Ogham}{varies}{}
-\TrackLangScriptMap{Olck}{261}{Ol Chiki}{LR}{}
-\TrackLangScriptMap{Orkh}{175}{Old Turkic, Orkhon Runic}{RL}{}
-\TrackLangScriptMap{Orya}{327}{Oriya}{LR}{}
-\TrackLangScriptMap{Osge}{219}{Osage}{LR}{}
-\TrackLangScriptMap{Osma}{260}{Osmanya}{LR}{}
-\TrackLangScriptMap{Palm}{126}{Palmyrene}{RL}{}
-\TrackLangScriptMap{Pauc}{263}{Pau Cin Hau}{LR}{}
-\TrackLangScriptMap{Perm}{227}{Old Permic}{LR}{}
-\TrackLangScriptMap{Phag}{331}{Phags-pa}{TB}{}
-\TrackLangScriptMap{Phli}{131}{Inscriptional Pahlavi}{RL}{}
-\TrackLangScriptMap{Phlp}{132}{Psalter Pahlavi}{RL}{}
-\TrackLangScriptMap{Phlv}{133}{Book Pahlavi}{RL}{}
-\TrackLangScriptMap{Phnx}{115}{Phoenician}{RL}{}
-\TrackLangScriptMap{Piqd}{293}{Klingon (KLI plqaD)}{LR}{}
-\TrackLangScriptMap{Plrd}{282}{Miao (Pollard)}{LR}{}
-\TrackLangScriptMap{Prti}{130}{Inscriptional Parthian}{RL}{}
-\TrackLangScriptMap{Qaaa}{900}{Reserved for private use{}
-(start)}{varies}{}
-\TrackLangScriptMap{Qaai}{908}{Private use}{varies}{}
-\TrackLangScriptMap{Qabx}{949}{Reserved for private use{}
-(end)}{varies}{}
-\TrackLangScriptMap{Rjng}{363}{Rejang (Redjang, Kaganga)}{LR}{}
-\TrackLangScriptMap{Roro}{620}{Rongorongo}{varies}{}
-\TrackLangScriptMap{Runr}{211}{Runic}{LR}{}
-\TrackLangScriptMap{Samr}{123}{Samaritan}{RL}{}
-\TrackLangScriptMap{Sara}{292}{Sarati}{varies}{}
-\TrackLangScriptMap{Sarb}{105}{Old South Arabian}{RL}{}
-\TrackLangScriptMap{Saur}{344}{Saurashtra}{LR}{}
-\TrackLangScriptMap{Sgnw}{095}{SignWriting}{TB}{}
-\TrackLangScriptMap{Shaw}{281}{Shavian (Shaw)}{LR}{}
-\TrackLangScriptMap{Shrd}{319}{Sharada}{LR}{}
-\TrackLangScriptMap{Sidd}{302}{Siddham}{LR}{}
-\TrackLangScriptMap{Sind}{318}{Khudawadi, Sindhi}{LR}{}
-\TrackLangScriptMap{Sinh}{348}{Sinhala}{LR}{}
-\TrackLangScriptMap{Sora}{398}{Sora Sompeng}{LR}{}
-\TrackLangScriptMap{Sund}{362}{Sundanese}{LR}{}
-\TrackLangScriptMap{Sylo}{316}{Syloti Nagri}{LR}{}
-\TrackLangScriptMap{Syrc}{135}{Syriac}{RL}{}
-\TrackLangScriptMap{Syre}{138}{Syriac (Estrangelo variant)}{RL}{}
-\TrackLangScriptMap{Syrj}{137}{Syriac (Western variant)}{RL}{}
-\TrackLangScriptMap{Syrn}{136}{Syriac (Eastern variant)}{RL}{}
-\TrackLangScriptMap{Tagb}{373}{Tagbanwa}{LR}{}
-\TrackLangScriptMap{Takr}{321}{Takri}{LR}{}
-\TrackLangScriptMap{Tale}{353}{Tai Le}{LR}{}
-\TrackLangScriptMap{Talu}{354}{New Tai Lue}{LR}{}
-\TrackLangScriptMap{Taml}{346}{Tamil}{LR}{}
-\TrackLangScriptMap{Taml}{346}{Tamil}{LR}{}
-\TrackLangScriptMap{Tang}{520}{Tangut}{LR}{}
-\TrackLangScriptMap{Tavt}{359}{Tai Viet}{LR}{}
-\TrackLangScriptMap{Telu}{340}{Telugu}{LR}{}
-\TrackLangScriptMap{Teng}{290}{Tengwar}{LR}{}
-\TrackLangScriptMap{Tfng}{120}{Tifinagh (Berber)}{LR}{}
-\TrackLangScriptMap{Tglg}{370}{Tagalog (Baybayin, Alibata)}{LR}{}
-\TrackLangScriptMap{Thaa}{170}{Thaana}{RL}{}
-\TrackLangScriptMap{Thai}{352}{Thai}{LR}{}
-\TrackLangScriptMap{Tibt}{330}{Tibetan}{LR}{}
-\TrackLangScriptMap{Tirh}{326}{Tirhuta}{LR}{}
-\TrackLangScriptMap{Ugar}{040}{Ugaritic}{LR}{}
-\TrackLangScriptMap{Vaii}{470}{Vai}{LR}{}
-\TrackLangScriptMap{Visp}{280}{Visible Speech}{LR}{}
-\TrackLangScriptMap{Wara}{262}{Warang Citi (Varang Kshiti)}{LR}{}
-\TrackLangScriptMap{Wole}{480}{Woleai}{RL}{}
-\TrackLangScriptMap{Xpeo}{030}{Old Persian}{LR}{}
-\TrackLangScriptMap{Xsux}{020}{Cuneiform, Sumero-Akkadian}{LR}{}
-\TrackLangScriptMap{Yiii}{460}{Yi}{LR}{}
-\TrackLangScriptMap{Zinh}{994}{Inherited script}{inherited}{}
-\TrackLangScriptMap{Zmth}{995}{Mathematical notation}{LR}{}
-\TrackLangScriptMap{Zsym}{996}{Symbols}{varies}{}
-\TrackLangScriptMap{Zsye}{993}{Symbols (emoji variant)}{varies}{}
-\TrackLangScriptMap{Zxxx}{997}{Unwritten documents}{varies}{}
-\TrackLangScriptMap{Zyyy}{998}{Undetermined script}{varies}{}
-\TrackLangScriptMap{Zzzz}{999}{Uncoded script}{varies}{}
+\TrackLangScriptMap{Adlm}{166}{Adlam}{RL}{}%
+\TrackLangScriptMap{Afak}{439}{Afaka}{varies}{}%
+\TrackLangScriptMap{Aghb}{239}{Caucasian Albanian}{LR}{}%
+\TrackLangScriptMap{Ahom}{338}{Ahom, Tai Ahom}{LR}{}%
+\TrackLangScriptMap{Arab}{160}{Arabic}{RL}{}%
+\TrackLangScriptMap{Aran}{161}{Arabic (Nastaliq variant)}{RL}{}%
+\TrackLangScriptMap{Armi}{124}{Imperial Aramaic}{RL}{}%
+\TrackLangScriptMap{Armn}{230}{Armenian}{LR}{}%
+\TrackLangScriptMap{Avst}{134}{Avestan}{RL}{}%
+\TrackLangScriptMap{Bali}{360}{Balinese}{LR}{}%
+\TrackLangScriptMap{Bamu}{435}{Bamum}{LR}{}%
+\TrackLangScriptMap{Bass}{259}{Bassa Vah}{LR}{}%
+\TrackLangScriptMap{Batk}{365}{Batak}{LR}{}%
+\TrackLangScriptMap{Beng}{334}{Bhaiksuki}{LR}{}%
+\TrackLangScriptMap{Blis}{550}{Blissymbols}{varies}{}%
+\TrackLangScriptMap{Bopo}{285}{Bopomofo}{LR}{}%
+\TrackLangScriptMap{Brah}{300}{Brahmi}{LR}{}%
+\TrackLangScriptMap{Brai}{570}{Braille}{LR}{}%
+\TrackLangScriptMap{Bugi}{367}{Buginese}{LR}{}%
+\TrackLangScriptMap{Buhd}{372}{Buhid}{LR}{}%
+\TrackLangScriptMap{Cakm}{349}{Chakma}{LR}{}%
+\TrackLangScriptMap{Cans}{440}{Unified Canadian Aboriginal Syllabics}{LR}{}%
+\TrackLangScriptMap{Cari}{201}{Carian}{LR}{}%
+\TrackLangScriptMap{Cham}{358}{Cham}{LR}{}%
+\TrackLangScriptMap{Cher}{445}{Cherokee}{LR}{}%
+\TrackLangScriptMap{Cirt}{291}{Cirth}{varies}{}%
+\TrackLangScriptMap{Copt}{204}{Coptic}{LR}{}%
+\TrackLangScriptMap{Cprt}{403}{Cypriot}{RL}{}%
+\TrackLangScriptMap{Cyrl}{220}{Cyrillic}{LR}{}%
+\TrackLangScriptMap{Cyrs}{221}{Cyrillic (Old Church Slavonic variant)}{varies}{}%
+\TrackLangScriptMap{Deva}{315}{Devanagari (Nagari)}{LR}{}%
+\TrackLangScriptMap{Dsrt}{250}{Deseret (Mormon)}{LR}{}%
+\TrackLangScriptMap{Dupl}{755}{Duployan shorthand, Duployan stenography}{LR}{}%
+\TrackLangScriptMap{Egyd}{070}{Egyptian demotic}{RL}{}%
+\TrackLangScriptMap{Egyh}{060}{Egyptian hieratic}{RL}{}%
+\TrackLangScriptMap{Egyp}{050}{Egyptian hieroglyphs}{LR}{}%
+\TrackLangScriptMap{Elba}{226}{Elbasan}{LR}{}%
+\TrackLangScriptMap{Ethi}{430}{Ethiopic (Ge'ez)}{LR}{}%
+\TrackLangScriptMap{Geok}{241}{Khutsuri (Asomtavruli and Nuskhuri)}{LR}{}%
+\TrackLangScriptMap{Geor}{240}{Georgian (Mkhedruli)}{LR}{}%
+\TrackLangScriptMap{Glag}{225}{Glagolitic}{LR}{}%
+\TrackLangScriptMap{Goth}{206}{Gothic}{LR}{}%
+\TrackLangScriptMap{Gran}{343}{Grantha}{LR}{}%
+\TrackLangScriptMap{Grek}{200}{Greek}{LR}{}%
+\TrackLangScriptMap{Gujr}{320}{Gujarati}{LR}{}%
+\TrackLangScriptMap{Guru}{310}{Gurmukhi}{LR}{}%
+\TrackLangScriptMap{Hanb}{503}{Han with Bopomofo (alias for Han + Bopomofo)}{LR}{}%
+\TrackLangScriptMap{Hang}{286}{Hangul}{LR}{}%
+\TrackLangScriptMap{Hani}{500}{Han (Hanzi, Kanji, Hanja)}{LR}{}%
+\TrackLangScriptMap{Hano}{371}{Hanunoo}{LR}{}%
+\TrackLangScriptMap{Hans}{501}{Han (Simplified variant)}{varies}{}%
+\TrackLangScriptMap{Hant}{502}{Han (Traditional variant)}{varies}{}%
+\TrackLangScriptMap{Hatr}{127}{Hatran}{RL}{}%
+\TrackLangScriptMap{Hebr}{125}{Hebrew}{RL}{}%
+\TrackLangScriptMap{Hira}{410}{Hiragana}{LR}{}%
+\TrackLangScriptMap{Hluw}{080}{Anatolian Hieroglyphs (Luwian Hieroglyphs, Hittite Hieroglyphs)}{LR}{}%
+\TrackLangScriptMap{Hmng}{450}{Pahawh Hmong}{LR}{}%
+\TrackLangScriptMap{Hrkt}{412}{Japanese syllabaries (alias for Hiragana + Katakana)}{varies}{}%
+\TrackLangScriptMap{Hung}{176}{Old Hungarian (Hungarian Runic)}{RL}{}%
+\TrackLangScriptMap{Inds}{610}{Indus (Harappan)}{RL}{}%
+\TrackLangScriptMap{Ital}{210}{Old Italic (Etruscan, Oscan, etc.)}{LR}{}%
+\TrackLangScriptMap{Jamo}{284}{Jamo (alias for Jamo subset of Hangul)}{LR}{}%
+\TrackLangScriptMap{Java}{361}{Javanese}{LR}{}%
+\TrackLangScriptMap{Jpan}{413}{Japanese (alias for Han + Hiragana + Katakana)}{varies}{}%
+\TrackLangScriptMap{Jurc}{510}{Jurchen}{LR}{}%
+\TrackLangScriptMap{Kali}{357}{Kayah Li}{LR}{}%
+\TrackLangScriptMap{Kana}{411}{Katakana}{LR}{}%
+\TrackLangScriptMap{Khar}{305}{Kharoshthi}{RL}{}%
+\TrackLangScriptMap{Khmr}{355}{Khmer}{LR}{}%
+\TrackLangScriptMap{Khoj}{322}{Khojki}{LR}{}%
+\TrackLangScriptMap{Kitl}{505}{Khitan large script}{LR}{}%
+\TrackLangScriptMap{Kits}{288}{Khitan small script}{TB}{}%
+\TrackLangScriptMap{Knda}{345}{Kannada}{LR}{}%
+\TrackLangScriptMap{Kore}{287}{Korean (alias for Hangul + Han)}{LR}{}%
+\TrackLangScriptMap{Kpel}{436}{Kpelle}{LR}{}%
+\TrackLangScriptMap{Kthi}{317}{Kaithi}{LR}{}%
+\TrackLangScriptMap{Lana}{351}{Tai Tham (Lanna)}{LR}{}%
+\TrackLangScriptMap{Laoo}{356}{Lao}{LR}{}%
+\TrackLangScriptMap{Latf}{217}{Latin (Fraktur variant)}{varies}{}%
+\TrackLangScriptMap{Latg}{216}{Latin (Gaelic variant)}{LR}{}%
+\TrackLangScriptMap{Latn}{215}{Latin}{LR}{}%
+\TrackLangScriptMap{Leke}{364}{Leke}{LR}{}%
+\TrackLangScriptMap{Lepc}{335}{Lepcha}{LR}{}%
+\TrackLangScriptMap{Limb}{336}{Limbu}{LR}{}%
+\TrackLangScriptMap{Lina}{400}{Linear A}{LR}{}%
+\TrackLangScriptMap{Linb}{401}{Linear B}{LR}{}%
+\TrackLangScriptMap{Lisu}{399}{Lisu (Fraser)}{LR}{}%
+\TrackLangScriptMap{Loma}{437}{Loma}{LR}{}%
+\TrackLangScriptMap{Lyci}{202}{Lycian}{LR}{}%
+\TrackLangScriptMap{Lydi}{116}{Lydian}{RL}{}%
+\TrackLangScriptMap{Mahj}{314}{Mahajani}{LR}{}%
+\TrackLangScriptMap{Mand}{140}{Mandaic, Mandaean}{RL}{}%
+\TrackLangScriptMap{Mani}{139}{Manichaean}{RL}{}%
+\TrackLangScriptMap{Marc}{332}{Marchen}{LR}{}%
+\TrackLangScriptMap{Maya}{090}{Mayan hieroglyphs}{varies}{}%
+\TrackLangScriptMap{Mend}{438}{Mende Kikakui}{RL}{}%
+\TrackLangScriptMap{Merc}{101}{Meroitic Cursive}{RL}{}%
+\TrackLangScriptMap{Mero}{100}{Meroitic Hieroglyphs}{RL}{}%
+\TrackLangScriptMap{Mlym}{347}{Malayalam}{LR}{}%
+\TrackLangScriptMap{Modi}{324}{Modi}{LR}{}%
+\TrackLangScriptMap{Mong}{145}{Mongolian}{TB}{}%
+\TrackLangScriptMap{Moon}{218}{Moon (Moon code, Moon script, Moon type)}{varies}{}%
+\TrackLangScriptMap{Mroo}{199}{Mro, Mru}{LR}{}%
+\TrackLangScriptMap{Mtei}{337}{Meitei Mayek (Meithei, Meetei)}{LR}{}%
+\TrackLangScriptMap{Mult}{323}{Multani}{LR}{}%
+\TrackLangScriptMap{Mymr}{350}{Myanmar (Burmese)}{LR}{}%
+\TrackLangScriptMap{Narb}{106}{Old North Arabian (Ancient North Arabian)}{RL}{}%
+\TrackLangScriptMap{Nbat}{159}{Nabataean}{RL}{}%
+\TrackLangScriptMap{Newa}{333}{Newa, Newar, Newari}{LR}{}%
+\TrackLangScriptMap{Nkgb}{420}{Nakhi Geba}{LR}{}%
+\TrackLangScriptMap{Nkoo}{165}{N'Ko}{RL}{}%
+\TrackLangScriptMap{Nshu}{499}{Nushu}{LR}{}%
+\TrackLangScriptMap{Ogam}{212}{Ogham}{varies}{}%
+\TrackLangScriptMap{Olck}{261}{Ol Chiki}{LR}{}%
+\TrackLangScriptMap{Orkh}{175}{Old Turkic, Orkhon Runic}{RL}{}%
+\TrackLangScriptMap{Orya}{327}{Oriya}{LR}{}%
+\TrackLangScriptMap{Osge}{219}{Osage}{LR}{}%
+\TrackLangScriptMap{Osma}{260}{Osmanya}{LR}{}%
+\TrackLangScriptMap{Palm}{126}{Palmyrene}{RL}{}%
+\TrackLangScriptMap{Pauc}{263}{Pau Cin Hau}{LR}{}%
+\TrackLangScriptMap{Perm}{227}{Old Permic}{LR}{}%
+\TrackLangScriptMap{Phag}{331}{Phags-pa}{TB}{}%
+\TrackLangScriptMap{Phli}{131}{Inscriptional Pahlavi}{RL}{}%
+\TrackLangScriptMap{Phlp}{132}{Psalter Pahlavi}{RL}{}%
+\TrackLangScriptMap{Phlv}{133}{Book Pahlavi}{RL}{}%
+\TrackLangScriptMap{Phnx}{115}{Phoenician}{RL}{}%
+\TrackLangScriptMap{Piqd}{293}{Klingon (KLI plqaD)}{LR}{}%
+\TrackLangScriptMap{Plrd}{282}{Miao (Pollard)}{LR}{}%
+\TrackLangScriptMap{Prti}{130}{Inscriptional Parthian}{RL}{}%
+\TrackLangScriptMap{Qaaa}{900}{Reserved for private use (start)}{varies}{}%
+\TrackLangScriptMap{Qaai}{908}{Private use}{varies}{}%
+\TrackLangScriptMap{Qabx}{949}{Reserved for private use (end)}{varies}{}%
+\TrackLangScriptMap{Rjng}{363}{Rejang (Redjang, Kaganga)}{LR}{}%
+\TrackLangScriptMap{Roro}{620}{Rongorongo}{varies}{}%
+\TrackLangScriptMap{Runr}{211}{Runic}{LR}{}%
+\TrackLangScriptMap{Samr}{123}{Samaritan}{RL}{}%
+\TrackLangScriptMap{Sara}{292}{Sarati}{varies}{}%
+\TrackLangScriptMap{Sarb}{105}{Old South Arabian}{RL}{}%
+\TrackLangScriptMap{Saur}{344}{Saurashtra}{LR}{}%
+\TrackLangScriptMap{Sgnw}{095}{SignWriting}{TB}{}%
+\TrackLangScriptMap{Shaw}{281}{Shavian (Shaw)}{LR}{}%
+\TrackLangScriptMap{Shrd}{319}{Sharada}{LR}{}%
+\TrackLangScriptMap{Sidd}{302}{Siddham}{LR}{}%
+\TrackLangScriptMap{Sind}{318}{Khudawadi, Sindhi}{LR}{}%
+\TrackLangScriptMap{Sinh}{348}{Sinhala}{LR}{}%
+\TrackLangScriptMap{Sora}{398}{Sora Sompeng}{LR}{}%
+\TrackLangScriptMap{Sund}{362}{Sundanese}{LR}{}%
+\TrackLangScriptMap{Sylo}{316}{Syloti Nagri}{LR}{}%
+\TrackLangScriptMap{Syrc}{135}{Syriac}{RL}{}%
+\TrackLangScriptMap{Syre}{138}{Syriac (Estrangelo variant)}{RL}{}%
+\TrackLangScriptMap{Syrj}{137}{Syriac (Western variant)}{RL}{}%
+\TrackLangScriptMap{Syrn}{136}{Syriac (Eastern variant)}{RL}{}%
+\TrackLangScriptMap{Tagb}{373}{Tagbanwa}{LR}{}%
+\TrackLangScriptMap{Takr}{321}{Takri}{LR}{}%
+\TrackLangScriptMap{Tale}{353}{Tai Le}{LR}{}%
+\TrackLangScriptMap{Talu}{354}{New Tai Lue}{LR}{}%
+\TrackLangScriptMap{Taml}{346}{Tamil}{LR}{}%
+\TrackLangScriptMap{Taml}{346}{Tamil}{LR}{}%
+\TrackLangScriptMap{Tang}{520}{Tangut}{LR}{}%
+\TrackLangScriptMap{Tavt}{359}{Tai Viet}{LR}{}%
+\TrackLangScriptMap{Telu}{340}{Telugu}{LR}{}%
+\TrackLangScriptMap{Teng}{290}{Tengwar}{LR}{}%
+\TrackLangScriptMap{Tfng}{120}{Tifinagh (Berber)}{LR}{}%
+\TrackLangScriptMap{Tglg}{370}{Tagalog (Baybayin, Alibata)}{LR}{}%
+\TrackLangScriptMap{Thaa}{170}{Thaana}{RL}{}%
+\TrackLangScriptMap{Thai}{352}{Thai}{LR}{}%
+\TrackLangScriptMap{Tibt}{330}{Tibetan}{LR}{}%
+\TrackLangScriptMap{Tirh}{326}{Tirhuta}{LR}{}%
+\TrackLangScriptMap{Ugar}{040}{Ugaritic}{LR}{}%
+\TrackLangScriptMap{Vaii}{470}{Vai}{LR}{}%
+\TrackLangScriptMap{Visp}{280}{Visible Speech}{LR}{}%
+\TrackLangScriptMap{Wara}{262}{Warang Citi (Varang Kshiti)}{LR}{}%
+\TrackLangScriptMap{Wole}{480}{Woleai}{RL}{}%
+\TrackLangScriptMap{Xpeo}{030}{Old Persian}{LR}{}%
+\TrackLangScriptMap{Xsux}{020}{Cuneiform, Sumero-Akkadian}{LR}{}%
+\TrackLangScriptMap{Yiii}{460}{Yi}{LR}{}%
+\TrackLangScriptMap{Zinh}{994}{Inherited script}{inherited}{}%
+\TrackLangScriptMap{Zmth}{995}{Mathematical notation}{LR}{}%
+\TrackLangScriptMap{Zsym}{996}{Symbols}{varies}{}%
+\TrackLangScriptMap{Zsye}{993}{Symbols (emoji variant)}{varies}{}%
+\TrackLangScriptMap{Zxxx}{997}{Unwritten documents}{varies}{}%
+\TrackLangScriptMap{Zyyy}{998}{Undetermined script}{varies}{}%
+\TrackLangScriptMap{Zzzz}{999}{Uncoded script}{varies}{}%
 %    \end{macrocode}
+%\changes{1.4}{2019-11-30}{new}
+%Load additional script files.
+%    \begin{macrocode}
+\@tracklang at input@extra at script@files
+%    \end{macrocode}
 %
 %Restore category code of \texttt{@}.
 %    \begin{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/tracklang/tracklang.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/tracklang/tracklang.ins	2019-12-01 21:35:44 UTC (rev 52990)
+++ trunk/Master/texmf-dist/source/latex/tracklang/tracklang.ins	2019-12-01 21:36:02 UTC (rev 52991)
@@ -1,4 +1,4 @@
-% tracklang.ins generated using makedtx version 1.2 2019/11/11 16:00
+% tracklang.ins generated using makedtx version 1.2 2019/12/1 17:41
 \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	2019-12-01 21:35:44 UTC (rev 52990)
+++ trunk/Master/texmf-dist/tex/generic/tracklang/tracklang-region-codes.tex	2019-12-01 21:36:02 UTC (rev 52991)
@@ -64,7 +64,7 @@
   \expandafter\endinput
 \fi
 \expandafter\def\csname ver at tracklang-region-codes.tex\endcsname{%
- 2019/11/11 v1.3.9 (NLCT) Track Languages Regions}%
+ 2019/11/30 v1.4 (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}%
@@ -349,6 +349,7 @@
 \TrackLangRegionMap{887}{YE}{YEM}%
 \TrackLangRegionMap{894}{ZM}{ZMB}%
 \TrackLangRegionMap{716}{ZW}{ZWE}%
+\@tracklang at input@extra at region@files
 \@tracklang at regions@restore at at
 \endinput
 %%

Modified: trunk/Master/texmf-dist/tex/generic/tracklang/tracklang-scripts.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tracklang/tracklang-scripts.tex	2019-12-01 21:35:44 UTC (rev 52990)
+++ trunk/Master/texmf-dist/tex/generic/tracklang/tracklang-scripts.tex	2019-12-01 21:36:02 UTC (rev 52991)
@@ -64,7 +64,7 @@
   \expandafter\endinput
 \fi
 \expandafter\def\csname ver at tracklang-scripts.tex\endcsname{%
- 2019/11/11 v1.3.9 (NLCT) Track Languages Scripts (Generic)}%
+ 2019/11/30 v1.4 (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}%
@@ -109,201 +109,190 @@
   {#3}%
   {#2}%
 }%
-\TrackLangScriptMap{Adlm}{166}{Adlam}{RL}{}
-\TrackLangScriptMap{Afak}{439}{Afaka}{varies}{}
-\TrackLangScriptMap{Aghb}{239}{Caucasian Albanian}{LR}{}
-\TrackLangScriptMap{Ahom}{338}{Ahom, Tai Ahom}{LR}{}
-\TrackLangScriptMap{Arab}{160}{Arabic}{RL}{}
-\TrackLangScriptMap{Aran}{161}{Arabic (Nastaliq variant)}{RL}{}
-\TrackLangScriptMap{Armi}{124}{Imperial Aramaic}{RL}{}
-\TrackLangScriptMap{Armn}{230}{Armenian}{LR}{}
-\TrackLangScriptMap{Avst}{134}{Avestan}{RL}{}
-\TrackLangScriptMap{Bali}{360}{Balinese}{LR}{}
-\TrackLangScriptMap{Bamu}{435}{Bamum}{LR}{}
-\TrackLangScriptMap{Bass}{259}{Bassa Vah}{LR}{}
-\TrackLangScriptMap{Batk}{365}{Batak}{LR}{}
-\TrackLangScriptMap{Beng}{334}{Bhaiksuki}{LR}{}
-\TrackLangScriptMap{Blis}{550}{Blissymbols}{varies}{}
-\TrackLangScriptMap{Bopo}{285}{Bopomofo}{LR}{}
-\TrackLangScriptMap{Brah}{300}{Brahmi}{LR}{}
-\TrackLangScriptMap{Brai}{570}{Braille}{LR}{}
-\TrackLangScriptMap{Bugi}{367}{Buginese}{LR}{}
-\TrackLangScriptMap{Buhd}{372}{Buhid}{LR}{}
-\TrackLangScriptMap{Cakm}{349}{Chakma}{LR}{}
-\TrackLangScriptMap{Cans}{440}{Unified Canadian Aboriginal Syllabics}{LR}{}
-\TrackLangScriptMap{Cari}{201}{Carian}{LR}{}
-\TrackLangScriptMap{Cham}{358}{Cham}{LR}{}
-\TrackLangScriptMap{Cher}{445}{Cherokee}{LR}{}
-\TrackLangScriptMap{Cirt}{291}{Cirth}{varies}{}
-\TrackLangScriptMap{Copt}{204}{Coptic}{LR}{}
-\TrackLangScriptMap{Cprt}{403}{Cypriot}{RL}{}
-\TrackLangScriptMap{Cyrl}{220}{Cyrillic}{LR}{}
-\TrackLangScriptMap{Cyrs}{221}{Cyrillic (Old Church Slavonic{}
-variant)}{varies}{}
-\TrackLangScriptMap{Deva}{315}{Devanagari (Nagari)}{LR}{}
-\TrackLangScriptMap{Dsrt}{250}{Deseret (Mormon)}{LR}{}
-\TrackLangScriptMap{Dupl}{755}{Duployan shorthand, Duployan{}
-stenography}{LR}{}
-\TrackLangScriptMap{Egyd}{070}{Egyptian demotic}{RL}{}
-\TrackLangScriptMap{Egyh}{060}{Egyptian hieratic}{RL}{}
-\TrackLangScriptMap{Egyp}{050}{Egyptian hieroglyphs}{LR}{}
-\TrackLangScriptMap{Elba}{226}{Elbasan}{LR}{}
-\TrackLangScriptMap{Ethi}{430}{Ethiopic (Ge'ez)}{LR}{}
-\TrackLangScriptMap{Geok}{241}{Khutsuri (Asomtavruli and{}
-Nuskhuri)}{LR}{}
-\TrackLangScriptMap{Geor}{240}{Georgian (Mkhedruli)}{LR}{}
-\TrackLangScriptMap{Glag}{225}{Glagolitic}{LR}{}
-\TrackLangScriptMap{Goth}{206}{Gothic}{LR}{}
-\TrackLangScriptMap{Gran}{343}{Grantha}{LR}{}
-\TrackLangScriptMap{Grek}{200}{Greek}{LR}{}
-\TrackLangScriptMap{Gujr}{320}{Gujarati}{LR}{}
-\TrackLangScriptMap{Guru}{310}{Gurmukhi}{LR}{}
-\TrackLangScriptMap{Hanb}{503}{Han with Bopomofo (alias for Han +{}
-Bopomofo)}{LR}{}
-\TrackLangScriptMap{Hang}{286}{Hangul}{LR}{}
-\TrackLangScriptMap{Hani}{500}{Han (Hanzi, Kanji, Hanja)}{LR}{}
-\TrackLangScriptMap{Hano}{371}{Hanunoo}{LR}{}
-\TrackLangScriptMap{Hans}{501}{Han (Simplified variant)}{varies}{}
-\TrackLangScriptMap{Hant}{502}{Han (Traditional variant)}{varies}{}
-\TrackLangScriptMap{Hatr}{127}{Hatran}{RL}{}
-\TrackLangScriptMap{Hebr}{125}{Hebrew}{RL}{}
-\TrackLangScriptMap{Hira}{410}{Hiragana}{LR}{}
-\TrackLangScriptMap{Hluw}{080}{Anatolian Hieroglyphs (Luwian{}
-Hieroglyphs, Hittite Hieroglyphs)}{LR}{}
-\TrackLangScriptMap{Hmng}{450}{Pahawh Hmong}{LR}{}
-\TrackLangScriptMap{Hrkt}{412}{Japanese syllabaries (alias for{}
-Hiragana + Katakana)}{varies}{}
-\TrackLangScriptMap{Hung}{176}{Old Hungarian (Hungarian Runic)}{RL}{}
-\TrackLangScriptMap{Inds}{610}{Indus (Harappan)}{RL}{}
-\TrackLangScriptMap{Ital}{210}{Old Italic (Etruscan, Oscan, etc.)}{LR}{}
-\TrackLangScriptMap{Jamo}{284}{Jamo (alias for Jamo subset of{}
-Hangul)}{LR}{}
-\TrackLangScriptMap{Java}{361}{Javanese}{LR}{}
-\TrackLangScriptMap{Jpan}{413}{Japanese (alias for Han + Hiragana +{}
-Katakana)}{varies}{}
-\TrackLangScriptMap{Jurc}{510}{Jurchen}{LR}{}
-\TrackLangScriptMap{Kali}{357}{Kayah Li}{LR}{}
-\TrackLangScriptMap{Kana}{411}{Katakana}{LR}{}
-\TrackLangScriptMap{Khar}{305}{Kharoshthi}{RL}{}
-\TrackLangScriptMap{Khmr}{355}{Khmer}{LR}{}
-\TrackLangScriptMap{Khoj}{322}{Khojki}{LR}{}
-\TrackLangScriptMap{Kitl}{505}{Khitan large script}{LR}{}
-\TrackLangScriptMap{Kits}{288}{Khitan small script}{TB}{}
-\TrackLangScriptMap{Knda}{345}{Kannada}{LR}{}
-\TrackLangScriptMap{Kore}{287}{Korean (alias for Hangul + Han)}{LR}{}
-\TrackLangScriptMap{Kpel}{436}{Kpelle}{LR}{}
-\TrackLangScriptMap{Kthi}{317}{Kaithi}{LR}{}
-\TrackLangScriptMap{Lana}{351}{Tai Tham (Lanna)}{LR}{}
-\TrackLangScriptMap{Laoo}{356}{Lao}{LR}{}
-\TrackLangScriptMap{Latf}{217}{Latin (Fraktur variant)}{varies}{}
-\TrackLangScriptMap{Latg}{216}{Latin (Gaelic variant)}{LR}{}
-\TrackLangScriptMap{Latn}{215}{Latin}{LR}{}
-\TrackLangScriptMap{Leke}{364}{Leke}{LR}{}
-\TrackLangScriptMap{Lepc}{335}{Lepcha}{LR}{}
-\TrackLangScriptMap{Limb}{336}{Limbu}{LR}{}
-\TrackLangScriptMap{Lina}{400}{Linear A}{LR}{}
-\TrackLangScriptMap{Linb}{401}{Linear B}{LR}{}
-\TrackLangScriptMap{Lisu}{399}{Lisu (Fraser)}{LR}{}
-\TrackLangScriptMap{Loma}{437}{Loma}{LR}{}
-\TrackLangScriptMap{Lyci}{202}{Lycian}{LR}{}
-\TrackLangScriptMap{Lydi}{116}{Lydian}{RL}{}
-\TrackLangScriptMap{Mahj}{314}{Mahajani}{LR}{}
-\TrackLangScriptMap{Mand}{140}{Mandaic, Mandaean}{RL}{}
-\TrackLangScriptMap{Mani}{139}{Manichaean}{RL}{}
-\TrackLangScriptMap{Marc}{332}{Marchen}{LR}{}
-\TrackLangScriptMap{Maya}{090}{Mayan hieroglyphs}{varies}{}
-\TrackLangScriptMap{Mend}{438}{Mende Kikakui}{RL}{}
-\TrackLangScriptMap{Merc}{101}{Meroitic Cursive}{RL}{}
-\TrackLangScriptMap{Mero}{100}{Meroitic Hieroglyphs}{RL}{}
-\TrackLangScriptMap{Mlym}{347}{Malayalam}{LR}{}
-\TrackLangScriptMap{Modi}{324}{Modi}{LR}{}
-\TrackLangScriptMap{Mong}{145}{Mongolian}{TB}{}
-\TrackLangScriptMap{Moon}{218}{Moon (Moon code, Moon script, Moon{}
-type)}{varies}{}
-\TrackLangScriptMap{Mroo}{199}{Mro, Mru}{LR}{}
-\TrackLangScriptMap{Mtei}{337}{Meitei Mayek (Meithei, Meetei)}{LR}{}
-\TrackLangScriptMap{Mult}{323}{Multani}{LR}{}
-\TrackLangScriptMap{Mymr}{350}{Myanmar (Burmese)}{LR}{}
-\TrackLangScriptMap{Narb}{106}{Old North Arabian (Ancient North{}
-Arabian)}{RL}{}
-\TrackLangScriptMap{Nbat}{159}{Nabataean}{RL}{}
-\TrackLangScriptMap{Newa}{333}{Newa, Newar, Newari}{LR}{}
-\TrackLangScriptMap{Nkgb}{420}{Nakhi Geba}{LR}{}
-\TrackLangScriptMap{Nkoo}{165}{N'Ko}{RL}{}
-\TrackLangScriptMap{Nshu}{499}{Nushu}{LR}{}
-\TrackLangScriptMap{Ogam}{212}{Ogham}{varies}{}
-\TrackLangScriptMap{Olck}{261}{Ol Chiki}{LR}{}
-\TrackLangScriptMap{Orkh}{175}{Old Turkic, Orkhon Runic}{RL}{}
-\TrackLangScriptMap{Orya}{327}{Oriya}{LR}{}
-\TrackLangScriptMap{Osge}{219}{Osage}{LR}{}
-\TrackLangScriptMap{Osma}{260}{Osmanya}{LR}{}
-\TrackLangScriptMap{Palm}{126}{Palmyrene}{RL}{}
-\TrackLangScriptMap{Pauc}{263}{Pau Cin Hau}{LR}{}
-\TrackLangScriptMap{Perm}{227}{Old Permic}{LR}{}
-\TrackLangScriptMap{Phag}{331}{Phags-pa}{TB}{}
-\TrackLangScriptMap{Phli}{131}{Inscriptional Pahlavi}{RL}{}
-\TrackLangScriptMap{Phlp}{132}{Psalter Pahlavi}{RL}{}
-\TrackLangScriptMap{Phlv}{133}{Book Pahlavi}{RL}{}
-\TrackLangScriptMap{Phnx}{115}{Phoenician}{RL}{}
-\TrackLangScriptMap{Piqd}{293}{Klingon (KLI plqaD)}{LR}{}
-\TrackLangScriptMap{Plrd}{282}{Miao (Pollard)}{LR}{}
-\TrackLangScriptMap{Prti}{130}{Inscriptional Parthian}{RL}{}
-\TrackLangScriptMap{Qaaa}{900}{Reserved for private use{}
-(start)}{varies}{}
-\TrackLangScriptMap{Qaai}{908}{Private use}{varies}{}
-\TrackLangScriptMap{Qabx}{949}{Reserved for private use{}
-(end)}{varies}{}
-\TrackLangScriptMap{Rjng}{363}{Rejang (Redjang, Kaganga)}{LR}{}
-\TrackLangScriptMap{Roro}{620}{Rongorongo}{varies}{}
-\TrackLangScriptMap{Runr}{211}{Runic}{LR}{}
-\TrackLangScriptMap{Samr}{123}{Samaritan}{RL}{}
-\TrackLangScriptMap{Sara}{292}{Sarati}{varies}{}
-\TrackLangScriptMap{Sarb}{105}{Old South Arabian}{RL}{}
-\TrackLangScriptMap{Saur}{344}{Saurashtra}{LR}{}
-\TrackLangScriptMap{Sgnw}{095}{SignWriting}{TB}{}
-\TrackLangScriptMap{Shaw}{281}{Shavian (Shaw)}{LR}{}
-\TrackLangScriptMap{Shrd}{319}{Sharada}{LR}{}
-\TrackLangScriptMap{Sidd}{302}{Siddham}{LR}{}
-\TrackLangScriptMap{Sind}{318}{Khudawadi, Sindhi}{LR}{}
-\TrackLangScriptMap{Sinh}{348}{Sinhala}{LR}{}
-\TrackLangScriptMap{Sora}{398}{Sora Sompeng}{LR}{}
-\TrackLangScriptMap{Sund}{362}{Sundanese}{LR}{}
-\TrackLangScriptMap{Sylo}{316}{Syloti Nagri}{LR}{}
-\TrackLangScriptMap{Syrc}{135}{Syriac}{RL}{}
-\TrackLangScriptMap{Syre}{138}{Syriac (Estrangelo variant)}{RL}{}
-\TrackLangScriptMap{Syrj}{137}{Syriac (Western variant)}{RL}{}
-\TrackLangScriptMap{Syrn}{136}{Syriac (Eastern variant)}{RL}{}
-\TrackLangScriptMap{Tagb}{373}{Tagbanwa}{LR}{}
-\TrackLangScriptMap{Takr}{321}{Takri}{LR}{}
-\TrackLangScriptMap{Tale}{353}{Tai Le}{LR}{}
-\TrackLangScriptMap{Talu}{354}{New Tai Lue}{LR}{}
-\TrackLangScriptMap{Taml}{346}{Tamil}{LR}{}
-\TrackLangScriptMap{Taml}{346}{Tamil}{LR}{}
-\TrackLangScriptMap{Tang}{520}{Tangut}{LR}{}
-\TrackLangScriptMap{Tavt}{359}{Tai Viet}{LR}{}
-\TrackLangScriptMap{Telu}{340}{Telugu}{LR}{}
-\TrackLangScriptMap{Teng}{290}{Tengwar}{LR}{}
-\TrackLangScriptMap{Tfng}{120}{Tifinagh (Berber)}{LR}{}
-\TrackLangScriptMap{Tglg}{370}{Tagalog (Baybayin, Alibata)}{LR}{}
-\TrackLangScriptMap{Thaa}{170}{Thaana}{RL}{}
-\TrackLangScriptMap{Thai}{352}{Thai}{LR}{}
-\TrackLangScriptMap{Tibt}{330}{Tibetan}{LR}{}
-\TrackLangScriptMap{Tirh}{326}{Tirhuta}{LR}{}
-\TrackLangScriptMap{Ugar}{040}{Ugaritic}{LR}{}
-\TrackLangScriptMap{Vaii}{470}{Vai}{LR}{}
-\TrackLangScriptMap{Visp}{280}{Visible Speech}{LR}{}
-\TrackLangScriptMap{Wara}{262}{Warang Citi (Varang Kshiti)}{LR}{}
-\TrackLangScriptMap{Wole}{480}{Woleai}{RL}{}
-\TrackLangScriptMap{Xpeo}{030}{Old Persian}{LR}{}
-\TrackLangScriptMap{Xsux}{020}{Cuneiform, Sumero-Akkadian}{LR}{}
-\TrackLangScriptMap{Yiii}{460}{Yi}{LR}{}
-\TrackLangScriptMap{Zinh}{994}{Inherited script}{inherited}{}
-\TrackLangScriptMap{Zmth}{995}{Mathematical notation}{LR}{}
-\TrackLangScriptMap{Zsym}{996}{Symbols}{varies}{}
-\TrackLangScriptMap{Zsye}{993}{Symbols (emoji variant)}{varies}{}
-\TrackLangScriptMap{Zxxx}{997}{Unwritten documents}{varies}{}
-\TrackLangScriptMap{Zyyy}{998}{Undetermined script}{varies}{}
-\TrackLangScriptMap{Zzzz}{999}{Uncoded script}{varies}{}
+\TrackLangScriptMap{Adlm}{166}{Adlam}{RL}{}%
+\TrackLangScriptMap{Afak}{439}{Afaka}{varies}{}%
+\TrackLangScriptMap{Aghb}{239}{Caucasian Albanian}{LR}{}%
+\TrackLangScriptMap{Ahom}{338}{Ahom, Tai Ahom}{LR}{}%
+\TrackLangScriptMap{Arab}{160}{Arabic}{RL}{}%
+\TrackLangScriptMap{Aran}{161}{Arabic (Nastaliq variant)}{RL}{}%
+\TrackLangScriptMap{Armi}{124}{Imperial Aramaic}{RL}{}%
+\TrackLangScriptMap{Armn}{230}{Armenian}{LR}{}%
+\TrackLangScriptMap{Avst}{134}{Avestan}{RL}{}%
+\TrackLangScriptMap{Bali}{360}{Balinese}{LR}{}%
+\TrackLangScriptMap{Bamu}{435}{Bamum}{LR}{}%
+\TrackLangScriptMap{Bass}{259}{Bassa Vah}{LR}{}%
+\TrackLangScriptMap{Batk}{365}{Batak}{LR}{}%
+\TrackLangScriptMap{Beng}{334}{Bhaiksuki}{LR}{}%
+\TrackLangScriptMap{Blis}{550}{Blissymbols}{varies}{}%
+\TrackLangScriptMap{Bopo}{285}{Bopomofo}{LR}{}%
+\TrackLangScriptMap{Brah}{300}{Brahmi}{LR}{}%
+\TrackLangScriptMap{Brai}{570}{Braille}{LR}{}%
+\TrackLangScriptMap{Bugi}{367}{Buginese}{LR}{}%
+\TrackLangScriptMap{Buhd}{372}{Buhid}{LR}{}%
+\TrackLangScriptMap{Cakm}{349}{Chakma}{LR}{}%
+\TrackLangScriptMap{Cans}{440}{Unified Canadian Aboriginal Syllabics}{LR}{}%
+\TrackLangScriptMap{Cari}{201}{Carian}{LR}{}%
+\TrackLangScriptMap{Cham}{358}{Cham}{LR}{}%
+\TrackLangScriptMap{Cher}{445}{Cherokee}{LR}{}%
+\TrackLangScriptMap{Cirt}{291}{Cirth}{varies}{}%
+\TrackLangScriptMap{Copt}{204}{Coptic}{LR}{}%
+\TrackLangScriptMap{Cprt}{403}{Cypriot}{RL}{}%
+\TrackLangScriptMap{Cyrl}{220}{Cyrillic}{LR}{}%
+\TrackLangScriptMap{Cyrs}{221}{Cyrillic (Old Church Slavonic variant)}{varies}{}%
+\TrackLangScriptMap{Deva}{315}{Devanagari (Nagari)}{LR}{}%
+\TrackLangScriptMap{Dsrt}{250}{Deseret (Mormon)}{LR}{}%
+\TrackLangScriptMap{Dupl}{755}{Duployan shorthand, Duployan stenography}{LR}{}%
+\TrackLangScriptMap{Egyd}{070}{Egyptian demotic}{RL}{}%
+\TrackLangScriptMap{Egyh}{060}{Egyptian hieratic}{RL}{}%
+\TrackLangScriptMap{Egyp}{050}{Egyptian hieroglyphs}{LR}{}%
+\TrackLangScriptMap{Elba}{226}{Elbasan}{LR}{}%
+\TrackLangScriptMap{Ethi}{430}{Ethiopic (Ge'ez)}{LR}{}%
+\TrackLangScriptMap{Geok}{241}{Khutsuri (Asomtavruli and Nuskhuri)}{LR}{}%
+\TrackLangScriptMap{Geor}{240}{Georgian (Mkhedruli)}{LR}{}%
+\TrackLangScriptMap{Glag}{225}{Glagolitic}{LR}{}%
+\TrackLangScriptMap{Goth}{206}{Gothic}{LR}{}%
+\TrackLangScriptMap{Gran}{343}{Grantha}{LR}{}%
+\TrackLangScriptMap{Grek}{200}{Greek}{LR}{}%
+\TrackLangScriptMap{Gujr}{320}{Gujarati}{LR}{}%
+\TrackLangScriptMap{Guru}{310}{Gurmukhi}{LR}{}%
+\TrackLangScriptMap{Hanb}{503}{Han with Bopomofo (alias for Han + Bopomofo)}{LR}{}%
+\TrackLangScriptMap{Hang}{286}{Hangul}{LR}{}%
+\TrackLangScriptMap{Hani}{500}{Han (Hanzi, Kanji, Hanja)}{LR}{}%
+\TrackLangScriptMap{Hano}{371}{Hanunoo}{LR}{}%
+\TrackLangScriptMap{Hans}{501}{Han (Simplified variant)}{varies}{}%
+\TrackLangScriptMap{Hant}{502}{Han (Traditional variant)}{varies}{}%
+\TrackLangScriptMap{Hatr}{127}{Hatran}{RL}{}%
+\TrackLangScriptMap{Hebr}{125}{Hebrew}{RL}{}%
+\TrackLangScriptMap{Hira}{410}{Hiragana}{LR}{}%
+\TrackLangScriptMap{Hluw}{080}{Anatolian Hieroglyphs (Luwian Hieroglyphs, Hittite Hieroglyphs)}{LR}{}%
+\TrackLangScriptMap{Hmng}{450}{Pahawh Hmong}{LR}{}%
+\TrackLangScriptMap{Hrkt}{412}{Japanese syllabaries (alias for Hiragana + Katakana)}{varies}{}%
+\TrackLangScriptMap{Hung}{176}{Old Hungarian (Hungarian Runic)}{RL}{}%
+\TrackLangScriptMap{Inds}{610}{Indus (Harappan)}{RL}{}%
+\TrackLangScriptMap{Ital}{210}{Old Italic (Etruscan, Oscan, etc.)}{LR}{}%
+\TrackLangScriptMap{Jamo}{284}{Jamo (alias for Jamo subset of Hangul)}{LR}{}%
+\TrackLangScriptMap{Java}{361}{Javanese}{LR}{}%
+\TrackLangScriptMap{Jpan}{413}{Japanese (alias for Han + Hiragana + Katakana)}{varies}{}%
+\TrackLangScriptMap{Jurc}{510}{Jurchen}{LR}{}%
+\TrackLangScriptMap{Kali}{357}{Kayah Li}{LR}{}%
+\TrackLangScriptMap{Kana}{411}{Katakana}{LR}{}%
+\TrackLangScriptMap{Khar}{305}{Kharoshthi}{RL}{}%
+\TrackLangScriptMap{Khmr}{355}{Khmer}{LR}{}%
+\TrackLangScriptMap{Khoj}{322}{Khojki}{LR}{}%
+\TrackLangScriptMap{Kitl}{505}{Khitan large script}{LR}{}%
+\TrackLangScriptMap{Kits}{288}{Khitan small script}{TB}{}%
+\TrackLangScriptMap{Knda}{345}{Kannada}{LR}{}%
+\TrackLangScriptMap{Kore}{287}{Korean (alias for Hangul + Han)}{LR}{}%
+\TrackLangScriptMap{Kpel}{436}{Kpelle}{LR}{}%
+\TrackLangScriptMap{Kthi}{317}{Kaithi}{LR}{}%
+\TrackLangScriptMap{Lana}{351}{Tai Tham (Lanna)}{LR}{}%
+\TrackLangScriptMap{Laoo}{356}{Lao}{LR}{}%
+\TrackLangScriptMap{Latf}{217}{Latin (Fraktur variant)}{varies}{}%
+\TrackLangScriptMap{Latg}{216}{Latin (Gaelic variant)}{LR}{}%
+\TrackLangScriptMap{Latn}{215}{Latin}{LR}{}%
+\TrackLangScriptMap{Leke}{364}{Leke}{LR}{}%
+\TrackLangScriptMap{Lepc}{335}{Lepcha}{LR}{}%
+\TrackLangScriptMap{Limb}{336}{Limbu}{LR}{}%
+\TrackLangScriptMap{Lina}{400}{Linear A}{LR}{}%
+\TrackLangScriptMap{Linb}{401}{Linear B}{LR}{}%
+\TrackLangScriptMap{Lisu}{399}{Lisu (Fraser)}{LR}{}%
+\TrackLangScriptMap{Loma}{437}{Loma}{LR}{}%
+\TrackLangScriptMap{Lyci}{202}{Lycian}{LR}{}%
+\TrackLangScriptMap{Lydi}{116}{Lydian}{RL}{}%
+\TrackLangScriptMap{Mahj}{314}{Mahajani}{LR}{}%
+\TrackLangScriptMap{Mand}{140}{Mandaic, Mandaean}{RL}{}%
+\TrackLangScriptMap{Mani}{139}{Manichaean}{RL}{}%
+\TrackLangScriptMap{Marc}{332}{Marchen}{LR}{}%
+\TrackLangScriptMap{Maya}{090}{Mayan hieroglyphs}{varies}{}%
+\TrackLangScriptMap{Mend}{438}{Mende Kikakui}{RL}{}%
+\TrackLangScriptMap{Merc}{101}{Meroitic Cursive}{RL}{}%
+\TrackLangScriptMap{Mero}{100}{Meroitic Hieroglyphs}{RL}{}%
+\TrackLangScriptMap{Mlym}{347}{Malayalam}{LR}{}%
+\TrackLangScriptMap{Modi}{324}{Modi}{LR}{}%
+\TrackLangScriptMap{Mong}{145}{Mongolian}{TB}{}%
+\TrackLangScriptMap{Moon}{218}{Moon (Moon code, Moon script, Moon type)}{varies}{}%
+\TrackLangScriptMap{Mroo}{199}{Mro, Mru}{LR}{}%
+\TrackLangScriptMap{Mtei}{337}{Meitei Mayek (Meithei, Meetei)}{LR}{}%
+\TrackLangScriptMap{Mult}{323}{Multani}{LR}{}%
+\TrackLangScriptMap{Mymr}{350}{Myanmar (Burmese)}{LR}{}%
+\TrackLangScriptMap{Narb}{106}{Old North Arabian (Ancient North Arabian)}{RL}{}%
+\TrackLangScriptMap{Nbat}{159}{Nabataean}{RL}{}%
+\TrackLangScriptMap{Newa}{333}{Newa, Newar, Newari}{LR}{}%
+\TrackLangScriptMap{Nkgb}{420}{Nakhi Geba}{LR}{}%
+\TrackLangScriptMap{Nkoo}{165}{N'Ko}{RL}{}%
+\TrackLangScriptMap{Nshu}{499}{Nushu}{LR}{}%
+\TrackLangScriptMap{Ogam}{212}{Ogham}{varies}{}%
+\TrackLangScriptMap{Olck}{261}{Ol Chiki}{LR}{}%
+\TrackLangScriptMap{Orkh}{175}{Old Turkic, Orkhon Runic}{RL}{}%
+\TrackLangScriptMap{Orya}{327}{Oriya}{LR}{}%
+\TrackLangScriptMap{Osge}{219}{Osage}{LR}{}%
+\TrackLangScriptMap{Osma}{260}{Osmanya}{LR}{}%
+\TrackLangScriptMap{Palm}{126}{Palmyrene}{RL}{}%
+\TrackLangScriptMap{Pauc}{263}{Pau Cin Hau}{LR}{}%
+\TrackLangScriptMap{Perm}{227}{Old Permic}{LR}{}%
+\TrackLangScriptMap{Phag}{331}{Phags-pa}{TB}{}%
+\TrackLangScriptMap{Phli}{131}{Inscriptional Pahlavi}{RL}{}%
+\TrackLangScriptMap{Phlp}{132}{Psalter Pahlavi}{RL}{}%
+\TrackLangScriptMap{Phlv}{133}{Book Pahlavi}{RL}{}%
+\TrackLangScriptMap{Phnx}{115}{Phoenician}{RL}{}%
+\TrackLangScriptMap{Piqd}{293}{Klingon (KLI plqaD)}{LR}{}%
+\TrackLangScriptMap{Plrd}{282}{Miao (Pollard)}{LR}{}%
+\TrackLangScriptMap{Prti}{130}{Inscriptional Parthian}{RL}{}%
+\TrackLangScriptMap{Qaaa}{900}{Reserved for private use (start)}{varies}{}%
+\TrackLangScriptMap{Qaai}{908}{Private use}{varies}{}%
+\TrackLangScriptMap{Qabx}{949}{Reserved for private use (end)}{varies}{}%
+\TrackLangScriptMap{Rjng}{363}{Rejang (Redjang, Kaganga)}{LR}{}%
+\TrackLangScriptMap{Roro}{620}{Rongorongo}{varies}{}%
+\TrackLangScriptMap{Runr}{211}{Runic}{LR}{}%
+\TrackLangScriptMap{Samr}{123}{Samaritan}{RL}{}%
+\TrackLangScriptMap{Sara}{292}{Sarati}{varies}{}%
+\TrackLangScriptMap{Sarb}{105}{Old South Arabian}{RL}{}%
+\TrackLangScriptMap{Saur}{344}{Saurashtra}{LR}{}%
+\TrackLangScriptMap{Sgnw}{095}{SignWriting}{TB}{}%
+\TrackLangScriptMap{Shaw}{281}{Shavian (Shaw)}{LR}{}%
+\TrackLangScriptMap{Shrd}{319}{Sharada}{LR}{}%
+\TrackLangScriptMap{Sidd}{302}{Siddham}{LR}{}%
+\TrackLangScriptMap{Sind}{318}{Khudawadi, Sindhi}{LR}{}%
+\TrackLangScriptMap{Sinh}{348}{Sinhala}{LR}{}%
+\TrackLangScriptMap{Sora}{398}{Sora Sompeng}{LR}{}%
+\TrackLangScriptMap{Sund}{362}{Sundanese}{LR}{}%
+\TrackLangScriptMap{Sylo}{316}{Syloti Nagri}{LR}{}%
+\TrackLangScriptMap{Syrc}{135}{Syriac}{RL}{}%
+\TrackLangScriptMap{Syre}{138}{Syriac (Estrangelo variant)}{RL}{}%
+\TrackLangScriptMap{Syrj}{137}{Syriac (Western variant)}{RL}{}%
+\TrackLangScriptMap{Syrn}{136}{Syriac (Eastern variant)}{RL}{}%
+\TrackLangScriptMap{Tagb}{373}{Tagbanwa}{LR}{}%
+\TrackLangScriptMap{Takr}{321}{Takri}{LR}{}%
+\TrackLangScriptMap{Tale}{353}{Tai Le}{LR}{}%
+\TrackLangScriptMap{Talu}{354}{New Tai Lue}{LR}{}%
+\TrackLangScriptMap{Taml}{346}{Tamil}{LR}{}%
+\TrackLangScriptMap{Taml}{346}{Tamil}{LR}{}%
+\TrackLangScriptMap{Tang}{520}{Tangut}{LR}{}%
+\TrackLangScriptMap{Tavt}{359}{Tai Viet}{LR}{}%
+\TrackLangScriptMap{Telu}{340}{Telugu}{LR}{}%
+\TrackLangScriptMap{Teng}{290}{Tengwar}{LR}{}%
+\TrackLangScriptMap{Tfng}{120}{Tifinagh (Berber)}{LR}{}%
+\TrackLangScriptMap{Tglg}{370}{Tagalog (Baybayin, Alibata)}{LR}{}%
+\TrackLangScriptMap{Thaa}{170}{Thaana}{RL}{}%
+\TrackLangScriptMap{Thai}{352}{Thai}{LR}{}%
+\TrackLangScriptMap{Tibt}{330}{Tibetan}{LR}{}%
+\TrackLangScriptMap{Tirh}{326}{Tirhuta}{LR}{}%
+\TrackLangScriptMap{Ugar}{040}{Ugaritic}{LR}{}%
+\TrackLangScriptMap{Vaii}{470}{Vai}{LR}{}%
+\TrackLangScriptMap{Visp}{280}{Visible Speech}{LR}{}%
+\TrackLangScriptMap{Wara}{262}{Warang Citi (Varang Kshiti)}{LR}{}%
+\TrackLangScriptMap{Wole}{480}{Woleai}{RL}{}%
+\TrackLangScriptMap{Xpeo}{030}{Old Persian}{LR}{}%
+\TrackLangScriptMap{Xsux}{020}{Cuneiform, Sumero-Akkadian}{LR}{}%
+\TrackLangScriptMap{Yiii}{460}{Yi}{LR}{}%
+\TrackLangScriptMap{Zinh}{994}{Inherited script}{inherited}{}%
+\TrackLangScriptMap{Zmth}{995}{Mathematical notation}{LR}{}%
+\TrackLangScriptMap{Zsym}{996}{Symbols}{varies}{}%
+\TrackLangScriptMap{Zsye}{993}{Symbols (emoji variant)}{varies}{}%
+\TrackLangScriptMap{Zxxx}{997}{Unwritten documents}{varies}{}%
+\TrackLangScriptMap{Zyyy}{998}{Undetermined script}{varies}{}%
+\TrackLangScriptMap{Zzzz}{999}{Uncoded script}{varies}{}%
+\@tracklang at input@extra at script@files
 \@tracklang at scripts@restore at at
 
 \endinput

Modified: trunk/Master/texmf-dist/tex/generic/tracklang/tracklang.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tracklang/tracklang.tex	2019-12-01 21:35:44 UTC (rev 52990)
+++ trunk/Master/texmf-dist/tex/generic/tracklang/tracklang.tex	2019-12-01 21:36:02 UTC (rev 52991)
@@ -64,7 +64,7 @@
   \expandafter\endinput
 \fi
 \expandafter\def\csname ver at tracklang.tex\endcsname{%
- 2019/11/11 v1.3.9 (NLCT) Track Languages Generic Code}
+ 2019/11/30 v1.4 (NLCT) Track Languages Generic Code}
 \long\def\@tracklang at ifundef#1#2#3{%
   \ifcsname#1\endcsname
     \expandafter\ifx\csname #1\endcsname\relax
@@ -145,6 +145,16 @@
 \def\@tracklang at nameuse#1{%
   \@tracklang at ifundef{#1}{}{\csname#1\endcsname}%
 }
+\def\@tracklang at ifcseqcsname#1#2#3#4{%
+  \@tracklang at ifundef{#2}{#4}%
+  {%
+    \expandafter\ifx\expandafter#1\csname#2\endcsname
+      #3%
+    \else
+      #4%
+    \fi
+  }%
+}
 \ifx\@onelevel at sanitize\undefined
   \def\@tracklang at sanitize#1{%
     \edef#1{\expandafter\@tracklang at strip@prefix\meaning#1}%
@@ -153,8 +163,8 @@
 \else
   \let\@tracklang at sanitize\@onelevel at sanitize
 \fi
-\def\@tracklang at firstoftwo#1#2{#1}
-\def\@tracklang at secondoftwo#1#2{#2}
+\long\def\@tracklang at firstoftwo#1#2{#1}
+\long\def\@tracklang at secondoftwo#1#2{#2}
 \ifx\PackageError\undefined
   \def\@tracklang at err#1#2{%
     \errhelp{#2}%
@@ -201,6 +211,13 @@
     \fi
   }%
 \fi
+\newif\ifTrackLangShowVerbose
+\TrackLangShowVerbosefalse
+\def\@tracklang at verbose#1{%
+  \ifTrackLangShowVerbose
+    \@tracklang at info{#1}%
+  \fi
+}%
 \ifx\IfFileExists\undefined
  \long\def\@tracklang at IfFileExists#1#2#3{%
    \openin0=#1 %
@@ -820,9 +837,11 @@
 }
 \def\SetCurrentTrackedDialect#1{%
   \edef\CurrentTrackedDialect{#1}%
+  \@tracklang at verbose{Setting current tracked dialect `\CurrentTrackedDialect'}%
   \IfTrackedDialect{\CurrentTrackedDialect}%
   {}%
   {%
+    \@tracklang at verbose{Not a recognised tracklang label}%
     \IfHookHasMappingFromTrackedDialect{\CurrentTrackedDialect}%
     {%
       \IfTrackedDialect{\GetTrackedDialectFromMapping\CurrentTrackedDialect}%
@@ -829,27 +848,37 @@
       {%
         \edef\CurrentTrackedDialect{\GetTrackedDialectFromMapping
           {\CurrentTrackedDialect}}%
+        \@tracklang at verbose{Mapping found to tracklang label `\CurrentTrackedDialect'}%
       }%
       {%
         \IfTrackedLanguage{#1}%
         {%
+          \@tracklang at verbose{Supplied label is a root language.
+             Finding last tracked dialect for language `#1'}%
           \edef\@tracklang at dialects{\TrackedDialectsFromLanguage{#1}}%
           \@tracklang at for\@tracklang at dialect:=\@tracklang at dialects\do{%
             \let\CurrentTrackedDialect\@tracklang at dialect
           }%
         }%
-        {}%
+        {%
+          \@tracklang at verbose{No tracklang dialect found for label `#1'}%
+        }%
       }%
     }%
     {%
+      \@tracklang at verbose{No mapping found}%
       \IfTrackedLanguage{#1}%
       {%
+        \@tracklang at verbose{Supplied label is a root language.
+           Finding last tracked dialect for language `#1'}%
         \edef\@tracklang at dialects{\TrackedDialectsFromLanguage{#1}}%
         \@tracklang at for\@tracklang at dialect:=\@tracklang at dialects\do{%
           \let\CurrentTrackedDialect\@tracklang at dialect
         }%
       }%
-      {}%
+      {%
+        \@tracklang at verbose{No tracklang dialect found for label `#1'}%
+      }%
     }%
   }%
   \IfTrackedDialect{\CurrentTrackedDialect}%
@@ -903,6 +932,17 @@
         }%
       }%
     }%
+   \@tracklang at verbose{Current tracked dialect: `\CurrentTrackedDialect'.\MessageBreak
+     Language: `\CurrentTrackedLanguage'.\MessageBreak
+     ISO code: `\CurrentTrackedIsoCode'.\MessageBreak
+     Sub-lang: `\CurrentTrackedDialectSubLang'.\MessageBreak
+     Modifier: `\CurrentTrackedDialectModifier'.\MessageBreak
+     Variant: `\CurrentTrackedDialectVariant'.\MessageBreak
+     Script: `\CurrentTrackedDialectScript'.\MessageBreak
+     Region: `\CurrentTrackedRegion'.\MessageBreak
+     Additional: `\CurrentTrackedDialectAdditional'.\MessageBreak
+     Tag: `\CurrentTrackedLanguageTag'.
+    }%
   }%
   {%
     \@tracklang at warn{Unknown dialect label `#1' passed to
@@ -1352,6 +1392,34 @@
      \let\@TrackLangEnvAdditional\@tracklang at split@post
   \fi
 }%
+\def\@tracklang at extra@region at filelist{}
+\def\TrackLangAddExtraRegionFile#1{%
+ \ifx\TrackLangRegionMap\undefined
+ \else
+    \@tracklang at input #1\relax
+ \fi
+ \@tracklang at add{#1}{\@tracklang at extra@region at filelist}%
+}
+\def\@tracklang at input@extra at region@files{%
+  \@tracklang at for\@tracklang at currfile:=\@tracklang at extra@region at filelist\do
+  {%
+    \@tracklang at input\@tracklang at currfile
+  }%
+}
+\def\@tracklang at extra@script at filelist{}
+\def\TrackLangAddExtraScriptFile#1{%
+ \ifx\TrackLangScriptMap\undefined
+ \else
+    \@tracklang at input #1\relax
+ \fi
+ \@tracklang at add{#1}{\@tracklang at extra@script at filelist}%
+}
+\def\@tracklang at input@extra at script@files{%
+  \@tracklang at for\@tracklang at currfile:=\@tracklang at extra@script at filelist\do
+  {%
+    \@tracklang at input\@tracklang at currfile
+  }%
+}
 \def\GetTrackedDialectFromLanguageTag#1#2{%
   \def#2{}%
   \def\TrackedDialectClosestSubMatch{}%
@@ -1552,15 +1620,18 @@
 \ifx\@tracklang at declareoption\undefined
   \def\@tracklang at declareoption#1{}
 \fi
+\def\TrackLangProvidePredefinedLanguage#1{%
+  \@tracklang at namedef{@tracklang at add@#1}{%
+    \AddTrackedLanguage{#1}%
+    \AddTrackedLanguageIsoCodes{#1}%
+    \AddTrackedCountryIsoCode{#1}%
+  }%
+}
 \def\TrackLangDeclareLanguageOption#1#2#3#4#5#6#7{%
   \@tracklang at ifundef{@tracklang at add@#1}%
   {%
     \TrackLangNewLanguage{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
-    \@tracklang at namedef{@tracklang at add@#1}{%
-      \AddTrackedLanguage{#1}%
-      \AddTrackedLanguageIsoCodes{#1}%
-      \AddTrackedCountryIsoCode{#1}%
-    }%
+    \TrackLangProvidePredefinedLanguage{#1}%
     \@tracklang at declareoption{#1}%
   }%
   {%
@@ -1765,9 +1836,7 @@
 \TrackLangDeclareLanguageOption{yoruba}{yo}{yor}{}{}{}{Latn}
 \TrackLangDeclareLanguageOption{zhuang}{za}{zha}{}{}{CN}{Hani}
 \TrackLangDeclareLanguageOption{zulu}{zu}{zul}{}{}{}{Latn}
-\def\TrackLangDeclareDialectOption#1#2#3#4#5#6#7{%
-  \@tracklang at ifundef{@tracklang at add@#1}%
-  {%
+\def\TrackLangProvidePredefinedDialect#1#2#3#4#5#6#7{
     \ifx\relax#3\relax
      \ifx\relax#4\relax
       \ifx\relax#5\relax
@@ -1855,6 +1924,11 @@
       \expandafter\def\csname @tracklang at add@#1\expandafter\endcsname
         \expandafter{\@tracklang at tmp\SetTrackedDialectScript{#1}{#7}}%
     \fi
+}
+\def\TrackLangDeclareDialectOption#1#2#3#4#5#6#7{%
+  \@tracklang at ifundef{@tracklang at add@#1}%
+  {%
+    \TrackLangProvidePredefinedDialect{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
     \@tracklang at declareoption{#1}%
   }%
   {%
@@ -2080,10 +2154,1314 @@
   \fi
 }
 \long\def\IfTrackedLanguageFileExists#1#2#3#4#5{%
+   \@tracklang at verbose{Finding file for dialect `#1'}%
    \def\CurrentTrackedTag{}%
    \SetCurrentTrackedDialect{#1}%
    \IfTrackedDialect{#1}%
    {%
+     \edef\CurrentTrackedIsoCodeI{\TrackedIsoCodeFromLanguage
+         {639-1}{\CurrentTrackedLanguage}}%
+     \edef\CurrentTrackedIsoCodeII{\TrackedIsoCodeFromLanguage
+         {639-2}{\CurrentTrackedLanguage}}%
+     \edef\CurrentTrackedIsoCodeIII{\TrackedIsoCodeFromLanguage
+         {639-3}{\CurrentTrackedLanguage}}%
+     \@tracklang at test@if at file@exists at for@tag{#1}{#2}{#3}%
+     \@tracklang at if@file at exists{#4}{#5}%
+   }%
+   {#5}% unknown dialect
+}
+\def\@tracklang at test@if at file@exists at noop#1#2#3{}
+\def\@tracklang at test@if at file@exists at for@tag#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedLanguageTag
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at secondoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@dialect
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@dialect#1#2#3{%
+  \edef\CurrentTrackedTag{#1}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \IfTrackedLanguageHasIsoCode{639-1}{\CurrentTrackedLanguage}%
+    {%
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIscriptregion
+    }%
+    {%
+      \IfTrackedLanguageHasIsoCode{639-2}{\CurrentTrackedLanguage}%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscriptregion
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode{639-3}{\CurrentTrackedLanguage}%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptregion
+        }%
+        {%
+          \let\CurrentTrackedIsoCode\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@scriptregion
+        }%
+      }%
+    }%
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIscriptregion#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeI
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \ifx\CurrentTrackedDialectScript\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \fi
+  \ifx\CurrentTrackedRegion\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedRegion}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedRegion\empty
+      \ifx\CurrentTrackedDialectScript\empty
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langII
+        \else
+          \let\CurrentTrackedTag\CurrentTrackedIsoCode
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langII
+          }%
+        \fi
+      \else
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipscript
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipscript
+          }%
+        \fi
+      \fi
+    \else
+      \ifx\CurrentTrackedDialectScript\empty
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipregion
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipregion
+          }%
+        \fi
+      \else
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipscriptregion
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript
+            -\CurrentTrackedRegion}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipscriptregion
+          }%
+        \fi
+      \fi
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIscriptregion#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \ifx\CurrentTrackedDialectScript\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \fi
+  \ifx\CurrentTrackedRegion\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedRegion}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedRegion\empty
+      \ifx\CurrentTrackedDialectScript\empty
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIII
+        \else
+          \let\CurrentTrackedTag\CurrentTrackedIsoCode
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIII
+          }%
+        \fi
+      \else
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscript
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscript
+          }%
+        \fi
+      \fi
+    \else
+      \ifx\CurrentTrackedDialectScript\empty
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+          }%
+        \fi
+      \else
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscriptregion
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript
+            -\CurrentTrackedRegion}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscriptregion
+          }%
+        \fi
+      \fi
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIIscriptregion#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \ifx\CurrentTrackedDialectScript\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \fi
+  \ifx\CurrentTrackedRegion\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedRegion}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedRegion\empty
+      \ifx\CurrentTrackedDialectScript\empty
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+        \else
+          \let\CurrentTrackedTag\CurrentTrackedIsoCode
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+          }%
+        \fi
+      \else
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscript
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscript
+          }%
+        \fi
+      \fi
+    \else
+      \ifx\CurrentTrackedDialectScript\empty
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipregion
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipregion
+          }%
+        \fi
+      \else
+        \ifx\CurrentTrackedDialectSubLang\empty
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscriptregion
+        \else
+          \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript
+            -\CurrentTrackedRegion}%
+          \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+          \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+          {%
+            \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscriptregion
+          }%
+        \fi
+      \fi
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIskipscript#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \IfTrackedLanguageHasIsoCode
+      {639-2}{\CurrentTrackedLanguage}
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscript
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode
+        {639-3}{\CurrentTrackedLanguage}
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscript
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+        }%
+      }%
+    \else
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode
+        {639-2}{\CurrentTrackedLanguage}
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscript
+        }%
+        {%
+          \IfTrackedLanguageHasIsoCode
+          {639-3}{\CurrentTrackedLanguage}
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscript
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+          }%
+        }%
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIscript#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscript
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscript
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIskipscript#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \IfTrackedLanguageHasIsoCode
+      {639-3}{\CurrentTrackedLanguage}
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscript
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+      }%
+    \else
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode
+        {639-3}{\CurrentTrackedLanguage}
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscript
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+        }%
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIIscript#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscript
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscript
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIIskipscript#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+    \else
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \IfTrackedLanguageHasIsoCode
+      {639-2}{\CurrentTrackedLanguage}
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIregion
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode
+        {639-3}{\CurrentTrackedLanguage}
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIregion
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+        }%
+      }%
+    \else
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode
+        {639-2}{\CurrentTrackedLanguage}
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIregion
+        }%
+        {%
+          \IfTrackedLanguageHasIsoCode
+          {639-3}{\CurrentTrackedLanguage}
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIregion
+          }%
+          {%
+            \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+          }%
+        }%
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIregion#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \IfTrackedLanguageHasIsoCode
+      {639-3}{\CurrentTrackedLanguage}
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIregion
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+      }%
+    \else
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode
+        {639-3}{\CurrentTrackedLanguage}
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIregion
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+        }%
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIregion#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+    \else
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIIregion#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipregion
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipregion
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIskipscriptregion#1#2#3{%
+  \@tracklang at ifcseqcsname\CurrentTrackedDialectScript
+     {@tracklang at knowniso@script@\CurrentTrackedLanguage}%
+  {%
+    \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \ifx\CurrentTrackedDialectSubLang\empty
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+    \fi
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedRegion}%
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+      \ifx\CurrentTrackedDialectSubLang\empty
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIscriptskipregion
+      \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+        \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+        \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+        {%
+          \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIscriptskipregion
+        }%
+      \fi
+    }%
+  }%
+  {%
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIscriptskipregion
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIscriptskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipscriptskipregion
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIskipscriptskipregion
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIskipscriptskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \IfTrackedLanguageHasIsoCode
+      {639-2}{\CurrentTrackedLanguage}
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscriptregion
+      }%
+      {%
+         \IfTrackedLanguageHasIsoCode
+         {639-3}{\CurrentTrackedLanguage}
+         {%
+           \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+           \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptregion
+         }%
+         {%
+           \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@region
+         }%
+      }%
+    \else
+    \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+      \IfTrackedLanguageHasIsoCode
+      {639-2}{\CurrentTrackedLanguage}
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscriptregion
+      }%
+      {%
+         \IfTrackedLanguageHasIsoCode
+         {639-3}{\CurrentTrackedLanguage}
+         {%
+           \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+           \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptregion
+         }%
+         {%
+           \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@region
+         }%
+      }%
+    }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIskipscriptregion#1#2#3{%
+  \@tracklang at ifcseqcsname\CurrentTrackedDialectScript
+     {@tracklang at knowniso@script@\CurrentTrackedLanguage}%
+  {%
+    \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \ifx\CurrentTrackedDialectSubLang\empty
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+    \fi
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedRegion}%
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+      \ifx\CurrentTrackedDialectSubLang\empty
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscriptskipregion
+      \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+        \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+        \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+        {%
+          \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscriptskipregion
+        }%
+      \fi
+    }%
+  }%
+  {%
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIscriptskipregion
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIscriptskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscriptskipregion
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIskipscriptskipregion
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIskipscriptskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \IfTrackedLanguageHasIsoCode
+      {639-3}{\CurrentTrackedLanguage}
+      {%
+        \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptregion
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@region
+      }%
+    \else
+    \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+       \IfTrackedLanguageHasIsoCode
+       {639-3}{\CurrentTrackedLanguage}
+       {%
+         \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+         \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptregion
+       }%
+       {%
+         \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@region
+       }%
+    }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIIskipscriptregion#1#2#3{%
+  \@tracklang at ifcseqcsname\CurrentTrackedDialectScript
+     {@tracklang at knowniso@script@\CurrentTrackedLanguage}%
+  {%
+    \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \ifx\CurrentTrackedDialectSubLang\empty
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+    \fi
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedRegion}%
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+      \ifx\CurrentTrackedDialectSubLang\empty
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptskipregion
+      \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+        \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+        \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+        {%
+          \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptskipregion
+        }%
+      \fi
+    }%
+  }%
+  {%
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIscriptskipregion
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIIscriptskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectScript}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscriptskipregion
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectScript}%
+      \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+      {%
+        \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+      }%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIskipscriptskipregion
+      }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIIskipscriptskipregion#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@region
+    \else
+    \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+       \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@region
+    }%
+    \fi
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langII#1#2#3{%
+  \IfTrackedLanguageHasIsoCode{639-2}{\CurrentTrackedLanguage}%
+  {%
+    \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeII
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectSubLang}%
+    \fi
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+      \ifx\CurrentTrackedDialectSubLang\empty
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIII
+      \else
+        \let\CurrentTrackedTag\CurrentTrackedIsoCode
+        \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+        \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+        {%
+          \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIII
+        }%
+      \fi
+    }%
+    {%
+      \fi
+    }%
+  }%
+  {%
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIII
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIII#1#2#3{%
+  \IfTrackedLanguageHasIsoCode{639-3}{\CurrentTrackedLanguage}%
+  {%
+    \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+    \ifx\CurrentTrackedDialectSubLang\empty
+      \let\CurrentTrackedTag\CurrentTrackedIsoCode
+    \else
+      \edef\CurrentTrackedTag{\CurrentTrackedIsoCode-\CurrentTrackedDialectSubLang}%
+    \fi
+    \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+    \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+    {%
+      \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+    }%
+    {%
+      \ifx\CurrentTrackedDialectSubLang\empty
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+      \else
+        \let\CurrentTrackedTag\CurrentTrackedIsoCode
+        \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+        \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+        {%
+          \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+        }%
+      \fi
+    }%
+  }%
+  {%
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@region#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedRegion
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langvariant
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langvariant#1#2#3{%
+  \ifx\CurrentTrackedDialectVariant\empty
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@rootlang
+  \else
+    \IfTrackedLanguageHasIsoCode{639-1}{\CurrentTrackedLanguage}%
+    {%
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIvariant
+    }%
+    {%
+      \IfTrackedLanguageHasIsoCode{639-2}{\CurrentTrackedLanguage}%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIvariant
+      }%
+      {%
+        \IfTrackedLanguageHasIsoCode{639-3}{\CurrentTrackedLanguage}%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIvariant
+        }%
+        {%
+          \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@rootlang
+        }%
+      }%
+    }%
+  \fi
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIvariant#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeI
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectVariant}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \IfTrackedLanguageHasIsoCode{639-2}{\CurrentTrackedLanguage}%
+    {%
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIvariant
+    }
+    {%
+      \IfTrackedLanguageHasIsoCode{639-3}{\CurrentTrackedLanguage}%
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIvariant
+      }
+      {%
+        \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@rootlang
+      }%
+    }%
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIvariant#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectVariant}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \IfTrackedLanguageHasIsoCode{639-3}{\CurrentTrackedLanguage}%
+    {%
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@langIIIvariant
+    }
+    {%
+      \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@rootlang
+    }%
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@langIIIvariant#1#2#3{%
+  \let\CurrentTrackedIsoCode\CurrentTrackedIsoCodeIII
+  \let\CurrentTrackedTag\CurrentTrackedIsoCode
+  \ifx\CurrentTrackedDialectSubLang\empty
+  \else
+    \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectSubLang}%
+  \fi
+  \edef\CurrentTrackedTag{\CurrentTrackedTag-\CurrentTrackedDialectVariant}%
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at noop
+  }%
+  {%
+    \let\@tracklang at test@if at file@exists at next\@tracklang at test@if at file@exists at for@rootlang
+  }%
+  \@tracklang at test@if at file@exists at next{#1}{#2}{#3}%
+}
+\def\@tracklang at test@if at file@exists at for@rootlang#1#2#3{%
+  \let\CurrentTrackedTag\CurrentTrackedLanguage
+  \@tracklang at verbose{Testing tag `\CurrentTrackedTag'}%
+  \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
+  {%
+    \let\@tracklang at if@file at exists\@tracklang at firstoftwo
+  }%
+  {}%
+}
+\long\def\IfTrackedLanguageFileExists at orig#1#2#3#4#5{%
+   \def\CurrentTrackedTag{}%
+   \SetCurrentTrackedDialect{#1}%
+   \IfTrackedDialect{#1}%
+   {%
      \edef\CurrentTrackedTag{#1}%
      \@tracklang at IfFileExists{#2\CurrentTrackedTag#3}%
      {#4}%
@@ -2330,6 +3708,49 @@
   \gdef\csname#1#2\expandafter\endcsname\expandafter{\@tracklang at hook#3}%
 }
 \def\TrackLangAddToCaptions#1{\TrackLangAddToHook{#1}{captions}}
+\def\TrackLangRedefHook{\noop at TrackLangRedefHook}
+\def\noop at TrackLangRedefHook#1#2{%
+  \@tracklang at err{\string\TrackLangRedefHook\space
+  only permitted within resource files}
+}
+\def\@TrackLangRedefHook#1#2{%
+  \@tracklang at ifundef{#2\CurrentTrackedDialect}%
+  {%
+    \IfTrackedDialectHasMapping{\CurrentTrackedDialect}%
+    {%
+      \edef\@tracklang at tmp{%
+        \csname @tracklang at dialectmap@tohook@\CurrentTrackedDialect\endcsname}%
+      \@tracklang at ifundef{#2\@tracklang at tmp}%
+      {%
+        \@tracklang at ifundef{#2\CurrentTrackedLanguage}%
+        {%
+          #1%
+        }%
+        {%
+          \@tracklang at redefhook{#2}{\CurrentTrackedLanguage}{#1}%
+        }%
+      }%
+      {%
+        \@tracklang at redefhook{#2}{\@tracklang at tmp}{#1}%
+      }%
+    }%
+    {%
+      \@tracklang at ifundef{#2\CurrentTrackedLanguage}%
+      {%
+      }%
+      {%
+        \@tracklang at redefhook{#2}{\CurrentTrackedLanguage}{#1}%
+      }%
+    }%
+  }%
+  {%
+     \@tracklang at redefhook{#2}{\CurrentTrackedDialect}{#1}%
+  }%
+  #1%
+}
+\def\@tracklang at redefhook#1#2#3{%
+ \expandafter\gdef\csname#1#2\endcsname{#3}%
+}
 \def\SetTrackedDialectLabelMap#1#2{%
   \@tracklang at enamedef{@tracklang at dialectmap@tohook@#1}{#2}%
   \@tracklang at enamedef{@tracklang at dialectmap@fromhook@#2}{#1}%

Modified: trunk/Master/texmf-dist/tex/latex/tracklang/tracklang-scripts.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tracklang/tracklang-scripts.sty	2019-12-01 21:35:44 UTC (rev 52990)
+++ trunk/Master/texmf-dist/tex/latex/tracklang/tracklang-scripts.sty	2019-12-01 21:36:02 UTC (rev 52991)
@@ -51,7 +51,7 @@
 %% do code now to initialise
 %% Pass all options to tracklang:
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tracklang-scripts}[2019/11/11 v1.3.9 (NLCT) Track
+\ProvidesPackage{tracklang-scripts}[2019/11/30 v1.4 (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	2019-12-01 21:35:44 UTC (rev 52990)
+++ trunk/Master/texmf-dist/tex/latex/tracklang/tracklang.sty	2019-12-01 21:36:02 UTC (rev 52991)
@@ -51,7 +51,7 @@
 %% do code now to initialise
 %% Pass all options to tracklang:
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tracklang}[2019/11/11 v1.3.9 (NLCT) Track Languages]
+\ProvidesPackage{tracklang}[2019/11/30 v1.4 (NLCT) Track Languages]
 \providecommand*{\@tracklang at declareoption}[1]{%
   \DeclareOption{#1}{\TrackPredefinedDialect{#1}}%
 }



More information about the tex-live-commits mailing list