\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{regions2}[2026/05/18 v1.6.7 (NLCT) Sample package to test tracklang.sty]

\RequirePackage{tracklang}[2016/10/07]

\DeclareOption*{\TrackLanguageTag{\CurrentOption}}
\ProcessOptions*

\newcommand*{\weightunit}{kg}
\newcommand*{\lengthunit}{mm}
\newcommand*{\currencyunit}{EUR}

\newcommand*{\unitname}{units}

\newcommand*{\defaultunits}{%
  \renewcommand*{\weightunit}{kg}%
  \renewcommand*{\lengthunit}{mm}%
  \renewcommand*{\currencyunit}{EUR}%
}

\newcommand*{\RequireRegionsDialect}[1]{%
    \TrackLangRequireDialect
    [\TrackLangRequireResource{\CurrentTrackedTag}%
      \ifx\CurrentTrackedTag\CurrentTrackedLanguage
        \ifx\CurrentTrackedRegion\empty
         \TrackLangAddToCaptions{\defaultunits}%
        \else
          \TrackLangRequireResource{\CurrentTrackedRegion}%
        \fi
      \else
        \TrackLangRequireResource{\CurrentTrackedLanguage}%
      \fi
    ]%
    {regions}{#1}%
}

\AnyTrackedLanguages
{%
  \ForEachTrackedDialect{\this@dialect}{%
    \RequireRegionsDialect\this@dialect
  }%
}
{% no tracked languages, default already set up
}

\endinput
