%%
%% This is file `tex-locale-support.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% tex-locale.dtx  (with options: `tex-locale-support.def,package')
%% 
%%  tex-locale.dtx
%%  Copyright 2018 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 or (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 tex-locale.dtx and tex-locale.ins and the derived files tex-locale.sty, tex-locale.tex, tex-locale-scripts-enc.def, tex-locale-encodings.def, tex-locale-support.def.
%% 
%% \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         \~}
%% arara: xetex: {shell: on}
%% arara: xetex: {shell: on}
\@locale@ifsupportbabelorpoly
{}
{%
  \def\@locale@providemap#1#2{%
    \IfTrackedDialectHasMapping{#1}%
    {}%
    {\SetTrackedDialectLabelMap{#1}{#2}}%
  }%
  \@locale@providemap{bahasa}{bahasa}%
  \@locale@providemap{indonesian}{indonesian}%
  \@locale@providemap{indon}{indon}%
  \@locale@providemap{bahasam}{bahasam}%
  \@locale@providemap{malay}{malay}%
  \@locale@providemap{melayu}{melayu}%
  \@locale@providemap{USenglish}{USenglish}%
  \@locale@providemap{american}{american}%
  \@locale@providemap{UKenglish}{UKenglish}%
  \@locale@providemap{british}{british}%
  \@locale@providemap{canadian}{canadian}%
  \@locale@providemap{australian}{australian}%
  \@locale@providemap{newzealand}{newzealand}%
  \@locale@providemap{francais}{francais}%
  \@locale@providemap{canadien}{canadien}%
  \@locale@providemap{acadian}{acadian}%
  \@locale@providemap{austrian}{austrian}%
  \@locale@providemap{germanb}{germanb}%
  \@locale@providemap{ngerman}{ngerman}%
  \@locale@providemap{naustrian}{naustrian}%
  \@locale@providemap{nswissgerman}{nswissgerman}%
  \@locale@providemap{swissgerman}{swissgerman}%
  \@locale@providemap{polutonikogreek}{greek}%
  \@locale@providemap{nynorsk}{nynorsk}%
  \@locale@providemap{portuguese}{portuguese}%
  \@locale@providemap{brazilian}{brazilian}%
  \@locale@providemap{brazil}{brazil}%
     \def\@locale@bbl@options{}%
     \ForEachTrackedDialect{\this@dialect}%
     {%
       \edef\this@root@lang{%
         \TrackedLanguageFromDialect{\this@dialect}}%
       \IfFileExists{\this@root@lang.ldf}
       {%
         \ifdefstring{\this@root@lang}{serbian}%
         {%
           \@locale@loadscripts
           \IfTrackedDialectIsScriptCs{\this@dialect}%
           {\TrackLangScriptLatn}%
           {\def\locale@bbl@dialect{serbian}}%
           {\def\locale@bbl@dialect{serbianc}}%
         }%
         {%
           \IfFileExists{\this@dialect.ldf}%
           {%
             \let\locale@bbl@dialect\this@dialect
           }%
           {%
             \IfTrackedDialectHasMapping{\this@dialect}%
             {%
               \edef\locale@bbl@dialect{%
                 \GetTrackedDialectToMapping{\this@dialect}}%
             }%
             {%
               \let\locale@bbl@dialect\this@root@lang
             }%
           }%
         }%
         \SetTrackedDialectLabelMap{\this@dialect}{\locale@bbl@dialect}%
         \ifx\this@dialect\LocaleMainDialect
           \ifx\@locale@bbl@options\empty
             \edef\@locale@bbl@options{main=\locale@bbl@dialect}%
           \else
             \edef\@locale@bbl@options{\@locale@bbl@options,%
               main=\locale@bbl@dialect}%
           \fi
         \else
           \ifx\@locale@bbl@options\empty
             \edef\@locale@bbl@options{\locale@bbl@dialect}%
           \else
             \edef\@locale@bbl@options{\@locale@bbl@options,%
               \locale@bbl@dialect}%
           \fi
         \fi
       }%
       {}%
     }%
     \ifx\@locale@bbl@options\@empty
       \ifTeXOSQueryDryRun
         \@locale@err{Can't determine `babel' package
          options\MessageBreak (texosquery's dry run mode is on)}{}
       \else
         \@locale@err{Can't determine `babel' package
          options (perhaps the shell escape failed, check
          `\jobname.log')}{}
       \fi
     \else
        \expandafter\PassOptionsToPackage\expandafter
           {\@locale@bbl@options}{babel}
        \RequirePackage{babel}%
     \fi
}%
{%
   \def\@set@locale@poly@map@script#1#2#3{%
     \@tracklang@namedef{@local@poly@map@script@#1@#2}{#3}%
   }
   \def\@if@locale@poly@map@script#1#2#3#4{%
     \@tracklang@ifundef{@local@poly@map@script@#1@#2}{#4}{#3}%
   }
   \def\@get@locale@poly@map@script#1#2{%
     \@tracklang@nameuse{@local@poly@map@script@#1@#2}%
   }
   \def\@set@locale@poly@map@region#1#2#3{%
     \@tracklang@namedef{@local@poly@map@region@#1@#2}{#3}%
   }
   \def\@if@locale@poly@map@region#1#2#3#4{%
     \@tracklang@ifundef{@local@poly@map@region@#1@#2}{#4}{#3}%
   }
   \def\@get@locale@poly@map@region#1#2{%
     \@tracklang@nameuse{@local@poly@map@region@#1@#2}%
   }
   \def\@set@locale@poly@map@variant#1#2#3{%
     \@tracklang@namedef{@local@poly@map@variant@#1@#2}{#3}%
   }
   \def\@if@locale@poly@map@variant#1#2#3#4{%
     \@tracklang@ifundef{@local@poly@map@variant@#1@#2}{#4}{#3}%
   }
   \def\@get@locale@poly@map@variant#1#2{%
     \@tracklang@nameuse{@local@poly@map@variant@#1@#2}%
   }
   \def\@set@locale@poly@map@sublang#1#2#3{%
     \@tracklang@namedef{@local@poly@map@sublang@#1@#2}{#3}%
   }
   \def\@if@locale@poly@map@sublang#1#2#3#4{%
     \@tracklang@ifundef{@local@poly@map@sublang@#1@#2}{#4}{#3}%
   }
   \def\@get@locale@poly@map@sublang#1#2{%
     \@tracklang@nameuse{@local@poly@map@sublang@#1@#2}%
   }
   \@set@locale@poly@map@region{arabic}{IQ}{locale=mashriq}
   \@set@locale@poly@map@region{arabic}{SY}{locale=mashriq}
   \@set@locale@poly@map@region{arabic}{JO}{locale=mashriq}
   \@set@locale@poly@map@region{arabic}{LB}{locale=mashriq}
   \@set@locale@poly@map@region{arabic}{PS}{locale=mashriq}
   \@set@locale@poly@map@region{arabic}{LY}{locale=libya}
   \@set@locale@poly@map@region{arabic}{DZ}{locale=algeria}
   \@set@locale@poly@map@region{arabic}{TN}{locale=tunisia}
   \@set@locale@poly@map@region{arabic}{MA}{locale=morocco}
   \@set@locale@poly@map@region{arabic}{MR}{locale=mauritania}
   \@set@locale@poly@map@variant{arabic}{islamic}{calendar=islamic}
   \@set@locale@poly@map@variant{arabic}{maghrib}{numerals=maghrib}
   \@set@locale@poly@map@variant{arabic}{abjad}{abjadjimnotail}
   \@set@locale@poly@map@variant{bengali}{western}{numerals=Western}
   \@set@locale@poly@map@variant{bengali}{devanagari}{numerals=Devanagari}
   \@set@locale@poly@map@variant{bengali}{bengali}{numerals=Bengali}
   \@set@locale@poly@map@region{english}{US}{variant=us}
   \@set@locale@poly@map@region{english}{GB}{variant=uk}
   \@set@locale@poly@map@region{english}{AU}{variant=australian}
   \@set@locale@poly@map@region{english}{NZ}{variant=newzealand}
   \@set@locale@poly@map@variant{farsi}{western}{numerals=western}
   \@set@locale@poly@map@variant{farsi}{eastern}{numerals=eastern}
   \@set@locale@poly@map@region{german}{DE}{variant=german}
   \@set@locale@poly@map@region{german}{AU}{variant=austrian}
   \@set@locale@poly@map@region{german}{CH}{variant=swiss}
   \@set@locale@poly@map@variant{german}{1996}{spelling=new}
   \@set@locale@poly@map@variant{german}{1901}{spelling=old}
   \@set@locale@poly@map@script{german}{Latf}{script=fraktur}
   \@set@locale@poly@map@variant{greek}{monoton}{variant=monotonic}
   \@set@locale@poly@map@variant{greek}{polyton}{variant=polytonic}
   \@set@locale@poly@map@variant{greek}{ancient}{variant=ancient}
   \@set@locale@poly@map@variant{greek}{arabic}{numerals=arabic}
   \@set@locale@poly@map@variant{hebrew}{arabic}{numerals=arabic}
   \@set@locale@poly@map@variant{hebrew}{gregorian}{calendar=gregorian}
   \@set@locale@poly@map@variant{hindi}{western}{numerals=Western}
   \@set@locale@poly@map@variant{hindi}{devanagari}{numerals=Devanagari}
   \@set@locale@poly@map@variant{latin}{classic}{variant=classic}
   \@set@locale@poly@map@variant{latin}{modern}{variant=modern}
   \@set@locale@poly@map@variant{latin}{medieval}{variant=medieval}
   \@set@locale@poly@map@sublang{russian}{orv}{spelling=old}
   \@set@locale@poly@map@variant{russian}{luna1918}{spelling=new}
   \@set@locale@poly@map@script{serbian}{Latn}{script=Latin}
   \@set@locale@poly@map@script{serbian}{Cyrl}{script=Cyrillic}
   \@set@locale@poly@map@variant{syriac}{western}{numerals=western}
   \@set@locale@poly@map@variant{syriac}{eastern}{numerals=eastern}
     \RequirePackage{polyglossia}
     \ForEachTrackedDialect{\this@dialect}%
     {%
       \edef\this@root@lang{%
         \TrackedLanguageFromDialect{\this@dialect}}%
       \edef\this@sublang{%
         \GetTrackedDialectSubLang{\this@dialect}}%
       \edef\this@region{%
         \TrackedIsoCodeFromLanguage{3166-1}{\this@dialect}}%
       \edef\this@script{%
         \GetTrackedDialectScript{\this@dialect}}%
       \edef\this@variant{%
         \GetTrackedDialectVariant{\this@dialect}}%
     \def\@locale@poly@options{}%
     \ifx\this@script\empty
     \else
       \@if@locale@poly@map@script{\this@root@lang}{\this@script}%
       {%
         \edef\@locale@poly@options{%
           \@get@locale@poly@map@script
             {\this@root@lang}{\this@script}}%
       }%
       {}%
     \fi
     \ifx\this@region\empty
     \else
       \@if@locale@poly@map@region{\this@root@lang}{\this@region}%
       {%
         \ifx\@locale@poly@options\empty
           \edef\@locale@poly@options{%
             \@get@locale@poly@map@region{\this@root@lang}{\this@region}}%
         \else
           \edef\@locale@poly@options{\@locale@poly@options,%
             \@get@locale@poly@map@region{\this@root@lang}{\this@region}}%
         \fi
       }%
       {}%
     \fi
     \ifx\this@sublang\empty
     \else
       \@if@locale@poly@map@sublang{\this@root@lang}{\this@sublang}%
       {%
         \ifx\@locale@poly@options\empty
           \edef\@locale@poly@options{%
             \@get@locale@poly@map@sublang
               {\this@root@lang}{\this@sublang}}%
         \else
           \edef\@locale@poly@options{\@locale@poly@options,%
             \@get@locale@poly@map@sublang
               {\this@root@lang}{\this@sublang}}%
         \fi
       }%
       {}%
     \fi
     \ifx\this@subvariant\empty
     \else
       \@if@locale@poly@map@variant{\this@root@lang}{\this@variant}%
       {%
         \ifx\@locale@poly@options\empty
           \edef\@locale@poly@options{%
             \@get@locale@poly@map@variant
               {\this@root@lang}{\this@variant}}%
         \else
           \edef\@locale@poly@options{\@locale@poly@options,%
             \@get@locale@poly@map@variant
               {\this@root@lang}{\this@variant}}%
         \fi
       }%
       {}%
     \fi
     \ifx\this@dialect\LocaleMainDialect
       \edef\@locale@tmp{\noexpand\setmainlanguage
           [\@locale@poly@options]{\this@root@lang}}%
     \else
        \edef\@locale@tmp{\noexpand\setotherlanguage
           [\@locale@poly@options]{\this@root@lang}}%
     \fi
     \@locale@tmp
   }%
   \def\localenopolypunct{\@locale@nopolypunct}%
}
\endinput
%%
%% End of file `tex-locale-support.def'.
