% arara: pdflatex
\documentclass{article}

\usepackage{tracklang}

% This sample file illustrates assigning a tracklang to babel map.
% NB ngerman babel option now discouraged but the captions hook
% is still \captionsngerman so the tracklang dialect label here
% needs to be mapped to "ngerman".

\TrackLanguageTag{de-US-1996}
\SetTrackedDialectLabelMap{\TrackLangLastTrackedDialect}{ngerman}

\TrackLanguageTag{en-MT}

\usepackage[main=ngerman,english]{babel}
\usepackage{regions2}

\newcommand{\test}[1]{%
 \section{#1}
 \selectlanguage{#1}%
 \SetCurrentTrackedDialect{#1}%
 Language tag: \CurrentTrackedLanguageTag.
 (tracklang dialect label: \CurrentTrackedDialect.)

 \unitname: \weightunit, \lengthunit, \currencyunit.
}

\begin{document}
\test{ngerman}

\test{english}

\end{document}
