%\iffalse
% tracklang.dtx generated using makedtx version 1.1 (c) Nicola Talbot
% Command line args:
%   -src "tracklang.sty\Z=>tracklang.sty"
%   -src "tracklang.tex\Z=>tracklang.tex"
%   -doc "tracklang-manual.tex"
%   -author "Nicola Talbot"
%   tracklang
% Created on 2015/3/23 13:50
%\fi
%\iffalse
%<*package>
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%</package>
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
% Copyright (C) 2015 Nicola Talbot, all rights reserved.
% \fi
% \iffalse
%<*driver>
\documentclass[widecs]{nlctdoc}

\usepackage{alltt}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[colorlinks,
            bookmarks,
            hyperindex=false,
            pdfauthor={Nicola L.C. Talbot},
            pdftitle={tracklang: tracking language options}]{hyperref}


\CheckSum{2003}

\renewcommand*{\usage}[1]{\hyperpage{#1}}
\renewcommand*{\main}[1]{\hyperpage{#1}}
\IndexPrologue{\section*{\indexname}\markboth{\indexname}{\indexname}}
\setcounter{IndexColumns}{2}

\begin{document}
\DocInput{tracklang.dtx}
\end{document}
%</driver>
%\fi
%
%\MakeShortVerb{"}
%
%\title{tracklang v1.2:
%tracking language options}
%\author{Nicola L. C. Talbot\\\url{http://www.dickimaw-books.com/}}
%
%\date{2015-03-23}
%\maketitle
%
%\begin{abstract}
%The \styfmt{tracklang} package is provided for package developers
%who want a simple interface to find out which languages the user has
%requested through packages such as \sty{babel} and
%\sty{polyglossia}. \emph{This package doesn't provide any
%translations.}
%Its purpose is simply to track which languages have been requested by the
%user. Generic \TeX\ code is in \texttt{tracklang.tex} for
%non-\LaTeX\ users (category code of \texttt{@} must be 11 on input).
%\end{abstract}
%
%\tableofcontents
%
%\section{Introduction}
%\label{sec:intro}
%
%When I'm developing a package that provides multilingual support
%(for example, \styfmt{glossaries}) it's cumbersome trying to work out
%if the user has requested translations for fixed text.  This usually
%involves checking if \sty{babel} or \sty{ngerman} or
%\sty{translator} or \sty{polyglossia} has been loaded and, if so,
%what language settings have been used. The result can be a tangled
%mass of conditional code. The alternative is to tell users to add
%the language as a~document class option, which they may or may not
%want to do, or to tell them to supply the language settings to every
%package they load that provides multilingual support, which users
%are even less likely to want to do.
%
%The \styfmt{tracklang} package tries to neaten this up by working out
%as much of this information as possible for you and providing a
%command that iterates through the loaded languages. This way, you
%can just iterate through the list of tracked languages and, for each
%language, either define the translations or warn the user that
%there's no translation for that language.
%
%This package works best with \sty{ngerman} or with recent versions
%of \sty{babel} or when the language options are specified
%in the document class option list. It works fairly well with
%\sty{translator} but will additionally assume the root language was
%also requested when a dialect is specified. So, for example,
%\begin{verbatim}
%\usepackage[british]{translator}
%\usepackage{tracklang}
%\end{verbatim}
%is equivalent to
%\begin{verbatim}
%\usepackage[british]{translator}
%\usepackage[english,british]{tracklang}
%\end{verbatim}
%This means that \ics{ForEachTrackedDialect} will iterate
%through the list ``english,british'' instead of just
%``british'', which can result in some redundancy.
%
%Unfortunately I can't work out how to pick up the language variant
%from \sty{polyglossia}, so only the root languages are detected,
%which is suboptimal but at least provides some information.
%
%If the \sty{ngerman} package has been loaded, \styfmt{tracklang}
%sets the root language to ``german'' and the dialect to ``ngerman'',
%but it doesn't set the country code.
%
%If any document class or package options are passed to
%\styfmt{tracklang}, then \styfmt{tracklang} won't bother checking
%for \sty{babel}, \sty{translator}, \sty{ngerman} or
%\sty{polyglossia}. So, if the above example is changed to:
%\begin{verbatim}
%\documentclass[british]{article}
%\usepackage{translator}
%\usepackage{tracklang}
%\end{verbatim}
%then the dialect list will just consist of ``british'' rather than
%``english,british''. This does, however, mean that if the user mixes
%class and package options, only the class options will be detected.
%For example:
%\begin{verbatim}
%\documentclass[british]{article}
%\usepackage[french]{babel}
%\usepackage{tracklang}
%\end{verbatim}
%In this case, only the ``british'' option will be detected. The user
%can therefore use the document class option (or \styfmt{tracklang}
%package option) to override the dialect and set the country code
%(where provided). For example:
%\begin{verbatim}
%\documentclass[es-MX]{article}
%\usepackage[spanish]{babel}
%\usepackage{tracklang}
%\end{verbatim}
%This sets the dialect to ``mexicanspanish'' and the root language to
%``spanish''.  See \texttt{tracklang.tex} (\sectionref{sec:predefined}) 
%for all predefined options.
%
%Section~\ref{sec:user} is for package writers who want to
%add multilingual support to their package and need to know which
%settings the user has requested through language packages like
%\sty{babel}. Section~\ref{sec:langsty} is for
%developers of language definition packages who want to help other
%package writers to detect what languages have been requested.
%Section~\ref{sec:plain} provides a plain \TeX\ example.
%
%\section{Detecting the User's Requested Languages}
%\label{sec:user}
%
%The \styfmt{tracklang} package tries to track the loaded languages and
%the option names used to identify those languages. For want of a better
%term, the language option names are referred to as dialects even if
%they're only a synonym for the language rather than an actual
%dialect.  For example, if the user
%has requested \texttt{british}, the root language label is
%\texttt{english} and the dialect is \texttt{british}, whereas if the
%user requested \texttt{UKenglish}, the root language label is
%\texttt{english} and the dialect is \texttt{UKenglish}. The
%exceptions to this are the \styfmt{tracklang} package options that have been
%specified in the form \meta{iso lang}-\meta{iso country}. For
%example, the package option \texttt{en-GB} behaves as though the
%user requested the package option \texttt{british}.
%
%In addition to the root language label and the dialect identifier,
%many of the language options also have corresponding ISO codes. In
%most cases there is an ISO~639-1 or an ISO~639-2 code (or both), and in some
%cases there is an ISO~3166-1 code identifying the dialect region.
%
%When \styfmt{tracklang} is loaded, it first attempts to find the
%language options through the package options supplied to
%\styfmt{tracklang}. This means that any languages that have been
%supplied in the document class options should get identified
%(provided that the document class has used the standard option
%declaration mechanism).  If no languages have been supplied in this
%way, \styfmt{tracklang} then attempts to identify any \sty{babel}
%language options and failing that it will try the \sty{translator}
%language options. It will then check if \sty{ngerman} or
%\sty{polyglossia} have been loaded.
%
%Each identified language and dialect is added to the \emph{tracked
%language} and \emph{tracked dialect} lists. Note that the tracked
%language and tracked dialect are labels rather than proper nouns.
%If a~dialect label is identical to its root language label, the
%label will appear in both lists.
%
%You can check whether or not any languages have been detected using:
%\begin{definition}
%\ics{AnyTrackedLanguages}\marg{true part}\marg{false part}
%\end{definition}
%This will do \meta{true part} if one or more languages have been
%detected otherwise it will do \meta{false part}. (Each detected
%dialect will automatically have the root language label added
%to the tracked language list, if it's not already present.)
%
%You can iterate through each tracked dialect using:
%\begin{definition}
%\ics{ForEachTrackedDialect}\marg{cs}\marg{code}
%\end{definition}
%At the start of each iteration, this sets \meta{cs} to the 
%tracked dialect and does \meta{code}.
%
%You can iterate through each tracked language using:
%\begin{definition}
%\ics{ForEachTrackedLanguage}\marg{cs}\marg{code}
%\end{definition}
%At the start of each iteration, this sets \meta{cs} to the 
%tracked language and does \meta{code}.
%
%You can test if a root language has been detected using:
%\begin{definition}
%\ics{IfTrackedLanguage}\marg{label}\marg{true part}\marg{false part}
%\end{definition}
%where \meta{label} is the language label. If
%true, this does \meta{true part} otherwise it does \meta{false
%part}.
%
%You can test if a particular dialect has been detected using:
%\begin{definition}
%\ics{IfTrackedDialect}\marg{label}\marg{true part}\marg{false part}
%\end{definition}
%where \meta{label} is the dialect label. If the root language was explicitly specified, then it will
%also be detected as a dialect.
%
%For example:
%\begin{verbatim}
%\documentclass[british,dutch]{article}
%
%\usepackage{tracklang}
%
%\begin{document}
%``english'' \IfTrackedDialect{english}{has}{hasn't} been specified.
%
%``british'' \IfTrackedDialect{british}{has}{hasn't} been specified.
%
%``flemish'' \IfTrackedDialect{flemish}{has}{hasn't} been specified.
%
%``dutch'' \IfTrackedDialect{dutch}{has}{hasn't} been specified.
%
%``english'' or an English variant 
%\IfTrackedLanguage{english}{has}{hasn't} been specified.
%
%\end{document}
%\end{verbatim}
%This produces:
%\begin{quote}
%``english'' hasn't been specified.
%
%``british'' has been specified.
%
%``flemish'' hasn't been specified.
%
%``dutch'' has been specified.
%
%``english'' or an English variant has been specified.
%\end{quote}
%
%You can find the root language label for a given tracked dialect
%using:
%\begin{definition}
%\ics{TrackedLanguageFromDialect}\marg{dialect}
%\end{definition}
%If \meta{dialect} hasn't been defined this does nothing otherwise it
%expands to the root language label.
%
%You can find the tracked dialects from a given root language
%using:
%\begin{definition}
%\ics{TrackedDialectsFromLanguage}\marg{root language label}
%\end{definition}
%This will expand to a~comma-separated list of dialect labels
%if the root language label has been defined, otherwise it
%does nothing.
%
%
%You can test if a language (or dialect) has a corresponding ISO code using:
%\begin{definition}
%\ics{IfTrackedLanguageHasIsoCode}\marg{code
%type}\marg{label}\marg{true part}\marg{false part}
%\end{definition}
%where \meta{code type} is the type of ISO code (for example,
%\texttt{639-1} for root languages or \texttt{3166-1} for regional
%dialects), and \meta{label} is the language or dialect label.
%
%Alternatively, you can test if a particular ISO code has been
%defined using:
%\begin{definition}
%\ics{IfTrackedIsoCode}\marg{code type}\marg{code}\marg{true
%part}\marg{false part}
%\end{definition}
%where \meta{code type} is again the type of ISO code (for example,
%\texttt{639-1} or \texttt{3166-1}), and \meta{code} is the
%particular code (for example, \texttt{en} for ISO 639-1 or
%\texttt{GB} for ISO 3166-1).
%
%You can fetch the language (or dialect) label associated with a
%given ISO code using:
%\begin{definition}
%\ics{TrackedLanguageFromIsoCode}\marg{code type}\marg{code}
%\end{definition}
%This does nothing if the given \meta{code} for the given ISO
%\meta{code type} has not been defined, otherwise it expands
%a~comma-separated list of language or dialect labels.
%
%You can fetch the ISO code for a given code type using:
%\begin{definition}
%\ics{TrackedIsoCodeFromLanguage}\marg{code type}\marg{label}
%\end{definition}
%where \meta{label} is the language or dialect label and \meta{code
%type} is the ISO code type (for example, \texttt{639-1} or
%\texttt{3166-1}). Unlike \ics{TrackedLanguageFromIsoCode}, this
%command only expands to a single label rather than a~comma-separated
%list.
%
%The above commands do nothing in the event of an unknown code or
%code type,
%so if you accidentally get the wrong code type, you won't get an error.
%If you're unsure of the code type, you can use the following commands:
%\begin{definition}
%\ics{TwoLetterIsoCountryCode}
%\end{definition}
%This expands to 3166-1 and is used for the two-letter country codes.
%
%\begin{definition}
%\ics{TwoLetterIsoLanguageCode}
%\end{definition}
%This expands to 639-1 and is used for the two-letter root language codes.
%
%\begin{definition}
%\ics{ThreeLetterIsoLanguageCode}
%\end{definition}
%This expands to 639-2 and is used for the three-letter root language
%codes.
%
%For example:
%\begin{verbatim}
%\documentclass[british,francais,american,canadian,canadien,dutch]{article}
%
%\usepackage{tracklang}
%
%\begin{document}
%
%Languages: \ForEachTrackedLanguage{\ThisLanguage}{\ThisLanguage\space
%(ISO \TwoLetterIsoLanguageCode: 
%``\TrackedIsoCodeFromLanguage{\TwoLetterIsoLanguageCode}{\ThisLanguage}''). }
%
%Dialects: \ForEachTrackedDialect{\ThisDialect}{\ThisDialect\space 
%(\IfTrackedLanguageHasIsoCode{\TwoLetterIsoCountryCode}{\ThisDialect}%
% {ISO \TwoLetterIsoCountryCode: 
%  ``\TrackedIsoCodeFromLanguage{\TwoLetterIsoCountryCode}{\ThisDialect}''}%
% {no specific region};
%root: \TrackedLanguageFromDialect{\ThisDialect}). }
%
%Language for ISO \TwoLetterIsoCountryCode\ ``GB'':
%\TrackedLanguageFromIsoCode{\TwoLetterIsoCountryCode}{GB}.
%
%Language for ISO \TwoLetterIsoCountryCode\ ``CA'': 
%\TrackedLanguageFromIsoCode{\TwoLetterIsoCountryCode}{CA}.
%
%Country ISO \TwoLetterIsoCountryCode\ code for ``canadian'':
%\TrackedIsoCodeFromLanguage{\TwoLetterIsoCountryCode}{canadian}.
%
%\end{document}
%\end{verbatim}
%This produces:
%\begin{quote}
%Languages: english (ISO 639-1: ``en''). french (ISO 639-1: ``fr'').
%dutch (ISO 639-1: ``nl'').
%
%Dialects: american (ISO 3166-1: ``US''; root: english).
%british (ISO 3166-1: ``GB''; root: english).
%canadian (ISO 3166-1: ``CA''; root: english).
%canadien (ISO 3166-1: ``CA''; root: french).
%dutch (no specific region; root: dutch).
%francais (no specific region; root: french).
%
%Language for ISO 3166-1 ``GB'': british.
%
%Language for ISO 3166-1 ``CA'': canadian,canadien.
%
%Country ISO 3166-1 code for ``canadian'': CA.
%
%\end{quote}
%
%Most packages that implement multilingual support have a~set of
%language definition files for each supported language or dialect.
%It may be that only the root language is needed, if there are no
%variations between that language's dialect (for the purposes of that
%package), or it may be that separate definition files are required
%for each dialect. However it can be awkward trying to map the
%requested dialect or language label to the file name. Should, say,
%the file containing the French code be called
%\meta{prefix}\texttt{-french-}\meta{suffix} or 
%\meta{prefix}\texttt{-frenchb-}\meta{suffix} or 
%\meta{prefix}\texttt{-francais-}\meta{suffix}?
%Should, say, the file containing the British English code be called
%\meta{prefix}\texttt{-british-}\meta{suffix} or 
%\meta{prefix}\texttt{-UKenglish-}\meta{suffix}?
%If you want to modularise the language support for your package so
%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:
%\begin{definition}
%\ics{IfTrackedLanguageFileExists}\marg{label}\meta{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{label}. If the file is found
%\begin{definition}
%\ics{CurrentTrackedTag}
%\end{definition}
%is set to \meta{tag} and \meta{true part} is done, otherwise
%\meta{false part} is done.
%
%The \meta{tag} is determined as follows:
%\begin{enumerate}
% \item If no dialect with the given label has been
%  detected, the condition evaluates to \emph{false} and
% \ics{CurrentTrackedTag} is empty.
%
% \item If \meta{label} has an ISO~3166-1 code, then
%\begin{definition}
%\ics{CurrentTrackedRegion}
%\end{definition}
%  is set to that code otherwise it's empty.
%
% \item If the file \meta{prefix}\meta{label}\meta{suffix} exists,
% \meta{tag} (\ics{CurrentTrackedTag}) is just \meta{label} and the
% condition evaluates to \emph{true}.  
%
% \item The root language label is obtained and stored in
%\begin{definition}
%\ics{CurrentTrackedLanguage}
%\end{definition}
% (This may or may not be the same as the original dialect 
% \meta{label}.)
%
% \item If the root language has an ISO~639-1 code, this code is
% fetched and stored in
%\begin{definition}
%\ics{CurrentTrackedIsoCode}
%\end{definition}
% If the root language doesn't have an ISO~639-1 code, but does
% have an ISO~639-2 code, then this code is fetched and stored
% in \ics{CurrentTrackedIsoCode}.
%
% \item If there is no ISO~639-1 and no ISO~636-2 code:
%
%  \begin{enumerate}
%  \item If there is 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 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 If \ics{CurrentTrackedRegion} is empty (no ISO~3166-1 code)
% then \meta{tag} (\ics{CurrentTrackedTag}) is set to just
% \ics{CurrentTrackedIsoCode} and if the file
% \meta{prefix}\meta{tag}\meta{suffix} exists, the condition will
% evaluate to \emph{true}. If the file doesn't exist and
% \ics{CurrentTrackedIsoCode} was set to the ISO~639-1 code, then
% the test will be repeated with the ISO~639-2 code. If that test
% also fails, then the condition evaluates to \emph{false}.
%
% \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 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 \ics{CurrentTrackedIsoCode} is set to the ISO~636-1 code and
% the language also has an ISO~636-2 code, then set
% \ics{CurrentTrackedIsoCode} to the ISO~636-2 code and go back to
% step~\ref{itm:lang-country}.
%
% \item If there is an ISO~3166-1 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 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}.
%
%\end{enumerate}
%
%The \ics{IfTrackedLanguageFileExists} command sets the following
%commands which may be used within \meta{true part} or \meta{false
%part}:
%\begin{definition}
%\ics{CurrentTrackedDialect}
%\end{definition}
%This command will always be set to the first argument of
%\ics{IfTrackedLanguageFileExists}.
%
%\begin{definition}
%\ics{CurrentTrackedTag}
%\end{definition}
%This command will be set to \meta{tag} if the file
%\meta{prefix}\meta{tag}\meta{suffix} is found. 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}.
%
%\begin{definition}
%\ics{CurrentTrackedLanguage}
%\end{definition}
%If the dialect hasn't been detected, this command will be empty,
%otherwise it will expand to the root language label (which may
%be the same as the dialect label).
%
%\begin{definition}
%\ics{CurrentTrackedRegion}
%\end{definition}
%If the dialect hasn't been detected, this command will be empty.
%If the dialect has been assigned an ISO~3166-1 code,
%\ics{CurrentTrackedRegion} will expand to that code, otherwise it
%will be empty.
%
%\begin{definition}
%\ics{CurrentTrackedIsoCode}
%\end{definition}
%If the dialect hasn't been detected, this command will be empty.
%Otherwise it may be empty or it may expand to either the
%ISO~639-1 or ISO~639-2 code (see above).
%
%For example:
%\begin{verbatim}
%\AnyTrackedLanguages
%{%
%  \ForEachTrackedDialect{\ThisDialect}%
%  {% try to load the language file for this dialect
%    \IfTrackedLanguageFileExists{\ThisDialect}%
%    {mypackage-}% file prefix
%    {.ldf}% file suffix
%    {\input{mypackage-\CurrentTrackedTag.ldf}}% file found
%    {% not found
%      \PackageWarning{mypackage}{No support for language
%       `\ThisDialect'}%
%    }%
%  }%
%}
%{% no languages detected so use defaults
%}
%\end{verbatim}
%
%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}
%\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}
%\end{enumerate}
%This is because the predefined \texttt{francais} option has no region assigned to it.
%
%Alternatively, if you're only providing support for the root
%languages:
%\begin{verbatim}
%\AnyTrackedLanguages
%{%
%  \ForEachTrackedLanguage{\ThisLanguage}%
%  {% try to load the language file for this root language
%    \IfTrackedLanguageFileExists{\ThisLanguage}%
%    {mypackage-}% file prefix
%    {.ldf}% file suffix
%    {\input{mypackage-\CurrentTrackedTag.ldf}}% file found
%    {% not found
%      \PackageWarning{mypackage}{No support for language
%       `\ThisLanguage'}%
%    }%
%  }%
%}
%{% no languages detected so use defaults
%}
%\end{verbatim}
%
%\subsection{Examples}
%\label{sec:examples}
%
%The examples in this section illustrate the above commands.
%
%\subsubsection{animals.sty}
%\label{sec:animals}
%
%This example is for a trivial package called \sty{animals.sty}
%that defines three textual commands: \cs{catname}, \cs{dogname}
%and \cs{ladybirdname}. The default values are: ``cat'', ``dog'' and
%``bishy-barney-bee''.\footnote{Thass Broad Norfolk, my bewties
%\texttt{:-P}}
%
%The supported languages are defined in files
%with the prefix \texttt{animals-} and the suffix \texttt{.ldf}.
%
%Here's the code for \texttt{animals.sty}:
%\begin{verbatim}
%\NeedsTeXFormat{LaTeX2e}
%\ProvidesPackage{animals}
%
%\RequirePackage{tracklang}
%
%\newcommand\catname{cat}
%\newcommand\dogname{dog}
%\newcommand\ladybirdname{bishy-barney-bee}
%
%\AnyTrackedLanguages
%{%
%  \ForEachTrackedDialect{\this@dialect}{%
%    \IfTrackedLanguageFileExists{\this@dialect}%
%    {animals-}% prefix
%    {.ldf}%
%    {%
%      \PackageInfo{animals}{Loading `animals-\CurrentTrackedTag.ldf'
%      for language `\this@dialect'}%
%      \input{animals-\CurrentTrackedTag.ldf}%
%    }%
%    {%
%       \PackageWarning{animals}%
%       {No support for language `\this@dialect'}%
%    }%
%  }%
%}
%{% no tracked languages, default already set up
%}
%
%\endinput
%\end{verbatim}
%The \texttt{animals-english.ldf} file contains:
%\begin{verbatim}
%\providecommand*{\englishanimals}{%
%  \renewcommand*{\catname}{cat}%
%  \renewcommand*{\dogname}{dog}%
%  \renewcommand*{\ladybirdname}{bishy-barney-bee}%
%}
%\englishanimals
%\end{verbatim}
%The \texttt{animals-en-GB.ldf} file contains:
%\begin{verbatim}
%\input{animals-english.ldf}
%
%\providecommand*{\englishGBanimals}{%
%  \englishanimals
%  \renewcommand*{\ladybirdname}{ladybird}%
%}
%\englishGBanimals
%\end{verbatim}
%The \texttt{animals-en-US.ldf} file contains:
%\begin{verbatim}
%\input{animals-english.ldf}
%
%\providecommand*{\englishUSanimals}{%
%  \englishanimals
%  \renewcommand*{\ladybirdname}{ladybug}%
%}
%\englishUSanimals
%\end{verbatim}
%
%This simple example doesn't try to use \sty{babel} or \sty{polyglossia}'s
%\cs{captions}\meta{language} mechanism, which means that if any
%users need to switch language part way through the document they
%will have to use \cs{englishanimals}, \cs{englishGBanimals} or 
%\cs{englishUSanimals} to redefine the fixed names provided by this
%package.
%
%The other drawback to this package is that if the user
%requests both \texttt{british} (or \texttt{UKenglish}) and
%\texttt{american} (or \texttt{USenglish}), then the
%\texttt{animals-english.ldf} file is loaded twice, once by
%\texttt{animals-en-GB.ldf} and once by \texttt{animals-en-US.ldf}.
%This redundant input can be avoided by implementing a mechanism
%similar to \cs{RequirePackage}. The example package below,
%\texttt{animals2.sty} adds the following definitions:
%\begin{verbatim}
%\newcommand*{\RequireAnimalsLang}[1]{%
%  \@ifundefined{ver@animals2-#1.ldf}{\input{animals2-#1.ldf}}{}%
%} 
%
%\newcommand*{\ProvidesAnimalsLang}[1]{%
%  \ProvidesFile{animals2-#1.ldf}%
%}
%\end{verbatim}
%Each \texttt{.ldf} file should now identify itself with
%\cs{ProvidesAnimalsLang} so it can then be loaded with
%\cs{RequireAnimalsLang}. The complete code for \texttt{animals2.sty}
%is now:
%\begin{verbatim}
%\NeedsTeXFormat{LaTeX2e}
%\ProvidesPackage{animals2}
%
%\RequirePackage{tracklang}
%
%\newcommand\catname{cat}
%\newcommand\dogname{dog}
%\newcommand\ladybirdname{bishy-barney-bee}
%
%\newcommand*{\RequireAnimalsLang}[1]{%
%  \@ifundefined{ver@animals2-#1.ldf}{\input{animals2-#1.ldf}}{}%
%}
%
%\newcommand*{\ProvidesAnimalsLang}[1]{%
%  \ProvidesFile{animals2-#1.ldf}%
%}
%
%\AnyTrackedLanguages
%{%
%  \ForEachTrackedDialect{\this@dialect}{%
%    \IfTrackedLanguageFileExists{\this@dialect}%
%    {animals2-}% prefix
%    {.ldf}%
%    {%
%      \RequireAnimalsLang{\CurrentTrackedTag}%
%    }%
%    {%
%       \PackageWarning{animals2}%
%       {No support for language `\this@dialect'}%
%    }%
%  }%
%}
%{% no tracked languages, default already set up
%}
%
%\endinput
%\end{verbatim}
%The \texttt{animals2-english.ldf} file is now:
%\begin{verbatim}
%\ProvidesAnimalsLang{english}
%
%\providecommand*{\englishanimals}{%
%  \renewcommand*{\catname}{cat}%
%  \renewcommand*{\dogname}{dog}%
%  \renewcommand*{\ladybirdname}{bishy-barney-bee}%
%}
%\englishanimals
%\end{verbatim}
%The \texttt{animals2-en-GB.ldf} file is now:
%\begin{verbatim}
%\ProvidesAnimalsLang{en-GB}
%
%\RequireAnimalsLang{english}%
%
%\providecommand*{\englishGBanimals}{%
%  \englishanimals
%  \renewcommand*{\ladybirdname}{ladybird}%
%}
%\englishGBanimals
%\end{verbatim}
%The \texttt{animals2-en-US.ldf} file is now:
%\begin{verbatim}
%\ProvidesAnimalsLang{en-US}
%
%\RequireAnimalsLang{english}%
%
%\providecommand*{\englishUSanimals}{%
%  \englishanimals
%  \renewcommand*{\ladybirdname}{ladybug}%
%}
%
%\englishUSanimals
%\end{verbatim}
%Here's a sample document:
%\begin{verbatim}
%\documentclass[british,american,a4paper]{article}
%
%\usepackage{animals2}
%
%\begin{document}
%
%\englishGBanimals
%
%\catname.
%\dogname.
%\ladybirdname.
%
%\englishUSanimals
%
%\catname.
%\dogname.
%\ladybirdname.
%
%\end{document}
%\end{verbatim}
%The transcript includes:
%\begin{verbatim}
%(./animals2.sty
%(./tracklang.sty) (./animals2-en-US.ldf (./animals2-english.ldf))
%(./animals2-en-GB.ldf))
%\end{verbatim}
%which shows that \texttt{animals2-english.ldf} is only input once.
%
%The next step is to integrate with \sty{babel} or
%\sty{polyglossia}. Both these packages use
%\cs{captions}\meta{language} to update fixed names whenever the
%given \meta{language} is selected. With \sty{babel} the
%\meta{language} setting is the dialect label (which may also be the
%root language label). With \sty{polyglossia} \meta{language} is the
%root language label, regardless of the selected variant.
%
%For example, if you load \sty{babel} using:
%\begin{verbatim}
%\usepackage[UKenglish]{babel}
%\end{verbatim}
%then \cs{captionsUKenglish} is defined but if you use:
%\begin{verbatim}
%\usepackage[british]{babel}
%\end{verbatim}
%then \cs{captionsbritish} is defined instead. If, however, you load
%\sty{polyglossia} using:
%\begin{verbatim}
%\usepackage{polyglossia}
%\setmainlanguage[variant=british]{english}
%\end{verbatim}
%then \cs{captionsenglish} is defined.
%
%This just requires a few minor modifications to the above example
%package.  Remember that the \texttt{.ldf} files are loaded within
%\ics{IfTrackedLanguageFileExists}, which means that the dialect label
%can be obtained from \ics{CurrentTrackedDialect}. To allow for the
%possibility of loading a language file at some later date,
%\ics{IfTrackedLanguageFile} can be moved to a new user command:
%\begin{verbatim}
%\newcommand*{\RequireAnimalsDialect}[1]{%
%    \IfTrackedLanguageFileExists{#1}%
%    {animals3-}% prefix
%    {.ldf}%
%    {%
%      \RequireAnimalsLang{\CurrentTrackedTag}%
%    }%
%    {%
%       \PackageWarning{animals3}%
%       {No support for language `#1'}%
%    }%
%}
%\end{verbatim}
%Now \texttt{animals3-en-GB.ldf} and \texttt{animals3-en-US.ldf} can
%use \ics{CurrentTrackedDialect} to add to the language captions mechanism.
%The file \texttt{animals3-en-GB.ldf} contains:
%\begin{verbatim}
%\ProvidesAnimalsLang{en-GB}
%
%\RequireAnimalsLang{english}%
%
%\providecommand*{\englishGBanimals}{%
%  \englishanimals
%  \renewcommand*{\ladybirdname}{ladybird}%
%}
%
%\englishGBanimals
%
%\@ifundefined{captions\CurrentTrackedDialect}
%{%
%  \@ifundefined{captions\CurrentTrackedLanguage}{}%
%  {%
%    \expandafter\g@addto@macro
%      \csname captions\CurrentTrackedLanguage\endcsname{\englishGBanimals}%
%  }
%}%
%{%
%  \expandafter\g@addto@macro
%    \csname captions\CurrentTrackedDialect\endcsname{\englishGBanimals}%
%}
%\end{verbatim}
%The file \texttt{animals3-en-GB.ldf} contains:
%\begin{verbatim}
%\ProvidesAnimalsLang{en-US}
%
%\RequireAnimalsLang{english}%
%
%\providecommand*{\englishUSanimals}{%
%  \englishanimals
%  \renewcommand*{\ladybirdname}{ladybug}%
%}
%
%\englishUSanimals
%
%\@ifundefined{captions\CurrentTrackedDialect}%
%{%
%  \@ifundefined{captions\CurrentTrackedLanguage}{}%
%  {%
%    \expandafter\g@addto@macro
%      \csname captions\CurrentTrackedLanguage\endcsname{\englishUSanimals}%
%  }
%}%
%{%
%  \expandafter\g@addto@macro
%    \csname captions\CurrentTrackedDialect\endcsname{\englishUSanimals}%
%}
%\end{verbatim}
%The inner \cs{@ifundefined} check is required in case
%\sty{polyglossia} has been loaded, although this causes some
%redundancy as \cs{captionsenglish} now contains both
%\cs{englishanimals} and \cs{englishGBanimals} (or
%\cs{englishUSanimals}).
%
%The root language file \texttt{animals3-english.ldf} contains:
%\begin{verbatim}
%\ProvidesAnimalsLang{english}
%
%\providecommand*{\englishanimals}{%
%  \renewcommand*{\catname}{cat}%
%  \renewcommand*{\dogname}{dog}%
%  \renewcommand*{\ladybirdname}{bishy-barney-bee}%
%}
%
%\englishanimals
%
%\@ifundefined{captionsenglish}%
%{%
%  \@ifundefined{captions\CurrentTrackedDialect}{}%
%  {%
%    \expandafter\g@addto@macro
%      \csname captions\CurrentTrackedDialect\endcsname{\englishanimals}%
%  }
%}%
%{%
%  \g@addto@macro\captionsenglish{\englishanimals}%
%}
%\end{verbatim}
%The additional \cs{@ifundefined} check ensures that the package
%will work with other English dialects (although it may not produce
%the correct translations for the given region). You'll have to
%decide on the most appropriate default translations for the 
%root language given no regional information.
%
%The complete code for the \texttt{animals3.sty} package is as
%follows:
%\begin{verbatim}
%\NeedsTeXFormat{LaTeX2e}
%\ProvidesPackage{animals3}
%
%\RequirePackage{tracklang}
%
%\newcommand\catname{cat}
%\newcommand\dogname{dog}
%\newcommand\ladybirdname{bishy-barney-bee}
%
%\newcommand*{\RequireAnimalsDialect}[1]{%
%    \IfTrackedLanguageFileExists{#1}%
%    {animals3-}% prefix
%    {.ldf}%
%    {%
%      \RequireAnimalsLang{\CurrentTrackedTag}%
%    }%
%    {%
%       \PackageWarning{animals3}%
%       {No support for language `#1'}%
%    }%
%}
%
%\newcommand*{\RequireAnimalsLang}[1]{%
%  \@ifundefined{ver@animals3-#1.ldf}{\input{animals3-#1.ldf}}{}%
%}
%
%\newcommand*{\ProvidesAnimalsLang}[1]{%
%  \ProvidesFile{animals3-#1.ldf}%
%}
%
%\AnyTrackedLanguages
%{%
%  \ForEachTrackedDialect{\this@dialect}{%
%    \RequireAnimalsDialect\this@dialect
%  }%
%}
%{% no tracked languages, default already set up
%}
%
%\endinput
%\end{verbatim}
%
%Here's sample document that uses this package with \sty{babel}:
%\begin{verbatim}
%\documentclass[a4paper]{article}
%
%\usepackage[british,american]{babel}
%
%\usepackage{animals3}
%
%\begin{document}
%
%\selectlanguage{british}
%
%\catname.
%\dogname.
%\ladybirdname.
%
%\selectlanguage{american}
%
%\catname.
%\dogname.
%\ladybirdname.
%
%\end{document}
%\end{verbatim}
%
%Unfortunately when used with \sty{polyglossia}, \styfmt{tracklang} can't 
%detect the requested dialect. Consider the following example
%document:
%\begin{verbatim}
%\documentclass[a4paper]{article}
%
%\usepackage{polyglossia}
%\setmainlanguage[variant=british]{english}
%
%\usepackage{animals3}
%
%\begin{document}
%
%\catname.
%\dogname.
%\ladybirdname.
%
%\end{document}
%\end{verbatim}
%This loads \texttt{animals3-english.ldf} but doesn't load
%\texttt{animals3-en-GB.ldf}. The dialect has to be added to the
%document class options:
%\begin{verbatim}
%\documentclass[british,a4paper]{article}
%
%\usepackage{polyglossia}
%\setmainlanguage[variant=british]{english}
%
%\usepackage{animals3}
%
%\begin{document}
%
%\catname.
%\dogname.
%\ladybirdname.
%
%\end{document}
%\end{verbatim}
%
%Other languages can be added by simply providing additional
%\texttt{.ldf} files. For example, \texttt{animals3-german.ldf}:
%\begin{verbatim}
%\ProvidesAnimalsLang{german}
%
%\providecommand*{\germananimals}{%
%  \renewcommand*{\catname}{Katze}%
%  \renewcommand*{\dogname}{Hund}%
%  \renewcommand*{\ladybirdname}{Marienk\"afer}%
%}
%
%\germananimals
%
%\@ifundefined{captionsgerman}%
%{%
%  \@ifundefined{captions\CurrentTrackedDialect}{}%
%  {%
%    \expandafter\g@addto@macro
%      \csname captions\CurrentTrackedDialect\endcsname{\germananimals}%
%  }
%}%
%{%
%  \g@addto@macro\captionsgerman{\germananimals}%
%}
%\end{verbatim}
%
%This works fine with \sty{babel}:
%\begin{verbatim}
%\documentclass[a4paper]{article}
%
%\usepackage[ngerman]{babel}
%
%\usepackage{animals3}
%
%\begin{document}
%
%\catname.
%\dogname.
%\ladybirdname.
%
%\end{document}
%\end{verbatim}
%It also works with \sty{ngerman}:
%\begin{verbatim}
%\documentclass[a4paper]{article}
%
%\usepackage{ngerman}
%
%\usepackage{animals3}
%
%\begin{document}
%
%\catname.
%\dogname.
%\ladybirdname.
%
%\end{document}
%\end{verbatim}
%and with \sty{translator}:
%\begin{verbatim}
%\documentclass[a4paper]{article}
%
%\usepackage[ngerman]{translator}
%
%\usepackage{animals3}
%
%\begin{document}
%
%\catname.
%\dogname.
%\ladybirdname.
%
%\end{document}
%\end{verbatim}
%
%Since no regional variants have been provided to accompany
%\texttt{animals3-german.ldf} this also works fine with
%\sty{polyglossia}:
%\begin{verbatim}
%\documentclass[a4paper]{article}
%
%\usepackage{polyglossia}
%\setmainlanguage{german}
%
%\usepackage{animals3}
%
%\begin{document}
%
%\catname.
%\dogname.
%\ladybirdname.
%
%\end{document}
%\end{verbatim}
%
%\subsubsection{regions.sty}
%\label{sec:regions}
%
%Earlier, I~mentioned the search order for
%\ics{IfTrackedLanguageFileExists} where if, for example, the dialect
%is \texttt{british}, the file search will be:
%\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}
%\end{enumerate}
%You may have wondered why
%\texttt{mypackage-GB.ldf} is included in the search given that some
%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 
%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
%document, but I also want to provide multilingual support. The
%language alone won't tell me whether to use imperial or metric (for
%example, the US uses imperial and the UK uses metric for most
%product attributes). I could provide \texttt{.ldf} files for every
%language and region combination, but this would result in a lot
%redundancy.
%
%The example package (\texttt{regions.sty}) below illustrates this.
%\begin{verbatim}
%\NeedsTeXFormat{LaTeX2e}
%\ProvidesPackage{regions}
%
%\RequirePackage{tracklang}
%
%\newcommand*{\weightunit}{kg}
%\newcommand*{\lengthunit}{mm}
%\newcommand*{\currencyunit}{EUR}
%
%\newcommand*{\unitname}{units}
%
%\AnyTrackedLanguages
%{%
%  \ForEachTrackedDialect{\this@dialect}{%
%    \IfTrackedLanguageFileExists{\this@dialect}%
%    {regions-}% prefix
%    {.ldf}%
%    {%
%      \PackageInfo{regions}{Loading `regions-\CurrentTrackedTag.ldf'
%      for language `\this@dialect'}%
%      \input{regions-\CurrentTrackedTag.ldf}%
%      \InputIfFileExists{regions-\CurrentTrackedLanguage.ldf}%
%      {}%
%      {%
%        \PackageWarning{regions}{No support for language
%          `\CurrentTrackedLanguage'}%
%      }%
%    }%
%    {%
%       \PackageWarning{regions}%
%       {No support for language `\this@dialect'}%
%    }%
%  }%
%}
%{% no tracked languages, default already set up
%}
%
%\endinput
%\end{verbatim}
%There are separate \texttt{.ldf} files for region and language.
%First are the regions.
%
%\begin{itemize}
%\item \texttt{regions-BE.ldf} (Belgium):
%\begin{verbatim}
%\providecommand*{\BEunits}{%
%  \renewcommand*{\weightunit}{kg}%
%  \renewcommand*{\lengthunit}{mm}%
%  \renewcommand*{\currencyunit}{EUR}%
%}
%
%\BEunits
%\end{verbatim}
%
%\item \texttt{regions-CA.ldf} (Canada):
%\begin{verbatim}
%\providecommand*{\CAunits}{%
%  \renewcommand*{\weightunit}{kg}%
%  \renewcommand*{\lengthunit}{mm}%
%  \renewcommand*{\currencyunit}{CAD}%
%}
%
%\CAunits
%\end{verbatim}
%
%\item \texttt{regions-GB.ldf} (Great Britain):
%\begin{verbatim}
%\providecommand*{\GBunits}{%
%  \renewcommand*{\weightunit}{kg}%
%  \renewcommand*{\lengthunit}{mm}%
%  \renewcommand*{\currencyunit}{GBP}%
%}
%
%\GBunits
%\end{verbatim}
%
%\item \texttt{regions-US.ldf} (USA):
%\begin{verbatim}
%\providecommand*{\USunits}{%
%  \renewcommand*{\weightunit}{lb}%
%  \renewcommand*{\lengthunit}{in}%
%  \renewcommand*{\currencyunit}{USD}%
%}
%
%\USunits
%\end{verbatim}
%\end{itemize}
%Now follow the language files.
%
%\begin{itemize}
%\item \texttt{regions-dutch.ldf}:
%\begin{verbatim}
%\providecommand*{\dutchnames}{%
%  \renewcommand*{\unitname}{meeteenheden}%
%}
%
%\dutchnames
%\end{verbatim}
%
%\item \texttt{regions-english.ldf}:
%\begin{verbatim}
%\providecommand*{\englishnames}{%
%  \renewcommand*{\unitname}{units}%
%}
%
%\englishnames
%\end{verbatim}
%
%\item \texttt{regions-french.ldf}:
%\begin{verbatim}
%\providecommand*{\frenchnames}{%
%  \renewcommand*{\unitname}{unit\'es}%
%}
%
%\frenchnames
%\end{verbatim}
%
%\item \texttt{regions-german.ldf}:
%\begin{verbatim}
%\providecommand*{\germannames}{%
%  \renewcommand*{\unitname}{Ma\ss einheiten}%
%}
%
%\germannames
%\end{verbatim}
%\end{itemize}
%
%Here's an example document that uses this package:
%\begin{verbatim}
%\documentclass[canadien]{article}
%
%\usepackage{regions}
%
%\begin{document}
%
%\unitname: \weightunit, \lengthunit, \currencyunit.
%
%\end{document}
%\end{verbatim}
%
%This works because \cs{IfTrackedLanguageFileExists} searches for the
%country code before the root language label. In this case, 
%\texttt{regions-CA.ldf} is matched rather than
%\texttt{regions-french.ldf}, so \texttt{regions-CA.ldf} is loaded by
%\begin{verbatim}
%      \input{regions-\CurrentTrackedTag.ldf}%
%\end{verbatim}
%After this, the language file \texttt{regions-french.ldf} is then loaded:
%\begin{verbatim}
%      \InputIfFileExists{regions-\CurrentTrackedLanguage.ldf}%
%      {}%
%      {%
%        \PackageWarning{regions}{No support for language
%          `\CurrentTrackedLanguage'}%
%      }%
%\end{verbatim}
%
%This assumes that there's a country code \texttt{.ldf} file
%available. This example needs a little modification to use default
%units in case the region is missing:
%\begin{verbatim}
%\NeedsTeXFormat{LaTeX2e}
%\ProvidesPackage{regions}
%
%\RequirePackage{tracklang}
%
%\newcommand*{\weightunit}{kg}
%\newcommand*{\lengthunit}{mm}
%\newcommand*{\currencyunit}{EUR}
%
%\newcommand*{\unitname}{units}
%
%\newcommand*{\defaultunits}{%
%  \renewcommand*{\weightunit}{kg}%
%  \renewcommand*{\lengthunit}{mm}%
%  \renewcommand*{\currencyunit}{EUR}%
%}
%
%\AnyTrackedLanguages
%{%
%  \ForEachTrackedDialect{\this@dialect}{%
%    \IfTrackedLanguageFileExists{\this@dialect}%
%    {regions-}% prefix
%    {.ldf}%
%    {%
%      \PackageInfo{regions}{Loading `regions-\CurrentTrackedTag.ldf'
%      for language `\this@dialect'}%
%      \input{regions-\CurrentTrackedTag.ldf}%
%      \ifx\CurrentTrackedTag\CurrentTrackedLanguage
%        \defaultunits
%      \else
%        \InputIfFileExists{regions-\CurrentTrackedLanguage.ldf}%
%        {}%
%        {%
%          \PackageWarning{regions}{No support for language
%            `\CurrentTrackedLanguage'}%
%        }%
%      \fi
%    }%
%    {%
%       \PackageWarning{regions}%
%       {No support for language `\this@dialect'}%
%    }%
%  }%
%}
%{% no tracked languages, default already set up
%}
%
%\endinput
%\end{verbatim} 
%
%As with the trivial example in the previous section, this package
%hasn't hooked into \sty{babel}'s caption mechanism, but this can be
%implemented for this example in a similar manner to the final
%example package in the previous section.
%
%\section{Adding Support for Language Tracking}
%\label{sec:langsty}
%
%If you are writing a package that \emph{defines} languages (rather
%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
%defined languages.
%
%You can notify \styfmt{tracklang} that a user has requested a
%particular dialect using:
%\begin{definition}
%\ics{AddTrackedDialect}\marg{dialect}\marg{root language label}
%\end{definition}
%where \meta{dialect} is the dialect label and \meta{root language
%label} is the label for the dialect's root language. This command
%may also be used for synonyms. If the dialect is already in the
%tracked dialect list, it won't be added again. If the root language
%is already in the tracked language list, it won't be added again.
%
%\begin{definition}
%\ics{AddTrackedLanguage}\marg{root language label}
%\end{definition}
%This is equivalent to \ics{AddTrackedDialect}\marg{root language
%label}\marg{root language label} and is provided for the cases
%where the language doesn't have any variants or the user
%wants the default variant for that language.
%
%The ISO codes are specified using:
%\begin{definition}
%\ics{AddTrackedIsoLanguage}\marg{code type}\marg{code}\marg{label}
%\end{definition}
%where \meta{code type} is the ISO code type (for example, 639-1),
%\meta{code} is the code (for example, ``en'') and \meta{label} is
%the language or dialect label. (The root language label for
%ISO~639-1 or ISO~639-2, and the dialect label for the country
%code ISO~3166-1.)
%
%For example:
%\begin{verbatim}
%\ProvidesPackage{alien}
%
%\RequirePackage{tracklang}
%
%\DeclareOption{martian}{%
%  \AddTrackedLanguage{martian}%
%  \AddTrackedIsoLanguage{639-1}{xx}{martian}%
%  % code to set Martian language
%}
%
%\DeclareOption{uppermartian}{%
%  \AddTrackedDialect{uppermartian}{martian}%
%  \AddTrackedIsoLanguage{639-1}{xx}{martian}%
%  \AddTrackedIsoLanguage{3166-1}{XX}{uppermartian}%
%  % code to set Upper Martian dialect
%}
%
%\DeclareOption{lowermartian}{%
%  \AddTrackedDialect{lowermartian}{martian}%
%  \AddTrackedIsoLanguage{639-1}{xx}{martian}%
%  \AddTrackedIsoLanguage{3166-1}{YY}{lowermartian}%
%  % code to set Lower Martian dialect
%}
%\end{verbatim}
%
%Now other package writers who want to provide support
%for the Martian dialects can easily detect which language options
%the user requested through your package, and it means the user
%doesn't have to specify all their language options through the
%document class or through each package that has multilingual
%support.
%
%If you want to track one of the dialects known to 
%\styfmt{tracklang} (for example, ``british'') you can do so
%using:
%\begin{definition}
%\ics{TrackPredefinedDialect}\marg{dialect label}
%\end{definition}
%This will add the dialect and the ISO codes.
%(See \texttt{tracklang.tex}, \sectionref{sec:predefined}, 
%for all predefined options. These are all the control sequences in the form
%\cs{@tracklang@add@}\meta{dialect label}.)
%
%For non-LaTeX packages, you can input \texttt{tracklang.tex} provided 
%the category code for \texttt{@} has been set to 11:
%\begin{verbatim}
%\catcode `\@11\relax
%\input tracklang
%\end{verbatim}
%(Remember to revert it back afterwards if necessary.)
%
%If you want some means of tracking each predefined option, you can
%define
%\begin{definition}
%\cs{@tracklang@declareoption}\marg{dialect label}
%\end{definition}
%before loading \texttt{tracklang.tex}. For example,
%\texttt{tracklang.sty} has the following code:
%\begin{verbatim}
%\newcommand*{\@tracklang@declareoption}[1]{%
%  \DeclareOption{#1}{\TrackPredefinedDialect{#1}}%
%}
%\input{tracklang}
%\end{verbatim}
%which ensures that each predefined dialect is also declared
%as a package option.
%
%\section{Plain \TeX\ Example}
%\label{sec:plain}
%
%Since plain \TeX\ doesn't have document class or package options,
%the dialects and ISO codes need to be added using the commands
%described in the previous section. For example:
%\begin{verbatim}
%\catcode `\@11\relax
%\input tracklang
%\catcode `\@12\relax
%
%\TrackPredefinedDialect{british}
%\TrackPredefinedDialect{american}
%\TrackPredefinedDialect{canadian}
%\TrackPredefinedDialect{canadien}
%\TrackPredefinedDialect{belgique}
%
%Dialect Regions:
%
%\ForEachTrackedDialect{\ThisDialect}{\ThisDialect:
% \TrackedIsoCodeFromLanguage{\TwoLetterIsoCountryCode}{\ThisDialect}. }
%
%Language Codes:
%
%\ForEachTrackedLanguage{\ThisLanguage}{\ThisLanguage:
% \TrackedIsoCodeFromLanguage{\TwoLetterIsoLanguageCode}{\ThisLanguage}. }
%
%\bye
%\end{verbatim}
%
%This produces:
%\begin{quotation}
%Dialect Regions:
%
%british: GB. american: US. canadian: CA. canadien: CA. belgique: BE.
%
%Language Codes:
%
%english: en. french: fr.
%
%Found ``animals-en-GB.ldf''
%
%Found ``animals-en-US.ldf''
%
%Found ``animals-english.ldf''
%
%No file found for dialect ``canadien''
%
%No file found for dialect ``belgique''
%\end{quotation}
%
%\clearpage
%\addtolength{\marginparwidth}{40pt}
%\addtolength{\oddsidemargin}{40pt}
%\addtolength{\evensidemargin}{40pt}
%\StopEventually{\clearpage
%\addtolength{\marginparwidth}{-60pt}
%\addtolength{\oddsidemargin}{-60pt}
%\addtolength{\evensidemargin}{-60pt}
%\addtolength{\textwidth}{80pt}
%\addtolength{\linewidth}{80pt}
%\addtolength{\hsize}{80pt}
%\PrintIndex}
%
%
%\section{The Code}
%\iffalse
%    \begin{macrocode}
%<*tracklang.sty>
%    \end{macrocode}
%\fi
%\changes{1.0}{2014-09-29}{Initial release}
%\subsection{\LaTeX\ Code (\texttt{tracklang.sty})}
% To ensure maximum portability this file only uses \LaTeX\ kernel
% commands, rather than using more convenient commands provided by
% packages such as \styfmt{etoolbox}.
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tracklang}[2015/03/23 v1.2 (NLCT) Track Languages]
%    \end{macrocode}
%\begin{macro}{\@tracklang@declareoption}
% Set up package options.
%    \begin{macrocode}
\providecommand*{\@tracklang@declareoption}[1]{%
  \DeclareOption{#1}{\TrackPredefinedDialect{#1}}%
}
%    \end{macrocode}
%\end{macro}
% Load generic code:
%    \begin{macrocode}
\input{tracklang}
%    \end{macrocode}
%    \begin{macrocode}
\let\@tracklang@declaredoptions\@declaredoptions
\ProcessOptions
%    \end{macrocode}
% Unset \cs{@tracklang@declareoption}:
%    \begin{macrocode}
\let\@tracklang@declareoption\@gobble
%    \end{macrocode}
%
% In the event that the language hasn't been supplied through the
% package options (or through the class options, which the package
% options should process provided the document class has used the
% standard option declarations) we need to check if any of the known
% language packages have been loaded. This is a bit dangerous as it
% relies on the packages not changing their internal language
% macros. It would be easier if all the language packages could
% provide a reliable user interface to determine which languages
% (and variants) have been loaded.
%
%    \begin{macrocode}
\ifx\@tracklang@languages\@empty
%    \end{macrocode}
% First try \sty{babel}. If \sty{babel} has been loaded, the
% languages are stored in \cs{bbl@loaded}, so check if this command
% has been defined, and if it has add those languages.
%    \begin{macrocode}
  \@ifundefined{bbl@loaded}%
  {%
%    \end{macrocode}
% If \sty{translator} has been loaded, the languages are stored in
% \cs{trans@languages}
%    \begin{macrocode}
    \@ifundefined{trans@languages}
    {%
%    \end{macrocode}
% Has \sty{ngerman} been loaded?
%    \begin{macrocode}
       \@ifpackageloaded{ngerman}%
       {%
         \@tracklang@add@ngerman
       }%
       {%
%    \end{macrocode}
% Has \sty{polyglossia} been loaded? 
%    \begin{macrocode}
         \@ifpackageloaded{polyglossia}
         {%
%    \end{macrocode}
% \sty{polyglossia} sets \cs{\meta{lang}@loaded} for each loaded
% language, so check this for all known languages. I don't know how
% to check for variants.
%    \begin{macrocode}
           \@for\this@language:=albanian,amharic,arabic,armenian,asturian,%
            bahasai,bahasam,basque,bengali,brazil,breton,bulgarian,%
            catalan,coptic,croatian,czech,danish,divehi,dutch,english,%
            esperanto,estonian,farsi,finnish,french,friulan,galician,%
            german,greek,hebrew,hindi,icelandic,interlingua,irish,%
            italian,kannada,lao,latin,latvian,lithuanian,lsorbian,%
            magyar,malayalam,marathi,nko,norsk,nynorsk,occitan,%
            piedmontese,polish,portuges,romanian,romansh,russian,%
            samin,sanskrit,scottish,serbian,slovak,slovenian,spanish,%
            swedish,syriac,tamil,telugu,thai,tibetan,turkish,turkmen,%
            ukrainian,urdu,usorbian,vietnamese,welsh\do{%
              \@ifundefined{\this@language @loaded}%
              {}%
              {%
               \@ifundefined{@tracklang@add@\this@language}%
               {%
                 \PackageWarning{tracklang}%
                    {Adding unknown language `\this@language'}%
                 \AddTrackedLanguage\this@language
               }%
               {%
                 \@nameuse{@tracklang@add@\this@language}%
               }%
             }%
           }%
         }%
         {%
%    \end{macrocode}
% None of the known packages have been loaded, so do nothing in case
% another package wants to load this one before setting up the
% language options. However, if at this point \sty{babel} has been
% loaded, then it's an older version that hasn't defined
% \cs{bbl@loaded} so check for this.
%    \begin{macrocode}
           \@ifpackageloaded{babel}
           {%
             \PackageInfo{tracklang}{babel loaded but
             \string\bb@loaded\space not defined. Will attempt
             to track known languages.}%
             \@for\this@language:=\@tracklang@declaredoptions\do{%
               \@ifundefined{captions\this@language}%
               {}%
               {\@nameuse{@tracklang@add@\this@language}}%
             }%
           }%
           {}%
         }%
       }%
    }%
    {%
%    \end{macrocode}
% Add from \sty{translator}.
% If \sty{translator} has been loaded, the language names are
% stored in \cs{trans@languages} but these are labels used by
% \sty{translator}, so some mapping is required.
%    \begin{macrocode}
      \let\@tracklang@add@Acadian\@tracklang@add@acadian
      \let\@tracklang@add@French\@tracklang@add@french
      \let\@tracklang@add@Afrikaans\@tracklang@add@afrikaans
      \let\@tracklang@add@Dutch\@tracklang@add@dutch
      \let\@tracklang@add@AmericanEnglish\@tracklang@add@american
      \let\@tracklang@add@Austrian\@tracklang@add@austrian
      \@namedef{@tracklang@add@Austrian1997}{\@tracklang@add@naustrian}
      \let\@tracklang@add@Bahasa\@tracklang@add@bahasa
      \let\@tracklang@add@Basque\@tracklang@add@basque
      \let\@tracklang@add@Brazilian\@tracklang@add@brazil
      \let\@tracklang@add@Portuguese\@tracklang@add@portuguese
      \let\@tracklang@add@Breton\@tracklang@add@breton
      \let\@tracklang@add@BritishEnglish\@tracklang@add@british
      \let\@tracklang@add@Bulgarian\@tracklang@add@bulgarian
      \let\@tracklang@add@Canadian\@tracklang@add@canadian
      \let\@tracklang@add@Canadien\@tracklang@add@canadien
      \let\@tracklang@add@Catalan\@tracklang@add@catalan
      \let\@tracklang@add@Croatian\@tracklang@add@croatian
      \let\@tracklang@add@Czech\@tracklang@add@czech
      \let\@tracklang@add@Danish\@tracklang@add@danish
      \let\@tracklang@add@Dutch\@tracklang@add@dutch
      \let\@tracklang@add@English\@tracklang@add@english
      \let\@tracklang@add@Esperanto\@tracklang@add@esperanto
      \let\@tracklang@add@Estonian\@tracklang@add@estonian
      \let\@tracklang@add@Finnish\@tracklang@add@finnish
      \let\@tracklang@add@French\@tracklang@add@french
      \let\@tracklang@add@Galician\@tracklang@add@galician
      \let\@tracklang@add@German\@tracklang@add@german
      \@namedef{@tracklang@add@German1997}{\@tracklang@add@ngerman}
      \let\@tracklang@add@Greek\@tracklang@add@greek
      \let\@tracklang@add@Polutoniko\@tracklang@add@polutoniko
      \let\@tracklang@add@Hebrew\@tracklang@add@hebrew
      \let\@tracklang@add@Hungarian\@tracklang@add@hungarian
      \let\@tracklang@add@Icelandic\@tracklang@add@icelandic
      \let\@tracklang@add@Irish\@tracklang@add@irish
      \let\@tracklang@add@Italian\@tracklang@add@italian
      \let\@tracklang@add@Latin\@tracklang@add@latin
      \let\@tracklang@add@LowerSorbian\@tracklang@add@lowersorbian
      \let\@tracklang@add@Magyar\@tracklang@add@magyar
      \let\@tracklang@add@Nynorsk\@tracklang@add@nynorsk
      \let\@tracklang@add@Norsk\@tracklang@add@norsk
      \let\@tracklang@add@Polish\@tracklang@add@polish
      \let\@tracklang@add@Portuguese\@tracklang@add@portuguese
      \let\@tracklang@add@Romanian\@tracklang@add@romanian
      \let\@tracklang@add@Russian\@tracklang@add@russian
      \let\@tracklang@add@Scottish\@tracklang@add@scottish
      \let\@tracklang@add@Serbian\@tracklang@add@serbian
      \let\@tracklang@add@Slovak\@tracklang@add@slovak
      \let\@tracklang@add@Slovene\@tracklang@add@slovene
      \let\@tracklang@add@Spanish\@tracklang@add@spanish
      \let\@tracklang@add@Swedish\@tracklang@add@swedish
      \let\@tracklang@add@Turkish\@tracklang@add@turkish
      \let\@tracklang@add@Ukrainian\@tracklang@add@ukrainian
      \let\@tracklang@add@UpperSorbian\@tracklang@add@uppersorbian
      \let\@tracklang@add@Welsh\@tracklang@add@welsh
%    \end{macrocode}
% Now iterate through the declared languages:
%    \begin{macrocode}
      \@for\this@language:=\trans@languages\do{%
         \@ifundefined{@tracklang@add@\this@language}{}%
         {\@nameuse{@tracklang@add@\this@language}}%
      }%
    }%
  }%
  {%
%    \end{macrocode}
% Add from \sty{babel}
%    \begin{macrocode}
    \@for\this@language:=\bbl@loaded\do{%
       \@ifundefined{@tracklang@add@\this@language}%
       {%
         \PackageWarning{tracklang}{Adding unknown language `\this@language'}%
         \AddTrackedLangage{\this@language}%
       }%
       {\@nameuse{@tracklang@add@\this@language}}%
     }%
  }
%    \end{macrocode}
% End of check for language packages
%    \begin{macrocode}
\fi
%    \end{macrocode}
%\iffalse
%    \begin{macrocode}
%</tracklang.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*tracklang.tex>
%    \end{macrocode}
%\fi
%\subsection{Generic Code (\texttt{tracklang.tex})}
% First check if this file has already been loaded:
%    \begin{macrocode}
\ifx \@tracklang@languages\undefined
\else
  \expandafter\endinput
\fi
%    \end{macrocode}
% Define a long command for determining the existence of a control
% sequence by its name.
%\begin{macro}{\@tracklang@ifundef}
%    \begin{macrocode}
\long\def\@tracklang@ifundef#1#2#3{%
  \expandafter\ifx\csname #1\endcsname\relax
     #2%
  \else 
     #3%
  \fi
}
%    \end{macrocode}
%\end{macro}
%
% Provide some commands in case the \LaTeX\ kernel hasn't been loaded.
%\begin{macro}{\@tracklang@nnil}
%    \begin{macrocode}
\ifx\@nnil\undefined
  \def\@tracklang@nnil{\@nil}
\else
  \let\@tracklang@nnil\@nnil
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@for}
%    \begin{macrocode}
\ifx\@for\undefined
  \long\def\@tracklang@for#1:=#2\do#3{%
    \expandafter\def\expandafter\@fortmp\expandafter{#2}%
    \ifx\@fortmp\empty
    \else
      \expandafter
        \@tracklang@forloop #2,\@nil,\@nil\@@ #1{#3}%
    \fi
  }
  \long\def\@tracklang@forloop#1,#2,#3\@@ #4#5{%
   \def #4{#1}%
   \ifx#4\@tracklang@nnil
   \else
     #5%
     \def #4{#2}%
     \ifx#4\@tracklang@nnil
     \else
       #5%
       \@tracklang@iforloop #3\@@ #4{#5}%
     \fi
   \fi
  }
  \long\def\@tracklang@iforloop#1,#2\@@ #3#4{%
    \def#3{#1}%
    \ifx#3\@tracklang@nnil
      \expandafter
        \@tracklang@fornoop
    \else
      #4\relax
      \expandafter\@tracklang@iforloop
    \fi
    #2\@@ #3{#4}%
  }
  \long\def\@tracklang@fornoop#1\@@ #2#3{}
\else
  \let\@tracklang@for\@for
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@namedef}
%    \begin{macrocode}
\ifx\@namedef\undefined
  \def\@tracklang@namedef#1{\expandafter\def\csname#1\endcsname}
\else
  \let\@tracklang@namedef\@namedef
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@nameuse}
%    \begin{macrocode}
\ifx\@nameuse\undefined
  \def\@tracklang@nameuse#1{\csname#1\endcsname}
\else
  \let\@tracklang@nameuse\@nameuse
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@err}
%    \begin{macrocode}
\ifx\PackageError\undefined
  \def\@tracklang@err#1#2{%
    \errehelp{#2}%
    \errmessage{tracklang: #1}}
\else
  \def\@tracklang@err#1#2{\PackageError{tracklang}{#1}{#2}}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@IfFileExists}
%    \begin{macrocode}
\ifx\IfFileExists\undefined
 \long\def\@tracklang@IfFileExists#1#2#3{%
   \openin0=#1 %
   \ifeof0\relax
     \def\reserved@a{#3}%
   \else
     \closein0\relax
     \edef\@filef@und{#1 }%
     \def\reserved@a{#2}%
   \fi
   \reserved@a
 }

\else
  \let\@tracklang@IfFileExists\IfFileExists
\fi
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Internal Lists}
%
%\begin{macro}{\@tracklang@languages}
% Provide a list to keep track of all the languages.
%    \begin{macrocode}
\def\@tracklang@languages{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@dialects}
% Provide a list to keep track of all the dialects. Here the
% ``dialect'' isn't necessarily an actual dialect but may be a
% root language or a synonym. It will usually correspond to the
% language name as specified by the user in the package option.
%    \begin{macrocode}
\def\@tracklang@dialects{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@ifinlist}
%\begin{definition}
%\cs{@tracklang@ifinlist}\marg{item}\marg{list}\marg{true
%part}\marg{false part}
%\end{definition}
%Checks if \meta{item} is in \meta{list}. (Performs a one-level
%expansion on \meta{list} but no expansion on \meta{item}.)
%    \begin{macrocode}
\def\@tracklang@ifinlist#1#2#3#4{%
  \def\@tracklang@doifinlist##1,#1,##2\end@tracklang@doifinlist{%
     \def\@before{##1}%
     \def\@after{##2}%
  }%
  \expandafter\@tracklang@doifinlist\expandafter,#2,#1,\@nil
    \end@tracklang@doifinlist
  \ifx\@after\@tracklang@nnil
%    \end{macrocode}
% not found
%    \begin{macrocode}
    #4%
  \else
%    \end{macrocode}
% found
%    \begin{macrocode}
    #3%
  \fi
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add}
%\begin{definition}
%\cs{@tracklang@add}\marg{item}\marg{list cs}
%\end{definition}
% Adds an item to the list given by \meta{list cs}. Does nothing if
% \meta{item} is empty or is already in the list. The \meta{item} is
% fully expanded before being added.
%    \begin{macrocode}
\def\@tracklang@add#1#2{%
%   \end{macrocode}
% First find out if the item is empty.
%    \begin{macrocode}
  \edef\@tracklang@element{#1}%
  \ifx\@tracklang@element\empty
%    \end{macrocode}
% Item is empty, so do nothing.
%    \begin{macrocode}
  \else
    \expandafter\@tracklang@ifinlist\expandafter{\@tracklang@element}#2%
    {%
%    \end{macrocode}
% Already in list, so do nothing.
%    \begin{macrocode}
    }%
    {%
%    \end{macrocode}
% Not in list, so add.
%    \begin{macrocode}
     \ifx\empty#2\relax
       \let#2\@tracklang@element
     \else
       \edef#2{#2,\@tracklang@element}%
     \fi
    }%
  \fi
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\AddTrackedDialect}
%\begin{definition}
%\cs{AddTrackedDialect}\marg{dialect name}\marg{language name}
%\end{definition}
% Add a dialect.
%    \begin{macrocode}
\def\AddTrackedDialect#1#2{%
 \@tracklang@add{#1}{\@tracklang@dialects}%
 \@tracklang@add{#2}{\@tracklang@languages}%
 \@tracklang@namedef{@tracklang@fromdialect@#1}{#2}%
 \@tracklang@ifundef{@tracklang@todialect@#2}%
 {\@tracklang@namedef{@tracklang@todialect@#2}{#1}}%
 {%
   \def\@tracklang@lang{#1}%
   \expandafter\@tracklang@add\expandafter\@tracklang@lang
     \csname @tracklang@todialect@#2\endcsname
 }%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\AddTrackedLanguage}
%\begin{definition}
%\cs{AddTrackedLanguage}\marg{language name}
%\end{definition}
% Add a dialect.
%    \begin{macrocode}
\def\AddTrackedLanguage#1{%
  \AddTrackedDialect{#1}{#1}%
}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Mappings}
%
%\begin{macro}{\AddTrackedIsoLanguage}
%\begin{definition}
%\cs{AddTrackedIsoLanguage}\marg{code type}\marg{code}\marg{language}
%\end{definition}
% Adds a~mapping between the given ISO code and language
% name. There may be multiple mappings from an ISO code to a
% language name, but only one mapping from a language name to an ISO
% code.
%    \begin{macrocode}
\def\AddTrackedIsoLanguage#1#2#3{%
  \@tracklang@namedef{@tracklang@#1@isofromlang@#3}{#2}%
  \@tracklang@ifundef{@tracklang@#1@isotolang@#2}%
  {\@tracklang@namedef{@tracklang@#1@isotolang@#2}{#3}}%
  {%
    \def\@tracklang@lang{#3}%
    \expandafter\@tracklang@add\expandafter\@tracklang@lang
      \csname @tracklang@#1@isotolang@#2\endcsname
  }%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\TrackedLanguageFromIsoCode}
%\begin{definition}
%\cs{TrackedLanguageFromIsoCode}\marg{code type}\marg{code}
%\end{definition}
% Fetches the language label (or labels) associated with the given code.
%    \begin{macrocode}
\def\TrackedLanguageFromIsoCode#1#2{%
  \@tracklang@nameuse{@tracklang@#1@isotolang@#2}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\TrackedIsoCodeFromLanguage}
%\begin{definition}
%\cs{TrackedIsoCodeFromLanguage}\marg{code type}\marg{language}
%\end{definition}
% Fetches the code associated with the given language or dialect.
%    \begin{macrocode}
\def\TrackedIsoCodeFromLanguage#1#2{%
  \@tracklang@nameuse{@tracklang@#1@isofromlang@#2}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\TrackedLanguageFromDialect}
%\begin{definition}
%\cs{TrackedLanguageFromDialect}\marg{dialect}
%\end{definition}
% Fetches the language name from the given dialect.
%    \begin{macrocode}
\def\TrackedLanguageFromDialect#1{%
 \@tracklang@nameuse{@tracklang@fromdialect@#1}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\TrackedDialectsFromLanguage}
%\begin{definition}
%\cs{TrackedDialectsFromLanguage}\marg{root language label}
%\end{definition}
% Fetches the tracked dialects whose language is given by \meta{root
% language label}.
%    \begin{macrocode}
\def\TrackedDialectsFromLanguage#1{%
 \@tracklang@nameuse{@tracklang@todialect@#1}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\TwoLetterIsoCountryCode}
%    \begin{macrocode}
\def\TwoLetterIsoCountryCode{3166-1}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\TwoLetterIsoLanguageCode}
%    \begin{macrocode}
\def\TwoLetterIsoLanguageCode{639-1}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\ThreeLetterIsoLanguageCode}
%    \begin{macrocode}
\def\ThreeLetterIsoLanguageCode{639-2}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Predefined Dialects}\label{sec:predefined}
%
% The ISO 639-1 and 639-2 codes are used to map the root language name to the
% ISO language code. The 3166-1 codes are used to map the
% dialect\slash variant to the ISO country code. The country code is
% omitted if ambiguous (for example, the language is spoken in
% multiple countries). Some ``dialects'' are just synonyms for a
% language name, such as ``francais'' or ``frenchb''.  Some of the
% languages have two ISO 639-2 codes designated as ``B''
% (bibliographic) or ``T'' (terminology). In these cases the
% terminology code is used as the primary 639-2 code.
%
%\begin{macro}{\TrackPredefinedDialect}
%\begin{definition}
%\cs{TrackPredefinedDialect}\marg{dialect label}
%\end{definition}
%    \begin{macrocode}
\def\TrackPredefinedDialect#1{%
  \@tracklang@ifundef{@tracklang@add@#1}%
  {%
    \@tracklang@err{Dialect `#1' is not predefined}{}%
  }%
  {\@tracklang@nameuse{@tracklang@add@#1}}%
}
%    \end{macrocode}
%\end{macro}
%
% Provide some predefined languages/dialects.
%\begin{macro}{\@tracklang@declareoption}
%\changes{1.1}{2014-11-21}{new}
% Provide a hook to declare a predefined setting as a package
% option. This is defined by tracklang.sty before loading
% tracklang.tex but if this file isn't load through tracklang.sty
% provide a definition that ignores its argument if not already
% defined.
%    \begin{macrocode}
\ifx\@tracklang@declareoption\undefined
  \def\@tracklang@declareoption#1{}
\fi
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@acadian}
%    \begin{macrocode}
\def\@tracklang@add@acadian{%
  \AddTrackedDialect{acadian}{french}%
  \AddTrackedIsoLanguage{639-1}{fr}{french}%
}
\@tracklang@declareoption{acadian}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@afrikaans}
%    \begin{macrocode}
\def\@tracklang@add@afrikaans{%
  \AddTrackedLanguage{afrikaans}%
  \AddTrackedIsoLanguage{639-1}{af}{afrikaans}%
  \AddTrackedIsoLanguage{639-2}{afr}{afrikaans}%
}
\@tracklang@declareoption{afrikaans}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@albanian}
%    \begin{macrocode}
\def\@tracklang@add@albanian{%
  \AddTrackedLanguage{albanian}%
  \AddTrackedIsoLanguage{639-1}{sq}{albanian}%
  \AddTrackedIsoLanguage{639-2-B}{alb}{albanian}%
  \AddTrackedIsoLanguage{639-2-T}{sqi}{albanian}%
  \AddTrackedIsoLanguage{639-2}{sqi}{albanian}%
}
\@tracklang@declareoption{albanian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@amharic}
%    \begin{macrocode}
\def\@tracklang@add@amharic{%
  \AddTrackedLanguage{amharic}%
  \AddTrackedIsoLanguage{639-1}{am}{amharic}%
  \AddTrackedIsoLanguage{639-2}{amh}{amharic}%
}
\@tracklang@declareoption{amharic}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@anglosaxon}
%    \begin{macrocode}
\def\@tracklang@add@anglosaxon{%
  \AddTrackedLanguage{anglosaxon}%
  \AddTrackedIsoLanguage{639-2}{ang}{anglosaxon}%
}
\@tracklang@declareoption{anglosaxon}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@apache}
%    \begin{macrocode}
\def\@tracklang@add@apache{%
  \AddTrackedLanguage{apache}%
  \AddTrackedIsoLanguage{639-2}{apa}{apache}%
}
\@tracklang@declareoption{apache}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@arabic}
%    \begin{macrocode}
\def\@tracklang@add@arabic{%
  \AddTrackedLanguage{arabic}%
  \AddTrackedIsoLanguage{639-1}{ar}{arabic}%
  \AddTrackedIsoLanguage{639-2}{ara}{arabic}%
}
\@tracklang@declareoption{arabic}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@armenian}
%    \begin{macrocode}
\def\@tracklang@add@armenian{%
  \AddTrackedLanguage{armenian}%
  \AddTrackedIsoLanguage{639-1}{hy}{armenian}%
  \AddTrackedIsoLanguage{639-2-B}{arm}{armenian}%
  \AddTrackedIsoLanguage{639-2-T}{hye}{armenian}%
  \AddTrackedIsoLanguage{639-2}{hye}{armenian}%
}
\@tracklang@declareoption{armenian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@asturian}
%    \begin{macrocode}
\def\@tracklang@add@asturian{%
  \AddTrackedLanguage{asturian}%
  \AddTrackedIsoLanguage{639-2}{ast}{asturian}%
}
\@tracklang@declareoption{asturian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@american}
%    \begin{macrocode}
\def\@tracklang@add@american{%
  \AddTrackedDialect{american}{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
  \AddTrackedIsoLanguage{3166-1}{US}{american}%
}
\@tracklang@declareoption{american}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@australian}
%    \begin{macrocode}
\def\@tracklang@add@australian{%
  \AddTrackedDialect{australian}{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
  \AddTrackedIsoLanguage{3166-1}{AU}{australian}%
}
\@tracklang@declareoption{australian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@austrian}
%    \begin{macrocode}
\def\@tracklang@add@austrian{%
  \AddTrackedDialect{austrian}{german}%
  \AddTrackedIsoLanguage{639-1}{de}{german}%
  \AddTrackedIsoLanguage{639-2-B}{ger}{german}%
  \AddTrackedIsoLanguage{639-2-T}{deu}{german}%
  \AddTrackedIsoLanguage{639-2}{deu}{german}%
  \AddTrackedIsoLanguage{3166-1}{AT}{austrian}%
}
\@tracklang@declareoption{austrian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@naustrian}
%    \begin{macrocode}
\def\@tracklang@add@naustrian{%
  \AddTrackedDialect{naustrian}{german}%
  \AddTrackedIsoLanguage{639-1}{de}{german}%
  \AddTrackedIsoLanguage{639-2-B}{ger}{german}%
  \AddTrackedIsoLanguage{639-2-T}{deu}{german}%
  \AddTrackedIsoLanguage{639-2}{deu}{german}%
  \AddTrackedIsoLanguage{3166-1}{AT}{naustrian}%
}
\@tracklang@declareoption{naustrian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@bahasa}
%    \begin{macrocode}
\def\@tracklang@add@bahasa{%
  \AddTrackedDialect{bahasa}{bahasai}%
  \AddTrackedIsoLanguage{639-1}{id}{bahasai}%
  \AddTrackedIsoLanguage{639-2}{ind}{bahasai}%
  \AddTrackedIsoLanguage{3166-1}{IN}{bahasa}%
}
\@tracklang@declareoption{bahasa}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@bahasai}
%    \begin{macrocode}
\def\@tracklang@add@bahasai{%
  \AddTrackedDialect{bahasai}{bahasai}%
  \AddTrackedIsoLanguage{639-1}{id}{bahasai}%
  \AddTrackedIsoLanguage{639-2}{ind}{bahasai}%
  \AddTrackedIsoLanguage{3166-1}{IN}{bahasai}%
}
\@tracklang@declareoption{bahasai}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@bahasam}
%    \begin{macrocode}
\def\@tracklang@add@bahasam{%
  \AddTrackedLanguage{bahasam}%
  \AddTrackedIsoLanguage{639-1}{ms}{bahasam}%
  \AddTrackedIsoLanguage{639-2-B}{may}{bahasam}%
  \AddTrackedIsoLanguage{639-2-T}{msa}{bahasam}%
  \AddTrackedIsoLanguage{639-2}{msa}{bahasam}%
  \AddTrackedIsoLanguage{3166-1}{MY}{bahasam}%
}
\@tracklang@declareoption{bahasam}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@basque}
%    \begin{macrocode}
\def\@tracklang@add@basque{%
  \AddTrackedLanguage{basque}%
  \AddTrackedIsoLanguage{639-1}{eu}{basque}%
  \AddTrackedIsoLanguage{639-2-B}{baq}{basque}%
  \AddTrackedIsoLanguage{639-2-T}{eus}{basque}%
  \AddTrackedIsoLanguage{639-2}{eus}{basque}%
}
\@tracklang@declareoption{basque}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@bengali}
%    \begin{macrocode}
\def\@tracklang@add@bengali{%
  \AddTrackedLanguage{bengali}%
  \AddTrackedIsoLanguage{639-1}{bn}{bengali}%
  \AddTrackedIsoLanguage{639-2}{ben}{bengali}%
}
\@tracklang@declareoption{bengali}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@brazil}
%    \begin{macrocode}
\def\@tracklang@add@brazil{%
  \AddTrackedDialect{brazil}{portuges}%
  \AddTrackedIsoLanguage{639-1}{pt}{portuges}%
  \AddTrackedIsoLanguage{639-2}{por}{portuges}%
  \AddTrackedIsoLanguage{3166-1}{BR}{brazil}%
}
\@tracklang@declareoption{brazil}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@brazilian}
%    \begin{macrocode}
\def\@tracklang@add@brazilian{%
  \AddTrackedDialect{brazilian}{portuges}%
  \AddTrackedIsoLanguage{639-1}{pt}{portuges}%
  \AddTrackedIsoLanguage{639-2}{por}{portuges}%
  \AddTrackedIsoLanguage{3166-1}{BR}{brazilian}%
}
\@tracklang@declareoption{brazilian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@breton}
%    \begin{macrocode}
\def\@tracklang@add@breton{%
  \AddTrackedLanguage{breton}%
  \AddTrackedIsoLanguage{639-1}{br}{breton}%
  \AddTrackedIsoLanguage{639-2}{bre}{breton}%
  \AddTrackedIsoLanguage{3166-1}{FR}{breton}%
}
\@tracklang@declareoption{breton}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@british}
%    \begin{macrocode}
\def\@tracklang@add@british{%
  \AddTrackedDialect{british}{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
  \AddTrackedIsoLanguage{3166-1}{GB}{british}%
}
\@tracklang@declareoption{british}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@bulgarian}
%    \begin{macrocode}
\def\@tracklang@add@bulgarian{%
  \AddTrackedLanguage{bulgarian}%
  \AddTrackedIsoLanguage{639-1}{bg}{bulgarian}%
  \AddTrackedIsoLanguage{639-2}{bul}{bulgarian}%
}
\@tracklang@declareoption{bulgarian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@canadian}
%    \begin{macrocode}
\def\@tracklang@add@canadian{%
  \AddTrackedDialect{canadian}{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
  \AddTrackedIsoLanguage{3166-1}{CA}{canadian}%
}
\@tracklang@declareoption{canadian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@canadien}
%    \begin{macrocode}
\def\@tracklang@add@canadien{%
  \AddTrackedDialect{canadien}{french}%
  \AddTrackedIsoLanguage{639-1}{fr}{french}%
  \AddTrackedIsoLanguage{639-2-B}{fre}{french}%
  \AddTrackedIsoLanguage{639-2-T}{fra}{french}%
  \AddTrackedIsoLanguage{639-2}{fra}{french}%
  \AddTrackedIsoLanguage{3166-1}{CA}{canadien}%
}
\@tracklang@declareoption{canadien}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@catalan}
%    \begin{macrocode}
\def\@tracklang@add@catalan{%
  \AddTrackedLanguage{catalan}%
  \AddTrackedIsoLanguage{639-1}{ca}{catalan}%
  \AddTrackedIsoLanguage{639-2}{cat}{catalan}%
}
\@tracklang@declareoption{catalan}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@coptic}
%    \begin{macrocode}
\def\@tracklang@add@coptic{%
  \AddTrackedLanguage{coptic}%
  \AddTrackedIsoLanguage{639-2}{cop}{coptic}%
}
\@tracklang@declareoption{coptic}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@croatian}
%    \begin{macrocode}
\def\@tracklang@add@croatian{%
  \AddTrackedLanguage{croatian}%
  \AddTrackedIsoLanguage{639-1}{hr}{croatian}%
  \AddTrackedIsoLanguage{639-2}{hrv}{croatian}%
}
\@tracklang@declareoption{croatian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@croatia}
%    \begin{macrocode}
\def\@tracklang@add@croatia{%
  \AddTrackedDialect{croatia}{croatian}%
  \AddTrackedIsoLanguage{639-1}{hr}{croatian}%
  \AddTrackedIsoLanguage{639-2}{hrv}{croatian}%
  \AddTrackedIsoLanguage{3166-1}{HR}{croatia}%
}
\@tracklang@declareoption{croatia}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@istriacountycroatian}
%    \begin{macrocode}
\def\@tracklang@add@istriacountycroatian{%
  \AddTrackedDialect{istriacountycroatian}{croatian}%
  \AddTrackedIsoLanguage{639-1}{hr}{croatian}%
  \AddTrackedIsoLanguage{639-2}{hrv}{croatian}%
  \AddTrackedIsoLanguage{3166-1}{HR}{istriacountycroatian}%
}
\@tracklang@declareoption{istriacountycroatian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@istriacountyitalian}
%    \begin{macrocode}
\def\@tracklang@add@istriacountyitalian{%
  \AddTrackedDialect{istriacountyitalian}{italian}%
  \AddTrackedIsoLanguage{639-1}{it}{italian}%
  \AddTrackedIsoLanguage{639-2}{ita}{italian}%
  \AddTrackedIsoLanguage{3166-1}{HR}{istriacountyitalian}%
}
\@tracklang@declareoption{istriacountyitalian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@czech}
%    \begin{macrocode}
\def\@tracklang@add@czech{%
  \AddTrackedLanguage{czech}%
  \AddTrackedIsoLanguage{639-1}{cs}{czech}%
  \AddTrackedIsoLanguage{639-2-B}{cze}{czech}%
  \AddTrackedIsoLanguage{639-2-T}{ces}{czech}%
  \AddTrackedIsoLanguage{639-2}{ces}{czech}%
}
\@tracklang@declareoption{czech}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@danish}
%    \begin{macrocode}
\def\@tracklang@add@danish{%
  \AddTrackedLanguage{danish}%
  \AddTrackedIsoLanguage{639-1}{da}{danish}%
  \AddTrackedIsoLanguage{639-2}{dan}{danish}%
}
\@tracklang@declareoption{danish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@divehi}
%    \begin{macrocode}
\def\@tracklang@add@divehi{%
  \AddTrackedLanguage{divehi}%
  \AddTrackedIsoLanguage{639-1}{dv}{divehi}%
  \AddTrackedIsoLanguage{639-2}{div}{divehi}%
}
\@tracklang@declareoption{divehi}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@dutch}
%    \begin{macrocode}
\def\@tracklang@add@dutch{%
  \AddTrackedLanguage{dutch}%
  \AddTrackedIsoLanguage{639-1}{nl}{dutch}%
  \AddTrackedIsoLanguage{639-2-B}{dut}{dutch}%
  \AddTrackedIsoLanguage{639-2-T}{nld}{dutch}%
  \AddTrackedIsoLanguage{639-2}{nld}{dutch}%
}
\@tracklang@declareoption{dutch}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@netherlands}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@netherlands{%
  \AddTrackedDialect{netherlands}{dutch}%
  \AddTrackedIsoLanguage{639-1}{nl}{dutch}%
  \AddTrackedIsoLanguage{639-2-B}{dut}{dutch}%
  \AddTrackedIsoLanguage{639-2-T}{nld}{dutch}%
  \AddTrackedIsoLanguage{639-2}{nld}{dutch}%
  \AddTrackedIsoLanguage{3166-1}{NL}{netherlands}%
}
\@tracklang@declareoption{netherlands}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@english}
%    \begin{macrocode}
\def\@tracklang@add@english{%
  \AddTrackedLanguage{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
}
\@tracklang@declareoption{english}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@esperanto}
%    \begin{macrocode}
\def\@tracklang@add@esperanto{%
  \AddTrackedLanguage{esperanto}%
  \AddTrackedIsoLanguage{639-1}{eo}{esperanto}%
  \AddTrackedIsoLanguage{639-2}{epo}{esperanto}%
}
\@tracklang@declareoption{esperanto}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@estonian}
%    \begin{macrocode}
\def\@tracklang@add@estonian{%
  \AddTrackedLanguage{estonian}%
  \AddTrackedIsoLanguage{639-1}{et}{estonian}%
  \AddTrackedIsoLanguage{639-2}{est}{estonian}%
}
\@tracklang@declareoption{estonian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@farsi}
%    \begin{macrocode}
\def\@tracklang@add@farsi{%
  \AddTrackedLanguage{farsi}%
  \AddTrackedIsoLanguage{639-1}{fa}{farsi}%
  \AddTrackedIsoLanguage{639-2-B}{per}{farsi}%
  \AddTrackedIsoLanguage{639-2-T}{fas}{farsi}%
  \AddTrackedIsoLanguage{639-2}{fas}{farsi}%
}
\@tracklang@declareoption{farsi}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@persian}
%    \begin{macrocode}
\def\@tracklang@add@persian{%
  \AddTrackedDialect{persian}{farsi}%
  \AddTrackedIsoLanguage{639-1}{fa}{farsi}%
  \AddTrackedIsoLanguage{639-2-B}{per}{farsi}%
  \AddTrackedIsoLanguage{639-2-T}{fas}{farsi}%
  \AddTrackedIsoLanguage{639-2}{fas}{farsi}%
}
\@tracklang@declareoption{persian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@finnish}
%    \begin{macrocode}
\def\@tracklang@add@finnish{%
  \AddTrackedLanguage{finnish}%
  \AddTrackedIsoLanguage{639-1}{fi}{finnish}%
  \AddTrackedIsoLanguage{639-2}{fin}{finnish}%
}
\@tracklang@declareoption{finnish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@flemish}
%    \begin{macrocode}
\def\@tracklang@add@flemish{%
  \AddTrackedDialect{flemish}{dutch}%
  \AddTrackedIsoLanguage{639-1}{nl}{dutch}%
  \AddTrackedIsoLanguage{639-2-B}{dut}{dutch}%
  \AddTrackedIsoLanguage{639-2-T}{nld}{dutch}%
  \AddTrackedIsoLanguage{639-2}{nld}{dutch}%
  \AddTrackedIsoLanguage{3166-1}{BE}{flemish}%
}
\@tracklang@declareoption{flemish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@francais}
%    \begin{macrocode}
\def\@tracklang@add@francais{%
  \AddTrackedDialect{francais}{french}%
  \AddTrackedIsoLanguage{639-1}{fr}{french}%
  \AddTrackedIsoLanguage{639-2-B}{fre}{french}%
  \AddTrackedIsoLanguage{639-2-T}{fra}{french}%
  \AddTrackedIsoLanguage{639-2}{fra}{french}%
}
\@tracklang@declareoption{francais}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@frenchb}
%    \begin{macrocode}
\def\@tracklang@add@frenchb{%
  \AddTrackedDialect{frenchb}{french}%
  \AddTrackedIsoLanguage{639-1}{fr}{french}%
  \AddTrackedIsoLanguage{639-2-B}{fre}{french}%
  \AddTrackedIsoLanguage{639-2-T}{fra}{french}%
  \AddTrackedIsoLanguage{639-2}{fra}{french}%
}
\@tracklang@declareoption{frenchb}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@french}
%    \begin{macrocode}
\def\@tracklang@add@french{%
  \AddTrackedLanguage{french}%
  \AddTrackedIsoLanguage{639-1}{fr}{french}%
  \AddTrackedIsoLanguage{639-2-B}{fre}{french}%
  \AddTrackedIsoLanguage{639-2-T}{fra}{french}%
  \AddTrackedIsoLanguage{639-2}{fra}{french}%
}
\@tracklang@declareoption{french}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@france}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@france{%
  \AddTrackedDialect{france}{french}%
  \AddTrackedIsoLanguage{639-1}{fr}{french}%
  \AddTrackedIsoLanguage{639-2-B}{fre}{french}%
  \AddTrackedIsoLanguage{639-2-T}{fra}{french}%
  \AddTrackedIsoLanguage{639-2}{fra}{french}%
  \AddTrackedIsoLanguage{3166-1}{FR}{france}%
}
\@tracklang@declareoption{france}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@belgique}
%    \begin{macrocode}
\def\@tracklang@add@belgique{%
  \AddTrackedDialect{belgique}{french}%
  \AddTrackedIsoLanguage{639-1}{fr}{french}%
  \AddTrackedIsoLanguage{639-2-B}{fre}{french}%
  \AddTrackedIsoLanguage{639-2-T}{fra}{french}%
  \AddTrackedIsoLanguage{639-2}{fra}{french}%
  \AddTrackedIsoLanguage{3166-1}{BE}{belgique}%
}
\@tracklang@declareoption{belgique}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@belgiangerman}
%    \begin{macrocode}
\def\@tracklang@add@belgiangerman{%
  \AddTrackedDialect{belgiangerman}{german}%
  \AddTrackedIsoLanguage{639-1}{de}{german}%
  \AddTrackedIsoLanguage{639-2-B}{ger}{german}%
  \AddTrackedIsoLanguage{639-2-T}{deu}{german}%
  \AddTrackedIsoLanguage{639-2}{deu}{german}%
  \AddTrackedIsoLanguage{3166-1}{BE}{belgiangerman}%
}
\@tracklang@declareoption{belgiangerman}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@friulan}
%    \begin{macrocode}
\def\@tracklang@add@friulan{%
  \AddTrackedLanguage{friulan}%
  \AddTrackedIsoLanguage{639-2}{fur}{friulan}%
  \AddTrackedIsoLanguage{3166-1}{IT}{friulan}%
}
\@tracklang@declareoption{friulan}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@friulian}
%    \begin{macrocode}
\def\@tracklang@add@friulian{%
  \AddTrackedDialect{friulian}{friulan}%
  \AddTrackedIsoLanguage{639-2}{fur}{friulan}%
  \AddTrackedIsoLanguage{3166-1}{IT}{friulan}%
}
\@tracklang@declareoption{friulian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@friulano}
%    \begin{macrocode}
\def\@tracklang@add@friulano{%
  \AddTrackedDialect{friulano}{friulan}%
  \AddTrackedIsoLanguage{639-2}{fur}{friulan}%
  \AddTrackedIsoLanguage{3166-1}{IT}{friulan}%
}
\@tracklang@declareoption{friulano}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@galician}
%    \begin{macrocode}
\def\@tracklang@add@galician{%
  \AddTrackedLanguage{galician}%
  \AddTrackedIsoLanguage{639-1}{gl}{galician}%
  \AddTrackedIsoLanguage{639-2}{glg}{galician}%
}
\@tracklang@declareoption{galician}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@galicien}
%    \begin{macrocode}
\def\@tracklang@add@galicien{%
  \AddTrackedDialect{galicien}{galician}%
  \AddTrackedIsoLanguage{639-1}{gl}{galician}%
  \AddTrackedIsoLanguage{639-2}{glg}{galician}%
}
\@tracklang@declareoption{galicien}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@german}
%    \begin{macrocode}
\def\@tracklang@add@german{%
  \AddTrackedLanguage{german}%
  \AddTrackedIsoLanguage{639-1}{de}{german}%
  \AddTrackedIsoLanguage{639-2-B}{ger}{german}%
  \AddTrackedIsoLanguage{639-2-T}{deu}{german}%
  \AddTrackedIsoLanguage{639-2}{deu}{german}%
}
\@tracklang@declareoption{german}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@deutsch}
%    \begin{macrocode}
\def\@tracklang@add@deutsch{%
  \AddTrackedDialect{deutsch}{german}%
  \AddTrackedIsoLanguage{639-1}{de}{german}%
  \AddTrackedIsoLanguage{639-2-B}{ger}{german}%
  \AddTrackedIsoLanguage{639-2-T}{deu}{german}%
  \AddTrackedIsoLanguage{639-2}{deu}{german}%
}
\@tracklang@declareoption{deutsch}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@ngerman}
%    \begin{macrocode}
\def\@tracklang@add@ngerman{%
  \AddTrackedDialect{ngerman}{german}%
  \AddTrackedIsoLanguage{639-1}{de}{german}%
  \AddTrackedIsoLanguage{639-2-B}{ger}{german}%
  \AddTrackedIsoLanguage{639-2-T}{deu}{german}%
  \AddTrackedIsoLanguage{639-2}{deu}{german}%
}
\@tracklang@declareoption{ngerman}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@ngermanDE}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@ngermanDE{%
  \AddTrackedDialect{ngerman}{german}%
  \AddTrackedIsoLanguage{639-1}{de}{german}%
  \AddTrackedIsoLanguage{639-2-B}{ger}{german}%
  \AddTrackedIsoLanguage{639-2-T}{deu}{german}%
  \AddTrackedIsoLanguage{639-2}{deu}{german}%
  \AddTrackedIsoLanguage{3166-1}{DE}{germany}%
}
\@tracklang@declareoption{ngermanDE}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@greek}
%    \begin{macrocode}
\def\@tracklang@add@greek{%
  \AddTrackedLanguage{greek}%
  \AddTrackedIsoLanguage{639-1}{el}{greek}%
  \AddTrackedIsoLanguage{639-2-B}{gre}{greek}%
  \AddTrackedIsoLanguage{639-2-T}{ell}{greek}%
  \AddTrackedIsoLanguage{639-2}{ell}{greek}%
}
\@tracklang@declareoption{greek}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@hebrew}
%    \begin{macrocode}
\def\@tracklang@add@hebrew{%
  \AddTrackedLanguage{hebrew}%
  \AddTrackedIsoLanguage{639-1}{he}{hebrew}%
  \AddTrackedIsoLanguage{639-2}{heb}{hebrew}%
}
\@tracklang@declareoption{hebrew}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@hindi}
%    \begin{macrocode}
\def\@tracklang@add@hindi{%
  \AddTrackedLanguage{hindi}%
  \AddTrackedIsoLanguage{639-1}{hi}{hindi}%
  \AddTrackedIsoLanguage{639-2}{hin}{hindi}%
}
\@tracklang@declareoption{hindi}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@hungarian}
%    \begin{macrocode}
\def\@tracklang@add@hungarian{%
  \AddTrackedDialect{hungarian}{magyar}%
  \AddTrackedIsoLanguage{639-1}{hu}{magyar}%
  \AddTrackedIsoLanguage{639-2}{hun}{magyar}%
  \AddTrackedIsoLanguage{3166-1}{HU}{hungarian}%
}
\@tracklang@declareoption{hungarian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@magyar}
%    \begin{macrocode}
\def\@tracklang@add@magyar{%
  \AddTrackedLanguage{magyar}%
  \AddTrackedIsoLanguage{639-1}{hu}{magyar}%
  \AddTrackedIsoLanguage{639-2}{hun}{magyar}%
}
\@tracklang@declareoption{magyar}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@icelandic}
%    \begin{macrocode}
\def\@tracklang@add@icelandic{%
  \AddTrackedLanguage{icelandic}%
  \AddTrackedIsoLanguage{639-1}{is}{icelandic}%
  \AddTrackedIsoLanguage{639-2-B}{ice}{icelandic}%
  \AddTrackedIsoLanguage{639-2-T}{isl}{icelandic}%
  \AddTrackedIsoLanguage{639-2}{isl}{icelandic}%
}
\@tracklang@declareoption{icelandic}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@indon}
%    \begin{macrocode}
\def\@tracklang@add@indon{%
  \AddTrackedDialect{indon}{bahasai}%
  \AddTrackedIsoLanguage{639-1}{id}{bahasai}%
  \AddTrackedIsoLanguage{639-2}{ind}{bahasai}%
  \AddTrackedIsoLanguage{3166-1}{IN}{indon}%
}
\@tracklang@declareoption{indon}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@indonesian}
%    \begin{macrocode}
\def\@tracklang@add@indonesian{%
  \AddTrackedDialect{indonesian}{bahasai}%
  \AddTrackedIsoLanguage{639-1}{id}{bahasai}%
  \AddTrackedIsoLanguage{639-2}{ind}{bahasai}%
  \AddTrackedIsoLanguage{3166-1}{IN}{indonesian}%
}
\@tracklang@declareoption{indonesian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@interlingua}
%    \begin{macrocode}
\def\@tracklang@add@interlingua{%
  \AddTrackedLanguage{interlingua}%
  \AddTrackedIsoLanguage{639-1}{ia}{interlingua}%
  \AddTrackedIsoLanguage{639-2}{ina}{interlingua}%
}
\@tracklang@declareoption{interlingua}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@irish}
%    \begin{macrocode}
\def\@tracklang@add@irish{%
  \AddTrackedLanguage{irish}%
  \AddTrackedIsoLanguage{639-1}{ga}{irish}%
  \AddTrackedIsoLanguage{639-2}{gle}{irish}%
}
\@tracklang@declareoption{irish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@gaeilge}
%    \begin{macrocode}
\def\@tracklang@add@gaeilge{%
  \AddTrackedDialect{gaeilge}{irish}%
  \AddTrackedIsoLanguage{639-1}{ga}{irish}%
  \AddTrackedIsoLanguage{639-2}{gle}{irish}%
}
\@tracklang@declareoption{gaeilge}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@IEirish}
%\changes{1.2}{2015-03-23}{new}
% Irish spoken in Republic of Ireland
%    \begin{macrocode}
\def\@tracklang@add@IEirish{%
  \AddTrackedDialect{IEirish}{irish}%
  \AddTrackedIsoLanguage{639-1}{ga}{irish}%
  \AddTrackedIsoLanguage{639-2}{gle}{irish}%
  \AddTrackedIsoLanguage{3166-1}{IE}{IEirish}%
}
\@tracklang@declareoption{IEirish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@GBirish}
%\changes{1.2}{2015-03-23}{new}
% Irish spoken in Northern Ireland
%    \begin{macrocode}
\def\@tracklang@add@GBirish{%
  \AddTrackedDialect{GBirish}{irish}%
  \AddTrackedIsoLanguage{639-1}{ga}{irish}%
  \AddTrackedIsoLanguage{639-2}{gle}{irish}%
  \AddTrackedIsoLanguage{3166-1}{GB}{GBirish}%
}
\@tracklang@declareoption{GBirish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@IEenglish}
%\changes{1.2}{2015-03-23}{new}
%English spoken in the Republic of Ireland.
%    \begin{macrocode}
\@tracklang@declareoption{IEenglish}
\def\@tracklang@add@IEenglish{%
  \AddTrackedDialect{IEenglish}{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
  \AddTrackedIsoLanguage{3166-1}{IE}{IEenglish}%
}
\@tracklang@declareoption{IEenglish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@italian}
%    \begin{macrocode}
\def\@tracklang@add@italian{%
  \AddTrackedLanguage{italian}%
  \AddTrackedIsoLanguage{639-1}{it}{italian}%
  \AddTrackedIsoLanguage{639-2}{ita}{italian}%
}
\@tracklang@declareoption{italian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@italy}
%    \begin{macrocode}
\def\@tracklang@add@italy{%
  \AddTrackedDialect{italy}{italian}%
  \AddTrackedIsoLanguage{639-1}{it}{italian}%
  \AddTrackedIsoLanguage{639-2}{ita}{italian}%
  \AddTrackedIsoLanguage{3166-1}{IT}{italy}%
}
\@tracklang@declareoption{italy}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@vatican}
%    \begin{macrocode}
\def\@tracklang@add@vatican{%
  \AddTrackedDialect{vatican}{italian}%
  \AddTrackedIsoLanguage{639-1}{it}{italian}%
  \AddTrackedIsoLanguage{639-2}{ita}{italian}%
  \AddTrackedIsoLanguage{3166-1}{VA}{vatican}%
}
\@tracklang@declareoption{vatican}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@sanmarino}
%    \begin{macrocode}
\def\@tracklang@add@sanmarino{%
  \AddTrackedDialect{sanmarino}{italian}%
  \AddTrackedIsoLanguage{639-1}{it}{italian}%
  \AddTrackedIsoLanguage{639-2}{ita}{italian}%
  \AddTrackedIsoLanguage{3166-1}{SM}{sanmarino}%
}
\@tracklang@declareoption{sanmarino}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@sloveneistriaitalian}
%    \begin{macrocode}
\def\@tracklang@add@sloveneistriaitalian{%
  \AddTrackedDialect{sloveneistriaitalian}{italian}%
  \AddTrackedIsoLanguage{639-1}{it}{italian}%
  \AddTrackedIsoLanguage{639-2}{ita}{italian}%
  \AddTrackedIsoLanguage{3166-1}{SI}{sloveneistriaitalian}%
}
\@tracklang@declareoption{sloveneistriaitalian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@jerseyenglish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@jerseyenglish{%
  \AddTrackedDialect{jerseyenglish}{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
  \AddTrackedIsoLanguage{3166-1}{JE}{jerseyenglish}%
}
\@tracklang@declareoption{jerseyenglish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@jerseyfrench}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@jerseyfrench{%
  \AddTrackedDialect{jerseyfrench}{french}%
  \AddTrackedIsoLanguage{639-1}{fr}{french}%
  \AddTrackedIsoLanguage{639-2-B}{fre}{french}%
  \AddTrackedIsoLanguage{639-2-T}{fra}{french}%
  \AddTrackedIsoLanguage{639-2}{fra}{french}%
  \AddTrackedIsoLanguage{3166-1}{JE}{jerseyfrench}%
}
\@tracklang@declareoption{jerseyfrench}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@guernseyenglish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@guernseyenglish{%
  \AddTrackedDialect{guernseyenglish}{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
  \AddTrackedIsoLanguage{3166-1}{GG}{guernseyenglish}%
}
\@tracklang@declareoption{guernseyenglish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@guernseyfrench}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@guernseyfrench{%
  \AddTrackedDialect{guernseyfrench}{french}%
  \AddTrackedIsoLanguage{639-1}{fr}{french}%
  \AddTrackedIsoLanguage{639-2-B}{fre}{french}%
  \AddTrackedIsoLanguage{639-2-T}{fra}{french}%
  \AddTrackedIsoLanguage{639-2}{fra}{french}%
  \AddTrackedIsoLanguage{3166-1}{GG}{guernseyfrench}%
}
\@tracklang@declareoption{guernseyfrench}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@kannada}
%    \begin{macrocode}
\def\@tracklang@add@kannada{%
  \AddTrackedLanguage{kannada}%
  \AddTrackedIsoLanguage{639-1}{kn}{kannada}%
  \AddTrackedIsoLanguage{639-2}{kan}{kannada}%
}
\@tracklang@declareoption{kannada}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@lao}
%    \begin{macrocode}
\def\@tracklang@add@lao{%
  \AddTrackedLanguage{lao}%
  \AddTrackedIsoLanguage{639-1}{lo}{lao}%
  \AddTrackedIsoLanguage{639-2}{lao}{lao}%
}
\@tracklang@declareoption{lao}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@latin}
%    \begin{macrocode}
\def\@tracklang@add@latin{%
  \AddTrackedLanguage{latin}%
  \AddTrackedIsoLanguage{639-1}{la}{latin}%
  \AddTrackedIsoLanguage{639-2}{lat}{latin}%
}
\@tracklang@declareoption{latin}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@latein}
%    \begin{macrocode}
\def\@tracklang@add@latein{%
  \AddTrackedDialect{latein}{latin}%
  \AddTrackedIsoLanguage{639-1}{la}{latin}%
  \AddTrackedIsoLanguage{639-2}{lat}{latin}%
}
\@tracklang@declareoption{latein}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@latvian}
%    \begin{macrocode}
\def\@tracklang@add@latvian{%
  \AddTrackedLanguage{latvian}%
  \AddTrackedIsoLanguage{639-1}{lv}{latvian}%
  \AddTrackedIsoLanguage{639-2}{lav}{latvian}%
}
\@tracklang@declareoption{latvian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@lithuanian}
%    \begin{macrocode}
\def\@tracklang@add@lithuanian{%
  \AddTrackedLanguage{lithuanian}%
  \AddTrackedIsoLanguage{639-1}{lt}{lithuanian}%
  \AddTrackedIsoLanguage{639-2}{lit}{lithuanian}%
}
\@tracklang@declareoption{lithuanian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@lsorbian}
%    \begin{macrocode}
\def\@tracklang@add@lsorbian{%
  \AddTrackedLanguage{lsorbian}%
  \AddTrackedIsoLanguage{639-2}{dsb}{lsorbian}%
  \AddTrackedIsoLanguage{3166-1}{DE}{lsorbian}%
}
\@tracklang@declareoption{lsorbian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@lowersorbian}
%    \begin{macrocode}
\def\@tracklang@add@lowersorbian{%
  \AddTrackedDialect{lowersorbian}{lsorbian}%
  \AddTrackedIsoLanguage{639-2}{dsb}{lsorbian}%
  \AddTrackedIsoLanguage{3166-1}{DE}{lowersorbian}%
}
\@tracklang@declareoption{lowersorbian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@malay}
%    \begin{macrocode}
\def\@tracklang@add@malay{%
  \AddTrackedDialect{malay}{bahasam}%
  \AddTrackedIsoLanguage{639-1}{ms}{bahasam}%
  \AddTrackedIsoLanguage{639-2-B}{may}{bahasam}%
  \AddTrackedIsoLanguage{639-2-T}{msa}{bahasam}%
  \AddTrackedIsoLanguage{639-2}{msa}{bahasam}%
  \AddTrackedIsoLanguage{3166-1}{MY}{malay}%
}
\@tracklang@declareoption{malay}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@meyalu}
%    \begin{macrocode}
\def\@tracklang@add@meyalu{%
  \AddTrackedDialect{meyalu}{bahasam}%
  \AddTrackedIsoLanguage{639-1}{ms}{bahasam}%
  \AddTrackedIsoLanguage{639-2-B}{may}{bahasam}%
  \AddTrackedIsoLanguage{639-2-T}{msa}{bahasam}%
  \AddTrackedIsoLanguage{639-2}{msa}{bahasam}%
  \AddTrackedIsoLanguage{3166-1}{MY}{meyalu}%
}
\@tracklang@declareoption{meyalu}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@maltese}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@maltese{%
  \AddTrackedLanguage{maltese}%
  \AddTrackedIsoLanguage{639-1}{mt}{maltese}%
  \AddTrackedIsoLanguage{639-2}{mlt}{maltese}%
}
\@tracklang@declareoption{maltese}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@maltamaltese}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@maltamaltese{%
  \AddTrackedDialect{maltamaltese}{maltese}%
  \AddTrackedIsoLanguage{639-1}{mt}{maltese}%
  \AddTrackedIsoLanguage{639-2}{mlt}{maltese}%
  \AddTrackedIsoLanguage{3166-1}{MT}{maltamaltese}%
}
\@tracklang@declareoption{maltamaltese}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@maltaenglish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@maltaenglish{%
  \AddTrackedDialect{maltaenglish}{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
  \AddTrackedIsoLanguage{3166-1}{MT}{maltaenglish}%
}
\@tracklang@declareoption{maltaenglish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@malayalam}
%    \begin{macrocode}
\def\@tracklang@add@malayalam{%
  \AddTrackedLanguage{malayalam}%
  \AddTrackedIsoLanguage{639-1}{ml}{malayalam}%
  \AddTrackedIsoLanguage{639-2}{mal}{malayalam}%
}
\@tracklang@declareoption{malayalam}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@marathi}
%    \begin{macrocode}
\def\@tracklang@add@marathi{%
  \AddTrackedLanguage{marathi}%
  \AddTrackedIsoLanguage{639-1}{mr}{marathi}%
  \AddTrackedIsoLanguage{639-2}{mar}{marathi}%
}
\@tracklang@declareoption{marathi}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@newzealand}
%    \begin{macrocode}
\def\@tracklang@add@newzealand{%
  \AddTrackedDialect{newzealand}{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
  \AddTrackedIsoLanguage{3166-1}{NZ}{newzealand}%
}
\@tracklang@declareoption{newzealand}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@isleofmanenglish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@isleofmanenglish{%
  \AddTrackedDialect{isleofmanenglish}{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
  \AddTrackedIsoLanguage{3166-1}{IM}{isleofmanenglish}%
}
\@tracklang@declareoption{isleofmanenglish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@manx}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@manx{%
  \AddTrackedLanguage{manx}%
  \AddTrackedIsoLanguage{639-1}{gv}{manx}%
  \AddTrackedIsoLanguage{639-2}{glv}{manx}%
  \AddTrackedIsoLanguage{3166-1}{IM}{manx}%
}
\@tracklang@declareoption{manx}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@nko}
%    \begin{macrocode}
\def\@tracklang@add@nko{%
  \AddTrackedLanguage{nko}%
  \AddTrackedIsoLanguage{639-2}{nqo}{nko}%
}
\@tracklang@declareoption{nko}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@nynorsk}
%    \begin{macrocode}
\def\@tracklang@add@nynorsk{%
  \AddTrackedDialect{nynorsk}{norsk}%
  \AddTrackedIsoLanguage{639-1}{nn}{norsk}%
  \AddTrackedIsoLanguage{639-2}{nno}{norsk}%
  \AddTrackedIsoLanguage{3166-1}{NO}{nynorsk}%
}
\@tracklang@declareoption{nynorsk}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@norwegian}
%    \begin{macrocode}
\def\@tracklang@add@norwegian{%
  \AddTrackedDialect{norwegian}{norsk}%
  \AddTrackedIsoLanguage{639-1}{nn}{norsk}%
  \AddTrackedIsoLanguage{639-2}{nno}{norsk}%
  \AddTrackedIsoLanguage{3166-1}{NO}{norwegian}%
}
\@tracklang@declareoption{norwegian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@norsk}
%    \begin{macrocode}
\def\@tracklang@add@norsk{%
  \AddTrackedLanguage{norsk}%
  \AddTrackedIsoLanguage{639-1}{nn}{norsk}%
  \AddTrackedIsoLanguage{639-2}{nno}{norsk}%
  \AddTrackedIsoLanguage{3166-1}{NO}{norsk}%
}
\@tracklang@declareoption{norsk}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@occitan}
%    \begin{macrocode}
\def\@tracklang@add@occitan{%
  \AddTrackedLanguage{occitan}%
  \AddTrackedIsoLanguage{639-1}{oc}{occitan}%
  \AddTrackedIsoLanguage{639-2}{oci}{occitan}%
}
\@tracklang@declareoption{occitan}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@piedmontese}
%    \begin{macrocode}
\def\@tracklang@add@piedmontese{%
  \AddTrackedLanguage{piedmontese}%
  \AddTrackedIsoLanguage{3166-1}{IT}{piedmontese}%
}
\@tracklang@declareoption{piedmontese}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@piemonteis}
%    \begin{macrocode}
\def\@tracklang@add@piemonteis{%
  \AddTrackedDialect{piemonteis}{piedmontese}%
  \AddTrackedIsoLanguage{3166-1}{IT}{piemonteis}%
}
\@tracklang@declareoption{piemonteis}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@polish}
%    \begin{macrocode}
\def\@tracklang@add@polish{%
  \AddTrackedLanguage{polish}%
  \AddTrackedIsoLanguage{639-1}{pl}{polish}%
  \AddTrackedIsoLanguage{639-2}{pol}{polish}%
}
\@tracklang@declareoption{polish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@polutonikogreek}
%    \begin{macrocode}
\def\@tracklang@add@polutonikogreek{%
  \AddTrackedDialect{polutonikogreek}{greek}%
  \AddTrackedIsoLanguage{639-1}{el}{greek}%
  \AddTrackedIsoLanguage{639-2-B}{gre}{greek}%
  \AddTrackedIsoLanguage{639-2-T}{ell}{greek}%
  \AddTrackedIsoLanguage{639-2}{ell}{greek}%
}
\@tracklang@declareoption{polutonikogreek}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@polutoniko}
%    \begin{macrocode}
\def\@tracklang@add@polutoniko{%
  \AddTrackedDialect{polutoniko}{greek}%
  \AddTrackedIsoLanguage{639-1}{el}{greek}%
  \AddTrackedIsoLanguage{639-2-B}{gre}{greek}%
  \AddTrackedIsoLanguage{639-2-T}{ell}{greek}%
  \AddTrackedIsoLanguage{639-2}{ell}{greek}%
}
\@tracklang@declareoption{polutoniko}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@portuguese}
%    \begin{macrocode}
\def\@tracklang@add@portuguese{%
  \AddTrackedDialect{portuguese}{portuges}%
  \AddTrackedIsoLanguage{639-1}{pt}{portuges}%
  \AddTrackedIsoLanguage{639-2}{por}{portuges}%
}
\@tracklang@declareoption{portuguese}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@portuges}
%    \begin{macrocode}
\def\@tracklang@add@portuges{%
  \AddTrackedLanguage{portuges}%
  \AddTrackedIsoLanguage{639-1}{pt}{portuges}%
  \AddTrackedIsoLanguage{639-2}{por}{portuges}%
}
\@tracklang@declareoption{portuges}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@portugal}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@portugal{%
  \AddTrackedDialect{portgual}{portuges}%
  \AddTrackedIsoLanguage{639-1}{pt}{portuges}%
  \AddTrackedIsoLanguage{639-2}{por}{portuges}%
  \AddTrackedIsoLanguage{3166-1}{PT}{portugal}%
}
\@tracklang@declareoption{portugal}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@romanian}
%    \begin{macrocode}
\def\@tracklang@add@romanian{%
  \AddTrackedLanguage{romanian}%
  \AddTrackedIsoLanguage{639-1}{ro}{romanian}%
  \AddTrackedIsoLanguage{639-2-B}{rum}{romanian}%
  \AddTrackedIsoLanguage{639-2-T}{ron}{romanian}%
  \AddTrackedIsoLanguage{639-2}{ron}{romanian}%
}
\@tracklang@declareoption{romanian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@romansh}
%    \begin{macrocode}
\def\@tracklang@add@romansh{%
  \AddTrackedLanguage{romansh}%
  \AddTrackedIsoLanguage{639-1}{rm}{romansh}%
  \AddTrackedIsoLanguage{639-2}{roh}{romansh}%
}
\@tracklang@declareoption{romansh}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@romansch}
%    \begin{macrocode}
\def\@tracklang@add@romansch{%
  \AddTrackedDialect{romansch}{romansh}%
  \AddTrackedIsoLanguage{639-1}{rm}{romansh}%
  \AddTrackedIsoLanguage{639-2}{roh}{romansh}%
}
\@tracklang@declareoption{romansch}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@rumantsch}
%    \begin{macrocode}
\def\@tracklang@add@rumantsch{%
  \AddTrackedDialect{rumantsch}{romansh}%
  \AddTrackedIsoLanguage{639-1}{rm}{romansh}%
  \AddTrackedIsoLanguage{639-2}{roh}{romansh}%
}
\@tracklang@declareoption{rumantsch}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@romanche}
%    \begin{macrocode}
\def\@tracklang@add@romanche{%
  \AddTrackedDialect{romanche}{romansh}%
  \AddTrackedIsoLanguage{639-1}{rm}{romansh}%
  \AddTrackedIsoLanguage{639-2}{roh}{romansh}%
}
\@tracklang@declareoption{romanche}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@russian}
%    \begin{macrocode}
\def\@tracklang@add@russian{%
  \AddTrackedLanguage{russian}%
  \AddTrackedIsoLanguage{639-1}{ru}{russian}%
  \AddTrackedIsoLanguage{639-2}{rus}{russian}%
}
\@tracklang@declareoption{russian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@russianb}
%    \begin{macrocode}
\def\@tracklang@add@russianb{%
  \AddTrackedDialect{russianb}{russian}%
  \AddTrackedIsoLanguage{639-1}{ru}{russian}%
  \AddTrackedIsoLanguage{639-2}{rus}{russian}%
}
\@tracklang@declareoption{russianb}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@samin}
%    \begin{macrocode}
\def\@tracklang@add@samin{%
  \AddTrackedLanguage{samin}%
  \AddTrackedIsoLanguage{639-1}{se}{samin}%
  \AddTrackedIsoLanguage{639-2}{sme}{samin}%
}
\@tracklang@declareoption{samin}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@sanskrit}
%    \begin{macrocode}
\def\@tracklang@add@sanskrit{%
  \AddTrackedLanguage{sanskrit}%
  \AddTrackedIsoLanguage{639-1}{sa}{sanskrit}%
  \AddTrackedIsoLanguage{639-2}{san}{sanskrit}%
}
\@tracklang@declareoption{sanskrit}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@scottish}
%    \begin{macrocode}
\def\@tracklang@add@scottish{%
  \AddTrackedLanguage{scottish}%
  \AddTrackedIsoLanguage{639-1}{gd}{scottish}%
  \AddTrackedIsoLanguage{639-2}{gla}{scottish}%
}
\@tracklang@declareoption{scottish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@gaelic}
%    \begin{macrocode}
\def\@tracklang@add@gaelic{%
  \AddTrackedDialect{gaelic}{scottish}%
  \AddTrackedIsoLanguage{639-1}{gd}{scottish}%
  \AddTrackedIsoLanguage{639-2}{gla}{scottish}%
}
\@tracklang@declareoption{gaelic}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@serbian}
%    \begin{macrocode}
\def\@tracklang@add@serbian{%
  \AddTrackedLanguage{serbian}%
  \AddTrackedIsoLanguage{639-1}{sr}{serbian}%
  \AddTrackedIsoLanguage{639-2}{srp}{serbian}%
}
\@tracklang@declareoption{serbian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@slovak}
%    \begin{macrocode}
\def\@tracklang@add@slovak{%
  \AddTrackedLanguage{slovak}%
  \AddTrackedIsoLanguage{639-1}{sk}{slovak}%
  \AddTrackedIsoLanguage{639-2-B}{slo}{slovak}%
  \AddTrackedIsoLanguage{639-2-T}{slk}{slovak}%
  \AddTrackedIsoLanguage{639-2}{slk}{slovak}%
}
\@tracklang@declareoption{slovak}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@slovene}
%    \begin{macrocode}
\def\@tracklang@add@slovene{%
  \AddTrackedLanguage{slovene}%
  \AddTrackedIsoLanguage{639-1}{sl}{slovene}%
  \AddTrackedIsoLanguage{639-2}{slv}{slovene}%
}
\@tracklang@declareoption{slovene}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@slovenian}
%    \begin{macrocode}
\def\@tracklang@add@slovenian{%
  \AddTrackedDialect{slovenian}{slovene}%
  \AddTrackedIsoLanguage{639-1}{sl}{slovene}%
  \AddTrackedIsoLanguage{639-2}{slv}{slovene}%
}
\@tracklang@declareoption{slovenian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@slovenia}
%    \begin{macrocode}
\def\@tracklang@add@slovenia{%
  \AddTrackedDialect{slovenia}{slovene}%
  \AddTrackedIsoLanguage{639-1}{sl}{slovene}%
  \AddTrackedIsoLanguage{639-2}{slv}{slovene}%
  \AddTrackedIsoLanguage{3166-1}{SI}{slovenia}%
}
\@tracklang@declareoption{slovenia}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@sloveneistriaslovenian}
%    \begin{macrocode}
\def\@tracklang@add@sloveneistriaslovenian{%
  \AddTrackedDialect{sloveneistriaslovenian}{slovenian}%
  \AddTrackedIsoLanguage{639-1}{sl}{slovene}%
  \AddTrackedIsoLanguage{639-2}{slv}{slovene}%
  \AddTrackedIsoLanguage{3166-1}{SI}{sloveneistriaslovenian}%
}
\@tracklang@declareoption{sloveneistriaslovenian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@spanish}
%    \begin{macrocode}
\def\@tracklang@add@spanish{%
  \AddTrackedLanguage{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
}
\@tracklang@declareoption{spanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@spainspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@spainspanish{%
  \AddTrackedDialect{spainspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{ES}{spainspanish}%
}
\@tracklang@declareoption{spainspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@argentinespanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@argentinespanish{%
  \AddTrackedDialect{argentinespanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{AR}{argentinespanish}%
}
\@tracklang@declareoption{argentinespanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@bolivianspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@bolivianspanish{%
  \AddTrackedDialect{bolivianspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{BO}{bolivianspanish}%
}
\@tracklang@declareoption{bolivianspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@chilianspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@chilianspanish{%
  \AddTrackedDialect{chilianspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{CL}{chilianspanish}%
}
\@tracklang@declareoption{chilianspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@columbianspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@columbianspanish{%
  \AddTrackedDialect{columbianspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{CO}{columbianspanish}%
}
\@tracklang@declareoption{columbianspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@costaricanspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@costaricanspanish{%
  \AddTrackedDialect{costaricanspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{CR}{costaricanspanish}%
}
\@tracklang@declareoption{costaricanspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@cubanspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@cubanspanish{%
  \AddTrackedDialect{cubanspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{CU}{cubanspanish}%
}
\@tracklang@declareoption{cubanspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@dominicanspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@dominicanspanish{%
  \AddTrackedDialect{dominicanspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{DO}{dominicanspanish}%
}
\@tracklang@declareoption{dominicanspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@ecudorianspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@ecudorianspanish{%
  \AddTrackedDialect{ecudorianspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{EC}{ecudorianspanish}%
}
\@tracklang@declareoption{ecudorianspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@elsalvadorspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@elsalvadorspanish{%
  \AddTrackedDialect{elsalvadorspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{SV}{elsalvadorspanish}%
}
\@tracklang@declareoption{elsalvadorspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@guatemalanspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@guatemalanspanish{%
  \AddTrackedDialect{guatemalanspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{GT}{guatemalanspanish}%
}
\@tracklang@declareoption{guatemalanspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@honduranspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@honduranspanish{%
  \AddTrackedDialect{honduranspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{HN}{honduranspanish}%
}
\@tracklang@declareoption{honduranspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@mexicanspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@mexicanspanish{%
  \AddTrackedDialect{mexicanspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{MX}{mexicanspanish}%
}
\@tracklang@declareoption{mexicanspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@nicaraguanspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@nicaraguanspanish{%
  \AddTrackedDialect{nicaraguanspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{NI}{nicaraguanspanish}%
}
\@tracklang@declareoption{nicaraguanspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@panamaspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@panamaspanish{%
  \AddTrackedDialect{panamaspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{PA}{panamaspanish}%
}
\@tracklang@declareoption{panamaspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@paraguayspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@paraguayspanish{%
  \AddTrackedDialect{paraguayspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{PY}{paraguayspanish}%
}
\@tracklang@declareoption{paraguayspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@peruvianspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@peruvianspanish{%
  \AddTrackedDialect{peruvianspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{PE}{peruvianspanish}%
}
\@tracklang@declareoption{peruvianspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@puertoricospanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@puertoricospanish{%
  \AddTrackedDialect{puertoricospanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{PR}{puertoricospanish}%
}
\@tracklang@declareoption{puertoricospanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@uruguayspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@uruguayspanish{%
  \AddTrackedDialect{uruguayspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{UY}{uruguayspanish}%
}
\@tracklang@declareoption{uruguayspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@venezuelanspanish}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@venezuelanspanish{%
  \AddTrackedDialect{venezuelanspanish}{spanish}%
  \AddTrackedIsoLanguage{639-1}{es}{spanish}%
  \AddTrackedIsoLanguage{639-2}{spa}{spanish}%
  \AddTrackedIsoLanguage{3166-1}{VE}{venezuelanspanish}%
}
\@tracklang@declareoption{venezuelanspanish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@swedish}
%    \begin{macrocode}
\def\@tracklang@add@swedish{%
  \AddTrackedLanguage{swedish}%
  \AddTrackedIsoLanguage{639-1}{sv}{swedish}%
  \AddTrackedIsoLanguage{639-2}{swe}{swedish}%
}
\@tracklang@declareoption{swedish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@swissgerman}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@swissgerman{%
  \AddTrackedDialect{swissgerman}{german}%
  \AddTrackedIsoLanguage{639-1}{de}{german}%
  \AddTrackedIsoLanguage{639-2-B}{ger}{german}%
  \AddTrackedIsoLanguage{639-2-T}{deu}{german}%
  \AddTrackedIsoLanguage{639-2}{deu}{german}%
  \AddTrackedIsoLanguage{3166-1}{CH}{swissgerman}%
}
\@tracklang@declareoption{swissgerman}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@swissfrench}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@swissfrench{%
  \AddTrackedDialect{swissfrench}{french}%
  \AddTrackedIsoLanguage{639-1}{fr}{french}%
  \AddTrackedIsoLanguage{639-2-B}{fre}{french}%
  \AddTrackedIsoLanguage{639-2-T}{fra}{french}%
  \AddTrackedIsoLanguage{639-2}{fra}{french}%
  \AddTrackedIsoLanguage{3166-1}{CH}{swissfrench}%
}
\@tracklang@declareoption{swissfrench}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@swissitalian}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@swissitalian{%
  \AddTrackedDialect{swissitalian}{italian}%
  \AddTrackedIsoLanguage{639-1}{it}{italian}%
  \AddTrackedIsoLanguage{639-2}{ita}{italian}%
  \AddTrackedIsoLanguage{3166-1}{CH}{swissitalian}%
}
\@tracklang@declareoption{swissitalian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@swissromansh}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\@tracklang@add@swissromansh{%
  \AddTrackedDialect{swissromansh}{romansh}%
  \AddTrackedIsoLanguage{639-1}{rm}{romansh}%
  \AddTrackedIsoLanguage{639-2}{roh}{romansh}%
  \AddTrackedIsoLanguage{3166-1}{CH}{swissromansh}%
}
\@tracklang@declareoption{swissromansh}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@syriac}
%    \begin{macrocode}
\def\@tracklang@add@syriac{%
  \AddTrackedLanguage{syriac}%
  \AddTrackedIsoLanguage{639-2}{syr}{syriac}%
}
\@tracklang@declareoption{syriac}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@tamil}
%    \begin{macrocode}
\def\@tracklang@add@tamil{%
  \AddTrackedLanguage{tamil}%
  \AddTrackedIsoLanguage{639-1}{ta}{tamil}%
  \AddTrackedIsoLanguage{639-2}{tam}{tamil}%
}
\@tracklang@declareoption{tamil}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@telugu}
%    \begin{macrocode}
\def\@tracklang@add@telugu{%
  \AddTrackedLanguage{telugu}%
  \AddTrackedIsoLanguage{639-1}{te}{telugu}%
  \AddTrackedIsoLanguage{639-2}{tel}{telugu}%
}
\@tracklang@declareoption{telugu}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@thai}
%    \begin{macrocode}
\def\@tracklang@add@tai{%
  \AddTrackedLanguage{tai}%
  \AddTrackedIsoLanguage{639-2}{tai}{tai}%
}
\@tracklang@declareoption{tai}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@thai}
%    \begin{macrocode}
\def\@tracklang@add@thai{%
  \AddTrackedLanguage{thai}%
  \AddTrackedIsoLanguage{639-1}{th}{thai}%
  \AddTrackedIsoLanguage{639-2}{tha}{thai}%
}
\@tracklang@declareoption{thai}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@tibetan}
%    \begin{macrocode}
\def\@tracklang@add@tibetan{%
  \AddTrackedLanguage{tibetan}%
  \AddTrackedIsoLanguage{639-1}{bo}{tibetan}%
  \AddTrackedIsoLanguage{639-2-B}{tib}{tibetan}%
  \AddTrackedIsoLanguage{639-2-T}{bod}{tibetan}%
  \AddTrackedIsoLanguage{639-2}{bod}{tibetan}%
}
\@tracklang@declareoption{tibetan}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@turkish}
%    \begin{macrocode}
\def\@tracklang@add@turkish{%
  \AddTrackedLanguage{turkish}%
  \AddTrackedIsoLanguage{639-1}{tr}{turkish}%
  \AddTrackedIsoLanguage{639-2}{tur}{turkish}%
}
\@tracklang@declareoption{turkish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@turkmen}
%    \begin{macrocode}
\def\@tracklang@add@turkmen{%
  \AddTrackedLanguage{turkmen}%
  \AddTrackedIsoLanguage{639-1}{tk}{turkmen}%
  \AddTrackedIsoLanguage{639-2}{tuk}{turkmen}%
}
\@tracklang@declareoption{turkmen}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@UKenglish}
%    \begin{macrocode}
\def\@tracklang@add@UKenglish{%
  \AddTrackedDialect{UKenglish}{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
  \AddTrackedIsoLanguage{3166-1}{GB}{UKenglish}%
}
\@tracklang@declareoption{UKenglish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@ukrainian}
%    \begin{macrocode}
\def\@tracklang@add@ukrainian{%
  \AddTrackedLanguage{ukrainian}%
  \AddTrackedIsoLanguage{639-1}{uk}{ukrainian}%
  \AddTrackedIsoLanguage{639-2}{ukr}{ukrainian}%
  \AddTrackedIsoLanguage{3166-1}{UA}{ukrainian}%
}
\@tracklang@declareoption{ukrainian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@ukraineb}
%    \begin{macrocode}
\def\@tracklang@add@ukraineb{%
  \AddTrackedDialect{ukraineb}{ukrainian}%
  \AddTrackedIsoLanguage{639-1}{uk}{ukrainian}%
  \AddTrackedIsoLanguage{639-2}{ukr}{ukrainian}%
  \AddTrackedIsoLanguage{3166-1}{UA}{ukraineb}%
}
\@tracklang@declareoption{ukraineb}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@ukraine}
%    \begin{macrocode}
\def\@tracklang@add@ukraine{%
  \AddTrackedDialect{ukraine}{ukrainian}%
  \AddTrackedIsoLanguage{639-1}{uk}{ukrainian}%
  \AddTrackedIsoLanguage{639-2}{ukr}{ukrainian}%
  \AddTrackedIsoLanguage{3166-1}{UA}{ukraine}%
}
\@tracklang@declareoption{ukraine}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@urdu}
%    \begin{macrocode}
\def\@tracklang@add@urdu{%
  \AddTrackedLanguage{urdu}%
  \AddTrackedIsoLanguage{639-1}{ur}{urdu}%
  \AddTrackedIsoLanguage{639-2}{urd}{urdu}%
}
\@tracklang@declareoption{urdu}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@usorbian}
%    \begin{macrocode}
\def\@tracklang@add@usorbian{%
  \AddTrackedLanguage{usorbian}%
  \AddTrackedIsoLanguage{639-2}{dsb}{usorbian}%
  \AddTrackedIsoLanguage{3166-1}{DE}{usorbian}%
}
\@tracklang@declareoption{usorbian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@uppersorbian}
%    \begin{macrocode}
\def\@tracklang@add@uppersorbian{%
  \AddTrackedDialect{uppersorbian}{usorbian}%
  \AddTrackedIsoLanguage{639-2}{hsb}{usorbian}%
  \AddTrackedIsoLanguage{3166-1}{DE}{uppersorbian}%
}
\@tracklang@declareoption{uppersorbian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@USenglish}
%    \begin{macrocode}
\def\@tracklang@add@USenglish{%
  \AddTrackedDialect{USenglish}{english}%
  \AddTrackedIsoLanguage{639-1}{en}{english}%
  \AddTrackedIsoLanguage{639-2}{eng}{english}%
  \AddTrackedIsoLanguage{3166-1}{US}{USenglish}%
}
\@tracklang@declareoption{USenglish}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@valencian}
%    \begin{macrocode}
\def\@tracklang@add@valencian{%
  \AddTrackedDialect{valencian}{catalan}%
  \AddTrackedIsoLanguage{639-1}{ca}{catalan}%
  \AddTrackedIsoLanguage{639-2}{cat}{catalan}%
}
\@tracklang@declareoption{valencian}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@valencien}
%    \begin{macrocode}
\def\@tracklang@add@valencien{%
  \AddTrackedDialect{valencien}{catalan}%
  \AddTrackedIsoLanguage{639-1}{ca}{catalan}%
  \AddTrackedIsoLanguage{639-2}{cat}{catalan}%
}
\@tracklang@declareoption{valencien}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@vietnamese}
%    \begin{macrocode}
\def\@tracklang@add@vietnamese{%
  \AddTrackedLanguage{vietnamese}%
  \AddTrackedIsoLanguage{639-1}{vi}{vietnamese}%
  \AddTrackedIsoLanguage{639-2}{vie}{vietnamese}%
}
\@tracklang@declareoption{vietnamese}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@walloon}
% No country code as Walloon is spoken in multiple regions
% (Wallonia in Belgium, some villages in Northern France and northeast of
% Wisconsin.) Not the same as Belgian French.
%    \begin{macrocode}
\def\@tracklang@add@walloon{%
  \AddTrackedLanguage{walloon}%
  \AddTrackedIsoLanguage{639-1}{wa}{walloon}%
  \AddTrackedIsoLanguage{639-2}{wln}{walloon}%
}
\@tracklang@declareoption{walloon}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@welsh}
%    \begin{macrocode}
\def\@tracklang@add@welsh{%
  \AddTrackedLanguage{welsh}%
  \AddTrackedIsoLanguage{639-1}{cy}{welsh}%
  \AddTrackedIsoLanguage{639-2-B}{wel}{welsh}%
  \AddTrackedIsoLanguage{639-2-T}{cym}{welsh}%
  \AddTrackedIsoLanguage{639-2}{cym}{welsh}%
}
\@tracklang@declareoption{welsh}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@tracklang@add@cymraeg}
%    \begin{macrocode}
\def\@tracklang@add@cymraeg{%
  \AddTrackedDialect{cymraeg}{welsh}%
  \AddTrackedIsoLanguage{639-1}{cy}{welsh}%
  \AddTrackedIsoLanguage{639-2-B}{wel}{welsh}%
  \AddTrackedIsoLanguage{639-2-T}{cym}{welsh}%
  \AddTrackedIsoLanguage{639-2}{cym}{welsh}%
}
\@tracklang@declareoption{cymraeg}
%    \end{macrocode}
%\end{macro}
%
% Add some dialect synonyms:
%\begin{macro}{\LetTrackLangOption}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\def\LetTrackLangOption#1#2{%
  \expandafter\let\csname @tracklang@add@#1\expandafter\endcsname
    \csname @tracklang@add@#2\endcsname
  \@tracklang@declareoption{#1}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@en-US}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{en-US}{american}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@en-GB}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{en-GB}{british}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@en-AU}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{en-AU}{australian}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@en-NZ}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{en-NZ}{newzealand}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@en-CA}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{en-CA}{canadian}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@fr-CA}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{fr-CA}{canadien}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@fr-BE}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{fr-BE}{belgique}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@pt-BR}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{pt-BR}{brazilian}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@it-HR}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{it-HR}{istriacountyitalian}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@nl-BE}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{nl-BE}{flemish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@fr-FR}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{fr-FR}{france}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@de-DE}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{de-DE}{ngermanDE}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@de-BE}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{de-BE}{belgiangerman}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@en-GG}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{en-GG}{guernseyenglish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@fr-GG}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{fr-GG}{guernseyfrench}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@it-IT}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{it-IT}{italy}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@mt-MT}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{mt-MT}{maltamaltese}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@en-MT}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{en-MT}{maltaenglish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@en-IM}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{en-IM}{isleofmanenglish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@en-JE}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{en-JE}{jerseyenglish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@fr-JE}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{fr-JE}{jerseyfrench}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@nl-NL}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{nl-NL}{netherlands}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@pt-PT}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{pt-PT}{portugal}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@it-SM}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{it-SM}{sanmarino}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@sl-SI}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{sl-SI}{slovenia}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@it-SI}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{it-SI}{sloveneistriaitalian}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-ES}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-ES}{spainspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-AR}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-AR}{argentinespanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-BO}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-BO}{bolivianspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-CL}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-CL}{chilianspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-CO}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-CO}{columbianspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-CR}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-CR}{costaricanspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-CU}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-CU}{cubanspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-DO}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-DO}{dominicanspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-EC}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-EC}{ecudorianspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-SV}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-SV}{elsalvadorspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-GT}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-GT}{guatemalanspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-HN}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-HN}{honduranspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-MX}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-MX}{mexicanspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-NI}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-NI}{nicaraguanspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-PA}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-PA}{panamaspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-PY}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-PY}{paraguayspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-PE}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-PE}{peruvianspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-PR}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-PR}{puertoricospanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-UY}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-UY}{uruguayspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@es-VE}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{es-VE}{venezuelanspanish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@de-CH}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{de-CH}{swissgerman}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@fr-CH}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{fr-CH}{swissfrench}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@it-CH}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{it-CH}{swissitalian}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@rm-CH}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{rm-CH}{swissromansh}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@it-VA}
%\changes{1.1}{2014-11-21}{new}
%    \begin{macrocode}
\LetTrackLangOption{it-VA}{vatican}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@ga-IE}
%\changes{1.2}{2015-03-23}{new}
% Irish Gaelic in Republic of Ireland.
%    \begin{macrocode}
\LetTrackLangOption{ga-IE}{IEirish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@ga-GB}
%\changes{1.2}{2015-03-23}{new}
% Irish Gaelic in Northern Ireland.
%    \begin{macrocode}
\LetTrackLangOption{ga-GB}{GBirish}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@tracklang@add@en-IE}
%\changes{1.2}{2015-03-23}{new}
% English spoken in Republic of Ireland.
%    \begin{macrocode}
\LetTrackLangOption{en-IE}{IEenglish}
%    \end{macrocode}
%\end{macro}
%
%\subsubsection{Conditionals and Loops}
%
%\begin{macro}{\IfTrackedLanguage}
%\begin{definition}
%\cs{IfTrackedLanguage}\marg{language}\marg{true part}\marg{false
%part}
%\end{definition}
%    \begin{macrocode}
\long\def\IfTrackedLanguage#1#2#3{%
%   \end{macrocode}
% First find out if the language name is empty.
%    \begin{macrocode}
  \edef\@tracklang@element{#1}%
  \ifx\@tracklang@element\empty
%    \end{macrocode}
% Language is empty, so do false part.
%    \begin{macrocode}
    #3%
  \else
    \expandafter\@tracklang@ifinlist\expandafter{\@tracklang@element}%
      \@tracklang@languages
    {%
%    \end{macrocode}
% In list, so do true part.
%    \begin{macrocode}
      #2%
    }%
    {%
%    \end{macrocode}
% Not in list, so do false part.
%    \begin{macrocode}
      #3%
    }%
  \fi
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\IfTrackedDialect}
%\begin{definition}
%\cs{IfTrackedDialect}\marg{dialect}\marg{true part}\marg{false
%part}
%\end{definition}
%    \begin{macrocode}
\long\def\IfTrackedDialect#1#2#3{%
  \@tracklang@ifundef{@tracklang@fromdialect@#1}{#3}{#2}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\IfTrackedIsoCode}
%\begin{definition}
%\cs{IfTrackedIsoCode}\marg{code type}\marg{code}\marg{true part}\marg{false
%part}
%\end{definition}
%    \begin{macrocode}
\long\def\IfTrackedIsoCode#1#2#3#4{%
  \@tracklang@ifundef{@tracklang@#1@isotolang@#2}{#4}{#3}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\IfTrackedLanguageHasIsoCode}
%\begin{definition}
%\cs{IfTrackedLanguageHasIsoCode}\marg{code type}\marg{language}\marg{true part}\marg{false
%part}
%\end{definition}
%    \begin{macrocode}
\long\def\IfTrackedLanguageHasIsoCode#1#2#3#4{%
  \@tracklang@ifundef{@tracklang@#1@isofromlang@#2}{#4}{#3}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\ForEachTrackedLanguage}
%\begin{definition}
%\cs{ForEachTrackedLanguage}\marg{cs}\marg{body}
%\end{definition}
% Iterates through the list of tracked languages. On each iteration
% \meta{cs} is set to the language tag and \meta{body} is performed.
%    \begin{macrocode}
\long\def\ForEachTrackedLanguage#1#2{%
  \@tracklang@for#1:=\@tracklang@languages\do{#2}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\ForEachTrackedDialect}
%\begin{definition}
%\cs{ForEachTrackedDialect}\marg{cs}\marg{body}
%\end{definition}
% Iterates through the list of tracked dialects. On each iteration
% \meta{cs} is set to the dialect tag and \meta{body} is performed.
%    \begin{macrocode}
\long\def\ForEachTrackedDialect#1#2{%
  \@tracklang@for#1:=\@tracklang@dialects\do{#2}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\AnyTrackedLanguages}
%    \begin{macrocode}
\long\def\AnyTrackedLanguages#1#2{%
  \ifx\@tracklang@languages\empty
    #2%
  \else
    #1%
  \fi
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\IfTrackedLanguageFileExists}
%\begin{definition}
%\cs{IfTrackedLanguageFileExists}\marg{dialect}\marg{prefix}\marg{suffix}\marg{true
%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
% 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}.
% 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.
%    \begin{macrocode}
\long\def\IfTrackedLanguageFileExists#1#2#3#4#5{%
   \def\CurrentTrackedTag{}%
   \def\CurrentTrackedDialect{#1}%
   \def\CurrentTrackedLanguage{}%
   \def\CurrentTrackedRegion{}%
   \def\CurrentTrackedIsoCode{}%
   \IfTrackedDialect{#1}%
   {%
%    \end{macrocode}
% Fetch the region if defined.
%    \begin{macrocode}
     \IfTrackedLanguageHasIsoCode{3166-1}{#1}%
     {%
       \edef\CurrentTrackedRegion{%
         \TrackedIsoCodeFromLanguage{3166-1}{#1}}%
     }%
     {}%
%    \end{macrocode}
% Fetch the root language.
%    \begin{macrocode}
     \edef\CurrentTrackedLanguage{\TrackedLanguageFromDialect{#1}}%
%    \end{macrocode}
% Try just the dialect label.
%    \begin{macrocode}
     \edef\CurrentTrackedTag{#1}%
     \@tracklang@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}
       {%
          \edef\CurrentTrackedIsoCode{%
             \TrackedIsoCodeFromLanguage
               {639-1}{\CurrentTrackedLanguage}}%
          \ifx\CurrentTrackedRegion\@empty
%    \end{macrocode}
% No region, just try ISO 639-1 code
%    \begin{macrocode}
            \let\CurrentTrackedTag\CurrentTrackedIsoCode
            \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
            {#4}
            {%
%    \end{macrocode}
% No region and file for just \meta{ISO 639-1 code}. Try ISO 639-2 code.
%    \begin{macrocode}
              \IfTrackedLanguageHasIsoCode
                {639-2}{\CurrentTrackedLanguage}
              {%
                 \edef\CurrentTrackedIsoCode{%
                    \TrackedIsoCodeFromLanguage
                      {639-2}{\CurrentTrackedLanguage}}%
                 \let\CurrentTrackedTag\CurrentTrackedIsoCode
                 \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
                 {#4}%
                 {%
%    \end{macrocode}
% Try root language.
%    \begin{macrocode}
                   \let\CurrentTrackedTag\CurrentTrackedLanguage
                   \@tracklang@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@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@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}
              {%
                \let\org@currenttrackedisocode\CurrentTrackedIsoCode
                \edef\CurrentTrackedIsoCode{%
                  \TrackedIsoCodeFromLanguage
                  {639-2}{\CurrentTrackedLanguage}}%
                \edef\CurrentTrackedTag{%
                  \CurrentTrackedIsoCode-\CurrentTrackedRegion}%
                \@tracklang@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@currenttrackedisocode
                  \let\org@currenttrackedisocode\CurrentTrackedIsoCode
                  \let\CurrentTrackedIsoCode\CurrentTrackedTag
                  \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
                  {#4}
                  {%
%    \end{macrocode}
% Try just the ISO 639-2 code.
%    \begin{macrocode}
                    \let\CurrentTrackedIsoCode\org@currenttrackedisocode
                    \let\CurrentTrackedTag\CurrentTrackedIsoCode
                    \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
                    {#4}%
                    {%
%    \end{macrocode}
% Try just the region.
%    \begin{macrocode}
                      \let\CurrentTrackedTag\CurrentTrackedRegion
                      \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
                      {#4}%
                      {%
%    \end{macrocode}
% Try the root language.
%    \begin{macrocode}
                        \let\CurrentTrackedTag\CurrentTrackedLanguage
                        \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
                      }%
                    }%
                  }%
                }%
              }%
              {%
%    \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@IfFileExists{#2\CurrentTrackedTag#3}%
                {#4}%
                {%
%    \end{macrocode}
% Just try the region
%    \begin{macrocode}
                  \let\CurrentTrackedTag\CurrentTrackedRegion
                  \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
                  {#4}%
                  {%
%    \end{macrocode}
% Try the root language.
%    \begin{macrocode}
                    \let\CurrentTrackedTag\CurrentTrackedLanguage
                    \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
                  }%
                }%
              }%
            }%
          \fi
       }%
       {%
%    \end{macrocode}
% No ISO 639-1 code. Try ISO 639-2 code.
%    \begin{macrocode}
         \IfTrackedLanguageHasIsoCode
           {639-2}{\CurrentTrackedLanguage}
         {%
            \edef\CurrentTrackedIsoCode{%
               \TrackedIsoCodeFromLanguage
               {639-2}{\CurrentTrackedLanguage}}%
            \ifx\CurrentTrackedRegion\@empty
%    \end{macrocode}
% Has ISO 639-2 code but no region
%    \begin{macrocode}
              \let\CurrentTrackedTag\CurrentTrackedIsoCode
              \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
              {#4}%
              {%
%    \end{macrocode}
% Try the root language.
%    \begin{macrocode}
                \let\CurrentTrackedTag\CurrentTrackedLanguage
                \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
              }%
            \else
%    \end{macrocode}
% Has ISO 639-2 code and a region. Try \meta{ISO
% 639-2}\texttt{-}\meta{region} first.
%    \begin{macrocode}
              \edef\CurrentTrackedTag{%
                \CurrentTrackedIsoCode-\CurrentTrackedRegion}%
              \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
              {#4}%
              {%
%    \end{macrocode}
% Has ISO 639-2 code and a region but \meta{ISO
% 639-2}\texttt{-}\meta{region} doesn't exist. Try just \meta{ISO
% 639-2}
%    \begin{macrocode}
                \let\CurrentTrackedTag\CurrentTrackedIsoCode
                \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
                {#4}%
                {%
%    \end{macrocode}
% Has ISO 639-2 code and a region but \meta{ISO
% 639-2} doesn't exist. Try just \meta{region}
%    \begin{macrocode}
                  \let\CurrentTrackedTag\CurrentTrackedRegion
                  \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
                  {#4}%
                  {%
%    \end{macrocode}
% Try the root language.
%    \begin{macrocode}
                    \let\CurrentTrackedTag\CurrentTrackedLanguage
                    \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
                  }%
                }%
              }%
            \fi
         }%
         {%
%    \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@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
           \else
%    \end{macrocode}
% Try the region.
%    \begin{macrocode}
             \let\CurrentTrackedTag\CurrentTrackedRegion
             \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
             {#4}%
             {%
%    \end{macrocode}
% Try the root language.
%    \begin{macrocode}
               \let\CurrentTrackedTag\CurrentTrackedLanguage
               \@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
             }%
           \fi
         }%
       }%
     }%
   }%
   {#5}% unknown dialect
}
%    \end{macrocode}
%\end{macro}
%
%\iffalse
%    \begin{macrocode}
%</tracklang.tex>
%    \end{macrocode}
%\fi
%\Finale
\endinput
