summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/tracklang
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-09-30 00:04:37 +0000
committerKarl Berry <karl@freefriends.org>2014-09-30 00:04:37 +0000
commit805c9c1fe26d5bd3dacaba4bc6d38ed7787aea38 (patch)
tree017e56c8381e854675ac3fb11bc7bb00258cc50e /Master/texmf-dist/source/latex/tracklang
parentbfcb5e953985804589a2a55b1f1f80bd00c34763 (diff)
tracklang (29sep14)
git-svn-id: svn://tug.org/texlive/trunk@35283 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/tracklang')
-rw-r--r--Master/texmf-dist/source/latex/tracklang/tracklang.dtx3956
-rw-r--r--Master/texmf-dist/source/latex/tracklang/tracklang.ins33
2 files changed, 3989 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/tracklang/tracklang.dtx b/Master/texmf-dist/source/latex/tracklang/tracklang.dtx
new file mode 100644
index 00000000000..a1f651a3acb
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tracklang/tracklang.dtx
@@ -0,0 +1,3956 @@
+%\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 2014/9/29 15: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) 2014 Nicola Talbot, all rights reserved.
+% \fi
+% \iffalse
+%<*driver>
+\documentclass{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{1685}
+
+\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.0:
+%tracking language options}
+%\author{Nicola L. C. Talbot\\\url{http://www.dickimaw-books.com/}}
+%
+%\date{2014-09-29}
+%\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} and recent versions of \sty{babel},
+%and next best 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''.
+%
+%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''.
+%
+%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}.
+%
+%In addition to the root language label and the dialect identifier,
+%most 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.
+%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 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}\marg{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 \ics{ThisDialect} is \texttt{british}, then the file search will
+%be: \texttt{mypackage-british.ldf}, \texttt{mypackage-en-GB.ldf},
+%\texttt{mypackage-eng-GB.ldf}, \texttt{mypackage-en.ldf},
+%\texttt{mypackage-eng.ldf}, \texttt{mypackage-GB.ldf},
+%\texttt{mypackage-english.ldf}.
+%
+%If \ics{ThisDialect} is \texttt{francais}, then the file search will
+%be: \texttt{mypackage-francais.ldf}, \texttt{mypackage-fr.ldf}
+%\texttt{mypackage-fra.ldf}, \texttt{mypackage-french.ldf}.
+%
+%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 the \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{tracklang}{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.
+%
+%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:
+%\texttt{mypackage-british.ldf}, \texttt{mypackage-en-GB.ldf},
+%\texttt{mypackage-eng-GB.ldf}, \texttt{mypackage-en.ldf},
+%\texttt{mypackage-eng.ldf}, \texttt{mypackage-GB.ldf},
+%\texttt{mypackage-english.ldf}. You may have wondered why
+%\texttt{mypackage-GB.ldf} is included in the search. Since some
+%countries have multiple official languages, 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). 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{tracklang}{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{tracklang}{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 \isty{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.
+%
+%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.)
+%
+%\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
+%\StopEventually{\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})}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{tracklang}[2014/09/29 v1.0 (NLCT) Track Languages]
+% \end{macrocode}
+% Load generic code:
+% \begin{macrocode}
+\input{tracklang}
+% \end{macrocode}
+% Define package/class options:
+% \begin{macrocode}
+\DeclareOption{acadian}{\@tracklang@add@acadian}
+\DeclareOption{afrikaans}{\@tracklang@add@afrikaans}
+\DeclareOption{albanian}{\@tracklang@add@albanian}
+\DeclareOption{american}{\@tracklang@add@american}
+\DeclareOption{amharic}{\@tracklang@add@amharic}
+\DeclareOption{anglosaxon}{\@tracklang@add@anglosaxon}
+\DeclareOption{apache}{\@tracklang@add@apache}
+\DeclareOption{arabic}{\@tracklang@add@arabic}
+\DeclareOption{armenian}{\@tracklang@add@armenian}
+\DeclareOption{asturian}{\@tracklang@add@asturian}
+\DeclareOption{australian}{\@tracklang@add@australian}
+\DeclareOption{austrian}{\@tracklang@add@austrian}
+\DeclareOption{bahasa}{\@tracklang@add@bahasa}
+\DeclareOption{bahasai}{\@tracklang@add@bahasai}
+\DeclareOption{bahasam}{\@tracklang@add@bahasam}
+\DeclareOption{basque}{\@tracklang@add@basque}
+\DeclareOption{belgique}{\@tracklang@add@belgique}
+\DeclareOption{bengali}{\@tracklang@add@bengali}
+\DeclareOption{brazil}{\@tracklang@add@brazil}
+\DeclareOption{brazilian}{\@tracklang@add@brazilian}
+\DeclareOption{breton}{\@tracklang@add@breton}
+\DeclareOption{british}{\@tracklang@add@british}
+\DeclareOption{bulgarian}{\@tracklang@add@bulgarian}
+\DeclareOption{canadian}{\@tracklang@add@canadian}
+\DeclareOption{canadien}{\@tracklang@add@canadien}
+\DeclareOption{catalan}{\@tracklang@add@catalan}
+\DeclareOption{coptic}{\@tracklang@add@coptic}
+\DeclareOption{croatian}{\@tracklang@add@croatian}
+\DeclareOption{cymraeg}{\@tracklang@add@cymraeg}
+\DeclareOption{czech}{\@tracklang@add@czech}
+\DeclareOption{danish}{\@tracklang@add@danish}
+\DeclareOption{deutsch}{\@tracklang@add@deutsch}
+\DeclareOption{divehi}{\@tracklang@add@divehi}
+\DeclareOption{dutch}{\@tracklang@add@dutch}
+\DeclareOption{english}{\@tracklang@add@english}
+\DeclareOption{esperanto}{\@tracklang@add@esperanto}
+\DeclareOption{estonian}{\@tracklang@add@estonian}
+\DeclareOption{farsi}{\@tracklang@add@farsi}
+\DeclareOption{finnish}{\@tracklang@add@finnish}
+\DeclareOption{flemish}{\@tracklang@add@flemish}
+\DeclareOption{francais}{\@tracklang@add@francais}
+\DeclareOption{french}{\@tracklang@add@french}
+\DeclareOption{frenchb}{\@tracklang@add@frenchb}
+\DeclareOption{friulan}{\@tracklang@add@friulan}
+\DeclareOption{friulano}{\@tracklang@add@friulano}
+\DeclareOption{friulian}{\@tracklang@add@friulian}
+\DeclareOption{gaeilge}{\@tracklang@add@gaeilge}
+\DeclareOption{galician}{\@tracklang@add@galician}
+\DeclareOption{galicien}{\@tracklang@add@galicien}
+\DeclareOption{german}{\@tracklang@add@german}
+\DeclareOption{greek}{\@tracklang@add@greek}
+\DeclareOption{hebrew}{\@tracklang@add@hebrew}
+\DeclareOption{hindi}{\@tracklang@add@hindi}
+\DeclareOption{hungarian}{\@tracklang@add@hungarian}
+\DeclareOption{icelandic}{\@tracklang@add@icelandic}
+\DeclareOption{indon}{\@tracklang@add@indon}
+\DeclareOption{indonesian}{\@tracklang@add@indonesian}
+\DeclareOption{interlingua}{\@tracklang@add@interlingua}
+\DeclareOption{irish}{\@tracklang@add@irish}
+\DeclareOption{italian}{\@tracklang@add@italian}
+\DeclareOption{kannada}{\@tracklang@add@kannada}
+\DeclareOption{lao}{\@tracklang@add@lao}
+\DeclareOption{latin}{\@tracklang@add@latin}
+\DeclareOption{latein}{\@tracklang@add@latein}
+\DeclareOption{latvian}{\@tracklang@add@latvian}
+\DeclareOption{lithuanian}{\@tracklang@add@lithuanian}
+\DeclareOption{lsorbian}{\@tracklang@add@lsorbian}
+\DeclareOption{magyar}{\@tracklang@add@magyar}
+\DeclareOption{malay}{\@tracklang@add@malay}
+\DeclareOption{malayalam}{\@tracklang@add@malayalam}
+\DeclareOption{marathi}{\@tracklang@add@marathi}
+\DeclareOption{meyalu}{\@tracklang@add@meyalu}
+\DeclareOption{naustrian}{\@tracklang@add@naustrian}
+\DeclareOption{ngerman}{\@tracklang@add@ngerman}
+\DeclareOption{lowersorbian}{\@tracklang@add@lowersorbian}
+\DeclareOption{newzealand}{\@tracklang@add@newzealand}
+\DeclareOption{nko}{\@tracklang@add@nko}
+\DeclareOption{norsk}{\@tracklang@add@norsk}
+\DeclareOption{norwegian}{\@tracklang@add@norwegian}
+\DeclareOption{nynorsk}{\@tracklang@add@nynorsk}
+\DeclareOption{occitan}{\@tracklang@add@occitan}
+\DeclareOption{persian}{\@tracklang@add@persian}
+\DeclareOption{piedmontese}{\@tracklang@add@piedmontese}
+\DeclareOption{piemonteis}{\@tracklang@add@piemonteis}
+\DeclareOption{polish}{\@tracklang@add@polish}
+\DeclareOption{polutoniko}{\@tracklang@add@polutoniko}
+\DeclareOption{polutonikogreek}{\@tracklang@add@polutonikogreek}
+\DeclareOption{portuges}{\@tracklang@add@portuges}
+\DeclareOption{portuguese}{\@tracklang@add@portuguese}
+\DeclareOption{romanche}{\@tracklang@add@romanche}
+\DeclareOption{romanian}{\@tracklang@add@romanian}
+\DeclareOption{romansh}{\@tracklang@add@romansh}
+\DeclareOption{romansch}{\@tracklang@add@romansch}
+\DeclareOption{rumantsch}{\@tracklang@add@rumantsch}
+\DeclareOption{russian}{\@tracklang@add@russian}
+\DeclareOption{russianb}{\@tracklang@add@russianb}
+\DeclareOption{samin}{\@tracklang@add@samin}
+\DeclareOption{sanskrit}{\@tracklang@add@sanskrit}
+\DeclareOption{scottish}{\@tracklang@add@scottish}
+\DeclareOption{gaelic}{\@tracklang@add@gaelic}
+\DeclareOption{serbian}{\@tracklang@add@serbian}
+\DeclareOption{slovak}{\@tracklang@add@slovak}
+\DeclareOption{slovene}{\@tracklang@add@slovene}
+\DeclareOption{slovenian}{\@tracklang@add@slovenian}
+\DeclareOption{spanish}{\@tracklang@add@spanish}
+\DeclareOption{swedish}{\@tracklang@add@swedish}
+\DeclareOption{syriac}{\@tracklang@add@syriac}
+\DeclareOption{tamil}{\@tracklang@add@tamil}
+\DeclareOption{telugu}{\@tracklang@add@telugu}
+\DeclareOption{tai}{\@tracklang@add@tai}
+\DeclareOption{thai}{\@tracklang@add@thai}
+\DeclareOption{tibetan}{\@tracklang@add@tibetan}
+\DeclareOption{turkish}{\@tracklang@add@turkish}
+\DeclareOption{turkmen}{\@tracklang@add@turkmen}
+\DeclareOption{UKenglish}{\@tracklang@add@UKenglish}
+\DeclareOption{ukrainian}{\@tracklang@add@ukrainian}
+\DeclareOption{ukraineb}{\@tracklang@add@ukraineb}
+\DeclareOption{ukraine}{\@tracklang@add@ukraine}
+\DeclareOption{urdu}{\@tracklang@add@urdu}
+\DeclareOption{usorbian}{\@tracklang@add@usorbian}
+\DeclareOption{uppersorbian}{\@tracklang@add@uppersorbian}
+\DeclareOption{USenglish}{\@tracklang@add@USenglish}
+\DeclareOption{valencian}{\@tracklang@add@valencian}
+\DeclareOption{valencien}{\@tracklang@add@valencien}
+\DeclareOption{vietnamese}{\@tracklang@add@vietnamese}
+\DeclareOption{walloon}{\@tracklang@add@walloon}
+\DeclareOption{welsh}{\@tracklang@add@welsh}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\let\@tracklang@declaredoptions\@declaredoptions
+\ProcessOptions
+% \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) 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 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}%
+ {%
+ \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}
+%
+%\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}
+%
+%\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}
+%
+% 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
+% language 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}
+%
+%\begin{macro}{\@tracklang@add@acadian}
+% \begin{macrocode}
+\def\@tracklang@add@acadian{%
+ \AddTrackedDialect{acadian}{french}%
+ \AddTrackedIsoLanguage{639-1}{fr}{french}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang@add@anglosaxon}
+% \begin{macrocode}
+\def\@tracklang@add@anglosaxon{%
+ \AddTrackedLanguage{anglosaxon}%
+ \AddTrackedIsoLanguage{639-2}{ang}{anglosaxon}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang@add@apache}
+% \begin{macrocode}
+\def\@tracklang@add@apache{%
+ \AddTrackedLanguage{apache}%
+ \AddTrackedIsoLanguage{639-2}{apa}{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}%
+}
+% \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}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang@add@asturian}
+% \begin{macrocode}
+\def\@tracklang@add@asturian{%
+ \AddTrackedLanguage{asturian}%
+ \AddTrackedIsoLanguage{639-2}{ast}{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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang@add@coptic}
+% \begin{macrocode}
+\def\@tracklang@add@coptic{%
+ \AddTrackedLanguage{coptic}%
+ \AddTrackedIsoLanguage{639-2}{cop}{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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang@add@nko}
+% \begin{macrocode}
+\def\@tracklang@add@nko{%
+ \AddTrackedLanguage{nko}%
+ \AddTrackedIsoLanguage{639-2}{nqo}{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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang@add@piedmontese}
+% \begin{macrocode}
+\def\@tracklang@add@piedmontese{%
+ \AddTrackedLanguage{piedmontese}%
+ \AddTrackedIsoLanguage{3166-1}{IT}{piedmontese}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang@add@piemonteis}
+% \begin{macrocode}
+\def\@tracklang@add@piemonteis{%
+ \AddTrackedDialect{piemonteis}{piedmontese}%
+ \AddTrackedIsoLanguage{3166-1}{IT}{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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang@add@syriac}
+% \begin{macrocode}
+\def\@tracklang@add@syriac{%
+ \AddTrackedLanguage{syriac}%
+ \AddTrackedIsoLanguage{639-2}{syr}{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}%
+}
+% \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}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang@add@thai}
+% \begin{macrocode}
+\def\@tracklang@add@tai{%
+ \AddTrackedLanguage{tai}%
+ \AddTrackedIsoLanguage{639-2}{tai}{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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \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}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@tracklang@add@walloon}
+% \begin{macrocode}
+\def\@tracklang@add@walloon{%
+ \AddTrackedLanguage{walloon}%
+ \AddTrackedIsoLanguage{639-1}{wa}{walloon}%
+ \AddTrackedIsoLanguage{639-2}{wln}{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}%
+}
+% \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}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\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
diff --git a/Master/texmf-dist/source/latex/tracklang/tracklang.ins b/Master/texmf-dist/source/latex/tracklang/tracklang.ins
new file mode 100644
index 00000000000..273053c1a22
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tracklang/tracklang.ins
@@ -0,0 +1,33 @@
+% tracklang.ins generated using makedtx version 1.1 2014/9/29 15:50
+\input docstrip
+
+\preamble
+
+ tracklang.dtx
+ Copyright 2014 Nicola Talbot
+
+ This work may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either version 1.3
+ of this license of (at your option) any later version.
+ The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+ and version 1.3 or later is part of all distributions of LaTeX
+ version 2005/12/01 or later.
+
+ This work has the LPPL maintenance status `maintained'.
+
+ The Current Maintainer of this work is Nicola Talbot.
+
+ This work consists of the files tracklang.dtx and tracklang.ins and the derived files tracklang.sty, tracklang.tex.
+
+\endpreamble
+
+\askforoverwritefalse
+
+\generate{\file{tracklang.sty}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{tracklang.dtx}{tracklang.sty,package}}
+\file{tracklang.tex}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{tracklang.dtx}{tracklang.tex,package}}
+}
+
+\endbatchfile