texlive[52808] Master/texmf-dist: polyglossia (15nov19)

commits+karl at tug.org commits+karl at tug.org
Fri Nov 15 22:41:34 CET 2019


Revision: 52808
          http://tug.org/svn/texlive?view=revision&revision=52808
Author:   karl
Date:     2019-11-15 22:41:34 +0100 (Fri, 15 Nov 2019)
Log Message:
-----------
polyglossia (15nov19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/polyglossia/README
    trunk/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf
    trunk/Master/texmf-dist/doc/latex/polyglossia/example-arabic.tex
    trunk/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf
    trunk/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf
    trunk/Master/texmf-dist/doc/latex/polyglossia/examples.pdf
    trunk/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf
    trunk/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex
    trunk/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
    trunk/Master/texmf-dist/tex/latex/polyglossia/babelsh.def
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua
    trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-acadien.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-american.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-australian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-austrian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasa.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bosnian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-british.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-canadian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-canadien.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-germanb.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinclassic.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinecclesiastic.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinmedieval.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-lowersorbian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-naustrian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-newzealand.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-ngerman.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-nswissgerman.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-polutonikogreek.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-serbianc.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovene.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-spanishmx.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-swissgerman.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-uppersorbian.ldf
    trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-french.lua
    trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-latin.lua
    trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua
    trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-sanskrit.lua
    trunk/Master/texmf-dist/tex/latex/polyglossia/xpg-cyrillicnumbers.sty

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/polyglossia/gloss-latin.pdf
    trunk/Master/texmf-dist/tex/latex/polyglossia/cyrillicnumbers.sty
    trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua

Modified: trunk/Master/texmf-dist/doc/latex/polyglossia/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/polyglossia/README	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/doc/latex/polyglossia/README	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,7 +1,7 @@
 
    ¦----------------------------------------------¦
    ¦                                              ¦
-   ¦       THE POLYGLOSSIA PACKAGE v1.45          ¦
+   ¦       THE POLYGLOSSIA PACKAGE v1.46          ¦
    ¦                                              ¦
    ¦     Modern multilingual typesetting          ¦
    ¦        with XeLaTeX and LuaLaTeX             ¦
@@ -10,8 +10,8 @@
 
 This package provides an alternative to Babel for users of XeLaTeX and LuaLaTeX
 (with a few languages incompletely supported for the latter). This version
-includes support for 75 different languages, some of which in different regional,
-national or scriptal varieties.
+includes support for 79 different languages, some of which in different
+regional or national varieties, or using a different writing system.
 
 Polyglossia makes it possible to automate the following tasks:
 
@@ -34,20 +34,16 @@
 
 LICENSE
 
-Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2019 Arthur Reutenauer
+Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2019 Arthur Reutenauer,
+Copyright (c) 2019 Bastien Roucariès, 2019 Jürgen Spitzmüller
 
-Polyglossia is placed under the terms of the LaTeX Project Public Licence
-(LPPL), either version 1.3, or, at your option, any later version.  See
-LICENCE.txt for the text of the LPPL v1.3c, or
-http://www.latex-project.org/lppl.txt for the latest version.
+Except where otherwise noted, Polyglossia is placed under the terms of the MIT licence
+(https://opensource.org/licenses/MIT).
 
-This work has the LPPL maintenance status ‘maintained’.  The current maintainer is
-Arthur Reutenauer.
-
 BUGS
 
 If you run into a bug, or suspect you do, or you have a request or comment, please
 use the GitHub issue tracker: http://github.com/reutenauer/polyglossia/issues
 
-This is more efficient than contacting me by email as it allows me to track the
-issues and follow progress.
+This is more efficient than contacting the maintainer by email as it allows me
+to track the issues and follow progress.

Modified: trunk/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/polyglossia/example-arabic.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/polyglossia/example-arabic.tex	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/doc/latex/polyglossia/example-arabic.tex	2019-11-15 21:41:34 UTC (rev 52808)
@@ -38,7 +38,7 @@
 مباشرا أو غير مباشر على كثير من اللغات الأخرى في العالم الإسلامي، كالتركية
 والفارسية والأردية مثلا.
 
-\textfarsi{\bfseries فارسی}\footnote{%
+\textlang{farsi}{\bfseries فارسی}\footnote{%
 از «\LR{\textenglish{\url{http://fa.wikipedia.org/wiki/}}\RL{\ttfamily فارسي}}»}
 \begin{farsi}
 یا پارسی، (که دری، فارسی دری، و پارسی دری نیز نامیده می‌شود) زبانی است که

Modified: trunk/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/polyglossia/examples.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/polyglossia/gloss-latin.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex	2019-11-15 21:41:34 UTC (rev 52808)
@@ -4,6 +4,7 @@
 \usepackage{color}
 \usepackage{xspace,fancyvrb,booktabs}
 \usepackage[neverdecrease]{paralist}
+\usepackage[format=hang,labelfont=bf,labelsep=period]{caption}
 \definecolor{myblue}{rgb}{0.02,0.04,0.48}
 \definecolor{lightblue}{rgb}{0.61,.8,.8}
 \definecolor{myred}{rgb}{0.65,0.04,0.07}
@@ -26,7 +27,7 @@
 \usepackage[babelshorthands]{polyglossia}
 \usepackage{farsical}
 \setmainlanguage[variant=british,ordinalmonthday=false]{english}
-\setotherlanguages{arabic,armenian,hebrew,syriac,greek,russian,serbian,catalan}
+\setotherlanguages{arabic,armenian,hebrew,syriac,greek,russian,serbian,catalan,georgian}
 \usepackage[protrusion]{microtype}
 \newcommand*\Cmd[1]{\cmd{#1}\DescribeMacro{#1}\xspace}
 \newcommand*\pkg[1]{\textsf{\color{myblue}#1}}
@@ -77,6 +78,7 @@
 \newfontfamily\armenianfont[Script=Armenian]{DejaVu Sans}
 \newfontfamily\syriacfont[Script=Syriac]{Serto Jerusalem}
 \newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL}
+\newfontfamily\georgianfont{DejaVu Serif}
 
 \linespread{1.05}
 \frenchspacing
@@ -102,7 +104,9 @@
 \maketitle
 \tableofcontents
 
+\condbreak{4\baselineskip}
 
+
 \DeleteShortVerb{\|}
 \MakeShortVerb{\¦}
 
@@ -132,8 +136,8 @@
       calendars are supported).
 \item For languages that have their own numbering system, modifying the formatting
       of numbers appropriately (this also includes redefining the alphabetic sequence
-      for non-Latin alphabets).\footnote{ %
-        For the Arabic script this is now done by the bundled package \pkg{arabicnumbers}.}
+      for non-Latin alphabets).\footnote{%
+        This is done by bundled sub-packages such as \pkg{arabicnumbers}.}
 \item Ensuring proper directionality if the document contains languages
       that are written from right to left (via the package \pkg{bidi},
       available separately).
@@ -182,48 +186,47 @@
 \subsection{Supported languages}
 
 Table~\ref{tab:lang} lists all languages currently supported.
-Those in red have specific options and/or commands
+Those in \TR{red} have specific options and/or commands
 that are explained in section \ref{specific} below.
 
 \begin{table}[ht]\centering
-\label{tab:lang}
-% Produced with tools/insert-language-list.rb -- JS, 2019-10-18
-% Edited by hand -- JS, 2019-10-18
+\caption{\label{tab:lang}Languages currently supported in \pkg{polyglossia}}
+% Produced with tools/insert-language-list.rb -- JS, 2019-11-01
+% Edited by hand -- JS, 2019-11-01
 \begin{tabular}{lllll}
 \toprule
-albanian     & \TX{dutch}     & interlingua  & \TX{mongolian}  & \TX{slovenian}\\
-amharic      & \TX{english}   & \TX{italian} & nko             & \TX{sorbian}\\
-\TX{arabic}  & \TX{esperanto} & japanese     & \TX{norwegian}  & spanish\\
-\TX{armenian}& estonian       & kannada      & occitan         & swedish\\
-asturian     & \TX{finnish}   & khmer        & \TX{persian}    & \TX{syriac}\\
-basque       & \TX{french}    & \TX{korean}  & piedmontese     & tamil\\
-\TX{bengali} & friulian       & \TX{kurdish} & polish          & telugu\\
-breton       & \TX{gaelic}    & \TX{lao}     & \TX{portuguese} & \TX{thai}\\
-bulgarian    & galician       & \TX{latin}   & romanian        & \TX{tibetan}\\
-\TX{catalan} & \TX{german}    & latvian      & romansh         & turkish\\
-coptic       & \TX{greek}     & lithuanian   & \TX{russian}    & turkmen\\
-croatian     & \TX{hebrew}    & macedonian   & \TX{sami}       & \TX{ukrainian}\\
-\TX{czech}   & \TX{hindi}     & \TX{malay}   & \TX{sanskrit}   & urdu\\
-danish       & \TX{hungarian} & malayalam    & \TX{serbian}    & vietnamese\\
-divehi       & icelandic      & marathi      & slovak          & \TX{welsh}\\
+\TX{afrikaans}  & danish         & \TX{hungarian} & marathi         & \TX{slovenian} \\
+albanian        & divehi         & icelandic      & \TX{mongolian}  & \TX{sorbian}   \\
+amharic         & \TX{dutch}     & interlingua    & nko             & \TX{spanish}   \\
+\TX{arabic}     & \TX{english}   & \TX{italian}   & \TX{norwegian}  & swedish        \\
+\TX{armenian}   & \TX{esperanto} & japanese       & occitan         & \TX{syriac}    \\
+asturian        & estonian       & kannada        & \TX{persian}    & tamil          \\
+basque          & \TX{finnish}   & khmer          & piedmontese     & telugu         \\
+\TX{belarusian} & \TX{french}    & \TX{korean}    & polish          & \TX{thai}      \\
+\TX{bengali}    & friulian       & \TX{kurdish}   & \TX{portuguese} & \TX{tibetan}   \\
+bosnian         & \TX{gaelic}    & \TX{lao}       & romanian        & turkish        \\
+breton          & galician       & \TX{latin}     & romansh         & turkmen        \\
+bulgarian       & \TX{georgian}  & latvian        & \TX{russian}    & \TX{ukrainian} \\
+\TX{catalan}    & \TX{german}    & lithuanian     & \TX{sami}       & urdu           \\
+coptic          & \TX{greek}     & macedonian     & \TX{sanskrit}   & vietnamese     \\
+croatian        & \TX{hebrew}    & \TX{malay}     & \TX{serbian}    & \TX{welsh}     \\
+\TX{czech}      & \TX{hindi}     & malayalam      & \TX{slovak}     &                \\
 \bottomrule
 \end{tabular}
 
-
-\caption{Languages currently supported in \pkg{polyglossia}}
 \end{table}
 
 \paragraph{Version Notes} The support for Amharic\new{v1.0.1} should be considered an experimental attempt to
-port the package \pkg{ethiop}.\footnote{Feedback is welcome.}
+port the package \pkg{ethiop}; feedback is welcome.
 Version 1.1.1\new{v1.1.1} added support for Asturian, %\footnote{ Provided by Kevin Godby and Xuacu Saturio.}, 
 Lithuanian, %\footnote{ Provided by Kevin Godby and Paulius Sladkevičius.},
 and Urdu. %\footnote{ Provided by Kamal Abdali.}
 %
-Version 1.2\new{v1.2.0} adds support for Armenian, Occitan, Bengali,
+Version 1.2\new{v1.2.0} introduced Armenian, Occitan, Bengali,
 Lao, Malayalam, Marathi, Tamil, Telugu, and Turkmen.\footnote{%
   See acknowledgements at the end for due credit to the various contributors.}
-Version 1.43\new{v1.43} silently introduced basic support for Japanese. This
-is considered experimental, and feedback is appreciated.
+Version 1.43\new{v1.43} brought basic support for Japanese (this
+is considered experimental, feedback is appreciated).
 In version 1.45\new{v1.45}, support for Kurdish and Mongolian as well as some new
 variants (Canadian French and English) have been added. Furthermore,  for consistency reasons, some language have
 been renamed (\emph{farsi}\textrightarrow\emph{persian}, \emph{friulan}\textrightarrow\emph{friulian},
@@ -233,68 +236,84 @@
 \emph{lsorbian}\slash\emph{usorbian}\textrightarrow\emph{sorbian},
 \emph{irish}\slash\emph{scottish}\textrightarrow\emph{gaelic},
 \emph{norsk}\slash\emph{nynorsk}\textrightarrow\emph{norwegian}). The old names are still supported for backwards
-compatibility reasons, but they might not give access to newer language features.
+compatibility reasons.
+Version 1.46\new{v1.46} introduces support for Afrikaans, Belarusian, Bosnian and Georgian.
 
 
-\subsection{Relation to Babel languages}
+\subsection{Relation to and use of Babel language names}
 
 If you are familiar with the \pkg{babel} package, you will note that \pkg{polyglossia}'s language naming
 slightly differs. Whereas \pkg{babel} has a unique name for each language variety (\eg\emph{american} and \emph{british}),
-\pkg{polyglossia} differentiates language varieties via language options.
+\pkg{polyglossia} differentiates language varieties via language options (\eg \emph{english}, ¦variant=american¦).
 
-Furthermore, \pkg{babel} uses sometimes abbreviations for language names (\eg\emph{bahasam} for Bahasa Malayu) as well
+Furthermore, \pkg{babel} sometimes uses abbreviated language names (\eg\emph{bahasam} for Bahasa Malayu) as well
 as endonyms, \ie language names coming from the designated languages (such as \emph{bahasa}, \emph{canadien} or \emph{magyar}).
 As opposed to this, \pkg{polyglossia} always uses spelled-out (lower-cased) English language names.
+Please refer to table~\ref{tab:bbllang} for the differing language names in both packages. 
 
-Table~\ref{tab:bbllang} lists the language names that differ in both packages. \pkg{Babel} names marked in red can also be used
-in \pkg{polyglossia} as an alias.\footnote{This is for historical reasons, since earlier versions of \pkg{polyglossia} used
-	those names as well. Note, however, that you need to use the matching language switching commands, then, as
-    well, \eg \cmd\textportuges\ with \emph{portuges} (rather than \cmd\textportuguese).}
+\begin{table}
+\caption{\label{tab:bbllang}Babel-polyglossia language name matching}
 
-\begin{table}
-\label{tab:bbllang}
+\begin{minipage}[t]{1\columnwidth}
+\small\centering
 \begin{tabular}{lll}
 \toprule 
 \textbf{Babel name} & \textbf{Polyglossia name} & \textbf{Polyglossia options}\tabularnewline
 \midrule
-acadien         & french     & variant=acadian                \\
-american        & english    & \emph{(default)}               \\
-australian      & english    & variant=australian             \\
-austrian        & german     & variant=austrian, spelling=old \\
-bahasa          & malay      & \emph{(default)}               \\
-\TR{bahasam}    & malay      & variant=malaysian              \\
-\TR{brazil}     & portuguese & variant=brazilian              \\
-british         & english    & variant=british                \\
-canadian        & english    & variant=canadian               \\
-canadien        & french     & variant=canadian               \\
-\TR{farsi}      & persian    &                                \\
-\TR{friulan}    & friulian   &                                \\
-german          & german     & spelling=old                   \\
-\TR{irish}      & gaelic     & variant=irish                  \\
-kurmanji        & kurdish    & variant=kurmanji               \\
-lowersorbian    & sorbian    & variant=lower                  \\
-\TR{magyar}     & hungarian  &                                \\
-naustrian       & german     & variant=austrian               \\
-newzealand      & english    & variant=newzealand             \\
-ngerman         & german     & \emph{(default)}               \\
-\TR{norsk}      & norwegian  & variant=bokmal                 \\
-nswissgerman    & german     & variant=swiss                  \\
-\TR{nynorsk}    & norwegian  & \emph{(default)}               \\
-polutonikogreek & greek      & variant=polytonic              \\
-\TR{portuges}   & portuguese & \emph{(default)}               \\
-\TR{samin}      & sami       &                                \\
-\TR{scottish}   & gaelic     & variant=scottish               \\
-serbianc        & serbian    & script=Cyrillic                \\
-slovene         & slovenian  &                                \\
-swissgerman     & german     & variant=swiss, spelling=old    \\
-uppersorbian    & sorbian    & variant=upper                  \\
+acadien            & french     & variant=acadian                     \\
+american           & english    & variant=american [\emph{default}]   \\
+australian         & english    & variant=australian                  \\
+austrian           & german     & variant=austrian, spelling=old      \\
+bahasa             & malay      & variant=indonesian [\emph{default}] \\
+bahasam            & malay      & variant=malaysian                   \\
+brazil             & portuguese & variant=brazilian                   \\
+british            & english    & variant=british                     \\
+canadian           & english    & variant=canadian                    \\
+canadien           & french     & variant=canadian                    \\
+farsi              & persian    &                                     \\
+friulan            & friulian   &                                     \\
+german\footnote{Due to the name conflict only available in \pkg{polyglossia} as \emph{germanb} (which is a \pkg{babel} synonym).}
+                   & german     & spelling=old                        \\
+irish              & gaelic     & variant=irish [\emph{default}]      \\
+kurmanji           & kurdish    & variant=kurmanji                    \\
+latin.classic\footnote{Available in \pkg{polyglossia} as \emph{latinclassic} (as dots are invalid in command names).}
+                   & latin      & variant=classic                     \\
+latin.ecclesiastic\footnote{Available in \pkg{polyglossia} as \emph{latinecclesiastic} (as dots are invalid in command names).}
+                   & latin      & variant=ecclesiastic                \\
+latin.medieval\footnote{Available in \pkg{polyglossia} as \emph{latinmedieval} (as dots are invalid in command names).}
+                   & latin      & variant=medieval                    \\
+lowersorbian       & sorbian    & variant=lower                       \\
+magyar             & hungarian  &                                     \\
+naustrian          & german     & variant=austrian                    \\
+newzealand         & english    & variant=newzealand                  \\
+ngerman            & german     & variant=german [\emph{default}]     \\
+norsk              & norwegian  & variant=bokmal                      \\
+nswissgerman       & german     & variant=swiss                       \\
+nynorsk            & norwegian  & variant=nynorsk [\emph{default}]    \\
+polutonikogreek    & greek      & variant=polytonic                   \\
+portuges           & portuguese & variant=portuguese [\emph{default}] \\
+samin              & sami       &                                     \\
+scottish           & gaelic     & variant=scottish                    \\
+serbianc           & serbian    & script=Cyrillic                     \\
+slovene            & slovenian  &                                     \\
+spanishmx          & spanish    & variant=mexican                     \\
+swissgerman        & german     & variant=swiss, spelling=old         \\
+uppersorbian       & sorbian    & variant=upper                       \\
 \bottomrule
 \end{tabular}
+\end{minipage}
 	
-\caption{Babel-polyglossia language name matching}
 \end{table}
 
+For convenience reasons, \pkg{polyglossia} also supports the use of babel names\new{v1.46} (for the few justified
+exceptions, please refer to the notes in table~\ref{tab:bbllang}).
+The babel names listed in table~\ref{tab:bbllang} can be used instead of the corresponding polyglossia
+name\slash options in \cmd\setdefaultlanguage\ and \cmd\setotherlanguage\ as well as in the \pkg{polyglossia} and
+\pkg{babel} language switching commands\slash environments documented in section~\ref{sec:langcmds} and
+\ref{sec:babelcmds} (\eg \cmd\textaustrian\ is synonymous to \cmd{\textgerman[variant=austrian,spelling=old]}).
+However, unless you have special reasons, we strongly encourage you to use the \pkg{polyglossia} names.
 
+
 \subsection{Global options}
 
 \pkg{Polyglossia} can be loaded with the following global package options:
@@ -301,52 +320,62 @@
 
 \begin{itemize}
 	\item \TB{babelshorthands}\new{v1.1.1} globally activates \pkg{babel}
-          shorthands whenever available. Currently shorthands are implemented for
-          Catalan, Czech, Dutch, Finnish, German, Italian, Mongolian, and Russian.
-          Please refer to the respective language descriptions (sec.~\ref{specific}) for details.
+		shorthands whenever available. Currently shorthands are implemented for
+		Afrikaans, Belarusian, Catalan, Czech, Dutch, Finnish, Georgian, German,
+		Italian, Latin, Mongolian, Russian, and Slovak. Please refer to the respective
+		language descriptions (sec.~\ref{specific}) for details.
 
-    \item \TB{localmarks} redefines the internal \LaTeX\ macros \cmd\markboth\ and \cmd\markright.
-          In earlier versions of \pkg{polyglossia},\new{v1.2.0} this option was set by default, but we
-          now realize that it causes more problems than it helps, so it is now off by default.
-          For backwards-compatibility, the option \TB{nolocalmarks} which used to switch off the previous
-          default, and now does nothing, is still available.
+	\item \TB{localmarks} redefines the internal \LaTeX\ macros \cmd\markboth\ and
+		\cmd\markright. In earlier versions of \pkg{polyglossia},\new{v1.2.0} this
+		option was set by default, but we now realize that it causes more problems
+		than it helps, so it is now off by default.  For backwards-compatibility, the
+		option \TB{nolocalmarks} which used to switch off the previous default, and
+		now does nothing, is still available.
 
-    \item \TB{quiet} turns off most info messages and some of the warnings issued by \LaTeX,
-          \pkg{fontspec} and \pkg{polyglossia}.
+	\item \TB{quiet} turns off most info messages and some of the warnings issued
+		by \LaTeX, \pkg{fontspec} and \pkg{polyglossia}.
 \end{itemize}
 
 \section{Language-switching commands}\label{languageswitching}
 
-\subsection{Recommended commands}
+\subsection{Recommended commands}\label{sec:langcmds}
 For each activated language the command
 \cmd{\text⟨lang⟩[⟨options⟩]\{…\}} \DescribeMacro{\text⟨lang⟩}
+(as well as the synonymous \DescribeMacro{\textlang}%
+\cmd{\textlang[⟨options⟩]\{⟨lang⟩\}\{…\}}\new{1.46})
 becomes available for short insertions of text in that language.
-For example ¦\textrussian{\today}¦ yields \textrussian{\today}
-This command switches to the correct hyphenation patterns, it activates
+For example ¦\textrussian{\today}¦ and ¦\textlang{russian}{\today}¦ yield \textrussian{\today}
+The commands switch to the correct hyphenation patterns, they activate
 some extra features for the selected language (such as extra spacing before
-punctuation in French), and it translates the date when using ¦\today¦.
-It does not, however, translate so-called \textit{caption strings}, i.\,e.
+punctuation in French), and they translate the date when using ¦\today¦.
+They do not, however, translate so-called \textit{caption strings},\ie
 ``chapter'', ``figure'' etc., to the local language (these remain in the main
 language).
 
 The\DescribeEnv{⟨lang⟩}\ environment ¦⟨lang⟩¦, which is also available for any activated language,
-is meant for longer passages of text. It behaves slightly different than the \cmd{\text⟨lang⟩\{…\}}
-command: It does everything the latter does, but additionally, the caption strings are translated
-as well, and the language is also passed to auxiliary files, the table of contents and the lists of
-figures/tables.
-Like the command, the environment provides the possibility of setting language options locally.
+is meant for longer passages of text. It behaves slightly different than the \cmd{\text⟨lang⟩} and
+\cmd\textlang\ commands: It does everything the latter do, but additionally, the caption strings
+are translated as well, and the language is also passed to auxiliary files, the table of contents
+and the lists of figures/tables.
+Like the commands, the environment provides the possibility of setting language options locally.
 For instance the following allows us to quote the beginning
 of Homer’s \textit{Iliad}:
 
 \begin{Verbatim}[formatcom=\color{myblue}]
-\begin{greek}[variant=ancient]
-μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς ἄλγε'
-ἔθηκε, πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων, αὐτοὺς δὲ ἑλώρια
-τεῦχε κύνεσσιν οἰωνοῖσί τε πᾶσι, Διὸς δ' ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ
-πρῶτα διαστήτην ἐρίσαντε Ἀτρεί̈δης τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς.
-\end{greek}
+  \begin{quote}
+   \begin{greek}[variant=ancient]
+     μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς
+     ἄλγε' ἔθηκε, πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων,
+     αὐτοὺς δὲ ἑλώρια τεῦχε κύνεσσιν οἰωνοῖσί τε πᾶσι, Διὸς δ'
+     ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ πρῶτα διαστήτην ἐρίσαντε Ἀτρεί̈δης
+     τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς.
+   \end{greek}
+  \end{quote}
 \end{Verbatim}
 
+\vspace{-.5\baselineskip}
+
+\begin{quote}
 \begin{greek}[variant=ancient]
 μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς ἄλγε' ἔθηκε,
 πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων, αὐτοὺς δὲ ἑλώρια τεῦχε κύνεσσιν
@@ -353,13 +382,13 @@
 οἰωνοῖσί τε πᾶσι, Διὸς δ' ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ πρῶτα διαστήτην ἐρίσαντε
 Ἀτρεί̈δης τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς.
 \end{greek}
-\bigskip
+\end{quote}
 
 \noindent\DescribeEnv{Arabic} Note that for Arabic one cannot use the environment ¦arabic¦,
 as \cmd\arabic\ is defined internally by \LaTeX. In this case
 we need to use the environment ¦Arabic¦ instead.
 
-\subsection{Babel commands}
+\subsection{Babel commands}\label{sec:babelcmds}
 Some macros defined in \pkg{babel}’s \file{hyphen.cfg} (and thus usually
 compiled into the \XeLaTeX\ and \LuaLaTeX\ format) are redefined, but keep a
 similar behaviour.
@@ -373,7 +402,7 @@
 ¦\selectlanguage{⟨lang⟩}¦ and the ¦otherlanguage¦ environment are identical to the
 the ¦⟨lang⟩¦ environment, except that ¦\selectlanguage{⟨lang⟩}¦
 does not need to be explicitly closed. The command ¦\foreinlanguage{⟨lang⟩}{…}¦ and the ¦otherlanguage*¦
-environment are identical with the use of the ¦\text⟨lang⟩¦ command, with the one
+environment are identical with the use of the ¦\text⟨lang⟩¦ or ¦\textlang¦ command, with the one
 notable exception that they do not translate the date with ¦\today¦.
 
 Since the \XeLaTeX\ and \LuaLaTeX\ format incorporate \pkg{babel}’s \file{hyphen.cfg},
@@ -382,12 +411,13 @@
 
 \subsection{Other commands}
 The following commands are probably of lesser interest to the end user, but
-ought to be mentioned here.
+ought to be mentioned here.\footnote{Note that these commands require polyglossia
+language names; they do not support language\slash babel aliases.}
 \begin{itemize}
-\item \Cmd\selectbackgroundlanguage: this selects the global font setup and
-	the numbering definitions for the default language.
+\item \DescribeMacro{\selectbackgroundlanguage}\cmd{\selectbackgroundlanguage\{⟨lang⟩\}}:
+    this selects the global font setup and the numbering definitions for the default language.
 
-\item \Cmd\resetdefaultlanguage\ (experimental):
+\item \DescribeMacro{\resetdefaultlanguage}\cmd{\resetdefaultlanguage[⟨options⟩]\{⟨lang⟩\}} (experimental):
 	completely switches the default language
 	to another one in the middle of a document: \textit{this may have adverse effects}!
 
@@ -398,9 +428,34 @@
 
 \item \Cmd\latinalph: Representation of counter as a lower-case letter:  1 = a, 2 = b, etc.
 
-\item \Cmd\latinAlph: Representation of counter as a uper-case letter:  1 = A, 2 = B, etc.
+\item \Cmd\latinAlph: Representation of counter as a upper-case letter:  1 = A, 2 = B, etc.
 \end{itemize}
 
+
+\subsection{Setting up alias commands}
+
+By means of the macro
+\displaycmd{\setlanguagealias[⟨options⟩]\{⟨language⟩\}\{⟨alias⟩\}}{\setlanguagealias}\new{v1.46}
+you can define alias commands for specific language (variants). \Eg
+
+\begin{quote}
+\begin{verbatim}
+\setlanguagealias[variant=austrian]{german}{deAT}
+\end{verbatim}
+\end{quote}
+%
+will define a command \cmd{\textdeAT} as well as an environment ¦{deAT}¦ which will link towards
+the command \cmd{\textgerman[variant=austrian]} and the environment ¦{german}[variant=austrian]¦,
+respectively. The aliases can also be used in the language switching commands described in
+section~\ref{sec:langcmds} and \ref{sec:babelcmds}.
+Note, though, that the usual restrictions for command names apply, so something such as
+¦de-AT¦ or ¦de_AT¦ will not work since ¦-¦ and ¦_¦ are not allowed in command names.
+
+For the latter case, and for the case where an alias would clash with an existing \cmd{\text⟨...⟩}
+command (\eg ¦\textit¦), a starred version \Cmd{\setlanguagealias*} is provided which does not define
+a \cmd{\text⟨alias⟩} command (but which will set up the alias for everything else, including
+\cmd{\textlang\{⟨alias⟩\}}).
+
 \section{Font setup}
 
 With polyglossia it is possible to associate a specific font with any script or language
@@ -409,11 +464,12 @@
 For instance, if the default font defined by \cmd\setmainfont\
 does not support Greek, then one can define the font used to display Greek with:\\
 \centerline{ \cmd\newfontfamily\cmd{\greekfont[Script=Greek,⟨…⟩]\{⟨font⟩\}}. }
-Note that polyglossia will use the font thus defined as is.
-for instance if ¦\arabicfont¦ is explicitly defined, then one should take care of
-including the option ¦Script=Arabic¦ in that definition.
-See the \pkg{fontspec} documentation for more information.
-If a specific sans or monospace font is needed for a particular script or language,
+Note that polyglossia will use the font defined as is, so assure to do all necessary settings
+(please refer to the \pkg{fontspec} documentation for details).
+For instance, if ¦\arabicfont¦ is explicitly defined, then the option ¦Script=Arabic¦ should
+be included in that definition.
+
+If a specific sans serif or monospace (`teletype') font is needed for a particular script or language,
 it can be defined by means of \new{v1.2.0}
 ¦\⟨script⟩fontsf¦\ or ¦\⟨language⟩fontsf¦ and ¦\⟨script⟩fonttt¦\ or ¦\⟨language⟩fonttt¦, respectively.
 
@@ -442,7 +498,7 @@
 \end{Verbatim}
 %
 These exceptions, however, apply to all languages. In addition to this, \pkg{polyglossia} provides
-the command\new{v.1.45}
+the command\new{v1.45}
 \displaycmd{\pghyphenation[⟨options⟩]\{⟨lang⟩\}\{⟨exceptions⟩\}}{\pghyphenation}
 which can be used to define exceptions that only apply to a specific language or language variant,
 respectively.
@@ -463,6 +519,24 @@
 
 %\subsection{amharic}\label{amharic}
 
+\subsection{afrikaans}\label{afikaans}
+\paragraph*{Options:}
+\begin{itemize}
+	\item \TB{babelshorthands} = \textit{false} or true. \new{v1.1.1}
+	if this is turned on, the following shorthands defined for fine-tuning hyphenation and
+	micro-typography of Afrikaans words are activated:
+	\begin{shorthands}
+		\item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+		in the hyphenation patterns (as opposed to ¦\-¦ in default \TeX).
+		\item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+		cases where the hyphen should stick at the following syllable.
+		\item[¦"|¦] disables a ligature at this position.
+		\item[¦""¦] allows for a line break at this position (without hyphenation sign).
+		\item[¦"/¦] a slash that allows for a subsequent line break. As opposed to ¦\slash¦,
+		hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
+	\end{shorthands}
+\end{itemize}
+
 \subsection{arabic}\label{arabic}
 \paragraph*{Options:}
 	\begin{itemize}
@@ -494,6 +568,42 @@
 	\item \TB{numerals}\new{v1.45} = armenian or \textit{arabic}
 \end{itemize}
 
+\subsection[belarusian]{belarusian\new{v1.46}}\label{belarusian}
+
+\paragraph*{Options:}
+\begin{itemize}
+	\item \TB{babelshorthands} = \textit{false} or true.
+	If this is turned on, the following shorthands are activated:
+	\begin{shorthands}
+		\item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+		in the hyphenation patterns (as opposed to ¦\-¦).
+		\item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+		cases where the hyphen should stick at the following syllable.
+		\item[¦"|¦] disables a ligature at this position.
+		\item[¦""¦] allows for a line break at this position (without hyphenation sign).
+		\item[¦"---¦] Cyrillic emdash in plain text.
+		\item[¦"--~¦] Cyrillic emdash in compound names (surnames).
+		\item[¦"--*¦] Cyrillic emdash for denoting direct speech.
+		\item[¦",¦] thinspace for initials with a breakpoint in following surname.
+		\item[¦"‘¦] for German left double quotes (looks like ,,).
+		\item[¦"’¦] for German right double quotes (looks like “).
+		\item[¦"<¦] for French left double quotes (looks like <<).
+		\item[¦">¦] for French right double quotes (looks like >>).
+	\end{shorthands}
+	\item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic
+	alphanumerical numbering.
+	\item \TB{spelling} = \textit{modern} or classic (=~tarask). With ¦spelling=classic¦, captions and dates
+	     adhere to the Taraškievica (or Belarusian classical) orthography rather than the standard orthography.
+\end{itemize}
+%
+\paragraph*{Commands:}
+\begin{itemize}
+	\item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for
+	environments such as ¦enumerate¦. The command takes a counter as argument,
+	\eg ¦\textbelarusian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}.
+	\item \Cmd\asbuk: same in lowercase
+\end{itemize}
+
 \subsection[bengali]{bengali\new{v1.2.0}}\label{bengali}
 \paragraph*{Options:}
 	\begin{itemize}
@@ -524,25 +634,25 @@
 	\begin{shorthands}
 		\item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning
 		            of the next line when hyphenated, as common in Czech typesetting
-		            (also see option ¦splithyphens¦).
+		            (only needed with ¦splithyphens=false¦).
 		\item[¦"‘¦] for Czech left double quotes (looks like ,,).
 		\item[¦"’¦] for Czech right double quotes (looks like “).
 		\item[¦">¦] for Czech left double guillemets (looks like >>).
 		\item[¦"<¦] for Czech right double guillemets (looks like <<).
 	\end{shorthands}
-	\item \TB{splithyphens} = \textit{false} or true. \new{v1.45}
+	\item \TB{splithyphens} = false or \textit{true}.\new{v1.45}
 	      According to Czech typesetting conventions, if a word with a hard hyphen (such as \emph{je-li})
 	      is hyphenated at this hyphen, a second hyphenation character is to be inserted at the beginning
-	      of the line that follows the hyphenation (\emph{je-/-li}).\\
-          If this option is true, this is done automatically (so the shorthand ¦"=¦ is not needed).
-          Note, however, that the option is only available for \XeTeX. If you are using \LuaTeX,
-          load the \pkg{luavlna} package to the same effect.
-    \item \TB{vlna} = \textit{false} or true. \new{v1.45}
+	      of the line that follows the hyphenation (\emph{je-/-li}).
+          By default, this is done automatically\new{v1.46} (if you are using \LuaTeX, the \pkg{luavlna} package is
+          loaded to achieve this).
+          Set this option to ¦false¦ to disable the feature.
+    \item \TB{vlna} = false or \textit{true}. \new{v1.45}
          According to Czech typesetting conventions, single-letter words (non-syllable prepositions)
-         must not occur at line ends.\\
-         If this option is true, this is taken care of. Note, however, that the option
-         is only available for \XeTeX. If you are using \LuaTeX, load the \pkg{luavlna} package
-         to the same effect.
+         must not occur at line ends.
+         \pkg{Polyglossia} takes care of this automatically by default\new{v1.46} (if you are using \LuaTeX, the
+         \pkg{luavlna} package is loaded to achieve this).
+         Set this option to ¦false¦ to disable the feature.
 \end{itemize}
 
 \subsection{dutch}\label{dutch}
@@ -603,14 +713,31 @@
 	\begin{itemize}
 		\item\TB{variant} = \textit{french} or canadian (=~acadian).\new{v1.45}
 		Currently, the three variants do not differ; they are supported for compatibility with \pkg{babel} (where they do not differ either).
-		\item \TB{autospacing} = true or \textit{false} (default value = true). One of the most distinct features of French typography is the addition
+		\item \TB{autospacing} = \textit{true} or false. One of the most distinct features of French typography is the addition
 		of extra spacing around punctuation and quotation marks (guillemets). By default, polyglossia adds these spaces automatically, so you don't need
 		to enter them. This options allows you to switch this feature off globally.
-		\item \TB{autospaceguillemets}\footnote{Up to version 1.44, the option was called \textit{automaticspacesaroundguillemets}. For backards compatibility reasons, the more verbose old option is still supported.} = true or \textit{false} (default value = true). If you only want to disable the automatic addition of spacing after opening and before closing guillemets (and not at punctuation), set this to \textit{false}. Note
-		that the more general option \textit{autospacing} overrides this.
+		\item \TB{thincolonspace}\new{v1.46} = true or \textit{false}. Normally, a
+		full (non-breaking) interword space is inserted before a colon. Use this
+		option if you prefer a thinner space as used before \texttt{;}, \texttt{!},
+		and \texttt{?}.
+		\item \TB{autospaceguillemets}\footnote{Up to version 1.44, the option was
+		called \textit{automaticspacesaroundguillemets}. For backards compatibility
+		reasons, the more verbose old option is still supported.} = \textit{true}
+		or false. If you only want to disable the automatic addition of spacing
+		after opening and before closing guillemets (and not at punctuation), set
+		this to \textit{false}. Note that the more general option
+		\textit{autospacing} overrides this.
 		\item \TB{autospacetypewriter}\footnote{Babel's syntax \textit{OriginalTypewriter} is also supported.}\new{1.45} = true or \textit{false} (default value = true). By default, automatic spacing is disabled in typewriter font. If this is enabled, spacing in typewriter context is the same as with roman and sans serif font, depending on the \textit{autospacing} and \textit{autospaceguillemets} settings (note that this was the default up to v.~1.44).	
 		\item \TB{frenchfootnote} = true or \textit{false} (default value = true). If \textit{true}, footnotes start with a non-superscripted number followed by a dot, as common in French typography. Note that this might interfere with the specific footnote handling of classes or packages.
 		Also note that this option is only functional (by design) if French is the main language.
+		\item \TB{frenchitemlabels}\new{v.1.46} = true or \textit{false} (default value = true). If \textit{true}, itemize item labels use em-dashes throughout,
+		as common in French typography.
+		Note that this option is only functional (by design) if French is the main language. Also, it might interfere with list packages such as \pkg{enumitem}.
+		\item \TB{itemlabels}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of all levels.
+		\item \TB{itemlabeli}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of the first level.
+		\item \TB{itemlabelii}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of the second level.
+		\item \TB{itemlabeliii}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of the third level.
+		\item \TB{itemlabeliv}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of the fourth level.
 	\end{itemize}
 \paragraph*{Commands:}
 \begin{itemize}
@@ -624,6 +751,34 @@
 	\item \TB{variant} = \textit{irish} or scottish
 \end{itemize}
 
+\subsection[georgian]{georgian\new{v1.46}}\label{georgian}
+
+\paragraph*{Options:}
+\begin{itemize}
+	\item \TB{babelshorthands} = \textit{false} or true.
+	If this is turned on, the following shorthands are activated:
+	\begin{shorthands}
+		\item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+		in the hyphenation patterns (as opposed to ¦\-¦).
+		\item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+		cases where the hyphen should stick at the following syllable.
+		\item[¦"|¦] disables a ligature at this position.
+		\item[¦""¦] allows for a line break at this position (without hyphenation sign).
+		\item[¦"---¦] Cyrillic emdash in plain text.
+		\item[¦"--~¦] Cyrillic emdash in compound names (surnames).
+		\item[¦"--*¦] Cyrillic emdash for denoting direct speech.
+		\item[¦",¦] thinspace for initials with a breakpoint in following surname.
+		\item[¦"‘¦] for German left double quotes (looks like ,,).
+		\item[¦"’¦] for German right double quotes (looks like “).
+		\item[¦"<¦] for French left double quotes (looks like <<).
+		\item[¦">¦] for French right double quotes (looks like >>).
+	\end{shorthands}
+	\item \TB{numerals} = \textit{arabic} or georgian. Uses either Arabic numerals or Georgian
+	      alphanumerical numbering.
+    \item \TB{oldmonthnames} = \textit{true} or false (default: false). Uses traditional Georgian
+          month names.
+\end{itemize}
+
 \subsection{german}\label{german}
 \paragraph*{Options:}
 	\begin{itemize}
@@ -665,8 +820,9 @@
 		\item[¦"<¦] for French left double quotes («)
 		\item[¦">¦] for French right double quotes (»).
 		\end{shorthands}
-	\item\TB{script} = \textit{latin} or fraktur.\new{v1.2.0}
-		Setting script=fraktur modifies the captions for typesetting German in Fraktur.
+	\item\TB{script} = \textit{latin} or blackletter\new{v1.46} (=~fraktur\new{v1.2.0}).
+		Setting ¦script=blackletter¦ adapts the captions for typesetting German in blackletter type (using the long s (ſ)
+		where appropriate).
 	\end{itemize}
 
 \subsection{greek}\label{greek}
@@ -707,6 +863,27 @@
 	\end{itemize}
 
 \subsection{hungarian}\label{hungarian}
+\paragraph*{Options:}
+\begin{itemize}
+	\item \TB{swapstrings} = \textit{all}, captions, headings, headers, hheaders or none\new{v1.46}
+	      
+	       In Hungarian, some caption strings need to be in a different order than in other languages
+	       (\eg \emph{1. fejezet} instead of \emph{Chapter 1}). By default, \pkg{polyglossia} tries hard to
+	       provide the correct order for different classes and packages (standard classes, \pkg{KOMA-script},
+	       \pkg{memoir}, and \pkg{titlesec} package should work, as well as \pkg{fancyhdr} and \pkg{caption}).
+	       However, since the definition of these strings is not standardized, the redefinitions might not work
+	       and even interfere badly if you use specific classes or packages that redefine the respective strings
+	       themselves. In this case, you can disable some or all changes.
+	       The possibilities are:
+	       \begin{itemize}
+	       	\item ¦all¦: Redefine figure and table captions, part and chapter headings, and running headers (=~default setting)
+	       	\item ¦captions¦: Redefine figure and table captions only
+	       	\item ¦headings¦: Redefine part and chapter headings only
+	       	\item ¦headers¦: Redefine running headers only
+	       	\item ¦hheaders¦: Redefine part and chapter headings as well as running headers
+	       	\item ¦none¦: Do not redefine anything
+	       \end{itemize}
+\end{itemize}
 \paragraph*{Commands:}
 \begin{itemize}
 	\item \Cmd\ontoday\ (= \Cmd\ondatehungarian): special form of \cmd\today\ which produces a slightly different
@@ -741,7 +918,6 @@
   \end{itemize}
 
 \subsection[kurdish]{kurdish\new{v1.45}}\label{kurdish}
-Kurdish support includes Sorani Kurdish and Kurmanji Kurdish, both in either Arabic or Latin script.
 
 \paragraph*{Options:}
 \begin{itemize}
@@ -750,9 +926,10 @@
 	\item \TB{numerals} = western or eastern. Defaults are ¦western¦ for Latin and ¦eastern¦ for Arabic script, depending on the selection above.
 	\item \TB{abjadjimnotail} = \textit{false} or true.
 	Set this to true if you want the \textit{abjad} form of the number three to be \textarabic{ج‍} – as in the manuscript tradition – instead of the modern usage \textarabic{ج}.
-	\item \TB{locale} (not yet implemented)
-	\item \TB{calendar} (not yet implemented)
+%	\item \TB{locale} (not yet implemented)
+%	\item \TB{calendar} (not yet implemented)
 \end{itemize}
+\condbreak{2\baselineskip}
 \paragraph*{Commands:}
 \begin{itemize}
 	\item \Cmd\ontoday: special form of \cmd\today\ which produces a slightly different
@@ -769,10 +946,153 @@
 
 \subsection{latin}\label{latin}
 \paragraph*{Options:}
-	\begin{itemize}
-	\item \TB{variant} = classic, medieval or \textit{modern}
-	\end{itemize}
+\begin{itemize}
+	\item \TB{variant} = classic, medieval, \emph{modern}, or ecclesiastic\new{v.1.46}
 
+			These variants refer to different spelling conventions. The ¦classic¦
+			and the ¦medieval¦ variant do not use the letters \emph{U} and
+			\emph{v}, but only \emph{V} and \emph{u}. This concerns predefined terms like
+			month names as well as the behaviour of the \cmd\MakeUppercase\ and the
+			\cmd\MakeLowercase\ command. The ¦medieval¦ and the
+			¦ecclesiastic¦ variant use the ligatures \emph{\ae} and \emph{\oe}.
+			See table \ref{tab:latin-spelling} for examples.
+
+			Furthermore, the \texttt{ecclesiastic} variant takes care for a punctuation
+			spacing similar to French, but with smaller spaces, as provided for
+			PDF\TeX\ by the \pkg{ecclesiastic} package.
+			\begin{table}
+			\centering
+			\caption{\label{tab:latin-spelling}Spelling differences between the Latin
+				language variants.\newline The capitalization of month names and the use of
+				\emph{i/j} may be affected by the \texttt{capitalizemonth} and the
+				\texttt{usej} option.}
+			\begin{tabular}{llll}
+			\toprule
+			\textbf{classic} & \textbf{medieval} & \textbf{modern} & \textbf{ecclesiastic} \\
+			\midrule
+			Ianuarii & Ianuarii & Ianuarii & ianuarii \\
+			Nouembris & Nouembris & Novembris & novembris \\
+			Praefatio & Præfatio & Praefatio & Præfatio \\
+			\addlinespace\multicolumn{4}{@{}l}{\cmd{\MakeUppercase\{Iulius\}} yields:} \\
+			IVLIVS & IVLIVS & IULIUS & IULIUS \\
+			\bottomrule
+			\end{tabular}
+			\end{table}
+	\item \TB{hyphenation}\new{v.1.46} = classic, modern, or liturgical
+
+			There are three different sets of hyphenation patterns for Latin. Separate
+			documention for them is available on the
+			Internet.\footnote{\url{https://github.com/gregorio-project/hyphen-la/blob/master/doc/README.md\#hyphenation-styles}}
+			Each of the four variants mentioned above has its default set of hyphenation
+			patterns as indicated by table \ref{tab:latin-hyphenation}. Use the
+			¦hyphenation¦ option if the default style does not fit your needs.
+			Note that the liturgical hyphenation patterns are the default of none of the
+			language variants. To use them, you have to say
+			¦hyphenation=liturgical¦ in any case.
+			\begin{table}
+			\caption{\label{tab:latin-hyphenation}Latin default hyphenation styles}
+			\centering
+			\begin{tabular}{ll}
+			\toprule
+			\textbf{Language variant} & \textbf{Default hyphenation style} \\
+			\midrule
+			classic & classic \\
+			medieval & modern \\
+			modern & modern \\
+			ecclesiastic & modern \\
+			\bottomrule
+			\end{tabular}
+			\end{table}
+	\item \TB{ecclesiasticfootnotes}\new{v.1.46} = true or \emph{false}
+
+			Use footnotes as provided by the \pkg{ecclesiastic} package, which typesets
+			footnotes with ordinary instead of superior numbers and without indentation.
+			As many ecclesiastic documents and liturgical books use footnotes that are
+			very similar to the ordinary \LaTeX\ ones, we do not use this footnote style
+			as default even for the ¦ecclesiastic¦ variant.
+		
+			Note that this option is only possible if Latin is the main language of your
+			document.
+	\item \TB{usej}\new{v.1.46} = true or \emph{false}
+
+			Use \emph{J/j} in predefined terms. The letter \emph{j} is not of ancient
+			origin. In early modern times, it was used to distinguish the consonantic
+			\emph{i} from the vocalic~\emph{i}. Nowadays, the use of \emph{j} has
+			disappeared from most Latin publications. So ¦false¦ is the default
+			value for all four language variants. Use this option if you prefer
+			\emph{Januarii} and \emph{Maji} to \emph{Ianuarii} and \emph{Maii}.
+			\item \TB{capitalizemonth}\new{v.1.46} = true or false
+		
+			Capitalize the month name when printing dates (using the \cmd\today\
+			command).  Traditionally, month names are capitalized. However, in recent
+			liturgical books they are lowercase. So ¦true¦ is the default value for
+			the variants ¦classic¦, ¦medieval¦, and ¦modern¦,
+			whereas ¦false¦ is the default value for the ¦ecclesiastic¦
+			variant.
+	\item \TB{babelshorthands} = true or \emph{false}
+
+			Enable the following shorthands inherited from \pkg{babel-latin} and the
+			\pkg{ecclesiastic} package.
+			\begin{shorthands}
+				\item[¦"<¦] for « (left guillemet)
+				\item[¦">¦] for » (right guillemet)
+				\item[¦"¦] If no other shorthand applies, ¦"¦ before any letter
+					character defines an optional break point allowing further break points
+					within the same word (as opposed to the \cmd\- command).
+				\item[¦"|¦] the same as ¦"¦, but also possible before non-letter
+					characters
+				\item[¦'a¦] for á (a with acute), also available for é, í, ó, ú, ý, ǽ, and
+					\'œ
+				\item[¦'A¦] for Á (A with acute), also available for É, Í, Ó, Ú, \'V, Ý, Ǽ,
+					and \'Œ
+			\end{shorthands}
+			The following shorthands are only available for the ¦medieval¦ and the
+			¦ecclesiastic¦ variant.
+			\begin{shorthands}
+				\item[¦"ae¦] for æ (ae ligature), also available for œ
+				\item[¦"Ae¦] for Æ (AE ligature), also available for Œ
+				\item[¦"AE¦] for Æ (AE ligature), also available for Œ
+				\item[¦'ae¦] for ǽ (ae ligature with acute), also available for \'œ
+				\item[¦'Ae¦] for Ǽ (AE ligature with acute), also available for \'Œ
+				\item[¦'AE¦] for Ǽ (AE ligature with acute), also available for \'Œ
+			\end{shorthands}
+	\item \TB{prosodicshorthands}\new{v.1.46} = true or \emph{false}
+
+			Enable shorthands for prosodic marks (macrons and breves) very similiar to
+			those provided by \pkg{babel-latin} using the ¦withprosodicmarks¦
+			modifier.
+		
+			Note that the active ¦=¦ character used for macrons will cause problems with
+			commands using \texttt{key=value} interfaces, \eg
+			¦\includegraphics[scale=2]{...}¦. Use \cmd{\shorthandoff\{=\}} before
+			such commands (and \cmd{\shorthandon\{=\}} thereafter) within every
+			environment with prosodic shorthands enabled.
+		
+			The following shorthands are available.
+			\begin{shorthands}
+				\item[¦=a¦] for ā (a with macron), also available for ē, ī, ō, ū, and ȳ
+				\item[¦=A¦] for Ā (A with macron), also available for Ē, Ī, Ō, Ū, V̄, and Ȳ.
+					Note that a macron above the letter V is only displayed if your font
+					supports the Unicode character ¦0304¦ (\emph{combining macron}).
+				\item[¦=ae¦] for a͞e (ae diphthong with macron), also available for a͞u, e͞u,
+					and o͞e. Note that macrons above diphthongs are only displayed if your font
+					supports the Unicode character ¦035E¦ (\emph{combining double
+					macron}).
+				\item[¦=Ae¦] for A͞e (Ae diphthong with macron), also available for A͞u, E͞u,
+					and O͞e.
+				\item[¦=AE¦] for A͞E (AE diphthong with macron), also available for A͞U, E͞U,
+					and O͞E.
+				\item[¦\textasciicircum a¦] for ă (a with breve), also available for ĕ, ĭ,
+					ŏ, ŭ, and y̆.  Note that a breve above the letter y is only displayed if
+					your font supports the Unicode character ¦0306¦ (\emph{combining
+					breve}).
+				\item[¦\textasciicircum A¦] Ă (A with breve), also available for Ĕ, Ĭ, Ŏ,
+					Ŭ, V̆, and Y̆. Note that breves above the letters V and Y are only displayed
+					if your font supports the Unicode character ¦0306¦ (\emph{combining
+					breve}).
+			\end{shorthands}
+\end{itemize}
+
 \subsection{malay}\label{malay}
 \paragraph*{Options:}
 \begin{itemize}
@@ -811,7 +1131,7 @@
 \begin{itemize}
 	\item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for
 	environments such as ¦enumerate¦. The command takes a counter as argument,
-	\eg ¦\textrussian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}.
+	\eg ¦\textmongolian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}.
 	\item \Cmd\asbuk: same in lowercase
 \end{itemize}
 
@@ -827,8 +1147,8 @@
 	\item \TB{numerals} = western or \textit{eastern}
 	\item \TB{abjadjimnotail} = \textit{false} or true. \new{v1.0.3}
 	Set this to true if you want the \textit{abjad} form of the number three to be \textarabic{ج‍} – as in the manuscript tradition – instead of the modern usage \textarabic{ج}.
-	\item \TB{locale} (not yet implemented)
-	\item \TB{calendar} (not yet implemented)
+%	\item \TB{locale} (not yet implemented)
+%	\item \TB{calendar} (not yet implemented)
 \end{itemize}
 \paragraph*{Commands:}
 \begin{itemize}
@@ -864,6 +1184,9 @@
 %		\item[¦"<¦] for French left double quotes (looks like <<).
 %		\item[¦">¦] for French right double quotes (looks like >>).
 	\end{shorthands}
+    \item \TB{indentfirst}\new{v1.46} = \textit{true} or false. By default, all paragraphs are indented in Russian,
+          also those after a chapter or section heading. If this option is false, the latter paragraphs
+          are not indented, as normal in \LaTeX. 
 	\item \TB{spelling} = \textit{modern} or old (for captions and date only, not for hyphenation)
 	\item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic
 	alphanumerical numbering.
@@ -883,17 +1206,17 @@
 \subsection{sanskrit}\label{sanskrit}
 \paragraph*{Options:}
 	\begin{itemize}
-	\item \TB{Script} = \textit{Devanagari}\new{v1.0.2}, Gujarati, Malayalam, Bengali, Kannada,
+	\item \TB{script} = \textit{Devanagari}\new{v1.0.2}, Gujarati, Malayalam, Bengali, Kannada,
 	Telugu or Latin.
-	The value is passed to \pkg{fontspec} in cases where the respective ¦\<script>font¦ is not defined.
+	The value is passed to \pkg{fontspec} in cases where the respective ¦\⟨script⟩font¦ is not defined.
 	This can be useful if you typeset Sanskrit texts in scripts other than Devanagari.
-	\item \TB{Numerals} = \textit{Devanagari}\new{v1.45} or Western
+	\item \TB{numerals} = \textit{Devanagari}\new{v1.45} or Western
 	\end{itemize}
  
 \subsection{serbian}\label{serbian}
 \paragraph*{Options:}
 	\begin{itemize}
-	\item \TB{Script} = \textit{Cyrillic} or Latin. Will likely go to a variant.
+	\item \TB{script} = \textit{Cyrillic} or Latin.
 	\item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic
 	      alphanumerical numbering.
 	\end{itemize}
@@ -906,6 +1229,44 @@
 \end{itemize}
 
 
+\subsection{slovak}\label{slovak}
+
+\paragraph*{Options:}
+\begin{itemize}
+	\item \TB{babelshorthands} = \textit{false} or true. \new{v1.46}
+	if this is turned on, the following shorthands for Slovak are activated:
+	\begin{shorthands}
+        \item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning
+                    of the next line when hyphenated, as common in Slovak typesetting
+		            (only needed with ¦splithyphens=false¦).
+        \item[¦"|¦] disables a ligature at this position.
+        \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+                    cases where the hyphen should stick at the following syllable.
+        \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+                    in the hyphenation patterns (as opposed to ¦\-¦).
+        \item[¦""¦] allows for a line break at this position (without hyphenation sign).
+        \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to ¦\slash¦, hyphenation at the breakpoints
+                    preset in the hyphenation patterns is still allowed.
+        \item[¦"‘¦] for Slovak left double quotes (looks like ,,).
+        \item[¦"’¦] for Slovak right double quotes (looks like “).
+        \item[¦">¦] for Slovak left double guillemets (looks like >>).
+        \item[¦"<¦] for Slovak right double guillemets (looks like <<).
+	\end{shorthands}
+	\item \TB{splithyphens} = \textit{false} or true. \new{v1.46}
+	      According to Slovak typesetting conventions, if a word with a hard hyphen (such as \emph{je-li})
+	      is hyphenated at this hyphen, a second hyphenation character is to be inserted at the beginning
+          of the line that follows the hyphenation (\emph{je-/-li}).
+	      By default, this is done automatically (if you are using \LuaTeX, the \pkg{luavlna} package is
+	      loaded to achieve this).
+	      Set this option to ¦false¦ to disable the feature.
+	\item \TB{vlna} = \textit{false} or true. \new{v1.46}
+	      According to Slovak typesetting conventions, single-letter words (non-syllable prepositions)
+	      must not occur at line ends.
+	      \pkg{Polyglossia} takes care of this automatically by default (if you are using \LuaTeX, the
+	      \pkg{luavlna} package is loaded to achieve this).
+	      Set this option to ¦false¦ to disable the feature.
+\end{itemize}
+
 \subsection{slovenian}\label{slovenian}
 \paragraph*{Options:}
 	\begin{itemize}
@@ -924,6 +1285,35 @@
 	\item \Cmd\oldtoday: outputs the current date using traditional Sorbian month names, even if \TB{olddate} is false.
 \end{itemize}
 
+\subsection{spanish}\label{spanish}
+\paragraph*{Options:}
+\begin{itemize}
+	\item \TB{variant} = \textit{spanish} or mexican.\new{v1.46}
+	\item \TB{spanishoperators} = all, accented, spaced or none or \textit{false} (default value = all).\new{v1.46}
+	      Determines of and how math operators are localized to Spanish.
+	      \begin{itemize}
+	      	\item ¦accented¦ causes some math operators to use accents where usual in Spanish (\emph{lím},
+	      	      \emph{lím\,sup}, \emph{lím\,inf}, \emph{máx}, \emph{mín}, \emph{ínf}, \emph{mód}).
+	      	\item ¦spaced¦ causes some math operators to use spaces where usual in Spanish (\emph{arc\,cos},
+	      	      \emph{arc\,sen}, \emph{arc\,tg}).
+	      	\item ¦all¦ activates ¦accented¦ and ¦spaced¦ and furthermore provides Spanish localizations of
+	      	      ¦\sin¦ (\emph{sen}), ¦\tan¦ (\emph{tg}), ¦\sinh¦ (\emph{senh}), and ¦\tanh¦ (\emph{tgh}).
+	      	\item ¦none¦ does no localization at all (default setting). 
+	      \end{itemize}
+\end{itemize}
+\paragraph*{\color{black}Commands:}\new{v1.46}
+\begin{itemize}
+	\item \Cmd\arcsen: alias to ¦\arcsin¦ (\pkg{babel} compatibility)
+	\item \Cmd\arctg: alias to ¦\arctan¦ (\pkg{babel} compatibility)
+	\item \Cmd\sen: alias to ¦\sin¦ (\pkg{babel} compatibility)
+	\item \Cmd\senh: alias to ¦\sinh¦ (\pkg{babel} compatibility)
+	\item \Cmd\tg: alias to ¦\tan¦ (\pkg{babel} compatibility)
+	\item \Cmd\tgh: alias to ¦\tanh¦ (\pkg{babel} compatibility)
+	\item \Cmd\spanishoperator: allows you to define further localized operators. For instance, ¦\spanishoperator{cotg}¦
+	      defines a command ¦\cotg¦ that outputs \emph{cotg} in math. The optional argument of the command lets you specify the
+	      spelling, if needed, \eg ¦\spanishoperator[arc\,ctg]{arcctg}¦.
+\end{itemize}
+
 \subsection{syriac}\label{syriac}
 \paragraph*{Options:}
 	\begin{itemize}
@@ -1120,6 +1510,9 @@
 	\item \Cmd\armeniannumeral produces Armenian alphabetic numbering.
 	          Example: ¦\armeniannumeral{1863}¦ yields \textarmenian{\armeniannumeral{1863}}.
 
+	\item \Cmd\georgiannumeral produces Georgian alphabetic numbering.\\
+              Example: ¦\georgiannumeral{1863}¦ yields \textgeorgian{\georgiannumeral{1863}}.
+
 	\item \Cmd\greeknumeral produces Greek alphabetic numbering, \Cmd\Greeknumeral outputs uppercased variants.
 			Example: ¦\greeknumeral{1863}¦ yields \textgreek{\greeknumeral{1863}},
 			¦\Greeknumeral{1863}¦ results in \textgreek{\Greeknumeral{1863}}.
@@ -1273,7 +1666,7 @@
 by other people. I take this opportunity to thank the following individuals,
 whose splendid work has made my task almost trivial in comparision: \TA{Johannes
 Braams} and the numerous contributors to the \pkg{babel} package (in particular
-\TA{Boris Lavva} and others for its Hebrew support), \TA{Alexej Kryuko}v (\pkg{antomega}),
+\TA{Boris Lavva} and others for its Hebrew support), \TA{Alexej Kryukov} (\pkg{antomega}),
 \TA{Will Robertson} (\pkg{fontspec}), \TA{Apostolos Syropoulos} (\pkg{xgreek}), \TA{Youssef Jabri}
 (\pkg{arabi}), and \TA{Vafa Khalighi} (\pkg{xepersian} and \pkg{bidi}).
 The work of \TA{Mojca Miklavec} and \TA{Arthur Reutenauer} on hyphenation patterns with their package
@@ -1293,12 +1686,26 @@
 I also thank \TA{Alan Munn} for kindly proof-reading the penultimate version of this documentation.
 And of course my gratitude also goes to \TA{Jonathan Kew}, the formidable author of \XeTeX!
 
-\section{More acknowledgements (by Arthur Reutenauer)}
-Many thanks to all the people who have contributed bugfixes and new features to
-Polyglossia since I took over.  Most of them can be identified from the contributor statistics on \href{https://github.com/reutenauer/polyglossia/graphs/contributors}{GitHub} and I won’t try to name them
-all (maybe, one day ...); among the ones who sent contributions directly to me
-I would like to especially thank \TA{Claudio Beccari}, the indefatigable champion of
-Romance languages, and beyond!
+\section{More acknowledgements (by the current development team)}
+Many thanks to all the people who have contributed bugfixes and new features to \pkg{polyglossia}
+since we took over.
+In alphabetical order: \TA{Ignas Anikevicius}, \TA{Sina Ahmadi}, \TA{Wouter Bolsterlee}, \TA{Christian Buhtz},
+\TA{Zgarbul Andrey}, \TA{Oleg Domanov}, \TA{Philipp Gesang}, \TA{Kevin Godby}, \TA{Enrico Gregorio},
+\TA{Khaled Hosny}, \TA{Najib Idrissi}, user \TA{julroy67}, \TA{Dohyun Kim}, \TA{Phil Kime}, \TA{Mike Kroutikov},
+\TA{Ivan Kokan}, \TA{Caleb Maclennan}, \TA{José Mancera}, \TA{Yevgen Pogribnyi}, \TA{Maïeul Rouquette},
+\TA{Elie Roux}, \TA{Hugo Roy},  \TA{Guy Rutenberg}, \TA{Philipp Stephani}, \TA{Keno Wehr}, \TA{Dominik Wujastyk},
+\TA{Sertaç Ö. Yıldız}, \TA{Maksim Zholudev}, \TA{Yan Zhou}, and \TA{Stefan Zlatinov}.
+Their respective contributions can be identified from the contributor statistics on
+\href{https://github.com/reutenauer/polyglossia/graphs/contributors}{GitHub}.
 
+Among the ones who sent contributions directly to us we would like to especially thank
+\TA{Claudio Beccari}, the indefatigable champion of Romance languages, and beyond! Furthermore,
+kudos go to \TA{Moritz Wemheuer} (of \pkg{biblatex}) who has helped a lot to improve \pkg{polyglossia} interaction
+with \pkg{biblatex} and \pkg{csquotes}.
+
+Not at least, we are very grateful for all bug reports and feature enhancement requests we received from
+the numerous users we cannot list all here (but again, you can find all names on \href{https://github.com/reutenauer/polyglossia/issues?utf8=%E2%9C%93&q=is%3Aissue}{GitHub}).
+Please go on with that, you are keeping \pkg{polyglossia} running!
+
 \end{document}
 

Modified: trunk/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx	2019-11-15 21:41:34 UTC (rev 52808)
@@ -11,7 +11,7 @@
 
    ¦----------------------------------------------¦
    ¦                                              ¦
-   ¦       THE POLYGLOSSIA PACKAGE v1.45          ¦
+   ¦       THE POLYGLOSSIA PACKAGE v1.46          ¦
    ¦                                              ¦
    ¦     Modern multilingual typesetting          ¦
    ¦        with XeLaTeX and LuaLaTeX             ¦
@@ -20,8 +20,8 @@
 
 This package provides an alternative to Babel for users of XeLaTeX and LuaLaTeX
 (with a few languages incompletely supported for the latter). This version
-includes support for 75 different languages, some of which in different regional,
-national or scriptal varieties.
+includes support for 79 different languages, some of which in different
+regional or national varieties, or using a different writing system.
 
 Polyglossia makes it possible to automate the following tasks:
 
@@ -44,23 +44,19 @@
 
 LICENSE
 
-Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2019 Arthur Reutenauer
+Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2019 Arthur Reutenauer,
+Copyright (c) 2019 Bastien Roucariès, 2019 Jürgen Spitzmüller
 
-Polyglossia is placed under the terms of the LaTeX Project Public Licence
-(LPPL), either version 1.3, or, at your option, any later version.  See
-LICENCE.txt for the text of the LPPL v1.3c, or
-http://www.latex-project.org/lppl.txt for the latest version.
+Except where otherwise noted, Polyglossia is placed under the terms of the MIT licence
+(https://opensource.org/licenses/MIT).
 
-This work has the LPPL maintenance status ‘maintained’.  The current maintainer is
-Arthur Reutenauer.
-
 BUGS
 
 If you run into a bug, or suspect you do, or you have a request or comment, please
 use the GitHub issue tracker: http://github.com/reutenauer/polyglossia/issues
 
-This is more efficient than contacting me by email as it allows me to track the
-issues and follow progress.
+This is more efficient than contacting the maintainer by email as it allows me
+to track the issues and follow progress.
 %</README>
 %<*internal>
 \fi
@@ -104,18 +100,29 @@
 \endpostamble
 \let\MetaPrefix\DoubleperCent
 \askforoverwritefalse
+\generate{\file{gloss-acadien.ldf}{\from{polyglossia.dtx}{gloss-acadien.ldf}}}
+\generate{\file{gloss-afrikaans.ldf}{\from{polyglossia.dtx}{gloss-afrikaans.ldf}}}
 \generate{\file{gloss-albanian.ldf}{\from{polyglossia.dtx}{gloss-albanian.ldf}}}
+\generate{\file{gloss-american.ldf}{\from{polyglossia.dtx}{gloss-american.ldf}}}
 \generate{\file{gloss-amharic.ldf}{\from{polyglossia.dtx}{gloss-amharic.ldf}}}
 \generate{\file{gloss-arabic.ldf}{\from{polyglossia.dtx}{gloss-arabic.ldf}}}
 \generate{\file{gloss-armenian.ldf}{\from{polyglossia.dtx}{gloss-armenian.ldf}}}
 \generate{\file{gloss-asturian.ldf}{\from{polyglossia.dtx}{gloss-asturian.ldf}}}
+\generate{\file{gloss-australian.ldf}{\from{polyglossia.dtx}{gloss-australian.ldf}}}
+\generate{\file{gloss-austrian.ldf}{\from{polyglossia.dtx}{gloss-austrian.ldf}}}
+\generate{\file{gloss-bahasa.ldf}{\from{polyglossia.dtx}{gloss-bahasa.ldf}}}
 \generate{\file{gloss-bahasai.ldf}{\from{polyglossia.dtx}{gloss-bahasai.ldf}}}
 \generate{\file{gloss-bahasam.ldf}{\from{polyglossia.dtx}{gloss-bahasam.ldf}}}
 \generate{\file{gloss-basque.ldf}{\from{polyglossia.dtx}{gloss-basque.ldf}}}
+\generate{\file{gloss-belarusian.ldf}{\from{polyglossia.dtx}{gloss-belarusian.ldf}}}
 \generate{\file{gloss-bengali.ldf}{\from{polyglossia.dtx}{gloss-bengali.ldf}}}
+\generate{\file{gloss-bosnian.ldf}{\from{polyglossia.dtx}{gloss-bosnian.ldf}}}
 \generate{\file{gloss-brazil.ldf}{\from{polyglossia.dtx}{gloss-brazil.ldf}}}
 \generate{\file{gloss-breton.ldf}{\from{polyglossia.dtx}{gloss-breton.ldf}}}
+\generate{\file{gloss-british.ldf}{\from{polyglossia.dtx}{gloss-british.ldf}}}
 \generate{\file{gloss-bulgarian.ldf}{\from{polyglossia.dtx}{gloss-bulgarian.ldf}}}
+\generate{\file{gloss-canadian.ldf}{\from{polyglossia.dtx}{gloss-canadian.ldf}}}
+\generate{\file{gloss-canadien.ldf}{\from{polyglossia.dtx}{gloss-canadien.ldf}}}
 \generate{\file{gloss-catalan.ldf}{\from{polyglossia.dtx}{gloss-catalan.ldf}}}
 \generate{\file{gloss-coptic.ldf}{\from{polyglossia.dtx}{gloss-coptic.ldf}}}
 \generate{\file{gloss-croatian.ldf}{\from{polyglossia.dtx}{gloss-croatian.ldf}}}
@@ -133,7 +140,9 @@
 \generate{\file{gloss-friulian.ldf}{\from{polyglossia.dtx}{gloss-friulian.ldf}}}
 \generate{\file{gloss-gaelic.ldf}{\from{polyglossia.dtx}{gloss-gaelic.ldf}}}
 \generate{\file{gloss-galician.ldf}{\from{polyglossia.dtx}{gloss-galician.ldf}}}
+\generate{\file{gloss-georgian.ldf}{\from{polyglossia.dtx}{gloss-georgian.ldf}}}
 \generate{\file{gloss-german.ldf}{\from{polyglossia.dtx}{gloss-german.ldf}}}
+\generate{\file{gloss-germanb.ldf}{\from{polyglossia.dtx}{gloss-germanb.ldf}}}
 \generate{\file{gloss-greek.ldf}{\from{polyglossia.dtx}{gloss-greek.ldf}}}
 \generate{\file{gloss-hebrew.ldf}{\from{polyglossia.dtx}{gloss-hebrew.ldf}}}
 \generate{\file{gloss-hindi.ldf}{\from{polyglossia.dtx}{gloss-hindi.ldf}}}
@@ -150,8 +159,12 @@
 \generate{\file{gloss-lao.ldf}{\from{polyglossia.dtx}{gloss-lao.ldf}}}
 \generate{\file{gloss-latex.ldf}{\from{polyglossia.dtx}{gloss-latex.ldf}}}
 \generate{\file{gloss-latin.ldf}{\from{polyglossia.dtx}{gloss-latin.ldf}}}
+\generate{\file{gloss-latinclassic.ldf}{\from{polyglossia.dtx}{gloss-latinclassic.ldf}}}
+\generate{\file{gloss-latinecclesiastic.ldf}{\from{polyglossia.dtx}{gloss-latinecclesiastic.ldf}}}
+\generate{\file{gloss-latinmedieval.ldf}{\from{polyglossia.dtx}{gloss-latinmedieval.ldf}}}
 \generate{\file{gloss-latvian.ldf}{\from{polyglossia.dtx}{gloss-latvian.ldf}}}
 \generate{\file{gloss-lithuanian.ldf}{\from{polyglossia.dtx}{gloss-lithuanian.ldf}}}
+\generate{\file{gloss-lowersorbian.ldf}{\from{polyglossia.dtx}{gloss-lowersorbian.ldf}}}
 \generate{\file{gloss-lsorbian.ldf}{\from{polyglossia.dtx}{gloss-lsorbian.ldf}}}
 \generate{\file{gloss-macedonian.ldf}{\from{polyglossia.dtx}{gloss-macedonian.ldf}}}
 \generate{\file{gloss-magyar.ldf}{\from{polyglossia.dtx}{gloss-magyar.ldf}}}
@@ -159,14 +172,19 @@
 \generate{\file{gloss-malayalam.ldf}{\from{polyglossia.dtx}{gloss-malayalam.ldf}}}
 \generate{\file{gloss-marathi.ldf}{\from{polyglossia.dtx}{gloss-marathi.ldf}}}
 \generate{\file{gloss-mongolian.ldf}{\from{polyglossia.dtx}{gloss-mongolian.ldf}}}
+\generate{\file{gloss-naustrian.ldf}{\from{polyglossia.dtx}{gloss-naustrian.ldf}}}
+\generate{\file{gloss-newzealand.ldf}{\from{polyglossia.dtx}{gloss-newzealand.ldf}}}
+\generate{\file{gloss-ngerman.ldf}{\from{polyglossia.dtx}{gloss-ngerman.ldf}}}
 \generate{\file{gloss-nko.ldf}{\from{polyglossia.dtx}{gloss-nko.ldf}}}
 \generate{\file{gloss-norsk.ldf}{\from{polyglossia.dtx}{gloss-norsk.ldf}}}
 \generate{\file{gloss-norwegian.ldf}{\from{polyglossia.dtx}{gloss-norwegian.ldf}}}
+\generate{\file{gloss-nswissgerman.ldf}{\from{polyglossia.dtx}{gloss-nswissgerman.ldf}}}
 \generate{\file{gloss-nynorsk.ldf}{\from{polyglossia.dtx}{gloss-nynorsk.ldf}}}
 \generate{\file{gloss-occitan.ldf}{\from{polyglossia.dtx}{gloss-occitan.ldf}}}
 \generate{\file{gloss-persian.ldf}{\from{polyglossia.dtx}{gloss-persian.ldf}}}
 \generate{\file{gloss-piedmontese.ldf}{\from{polyglossia.dtx}{gloss-piedmontese.ldf}}}
 \generate{\file{gloss-polish.ldf}{\from{polyglossia.dtx}{gloss-polish.ldf}}}
+\generate{\file{gloss-polutonikogreek.ldf}{\from{polyglossia.dtx}{gloss-polutonikogreek.ldf}}}
 \generate{\file{gloss-portuges.ldf}{\from{polyglossia.dtx}{gloss-portuges.ldf}}}
 \generate{\file{gloss-portuguese.ldf}{\from{polyglossia.dtx}{gloss-portuguese.ldf}}}
 \generate{\file{gloss-romanian.ldf}{\from{polyglossia.dtx}{gloss-romanian.ldf}}}
@@ -177,11 +195,15 @@
 \generate{\file{gloss-sanskrit.ldf}{\from{polyglossia.dtx}{gloss-sanskrit.ldf}}}
 \generate{\file{gloss-scottish.ldf}{\from{polyglossia.dtx}{gloss-scottish.ldf}}}
 \generate{\file{gloss-serbian.ldf}{\from{polyglossia.dtx}{gloss-serbian.ldf}}}
+\generate{\file{gloss-serbianc.ldf}{\from{polyglossia.dtx}{gloss-serbianc.ldf}}}
 \generate{\file{gloss-slovak.ldf}{\from{polyglossia.dtx}{gloss-slovak.ldf}}}
+\generate{\file{gloss-slovene.ldf}{\from{polyglossia.dtx}{gloss-slovene.ldf}}}
 \generate{\file{gloss-slovenian.ldf}{\from{polyglossia.dtx}{gloss-slovenian.ldf}}}
 \generate{\file{gloss-sorbian.ldf}{\from{polyglossia.dtx}{gloss-sorbian.ldf}}}
 \generate{\file{gloss-spanish.ldf}{\from{polyglossia.dtx}{gloss-spanish.ldf}}}
+\generate{\file{gloss-spanishmx.ldf}{\from{polyglossia.dtx}{gloss-spanishmx.ldf}}}
 \generate{\file{gloss-swedish.ldf}{\from{polyglossia.dtx}{gloss-swedish.ldf}}}
+\generate{\file{gloss-swissgerman.ldf}{\from{polyglossia.dtx}{gloss-swissgerman.ldf}}}
 \generate{\file{gloss-syriac.ldf}{\from{polyglossia.dtx}{gloss-syriac.ldf}}}
 \generate{\file{gloss-tamil.ldf}{\from{polyglossia.dtx}{gloss-tamil.ldf}}}
 \generate{\file{gloss-telugu.ldf}{\from{polyglossia.dtx}{gloss-telugu.ldf}}}
@@ -190,6 +212,7 @@
 \generate{\file{gloss-turkish.ldf}{\from{polyglossia.dtx}{gloss-turkish.ldf}}}
 \generate{\file{gloss-turkmen.ldf}{\from{polyglossia.dtx}{gloss-turkmen.ldf}}}
 \generate{\file{gloss-ukrainian.ldf}{\from{polyglossia.dtx}{gloss-ukrainian.ldf}}}
+\generate{\file{gloss-uppersorbian.ldf}{\from{polyglossia.dtx}{gloss-uppersorbian.ldf}}}
 \generate{\file{gloss-urdu.ldf}{\from{polyglossia.dtx}{gloss-urdu.ldf}}}
 \generate{\file{gloss-usorbian.ldf}{\from{polyglossia.dtx}{gloss-usorbian.ldf}}}
 \generate{\file{gloss-vietnamese.ldf}{\from{polyglossia.dtx}{gloss-vietnamese.ldf}}}
@@ -200,8 +223,11 @@
 \generate{\file{farsidigits.map}{\from{polyglossia.dtx}{farsidigits.map}}}
 \generate{\file{thaidigits.map}{\from{polyglossia.dtx}{thaidigits.map}}}
 \def\MetaPrefix{-- }
-\generate{\file{polyglossia-frpt.lua}{\from{polyglossia.dtx}{polyglossia-frpt.lua}}}
+\generate{\file{polyglossia-french.lua}{\from{polyglossia.dtx}{polyglossia-french.lua}}}
 \generate{\file{polyglossia-korean.lua}{\from{polyglossia.dtx}{polyglossia-korean.lua}}}
+\generate{\file{polyglossia-latin.lua}{\from{polyglossia.dtx}{polyglossia-latin.lua}}}
+\generate{\file{polyglossia-punct.lua}{\from{polyglossia.dtx}{polyglossia-punct.lua}}}
+\generate{\file{polyglossia-sanskrit.lua}{\from{polyglossia.dtx}{polyglossia-sanskrit.lua}}}
 \generate{\file{polyglossia-tibt.lua}{\from{polyglossia.dtx}{polyglossia-tibt.lua}}}
 \generate{\file{polyglossia.lua}{\from{polyglossia.dtx}{polyglossia.lua}}}
 \let\MetaPrefix\DoubleperCent
@@ -225,6 +251,7 @@
 \usepackage{color}
 \usepackage{xspace,fancyvrb,booktabs}
 \usepackage[neverdecrease]{paralist}
+\usepackage[format=hang,labelfont=bf,labelsep=period]{caption}
 \definecolor{myblue}{rgb}{0.02,0.04,0.48}
 \definecolor{lightblue}{rgb}{0.61,.8,.8}
 \definecolor{myred}{rgb}{0.65,0.04,0.07}
@@ -247,7 +274,7 @@
 \usepackage[babelshorthands]{polyglossia}
 \usepackage{farsical}
 \setmainlanguage[variant=british,ordinalmonthday=false]{english}
-\setotherlanguages{arabic,armenian,hebrew,syriac,greek,russian,serbian,catalan}
+\setotherlanguages{arabic,armenian,hebrew,syriac,greek,russian,serbian,catalan,georgian}
 \usepackage[protrusion]{microtype}
 \newcommand*\Cmd[1]{\cmd{#1}\DescribeMacro{#1}\xspace}
 \newcommand*\pkg[1]{\textsf{\color{myblue}#1}}
@@ -298,6 +325,7 @@
 \newfontfamily\armenianfont[Script=Armenian]{DejaVu Sans}
 \newfontfamily\syriacfont[Script=Syriac]{Serto Jerusalem}
 \newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL}
+\newfontfamily\georgianfont{DejaVu Serif}
 
 \linespread{1.05}
 \frenchspacing
@@ -334,7 +362,9 @@
 % \maketitle
 % \tableofcontents
 % 
+% \condbreak{4\baselineskip}
 % 
+% 
 % \DeleteShortVerb{\|}
 % \MakeShortVerb{\¦}
 % 
@@ -364,8 +394,8 @@
 %       calendars are supported).
 % \item For languages that have their own numbering system, modifying the formatting
 %       of numbers appropriately (this also includes redefining the alphabetic sequence
-%       for non-Latin alphabets).\footnote{ %
-%         For the Arabic script this is now done by the bundled package \pkg{arabicnumbers}.}
+%       for non-Latin alphabets).\footnote{%
+%         This is done by bundled sub-packages such as \pkg{arabicnumbers}.}
 % \item Ensuring proper directionality if the document contains languages
 %       that are written from right to left (via the package \pkg{bidi},
 %       available separately).
@@ -414,48 +444,47 @@
 % \subsection{Supported languages}
 % 
 % Table~\ref{tab:lang} lists all languages currently supported.
-% Those in red have specific options and/or commands
+% Those in \TR{red} have specific options and/or commands
 % that are explained in section \ref{specific} below.
 % 
 % \begin{table}[ht]\centering
-% \label{tab:lang}
-% ^^A Produced with tools/insert-language-list.rb -- JS, 2019-10-18
-% ^^A Edited by hand -- JS, 2019-10-18
+% \caption{\label{tab:lang}Languages currently supported in \pkg{polyglossia}}
+% ^^A Produced with tools/insert-language-list.rb -- JS, 2019-11-01
+% ^^A Edited by hand -- JS, 2019-11-01
 % \begin{tabular}{lllll}
 % \toprule
-% albanian     & \TX{dutch}     & interlingua  & \TX{mongolian}  & \TX{slovenian}\\
-% amharic      & \TX{english}   & \TX{italian} & nko             & \TX{sorbian}\\
-% \TX{arabic}  & \TX{esperanto} & japanese     & \TX{norwegian}  & spanish\\
-% \TX{armenian}& estonian       & kannada      & occitan         & swedish\\
-% asturian     & \TX{finnish}   & khmer        & \TX{persian}    & \TX{syriac}\\
-% basque       & \TX{french}    & \TX{korean}  & piedmontese     & tamil\\
-% \TX{bengali} & friulian       & \TX{kurdish} & polish          & telugu\\
-% breton       & \TX{gaelic}    & \TX{lao}     & \TX{portuguese} & \TX{thai}\\
-% bulgarian    & galician       & \TX{latin}   & romanian        & \TX{tibetan}\\
-% \TX{catalan} & \TX{german}    & latvian      & romansh         & turkish\\
-% coptic       & \TX{greek}     & lithuanian   & \TX{russian}    & turkmen\\
-% croatian     & \TX{hebrew}    & macedonian   & \TX{sami}       & \TX{ukrainian}\\
-% \TX{czech}   & \TX{hindi}     & \TX{malay}   & \TX{sanskrit}   & urdu\\
-% danish       & \TX{hungarian} & malayalam    & \TX{serbian}    & vietnamese\\
-% divehi       & icelandic      & marathi      & slovak          & \TX{welsh}\\
+% \TX{afrikaans}  & danish         & \TX{hungarian} & marathi         & \TX{slovenian} \\
+% albanian        & divehi         & icelandic      & \TX{mongolian}  & \TX{sorbian}   \\
+% amharic         & \TX{dutch}     & interlingua    & nko             & \TX{spanish}   \\
+% \TX{arabic}     & \TX{english}   & \TX{italian}   & \TX{norwegian}  & swedish        \\
+% \TX{armenian}   & \TX{esperanto} & japanese       & occitan         & \TX{syriac}    \\
+% asturian        & estonian       & kannada        & \TX{persian}    & tamil          \\
+% basque          & \TX{finnish}   & khmer          & piedmontese     & telugu         \\
+% \TX{belarusian} & \TX{french}    & \TX{korean}    & polish          & \TX{thai}      \\
+% \TX{bengali}    & friulian       & \TX{kurdish}   & \TX{portuguese} & \TX{tibetan}   \\
+% bosnian         & \TX{gaelic}    & \TX{lao}       & romanian        & turkish        \\
+% breton          & galician       & \TX{latin}     & romansh         & turkmen        \\
+% bulgarian       & \TX{georgian}  & latvian        & \TX{russian}    & \TX{ukrainian} \\
+% \TX{catalan}    & \TX{german}    & lithuanian     & \TX{sami}       & urdu           \\
+% coptic          & \TX{greek}     & macedonian     & \TX{sanskrit}   & vietnamese     \\
+% croatian        & \TX{hebrew}    & \TX{malay}     & \TX{serbian}    & \TX{welsh}     \\
+% \TX{czech}      & \TX{hindi}     & malayalam      & \TX{slovak}     &                \\
 % \bottomrule
 % \end{tabular}
 % 
-% 
-% \caption{Languages currently supported in \pkg{polyglossia}}
 % \end{table}
 % 
 % \paragraph{Version Notes} The support for Amharic\new{v1.0.1} should be considered an experimental attempt to
-% port the package \pkg{ethiop}.\footnote{Feedback is welcome.}
+% port the package \pkg{ethiop}; feedback is welcome.
 % Version 1.1.1\new{v1.1.1} added support for Asturian, %\footnote{ Provided by Kevin Godby and Xuacu Saturio.}, 
 % Lithuanian, %\footnote{ Provided by Kevin Godby and Paulius Sladkevičius.},
 % and Urdu. %\footnote{ Provided by Kamal Abdali.}
 % ^^A
-% Version 1.2\new{v1.2.0} adds support for Armenian, Occitan, Bengali,
+% Version 1.2\new{v1.2.0} introduced Armenian, Occitan, Bengali,
 % Lao, Malayalam, Marathi, Tamil, Telugu, and Turkmen.\footnote{%
 %   See acknowledgements at the end for due credit to the various contributors.}
-% Version 1.43\new{v1.43} silently introduced basic support for Japanese. This
-% is considered experimental, and feedback is appreciated.
+% Version 1.43\new{v1.43} brought basic support for Japanese (this
+% is considered experimental, feedback is appreciated).
 % In version 1.45\new{v1.45}, support for Kurdish and Mongolian as well as some new
 % variants (Canadian French and English) have been added. Furthermore,  for consistency reasons, some language have
 % been renamed (\emph{farsi}\textrightarrow\emph{persian}, \emph{friulan}\textrightarrow\emph{friulian},
@@ -465,68 +494,84 @@
 % \emph{lsorbian}\slash\emph{usorbian}\textrightarrow\emph{sorbian},
 % \emph{irish}\slash\emph{scottish}\textrightarrow\emph{gaelic},
 % \emph{norsk}\slash\emph{nynorsk}\textrightarrow\emph{norwegian}). The old names are still supported for backwards
-% compatibility reasons, but they might not give access to newer language features.
+% compatibility reasons.
+% Version 1.46\new{v1.46} introduces support for Afrikaans, Belarusian, Bosnian and Georgian.
 % 
 % 
-% \subsection{Relation to Babel languages}
+% \subsection{Relation to and use of Babel language names}
 % 
 % If you are familiar with the \pkg{babel} package, you will note that \pkg{polyglossia}'s language naming
 % slightly differs. Whereas \pkg{babel} has a unique name for each language variety (\eg\emph{american} and \emph{british}),
-% \pkg{polyglossia} differentiates language varieties via language options.
+% \pkg{polyglossia} differentiates language varieties via language options (\eg \emph{english}, ¦variant=american¦).
 % 
-% Furthermore, \pkg{babel} uses sometimes abbreviations for language names (\eg\emph{bahasam} for Bahasa Malayu) as well
+% Furthermore, \pkg{babel} sometimes uses abbreviated language names (\eg\emph{bahasam} for Bahasa Malayu) as well
 % as endonyms, \ie language names coming from the designated languages (such as \emph{bahasa}, \emph{canadien} or \emph{magyar}).
 % As opposed to this, \pkg{polyglossia} always uses spelled-out (lower-cased) English language names.
+% Please refer to table~\ref{tab:bbllang} for the differing language names in both packages. 
 % 
-% Table~\ref{tab:bbllang} lists the language names that differ in both packages. \pkg{Babel} names marked in red can also be used
-% in \pkg{polyglossia} as an alias.\footnote{This is for historical reasons, since earlier versions of \pkg{polyglossia} used
-% 	those names as well. Note, however, that you need to use the matching language switching commands, then, as
-%     well, \eg \cmd\textportuges\ with \emph{portuges} (rather than \cmd\textportuguese).}
+% \begin{table}
+% \caption{\label{tab:bbllang}Babel-polyglossia language name matching}
 % 
-% \begin{table}
-% \label{tab:bbllang}
+% \begin{minipage}[t]{1\columnwidth}
+% \small\centering
 % \begin{tabular}{lll}
 % \toprule 
 % \textbf{Babel name} & \textbf{Polyglossia name} & \textbf{Polyglossia options}\tabularnewline
 % \midrule
-% acadien         & french     & variant=acadian                \\
-% american        & english    & \emph{(default)}               \\
-% australian      & english    & variant=australian             \\
-% austrian        & german     & variant=austrian, spelling=old \\
-% bahasa          & malay      & \emph{(default)}               \\
-% \TR{bahasam}    & malay      & variant=malaysian              \\
-% \TR{brazil}     & portuguese & variant=brazilian              \\
-% british         & english    & variant=british                \\
-% canadian        & english    & variant=canadian               \\
-% canadien        & french     & variant=canadian               \\
-% \TR{farsi}      & persian    &                                \\
-% \TR{friulan}    & friulian   &                                \\
-% german          & german     & spelling=old                   \\
-% \TR{irish}      & gaelic     & variant=irish                  \\
-% kurmanji        & kurdish    & variant=kurmanji               \\
-% lowersorbian    & sorbian    & variant=lower                  \\
-% \TR{magyar}     & hungarian  &                                \\
-% naustrian       & german     & variant=austrian               \\
-% newzealand      & english    & variant=newzealand             \\
-% ngerman         & german     & \emph{(default)}               \\
-% \TR{norsk}      & norwegian  & variant=bokmal                 \\
-% nswissgerman    & german     & variant=swiss                  \\
-% \TR{nynorsk}    & norwegian  & \emph{(default)}               \\
-% polutonikogreek & greek      & variant=polytonic              \\
-% \TR{portuges}   & portuguese & \emph{(default)}               \\
-% \TR{samin}      & sami       &                                \\
-% \TR{scottish}   & gaelic     & variant=scottish               \\
-% serbianc        & serbian    & script=Cyrillic                \\
-% slovene         & slovenian  &                                \\
-% swissgerman     & german     & variant=swiss, spelling=old    \\
-% uppersorbian    & sorbian    & variant=upper                  \\
+% acadien            & french     & variant=acadian                     \\
+% american           & english    & variant=american [\emph{default}]   \\
+% australian         & english    & variant=australian                  \\
+% austrian           & german     & variant=austrian, spelling=old      \\
+% bahasa             & malay      & variant=indonesian [\emph{default}] \\
+% bahasam            & malay      & variant=malaysian                   \\
+% brazil             & portuguese & variant=brazilian                   \\
+% british            & english    & variant=british                     \\
+% canadian           & english    & variant=canadian                    \\
+% canadien           & french     & variant=canadian                    \\
+% farsi              & persian    &                                     \\
+% friulan            & friulian   &                                     \\
+% german\footnote{Due to the name conflict only available in \pkg{polyglossia} as \emph{germanb} (which is a \pkg{babel} synonym).}
+%                    & german     & spelling=old                        \\
+% irish              & gaelic     & variant=irish [\emph{default}]      \\
+% kurmanji           & kurdish    & variant=kurmanji                    \\
+% latin.classic\footnote{Available in \pkg{polyglossia} as \emph{latinclassic} (as dots are invalid in command names).}
+%                    & latin      & variant=classic                     \\
+% latin.ecclesiastic\footnote{Available in \pkg{polyglossia} as \emph{latinecclesiastic} (as dots are invalid in command names).}
+%                    & latin      & variant=ecclesiastic                \\
+% latin.medieval\footnote{Available in \pkg{polyglossia} as \emph{latinmedieval} (as dots are invalid in command names).}
+%                    & latin      & variant=medieval                    \\
+% lowersorbian       & sorbian    & variant=lower                       \\
+% magyar             & hungarian  &                                     \\
+% naustrian          & german     & variant=austrian                    \\
+% newzealand         & english    & variant=newzealand                  \\
+% ngerman            & german     & variant=german [\emph{default}]     \\
+% norsk              & norwegian  & variant=bokmal                      \\
+% nswissgerman       & german     & variant=swiss                       \\
+% nynorsk            & norwegian  & variant=nynorsk [\emph{default}]    \\
+% polutonikogreek    & greek      & variant=polytonic                   \\
+% portuges           & portuguese & variant=portuguese [\emph{default}] \\
+% samin              & sami       &                                     \\
+% scottish           & gaelic     & variant=scottish                    \\
+% serbianc           & serbian    & script=Cyrillic                     \\
+% slovene            & slovenian  &                                     \\
+% spanishmx          & spanish    & variant=mexican                     \\
+% swissgerman        & german     & variant=swiss, spelling=old         \\
+% uppersorbian       & sorbian    & variant=upper                       \\
 % \bottomrule
 % \end{tabular}
+% \end{minipage}
 % 	
-% \caption{Babel-polyglossia language name matching}
 % \end{table}
 % 
+% For convenience reasons, \pkg{polyglossia} also supports the use of babel names\new{v1.46} (for the few justified
+% exceptions, please refer to the notes in table~\ref{tab:bbllang}).
+% The babel names listed in table~\ref{tab:bbllang} can be used instead of the corresponding polyglossia
+% name\slash options in \cmd\setdefaultlanguage\ and \cmd\setotherlanguage\ as well as in the \pkg{polyglossia} and
+% \pkg{babel} language switching commands\slash environments documented in section~\ref{sec:langcmds} and
+% \ref{sec:babelcmds} (\eg \cmd\textaustrian\ is synonymous to \cmd{\textgerman[variant=austrian,spelling=old]}).
+% However, unless you have special reasons, we strongly encourage you to use the \pkg{polyglossia} names.
 % 
+% 
 % \subsection{Global options}
 % 
 % \pkg{Polyglossia} can be loaded with the following global package options:
@@ -533,52 +578,62 @@
 % 
 % \begin{itemize}
 % 	\item \TB{babelshorthands}\new{v1.1.1} globally activates \pkg{babel}
-%           shorthands whenever available. Currently shorthands are implemented for
-%           Catalan, Czech, Dutch, Finnish, German, Italian, Mongolian, and Russian.
-%           Please refer to the respective language descriptions (sec.~\ref{specific}) for details.
+% 		shorthands whenever available. Currently shorthands are implemented for
+% 		Afrikaans, Belarusian, Catalan, Czech, Dutch, Finnish, Georgian, German,
+% 		Italian, Latin, Mongolian, Russian, and Slovak. Please refer to the respective
+% 		language descriptions (sec.~\ref{specific}) for details.
 % 
-%     \item \TB{localmarks} redefines the internal \LaTeX\ macros \cmd\markboth\ and \cmd\markright.
-%           In earlier versions of \pkg{polyglossia},\new{v1.2.0} this option was set by default, but we
-%           now realize that it causes more problems than it helps, so it is now off by default.
-%           For backwards-compatibility, the option \TB{nolocalmarks} which used to switch off the previous
-%           default, and now does nothing, is still available.
+% 	\item \TB{localmarks} redefines the internal \LaTeX\ macros \cmd\markboth\ and
+% 		\cmd\markright. In earlier versions of \pkg{polyglossia},\new{v1.2.0} this
+% 		option was set by default, but we now realize that it causes more problems
+% 		than it helps, so it is now off by default.  For backwards-compatibility, the
+% 		option \TB{nolocalmarks} which used to switch off the previous default, and
+% 		now does nothing, is still available.
 % 
-%     \item \TB{quiet} turns off most info messages and some of the warnings issued by \LaTeX,
-%           \pkg{fontspec} and \pkg{polyglossia}.
+% 	\item \TB{quiet} turns off most info messages and some of the warnings issued
+% 		by \LaTeX, \pkg{fontspec} and \pkg{polyglossia}.
 % \end{itemize}
 % 
 % \section{Language-switching commands}\label{languageswitching}
 % 
-% \subsection{Recommended commands}
+% \subsection{Recommended commands}\label{sec:langcmds}
 % For each activated language the command
 % \cmd{\text⟨lang⟩[⟨options⟩]\{…\}} \DescribeMacro{\text⟨lang⟩}
+% (as well as the synonymous \DescribeMacro{\textlang}%
+% \cmd{\textlang[⟨options⟩]\{⟨lang⟩\}\{…\}}\new{1.46})
 % becomes available for short insertions of text in that language.
-% For example ¦\textrussian{\today}¦ yields \textrussian{\today}
-% This command switches to the correct hyphenation patterns, it activates
+% For example ¦\textrussian{\today}¦ and ¦\textlang{russian}{\today}¦ yield \textrussian{\today}
+% The commands switch to the correct hyphenation patterns, they activate
 % some extra features for the selected language (such as extra spacing before
-% punctuation in French), and it translates the date when using ¦\today¦.
-% It does not, however, translate so-called \textit{caption strings}, i.\,e.
+% punctuation in French), and they translate the date when using ¦\today¦.
+% They do not, however, translate so-called \textit{caption strings},\ie
 % ``chapter'', ``figure'' etc., to the local language (these remain in the main
 % language).
 % 
 % The\DescribeEnv{⟨lang⟩}\ environment ¦⟨lang⟩¦, which is also available for any activated language,
-% is meant for longer passages of text. It behaves slightly different than the \cmd{\text⟨lang⟩\{…\}}
-% command: It does everything the latter does, but additionally, the caption strings are translated
-% as well, and the language is also passed to auxiliary files, the table of contents and the lists of
-% figures/tables.
-% Like the command, the environment provides the possibility of setting language options locally.
+% is meant for longer passages of text. It behaves slightly different than the \cmd{\text⟨lang⟩} and
+% \cmd\textlang\ commands: It does everything the latter do, but additionally, the caption strings
+% are translated as well, and the language is also passed to auxiliary files, the table of contents
+% and the lists of figures/tables.
+% Like the commands, the environment provides the possibility of setting language options locally.
 % For instance the following allows us to quote the beginning
 % of Homer’s \textit{Iliad}:
 % 
 % \begin{Verbatim}[formatcom=\color{myblue}]
-% \begin{greek}[variant=ancient]
-% μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς ἄλγε'
-% ἔθηκε, πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων, αὐτοὺς δὲ ἑλώρια
-% τεῦχε κύνεσσιν οἰωνοῖσί τε πᾶσι, Διὸς δ' ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ
-% πρῶτα διαστήτην ἐρίσαντε Ἀτρεί̈δης τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς.
-% \end{greek}
+%   \begin{quote}
+%    \begin{greek}[variant=ancient]
+%      μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς
+%      ἄλγε' ἔθηκε, πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων,
+%      αὐτοὺς δὲ ἑλώρια τεῦχε κύνεσσιν οἰωνοῖσί τε πᾶσι, Διὸς δ'
+%      ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ πρῶτα διαστήτην ἐρίσαντε Ἀτρεί̈δης
+%      τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς.
+%    \end{greek}
+%   \end{quote}
 % \end{Verbatim}
 % 
+% \vspace{-.5\baselineskip}
+% 
+% \begin{quote}
 % \begin{greek}[variant=ancient]
 % μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος οὐλομένην, ἣ μυρί' Ἀχαιοῖς ἄλγε' ἔθηκε,
 % πολλὰς δ' ἰφθίμους ψυχὰς Ἄϊδι προί̈αψεν ἡρώων, αὐτοὺς δὲ ἑλώρια τεῦχε κύνεσσιν
@@ -585,13 +640,13 @@
 % οἰωνοῖσί τε πᾶσι, Διὸς δ' ἐτελείετο βουλή, ἐξ οὗ δὴ τὰ πρῶτα διαστήτην ἐρίσαντε
 % Ἀτρεί̈δης τε ἄναξ ἀνδρῶν καὶ δῖος Ἀχιλλεύς.
 % \end{greek}
-% \bigskip
+% \end{quote}
 % 
 % \noindent\DescribeEnv{Arabic} Note that for Arabic one cannot use the environment ¦arabic¦,
 % as \cmd\arabic\ is defined internally by \LaTeX. In this case
 % we need to use the environment ¦Arabic¦ instead.
 % 
-% \subsection{Babel commands}
+% \subsection{Babel commands}\label{sec:babelcmds}
 % Some macros defined in \pkg{babel}’s \file{hyphen.cfg} (and thus usually
 % compiled into the \XeLaTeX\ and \LuaLaTeX\ format) are redefined, but keep a
 % similar behaviour.
@@ -605,7 +660,7 @@
 % ¦\selectlanguage{⟨lang⟩}¦ and the ¦otherlanguage¦ environment are identical to the
 % the ¦⟨lang⟩¦ environment, except that ¦\selectlanguage{⟨lang⟩}¦
 % does not need to be explicitly closed. The command ¦\foreinlanguage{⟨lang⟩}{…}¦ and the ¦otherlanguage*¦
-% environment are identical with the use of the ¦\text⟨lang⟩¦ command, with the one
+% environment are identical with the use of the ¦\text⟨lang⟩¦ or ¦\textlang¦ command, with the one
 % notable exception that they do not translate the date with ¦\today¦.
 % 
 % Since the \XeLaTeX\ and \LuaLaTeX\ format incorporate \pkg{babel}’s \file{hyphen.cfg},
@@ -614,12 +669,13 @@
 % 
 % \subsection{Other commands}
 % The following commands are probably of lesser interest to the end user, but
-% ought to be mentioned here.
+% ought to be mentioned here.\footnote{Note that these commands require polyglossia
+% language names; they do not support language\slash babel aliases.}
 % \begin{itemize}
-% \item \Cmd\selectbackgroundlanguage: this selects the global font setup and
-% 	the numbering definitions for the default language.
+% \item \DescribeMacro{\selectbackgroundlanguage}\cmd{\selectbackgroundlanguage\{⟨lang⟩\}}:
+%     this selects the global font setup and the numbering definitions for the default language.
 % 
-% \item \Cmd\resetdefaultlanguage\ (experimental):
+% \item \DescribeMacro{\resetdefaultlanguage}\cmd{\resetdefaultlanguage[⟨options⟩]\{⟨lang⟩\}} (experimental):
 % 	completely switches the default language
 % 	to another one in the middle of a document: \textit{this may have adverse effects}!
 % 
@@ -630,9 +686,34 @@
 % 
 % \item \Cmd\latinalph: Representation of counter as a lower-case letter:  1 = a, 2 = b, etc.
 % 
-% \item \Cmd\latinAlph: Representation of counter as a uper-case letter:  1 = A, 2 = B, etc.
+% \item \Cmd\latinAlph: Representation of counter as a upper-case letter:  1 = A, 2 = B, etc.
 % \end{itemize}
 % 
+% 
+% \subsection{Setting up alias commands}
+% 
+% By means of the macro
+% \displaycmd{\setlanguagealias[⟨options⟩]\{⟨language⟩\}\{⟨alias⟩\}}{\setlanguagealias}\new{v1.46}
+% you can define alias commands for specific language (variants). \Eg
+% 
+% \begin{quote}
+% \begin{verbatim}
+% \setlanguagealias[variant=austrian]{german}{deAT}
+% \end{verbatim}
+% \end{quote}
+% ^^A
+% will define a command \cmd{\textdeAT} as well as an environment ¦{deAT}¦ which will link towards
+% the command \cmd{\textgerman[variant=austrian]} and the environment ¦{german}[variant=austrian]¦,
+% respectively. The aliases can also be used in the language switching commands described in
+% section~\ref{sec:langcmds} and \ref{sec:babelcmds}.
+% Note, though, that the usual restrictions for command names apply, so something such as
+% ¦de-AT¦ or ¦de_AT¦ will not work since ¦-¦ and ¦_¦ are not allowed in command names.
+% 
+% For the latter case, and for the case where an alias would clash with an existing \cmd{\text⟨...⟩}
+% command (\eg ¦\textit¦), a starred version \Cmd{\setlanguagealias*} is provided which does not define
+% a \cmd{\text⟨alias⟩} command (but which will set up the alias for everything else, including
+% \cmd{\textlang\{⟨alias⟩\}}).
+% 
 % \section{Font setup}
 % 
 % With polyglossia it is possible to associate a specific font with any script or language
@@ -641,11 +722,12 @@
 % For instance, if the default font defined by \cmd\setmainfont\
 % does not support Greek, then one can define the font used to display Greek with:\\
 % \centerline{ \cmd\newfontfamily\cmd{\greekfont[Script=Greek,⟨…⟩]\{⟨font⟩\}}. }
-% Note that polyglossia will use the font thus defined as is.
-% for instance if ¦\arabicfont¦ is explicitly defined, then one should take care of
-% including the option ¦Script=Arabic¦ in that definition.
-% See the \pkg{fontspec} documentation for more information.
-% If a specific sans or monospace font is needed for a particular script or language,
+% Note that polyglossia will use the font defined as is, so assure to do all necessary settings
+% (please refer to the \pkg{fontspec} documentation for details).
+% For instance, if ¦\arabicfont¦ is explicitly defined, then the option ¦Script=Arabic¦ should
+% be included in that definition.
+% 
+% If a specific sans serif or monospace (`teletype') font is needed for a particular script or language,
 % it can be defined by means of \new{v1.2.0}
 % ¦\⟨script⟩fontsf¦\ or ¦\⟨language⟩fontsf¦ and ¦\⟨script⟩fonttt¦\ or ¦\⟨language⟩fonttt¦, respectively.
 % 
@@ -674,7 +756,7 @@
 % \end{Verbatim}
 % ^^A
 % These exceptions, however, apply to all languages. In addition to this, \pkg{polyglossia} provides
-% the command\new{v.1.45}
+% the command\new{v1.45}
 % \displaycmd{\pghyphenation[⟨options⟩]\{⟨lang⟩\}\{⟨exceptions⟩\}}{\pghyphenation}
 % which can be used to define exceptions that only apply to a specific language or language variant,
 % respectively.
@@ -695,6 +777,24 @@
 % 
 % ^^A\subsection{amharic}\label{amharic}
 % 
+% \subsection{afrikaans}\label{afikaans}
+% \paragraph*{Options:}
+% \begin{itemize}
+% 	\item \TB{babelshorthands} = \textit{false} or true. \new{v1.1.1}
+% 	if this is turned on, the following shorthands defined for fine-tuning hyphenation and
+% 	micro-typography of Afrikaans words are activated:
+% 	\begin{shorthands}
+% 		\item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+% 		in the hyphenation patterns (as opposed to ¦\-¦ in default \TeX).
+% 		\item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+% 		cases where the hyphen should stick at the following syllable.
+% 		\item[¦"|¦] disables a ligature at this position.
+% 		\item[¦""¦] allows for a line break at this position (without hyphenation sign).
+% 		\item[¦"/¦] a slash that allows for a subsequent line break. As opposed to ¦\slash¦,
+% 		hyphenation at the breakpoints preset in the hyphenation patterns is still allowed.
+% 	\end{shorthands}
+% \end{itemize}
+% 
 % \subsection{arabic}\label{arabic}
 % \paragraph*{Options:}
 % 	\begin{itemize}
@@ -726,6 +826,42 @@
 % 	\item \TB{numerals}\new{v1.45} = armenian or \textit{arabic}
 % \end{itemize}
 % 
+% \subsection[belarusian]{belarusian\new{v1.46}}\label{belarusian}
+% 
+% \paragraph*{Options:}
+% \begin{itemize}
+% 	\item \TB{babelshorthands} = \textit{false} or true.
+% 	If this is turned on, the following shorthands are activated:
+% 	\begin{shorthands}
+% 		\item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+% 		in the hyphenation patterns (as opposed to ¦\-¦).
+% 		\item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+% 		cases where the hyphen should stick at the following syllable.
+% 		\item[¦"|¦] disables a ligature at this position.
+% 		\item[¦""¦] allows for a line break at this position (without hyphenation sign).
+% 		\item[¦"---¦] Cyrillic emdash in plain text.
+% 		\item[¦"--~¦] Cyrillic emdash in compound names (surnames).
+% 		\item[¦"--*¦] Cyrillic emdash for denoting direct speech.
+% 		\item[¦",¦] thinspace for initials with a breakpoint in following surname.
+% 		\item[¦"‘¦] for German left double quotes (looks like ,,).
+% 		\item[¦"’¦] for German right double quotes (looks like “).
+% 		\item[¦"<¦] for French left double quotes (looks like <<).
+% 		\item[¦">¦] for French right double quotes (looks like >>).
+% 	\end{shorthands}
+% 	\item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic
+% 	alphanumerical numbering.
+% 	\item \TB{spelling} = \textit{modern} or classic (=~tarask). With ¦spelling=classic¦, captions and dates
+% 	     adhere to the Taraškievica (or Belarusian classical) orthography rather than the standard orthography.
+% \end{itemize}
+% ^^A
+% \paragraph*{Commands:}
+% \begin{itemize}
+% 	\item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for
+% 	environments such as ¦enumerate¦. The command takes a counter as argument,
+% 	\eg ¦\textbelarusian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}.
+% 	\item \Cmd\asbuk: same in lowercase
+% \end{itemize}
+% 
 % \subsection[bengali]{bengali\new{v1.2.0}}\label{bengali}
 % \paragraph*{Options:}
 % 	\begin{itemize}
@@ -756,25 +892,25 @@
 % 	\begin{shorthands}
 % 		\item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning
 % 		            of the next line when hyphenated, as common in Czech typesetting
-% 		            (also see option ¦splithyphens¦).
+% 		            (only needed with ¦splithyphens=false¦).
 % 		\item[¦"‘¦] for Czech left double quotes (looks like ,,).
 % 		\item[¦"’¦] for Czech right double quotes (looks like “).
 % 		\item[¦">¦] for Czech left double guillemets (looks like >>).
 % 		\item[¦"<¦] for Czech right double guillemets (looks like <<).
 % 	\end{shorthands}
-% 	\item \TB{splithyphens} = \textit{false} or true. \new{v1.45}
+% 	\item \TB{splithyphens} = false or \textit{true}.\new{v1.45}
 % 	      According to Czech typesetting conventions, if a word with a hard hyphen (such as \emph{je-li})
 % 	      is hyphenated at this hyphen, a second hyphenation character is to be inserted at the beginning
-% 	      of the line that follows the hyphenation (\emph{je-/-li}).\\
-%           If this option is true, this is done automatically (so the shorthand ¦"=¦ is not needed).
-%           Note, however, that the option is only available for \XeTeX. If you are using \LuaTeX,
-%           load the \pkg{luavlna} package to the same effect.
-%     \item \TB{vlna} = \textit{false} or true. \new{v1.45}
+% 	      of the line that follows the hyphenation (\emph{je-/-li}).
+%           By default, this is done automatically\new{v1.46} (if you are using \LuaTeX, the \pkg{luavlna} package is
+%           loaded to achieve this).
+%           Set this option to ¦false¦ to disable the feature.
+%     \item \TB{vlna} = false or \textit{true}. \new{v1.45}
 %          According to Czech typesetting conventions, single-letter words (non-syllable prepositions)
-%          must not occur at line ends.\\
-%          If this option is true, this is taken care of. Note, however, that the option
-%          is only available for \XeTeX. If you are using \LuaTeX, load the \pkg{luavlna} package
-%          to the same effect.
+%          must not occur at line ends.
+%          \pkg{Polyglossia} takes care of this automatically by default\new{v1.46} (if you are using \LuaTeX, the
+%          \pkg{luavlna} package is loaded to achieve this).
+%          Set this option to ¦false¦ to disable the feature.
 % \end{itemize}
 % 
 % \subsection{dutch}\label{dutch}
@@ -835,14 +971,31 @@
 % 	\begin{itemize}
 % 		\item\TB{variant} = \textit{french} or canadian (=~acadian).\new{v1.45}
 % 		Currently, the three variants do not differ; they are supported for compatibility with \pkg{babel} (where they do not differ either).
-% 		\item \TB{autospacing} = true or \textit{false} (default value = true). One of the most distinct features of French typography is the addition
+% 		\item \TB{autospacing} = \textit{true} or false. One of the most distinct features of French typography is the addition
 % 		of extra spacing around punctuation and quotation marks (guillemets). By default, polyglossia adds these spaces automatically, so you don't need
 % 		to enter them. This options allows you to switch this feature off globally.
-% 		\item \TB{autospaceguillemets}\footnote{Up to version 1.44, the option was called \textit{automaticspacesaroundguillemets}. For backards compatibility reasons, the more verbose old option is still supported.} = true or \textit{false} (default value = true). If you only want to disable the automatic addition of spacing after opening and before closing guillemets (and not at punctuation), set this to \textit{false}. Note
-% 		that the more general option \textit{autospacing} overrides this.
+% 		\item \TB{thincolonspace}\new{v1.46} = true or \textit{false}. Normally, a
+% 		full (non-breaking) interword space is inserted before a colon. Use this
+% 		option if you prefer a thinner space as used before \texttt{;}, \texttt{!},
+% 		and \texttt{?}.
+% 		\item \TB{autospaceguillemets}\footnote{Up to version 1.44, the option was
+% 		called \textit{automaticspacesaroundguillemets}. For backards compatibility
+% 		reasons, the more verbose old option is still supported.} = \textit{true}
+% 		or false. If you only want to disable the automatic addition of spacing
+% 		after opening and before closing guillemets (and not at punctuation), set
+% 		this to \textit{false}. Note that the more general option
+% 		\textit{autospacing} overrides this.
 % 		\item \TB{autospacetypewriter}\footnote{Babel's syntax \textit{OriginalTypewriter} is also supported.}\new{1.45} = true or \textit{false} (default value = true). By default, automatic spacing is disabled in typewriter font. If this is enabled, spacing in typewriter context is the same as with roman and sans serif font, depending on the \textit{autospacing} and \textit{autospaceguillemets} settings (note that this was the default up to v.~1.44).	
 % 		\item \TB{frenchfootnote} = true or \textit{false} (default value = true). If \textit{true}, footnotes start with a non-superscripted number followed by a dot, as common in French typography. Note that this might interfere with the specific footnote handling of classes or packages.
 % 		Also note that this option is only functional (by design) if French is the main language.
+% 		\item \TB{frenchitemlabels}\new{v.1.46} = true or \textit{false} (default value = true). If \textit{true}, itemize item labels use em-dashes throughout,
+% 		as common in French typography.
+% 		Note that this option is only functional (by design) if French is the main language. Also, it might interfere with list packages such as \pkg{enumitem}.
+% 		\item \TB{itemlabels}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of all levels.
+% 		\item \TB{itemlabeli}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of the first level.
+% 		\item \TB{itemlabelii}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of the second level.
+% 		\item \TB{itemlabeliii}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of the third level.
+% 		\item \TB{itemlabeliv}\new{v.1.46} = ¦⟨cmd⟩¦ (default value = ¦\textemdash¦). If \emph{frenchitemlabels} is true, you can customize here the used item label of the fourth level.
 % 	\end{itemize}
 % \paragraph*{Commands:}
 % \begin{itemize}
@@ -856,6 +1009,34 @@
 % 	\item \TB{variant} = \textit{irish} or scottish
 % \end{itemize}
 % 
+% \subsection[georgian]{georgian\new{v1.46}}\label{georgian}
+% 
+% \paragraph*{Options:}
+% \begin{itemize}
+% 	\item \TB{babelshorthands} = \textit{false} or true.
+% 	If this is turned on, the following shorthands are activated:
+% 	\begin{shorthands}
+% 		\item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+% 		in the hyphenation patterns (as opposed to ¦\-¦).
+% 		\item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+% 		cases where the hyphen should stick at the following syllable.
+% 		\item[¦"|¦] disables a ligature at this position.
+% 		\item[¦""¦] allows for a line break at this position (without hyphenation sign).
+% 		\item[¦"---¦] Cyrillic emdash in plain text.
+% 		\item[¦"--~¦] Cyrillic emdash in compound names (surnames).
+% 		\item[¦"--*¦] Cyrillic emdash for denoting direct speech.
+% 		\item[¦",¦] thinspace for initials with a breakpoint in following surname.
+% 		\item[¦"‘¦] for German left double quotes (looks like ,,).
+% 		\item[¦"’¦] for German right double quotes (looks like “).
+% 		\item[¦"<¦] for French left double quotes (looks like <<).
+% 		\item[¦">¦] for French right double quotes (looks like >>).
+% 	\end{shorthands}
+% 	\item \TB{numerals} = \textit{arabic} or georgian. Uses either Arabic numerals or Georgian
+% 	      alphanumerical numbering.
+%     \item \TB{oldmonthnames} = \textit{true} or false (default: false). Uses traditional Georgian
+%           month names.
+% \end{itemize}
+% 
 % \subsection{german}\label{german}
 % \paragraph*{Options:}
 % 	\begin{itemize}
@@ -897,8 +1078,9 @@
 % 		\item[¦"<¦] for French left double quotes («)
 % 		\item[¦">¦] for French right double quotes (»).
 % 		\end{shorthands}
-% 	\item\TB{script} = \textit{latin} or fraktur.\new{v1.2.0}
-% 		Setting script=fraktur modifies the captions for typesetting German in Fraktur.
+% 	\item\TB{script} = \textit{latin} or blackletter\new{v1.46} (=~fraktur\new{v1.2.0}).
+% 		Setting ¦script=blackletter¦ adapts the captions for typesetting German in blackletter type (using the long s (ſ)
+% 		where appropriate).
 % 	\end{itemize}
 % 
 % \subsection{greek}\label{greek}
@@ -939,6 +1121,27 @@
 % 	\end{itemize}
 % 
 % \subsection{hungarian}\label{hungarian}
+% \paragraph*{Options:}
+% \begin{itemize}
+% 	\item \TB{swapstrings} = \textit{all}, captions, headings, headers, hheaders or none\new{v1.46}
+% 	      
+% 	       In Hungarian, some caption strings need to be in a different order than in other languages
+% 	       (\eg \emph{1. fejezet} instead of \emph{Chapter 1}). By default, \pkg{polyglossia} tries hard to
+% 	       provide the correct order for different classes and packages (standard classes, \pkg{KOMA-script},
+% 	       \pkg{memoir}, and \pkg{titlesec} package should work, as well as \pkg{fancyhdr} and \pkg{caption}).
+% 	       However, since the definition of these strings is not standardized, the redefinitions might not work
+% 	       and even interfere badly if you use specific classes or packages that redefine the respective strings
+% 	       themselves. In this case, you can disable some or all changes.
+% 	       The possibilities are:
+% 	       \begin{itemize}
+% 	       	\item ¦all¦: Redefine figure and table captions, part and chapter headings, and running headers (=~default setting)
+% 	       	\item ¦captions¦: Redefine figure and table captions only
+% 	       	\item ¦headings¦: Redefine part and chapter headings only
+% 	       	\item ¦headers¦: Redefine running headers only
+% 	       	\item ¦hheaders¦: Redefine part and chapter headings as well as running headers
+% 	       	\item ¦none¦: Do not redefine anything
+% 	       \end{itemize}
+% \end{itemize}
 % \paragraph*{Commands:}
 % \begin{itemize}
 % 	\item \Cmd\ontoday\ (= \Cmd\ondatehungarian): special form of \cmd\today\ which produces a slightly different
@@ -973,7 +1176,6 @@
 %   \end{itemize}
 % 
 % \subsection[kurdish]{kurdish\new{v1.45}}\label{kurdish}
-% Kurdish support includes Sorani Kurdish and Kurmanji Kurdish, both in either Arabic or Latin script.
 % 
 % \paragraph*{Options:}
 % \begin{itemize}
@@ -982,9 +1184,10 @@
 % 	\item \TB{numerals} = western or eastern. Defaults are ¦western¦ for Latin and ¦eastern¦ for Arabic script, depending on the selection above.
 % 	\item \TB{abjadjimnotail} = \textit{false} or true.
 % 	Set this to true if you want the \textit{abjad} form of the number three to be \textarabic{ج‍} – as in the manuscript tradition – instead of the modern usage \textarabic{ج}.
-% 	\item \TB{locale} (not yet implemented)
-% 	\item \TB{calendar} (not yet implemented)
+% ^^A	\item \TB{locale} (not yet implemented)
+% ^^A	\item \TB{calendar} (not yet implemented)
 % \end{itemize}
+% \condbreak{2\baselineskip}
 % \paragraph*{Commands:}
 % \begin{itemize}
 % 	\item \Cmd\ontoday: special form of \cmd\today\ which produces a slightly different
@@ -1001,10 +1204,153 @@
 % 
 % \subsection{latin}\label{latin}
 % \paragraph*{Options:}
-% 	\begin{itemize}
-% 	\item \TB{variant} = classic, medieval or \textit{modern}
-% 	\end{itemize}
+% \begin{itemize}
+% 	\item \TB{variant} = classic, medieval, \emph{modern}, or ecclesiastic\new{v.1.46}
 % 
+% 			These variants refer to different spelling conventions. The ¦classic¦
+% 			and the ¦medieval¦ variant do not use the letters \emph{U} and
+% 			\emph{v}, but only \emph{V} and \emph{u}. This concerns predefined terms like
+% 			month names as well as the behaviour of the \cmd\MakeUppercase\ and the
+% 			\cmd\MakeLowercase\ command. The ¦medieval¦ and the
+% 			¦ecclesiastic¦ variant use the ligatures \emph{\ae} and \emph{\oe}.
+% 			See table \ref{tab:latin-spelling} for examples.
+% 
+% 			Furthermore, the \texttt{ecclesiastic} variant takes care for a punctuation
+% 			spacing similar to French, but with smaller spaces, as provided for
+% 			PDF\TeX\ by the \pkg{ecclesiastic} package.
+% 			\begin{table}
+% 			\centering
+% 			\caption{\label{tab:latin-spelling}Spelling differences between the Latin
+% 				language variants.\newline The capitalization of month names and the use of
+% 				\emph{i/j} may be affected by the \texttt{capitalizemonth} and the
+% 				\texttt{usej} option.}
+% 			\begin{tabular}{llll}
+% 			\toprule
+% 			\textbf{classic} & \textbf{medieval} & \textbf{modern} & \textbf{ecclesiastic} \\
+% 			\midrule
+% 			Ianuarii & Ianuarii & Ianuarii & ianuarii \\
+% 			Nouembris & Nouembris & Novembris & novembris \\
+% 			Praefatio & Præfatio & Praefatio & Præfatio \\
+% 			\addlinespace\multicolumn{4}{@{}l}{\cmd{\MakeUppercase\{Iulius\}} yields:} \\
+% 			IVLIVS & IVLIVS & IULIUS & IULIUS \\
+% 			\bottomrule
+% 			\end{tabular}
+% 			\end{table}
+% 	\item \TB{hyphenation}\new{v.1.46} = classic, modern, or liturgical
+% 
+% 			There are three different sets of hyphenation patterns for Latin. Separate
+% 			documention for them is available on the
+% 			Internet.\footnote{\url{https://github.com/gregorio-project/hyphen-la/blob/master/doc/README.md\#hyphenation-styles}}
+% 			Each of the four variants mentioned above has its default set of hyphenation
+% 			patterns as indicated by table \ref{tab:latin-hyphenation}. Use the
+% 			¦hyphenation¦ option if the default style does not fit your needs.
+% 			Note that the liturgical hyphenation patterns are the default of none of the
+% 			language variants. To use them, you have to say
+% 			¦hyphenation=liturgical¦ in any case.
+% 			\begin{table}
+% 			\caption{\label{tab:latin-hyphenation}Latin default hyphenation styles}
+% 			\centering
+% 			\begin{tabular}{ll}
+% 			\toprule
+% 			\textbf{Language variant} & \textbf{Default hyphenation style} \\
+% 			\midrule
+% 			classic & classic \\
+% 			medieval & modern \\
+% 			modern & modern \\
+% 			ecclesiastic & modern \\
+% 			\bottomrule
+% 			\end{tabular}
+% 			\end{table}
+% 	\item \TB{ecclesiasticfootnotes}\new{v.1.46} = true or \emph{false}
+% 
+% 			Use footnotes as provided by the \pkg{ecclesiastic} package, which typesets
+% 			footnotes with ordinary instead of superior numbers and without indentation.
+% 			As many ecclesiastic documents and liturgical books use footnotes that are
+% 			very similar to the ordinary \LaTeX\ ones, we do not use this footnote style
+% 			as default even for the ¦ecclesiastic¦ variant.
+% 		
+% 			Note that this option is only possible if Latin is the main language of your
+% 			document.
+% 	\item \TB{usej}\new{v.1.46} = true or \emph{false}
+% 
+% 			Use \emph{J/j} in predefined terms. The letter \emph{j} is not of ancient
+% 			origin. In early modern times, it was used to distinguish the consonantic
+% 			\emph{i} from the vocalic~\emph{i}. Nowadays, the use of \emph{j} has
+% 			disappeared from most Latin publications. So ¦false¦ is the default
+% 			value for all four language variants. Use this option if you prefer
+% 			\emph{Januarii} and \emph{Maji} to \emph{Ianuarii} and \emph{Maii}.
+% 			\item \TB{capitalizemonth}\new{v.1.46} = true or false
+% 		
+% 			Capitalize the month name when printing dates (using the \cmd\today\
+% 			command).  Traditionally, month names are capitalized. However, in recent
+% 			liturgical books they are lowercase. So ¦true¦ is the default value for
+% 			the variants ¦classic¦, ¦medieval¦, and ¦modern¦,
+% 			whereas ¦false¦ is the default value for the ¦ecclesiastic¦
+% 			variant.
+% 	\item \TB{babelshorthands} = true or \emph{false}
+% 
+% 			Enable the following shorthands inherited from \pkg{babel-latin} and the
+% 			\pkg{ecclesiastic} package.
+% 			\begin{shorthands}
+% 				\item[¦"<¦] for « (left guillemet)
+% 				\item[¦">¦] for » (right guillemet)
+% 				\item[¦"¦] If no other shorthand applies, ¦"¦ before any letter
+% 					character defines an optional break point allowing further break points
+% 					within the same word (as opposed to the \cmd\- command).
+% 				\item[¦"|¦] the same as ¦"¦, but also possible before non-letter
+% 					characters
+% 				\item[¦'a¦] for á (a with acute), also available for é, í, ó, ú, ý, ǽ, and
+% 					\'œ
+% 				\item[¦'A¦] for Á (A with acute), also available for É, Í, Ó, Ú, \'V, Ý, Ǽ,
+% 					and \'Œ
+% 			\end{shorthands}
+% 			The following shorthands are only available for the ¦medieval¦ and the
+% 			¦ecclesiastic¦ variant.
+% 			\begin{shorthands}
+% 				\item[¦"ae¦] for æ (ae ligature), also available for œ
+% 				\item[¦"Ae¦] for Æ (AE ligature), also available for Œ
+% 				\item[¦"AE¦] for Æ (AE ligature), also available for Œ
+% 				\item[¦'ae¦] for ǽ (ae ligature with acute), also available for \'œ
+% 				\item[¦'Ae¦] for Ǽ (AE ligature with acute), also available for \'Œ
+% 				\item[¦'AE¦] for Ǽ (AE ligature with acute), also available for \'Œ
+% 			\end{shorthands}
+% 	\item \TB{prosodicshorthands}\new{v.1.46} = true or \emph{false}
+% 
+% 			Enable shorthands for prosodic marks (macrons and breves) very similiar to
+% 			those provided by \pkg{babel-latin} using the ¦withprosodicmarks¦
+% 			modifier.
+% 		
+% 			Note that the active ¦=¦ character used for macrons will cause problems with
+% 			commands using \texttt{key=value} interfaces, \eg
+% 			¦\includegraphics[scale=2]{...}¦. Use \cmd{\shorthandoff\{=\}} before
+% 			such commands (and \cmd{\shorthandon\{=\}} thereafter) within every
+% 			environment with prosodic shorthands enabled.
+% 		
+% 			The following shorthands are available.
+% 			\begin{shorthands}
+% 				\item[¦=a¦] for ā (a with macron), also available for ē, ī, ō, ū, and ȳ
+% 				\item[¦=A¦] for Ā (A with macron), also available for Ē, Ī, Ō, Ū, V̄, and Ȳ.
+% 					Note that a macron above the letter V is only displayed if your font
+% 					supports the Unicode character ¦0304¦ (\emph{combining macron}).
+% 				\item[¦=ae¦] for a͞e (ae diphthong with macron), also available for a͞u, e͞u,
+% 					and o͞e. Note that macrons above diphthongs are only displayed if your font
+% 					supports the Unicode character ¦035E¦ (\emph{combining double
+% 					macron}).
+% 				\item[¦=Ae¦] for A͞e (Ae diphthong with macron), also available for A͞u, E͞u,
+% 					and O͞e.
+% 				\item[¦=AE¦] for A͞E (AE diphthong with macron), also available for A͞U, E͞U,
+% 					and O͞E.
+% 				\item[¦\textasciicircum a¦] for ă (a with breve), also available for ĕ, ĭ,
+% 					ŏ, ŭ, and y̆.  Note that a breve above the letter y is only displayed if
+% 					your font supports the Unicode character ¦0306¦ (\emph{combining
+% 					breve}).
+% 				\item[¦\textasciicircum A¦] Ă (A with breve), also available for Ĕ, Ĭ, Ŏ,
+% 					Ŭ, V̆, and Y̆. Note that breves above the letters V and Y are only displayed
+% 					if your font supports the Unicode character ¦0306¦ (\emph{combining
+% 					breve}).
+% 			\end{shorthands}
+% \end{itemize}
+% 
 % \subsection{malay}\label{malay}
 % \paragraph*{Options:}
 % \begin{itemize}
@@ -1043,7 +1389,7 @@
 % \begin{itemize}
 % 	\item \Cmd\Asbuk: produces uppercased Cyrillic alphanumerals, for
 % 	environments such as ¦enumerate¦. The command takes a counter as argument,
-% 	\eg ¦\textrussian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}.
+% 	\eg ¦\textmongolian{\Asbuk{page}}¦ produces \textrussian{\Asbuk{page}}.
 % 	\item \Cmd\asbuk: same in lowercase
 % \end{itemize}
 % 
@@ -1059,8 +1405,8 @@
 % 	\item \TB{numerals} = western or \textit{eastern}
 % 	\item \TB{abjadjimnotail} = \textit{false} or true. \new{v1.0.3}
 % 	Set this to true if you want the \textit{abjad} form of the number three to be \textarabic{ج‍} – as in the manuscript tradition – instead of the modern usage \textarabic{ج}.
-% 	\item \TB{locale} (not yet implemented)
-% 	\item \TB{calendar} (not yet implemented)
+% ^^A	\item \TB{locale} (not yet implemented)
+% ^^A	\item \TB{calendar} (not yet implemented)
 % \end{itemize}
 % \paragraph*{Commands:}
 % \begin{itemize}
@@ -1096,6 +1442,9 @@
 % ^^A		\item[¦"<¦] for French left double quotes (looks like <<).
 % ^^A		\item[¦">¦] for French right double quotes (looks like >>).
 % 	\end{shorthands}
+%     \item \TB{indentfirst}\new{v1.46} = \textit{true} or false. By default, all paragraphs are indented in Russian,
+%           also those after a chapter or section heading. If this option is false, the latter paragraphs
+%           are not indented, as normal in \LaTeX. 
 % 	\item \TB{spelling} = \textit{modern} or old (for captions and date only, not for hyphenation)
 % 	\item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic
 % 	alphanumerical numbering.
@@ -1115,17 +1464,17 @@
 % \subsection{sanskrit}\label{sanskrit}
 % \paragraph*{Options:}
 % 	\begin{itemize}
-% 	\item \TB{Script} = \textit{Devanagari}\new{v1.0.2}, Gujarati, Malayalam, Bengali, Kannada,
+% 	\item \TB{script} = \textit{Devanagari}\new{v1.0.2}, Gujarati, Malayalam, Bengali, Kannada,
 % 	Telugu or Latin.
-% 	The value is passed to \pkg{fontspec} in cases where the respective ¦\<script>font¦ is not defined.
+% 	The value is passed to \pkg{fontspec} in cases where the respective ¦\⟨script⟩font¦ is not defined.
 % 	This can be useful if you typeset Sanskrit texts in scripts other than Devanagari.
-% 	\item \TB{Numerals} = \textit{Devanagari}\new{v1.45} or Western
+% 	\item \TB{numerals} = \textit{Devanagari}\new{v1.45} or Western
 % 	\end{itemize}
 %  
 % \subsection{serbian}\label{serbian}
 % \paragraph*{Options:}
 % 	\begin{itemize}
-% 	\item \TB{Script} = \textit{Cyrillic} or Latin. Will likely go to a variant.
+% 	\item \TB{script} = \textit{Cyrillic} or Latin.
 % 	\item \TB{numerals} = \textit{arabic} or cyrillic. Uses either Arabic numerals or Cyrillic
 % 	      alphanumerical numbering.
 % 	\end{itemize}
@@ -1138,6 +1487,44 @@
 % \end{itemize}
 % 
 % 
+% \subsection{slovak}\label{slovak}
+% 
+% \paragraph*{Options:}
+% \begin{itemize}
+% 	\item \TB{babelshorthands} = \textit{false} or true. \new{v1.46}
+% 	if this is turned on, the following shorthands for Slovak are activated:
+% 	\begin{shorthands}
+%         \item[¦"=¦] for an explicit hyphen sign which is repeated at the beginning
+%                     of the next line when hyphenated, as common in Slovak typesetting
+% 		            (only needed with ¦splithyphens=false¦).
+%         \item[¦"|¦] disables a ligature at this position.
+%         \item[\texttt{"\textasciitilde}] for a hyphen sign without a breakpoint. Useful for
+%                     cases where the hyphen should stick at the following syllable.
+%         \item[¦"-¦] adds a hyphenation point that does still allow for hyphenation at the points preset
+%                     in the hyphenation patterns (as opposed to ¦\-¦).
+%         \item[¦""¦] allows for a line break at this position (without hyphenation sign).
+%         \item[¦"/¦] a slash that allows for a subsequent line break. As opposed to ¦\slash¦, hyphenation at the breakpoints
+%                     preset in the hyphenation patterns is still allowed.
+%         \item[¦"‘¦] for Slovak left double quotes (looks like ,,).
+%         \item[¦"’¦] for Slovak right double quotes (looks like “).
+%         \item[¦">¦] for Slovak left double guillemets (looks like >>).
+%         \item[¦"<¦] for Slovak right double guillemets (looks like <<).
+% 	\end{shorthands}
+% 	\item \TB{splithyphens} = \textit{false} or true. \new{v1.46}
+% 	      According to Slovak typesetting conventions, if a word with a hard hyphen (such as \emph{je-li})
+% 	      is hyphenated at this hyphen, a second hyphenation character is to be inserted at the beginning
+%           of the line that follows the hyphenation (\emph{je-/-li}).
+% 	      By default, this is done automatically (if you are using \LuaTeX, the \pkg{luavlna} package is
+% 	      loaded to achieve this).
+% 	      Set this option to ¦false¦ to disable the feature.
+% 	\item \TB{vlna} = \textit{false} or true. \new{v1.46}
+% 	      According to Slovak typesetting conventions, single-letter words (non-syllable prepositions)
+% 	      must not occur at line ends.
+% 	      \pkg{Polyglossia} takes care of this automatically by default (if you are using \LuaTeX, the
+% 	      \pkg{luavlna} package is loaded to achieve this).
+% 	      Set this option to ¦false¦ to disable the feature.
+% \end{itemize}
+% 
 % \subsection{slovenian}\label{slovenian}
 % \paragraph*{Options:}
 % 	\begin{itemize}
@@ -1156,6 +1543,35 @@
 % 	\item \Cmd\oldtoday: outputs the current date using traditional Sorbian month names, even if \TB{olddate} is false.
 % \end{itemize}
 % 
+% \subsection{spanish}\label{spanish}
+% \paragraph*{Options:}
+% \begin{itemize}
+% 	\item \TB{variant} = \textit{spanish} or mexican.\new{v1.46}
+% 	\item \TB{spanishoperators} = all, accented, spaced or none or \textit{false} (default value = all).\new{v1.46}
+% 	      Determines of and how math operators are localized to Spanish.
+% 	      \begin{itemize}
+% 	      	\item ¦accented¦ causes some math operators to use accents where usual in Spanish (\emph{lím},
+% 	      	      \emph{lím\,sup}, \emph{lím\,inf}, \emph{máx}, \emph{mín}, \emph{ínf}, \emph{mód}).
+% 	      	\item ¦spaced¦ causes some math operators to use spaces where usual in Spanish (\emph{arc\,cos},
+% 	      	      \emph{arc\,sen}, \emph{arc\,tg}).
+% 	      	\item ¦all¦ activates ¦accented¦ and ¦spaced¦ and furthermore provides Spanish localizations of
+% 	      	      ¦\sin¦ (\emph{sen}), ¦\tan¦ (\emph{tg}), ¦\sinh¦ (\emph{senh}), and ¦\tanh¦ (\emph{tgh}).
+% 	      	\item ¦none¦ does no localization at all (default setting). 
+% 	      \end{itemize}
+% \end{itemize}
+% \paragraph*{\color{black}Commands:}\new{v1.46}
+% \begin{itemize}
+% 	\item \Cmd\arcsen: alias to ¦\arcsin¦ (\pkg{babel} compatibility)
+% 	\item \Cmd\arctg: alias to ¦\arctan¦ (\pkg{babel} compatibility)
+% 	\item \Cmd\sen: alias to ¦\sin¦ (\pkg{babel} compatibility)
+% 	\item \Cmd\senh: alias to ¦\sinh¦ (\pkg{babel} compatibility)
+% 	\item \Cmd\tg: alias to ¦\tan¦ (\pkg{babel} compatibility)
+% 	\item \Cmd\tgh: alias to ¦\tanh¦ (\pkg{babel} compatibility)
+% 	\item \Cmd\spanishoperator: allows you to define further localized operators. For instance, ¦\spanishoperator{cotg}¦
+% 	      defines a command ¦\cotg¦ that outputs \emph{cotg} in math. The optional argument of the command lets you specify the
+% 	      spelling, if needed, \eg ¦\spanishoperator[arc\,ctg]{arcctg}¦.
+% \end{itemize}
+% 
 % \subsection{syriac}\label{syriac}
 % \paragraph*{Options:}
 % 	\begin{itemize}
@@ -1352,6 +1768,9 @@
 % 	\item \Cmd\armeniannumeral produces Armenian alphabetic numbering.
 % 	          Example: ¦\armeniannumeral{1863}¦ yields \textarmenian{\armeniannumeral{1863}}.
 % 
+% 	\item \Cmd\georgiannumeral produces Georgian alphabetic numbering.\\
+%               Example: ¦\georgiannumeral{1863}¦ yields \textgeorgian{\georgiannumeral{1863}}.
+% 
 % 	\item \Cmd\greeknumeral produces Greek alphabetic numbering, \Cmd\Greeknumeral outputs uppercased variants.
 % 			Example: ¦\greeknumeral{1863}¦ yields \textgreek{\greeknumeral{1863}},
 % 			¦\Greeknumeral{1863}¦ results in \textgreek{\Greeknumeral{1863}}.
@@ -1505,7 +1924,7 @@
 % by other people. I take this opportunity to thank the following individuals,
 % whose splendid work has made my task almost trivial in comparision: \TA{Johannes
 % Braams} and the numerous contributors to the \pkg{babel} package (in particular
-% \TA{Boris Lavva} and others for its Hebrew support), \TA{Alexej Kryuko}v (\pkg{antomega}),
+% \TA{Boris Lavva} and others for its Hebrew support), \TA{Alexej Kryukov} (\pkg{antomega}),
 % \TA{Will Robertson} (\pkg{fontspec}), \TA{Apostolos Syropoulos} (\pkg{xgreek}), \TA{Youssef Jabri}
 % (\pkg{arabi}), and \TA{Vafa Khalighi} (\pkg{xepersian} and \pkg{bidi}).
 % The work of \TA{Mojca Miklavec} and \TA{Arthur Reutenauer} on hyphenation patterns with their package
@@ -1525,19 +1944,142 @@
 % I also thank \TA{Alan Munn} for kindly proof-reading the penultimate version of this documentation.
 % And of course my gratitude also goes to \TA{Jonathan Kew}, the formidable author of \XeTeX!
 % 
-% \section{More acknowledgements (by Arthur Reutenauer)}
-% Many thanks to all the people who have contributed bugfixes and new features to
-% Polyglossia since I took over.  Most of them can be identified from the contributor statistics on \href{https://github.com/reutenauer/polyglossia/graphs/contributors}{GitHub} and I won’t try to name them
-% all (maybe, one day ...); among the ones who sent contributions directly to me
-% I would like to especially thank \TA{Claudio Beccari}, the indefatigable champion of
-% Romance languages, and beyond!
+% \section{More acknowledgements (by the current development team)}
+% Many thanks to all the people who have contributed bugfixes and new features to \pkg{polyglossia}
+% since we took over.
+% In alphabetical order: \TA{Ignas Anikevicius}, \TA{Sina Ahmadi}, \TA{Wouter Bolsterlee}, \TA{Christian Buhtz},
+% \TA{Zgarbul Andrey}, \TA{Oleg Domanov}, \TA{Philipp Gesang}, \TA{Kevin Godby}, \TA{Enrico Gregorio},
+% \TA{Khaled Hosny}, \TA{Najib Idrissi}, user \TA{julroy67}, \TA{Dohyun Kim}, \TA{Phil Kime}, \TA{Mike Kroutikov},
+% \TA{Ivan Kokan}, \TA{Caleb Maclennan}, \TA{José Mancera}, \TA{Yevgen Pogribnyi}, \TA{Maïeul Rouquette},
+% \TA{Elie Roux}, \TA{Hugo Roy},  \TA{Guy Rutenberg}, \TA{Philipp Stephani}, \TA{Keno Wehr}, \TA{Dominik Wujastyk},
+% \TA{Sertaç Ö. Yıldız}, \TA{Maksim Zholudev}, \TA{Yan Zhou}, and \TA{Stefan Zlatinov}.
+% Their respective contributions can be identified from the contributor statistics on
+% \href{https://github.com/reutenauer/polyglossia/graphs/contributors}{GitHub}.
 % 
+% Among the ones who sent contributions directly to us we would like to especially thank
+% \TA{Claudio Beccari}, the indefatigable champion of Romance languages, and beyond! Furthermore,
+% kudos go to \TA{Moritz Wemheuer} (of \pkg{biblatex}) who has helped a lot to improve \pkg{polyglossia} interaction
+% with \pkg{biblatex} and \pkg{csquotes}.
 % 
+% Not at least, we are very grateful for all bug reports and feature enhancement requests we received from
+% the numerous users we cannot list all here (but again, you can find all names on \href{https://github.com/reutenauer/polyglossia/issues?utf8=%E2%9C%93&q=is%3Aissue}{GitHub}).
+% Please go on with that, you are keeping \pkg{polyglossia} running!
 % 
 % 
+% 
+% 
 % \StopEventually{}
 % \section{Implementation}
 % \iffalse
+%<*gloss-acadien.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-acadien.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for canadian (acadian) french]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{french}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-acadien.ldf>
+%<*gloss-afrikaans.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-afrikaans.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-afrikaans.ldf}[polyglossia: module for afrikaans]
+
+\PolyglossiaSetup{afrikaans}{
+  hyphennames={afrikaans,dutch},
+  hyphenmins={2,2},
+  langtag=AFK,
+  frenchspacing=true,
+  fontsetup=true,
+}
+
+\define at boolkey{afrikaans}[afrikaans@]{babelshorthands}[true]{}
+
+\ifsystem at babelshorthands
+  \setkeys{afrikaans}{babelshorthands=true}
+\else
+  \setkeys{afrikaans}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate at active@char}{%
+  \input{babelsh.def}%
+  \initiate at active@char{"}%
+  \shorthandoff{"}%
+}{}
+
+\def\afrikaans at shorthands{%
+  \bbl at activate{"}%
+  \def\language at group{afrikaans}%
+  \declare at shorthand{afrikaans}{"-}{\nobreak-\bbl at allowhyphens}
+  \declare at shorthand{afrikaans}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+  \declare at shorthand{afrikaans}{"|}{%
+    \textormath{\discretionary{-}{}{\kern.03em}}{}}
+  \declare at shorthand{afrikaans}{""}{\hskip\z at skip}
+  \declare at shorthand{afrikaans}{"/}{\textormath
+    {\bbl at allowhyphens\discretionary{/}{}{/}\bbl at allowhyphens}{}}%
+  \def\-{\bbl at allowhyphens\discretionary{-}{}{}\bbl at allowhyphens}%
+}
+
+\def\noafrikaans at shorthands{%
+  \@ifundefined{initiate at active@char}{}{\bbl at deactivate{"}}%
+}
+
+\def\captionsafrikaans{%
+    \def\prefacename{Voorwoord}%
+    \def\refname{Verwysings}%
+    \def\abstractname{Samevatting}%
+    \def\bibname{Bibliografie}%
+    \def\chaptername{Hoofstuk}%
+    \def\appendixname{Bylae}%
+    \def\contentsname{Inhoudsopgawe}%
+    \def\listfigurename{Lys van figure}%
+    \def\listtablename{Lys van tabelle}%
+    \def\indexname{Inhoud}%
+    \def\figurename{Figuur}%
+    \def\tablename{Tabel}%
+    \def\partname{Deel}%
+    \def\enclname{Bylae(n)}%
+    \def\ccname{a.\,a.}%
+    \def\headtoname{Aan}%
+    \def\pagename{Bladsy}%
+    \def\seename{sien}%
+    \def\alsoname{sien ook}%
+    \def\proofname{Bewys}%
+%   \def\glossaryname{}%
+}
+
+\def\dateafrikaans{%
+    \def\today{\number\day~\ifcase\month\or
+      Januarie\or Februarie\or Maart\or April\or Mei\or Junie\or
+      Julie\or  Augustus\or September\or Oktober\or November\or
+      Desember\fi
+      \space \number\year}%
+}
+
+\def\noextras at afrikaans{%
+  \noafrikaans at shorthands%
+}
+
+\def\blockextras at afrikaans{%
+  \ifafrikaans at babelshorthands\afrikaans at shorthands\fi%
+}
+
+\def\inlineextras at afrikaans{%
+  \ifafrikaans at babelshorthands\afrikaans at shorthands\fi%
+}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-afrikaans.ldf>
 %<*gloss-albanian.ldf>
 % \fi
 % \clearpage
@@ -1587,6 +2129,21 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-albanian.ldf>
+%<*gloss-american.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-american.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-american.ldf}[polyglossia: module for american english]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{english}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-american.ldf>
 %<*gloss-amharic.ldf>
 % \fi
 % \clearpage
@@ -1950,9 +2507,8 @@
 
 \def\arabicnumber#1{%
   \ifeastern at numerals
-    \arabicdigits{\number#1}%
+    \@ensure at dir{\arabicdigits{\number#1}}%
   \else
-    %%\RL{\protect\reset at font\number#1}%
     \number#1%
   \fi}
 
@@ -2261,6 +2817,51 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-asturian.ldf>
+%<*gloss-australian.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-australian.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-australian.ldf}[polyglossia: module for australian english]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{english}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-australian.ldf>
+%<*gloss-austrian.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-austrian.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for austrian german (old spelling)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{german}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-austrian.ldf>
+%<*gloss-bahasa.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-bahasa.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-kurmanji.ldf}[polyglossia: module for kurmanji kurdish]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{kurdish}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-bahasa.ldf>
 %<*gloss-bahasai.ldf>
 % \fi
 % \clearpage
@@ -2272,21 +2873,8 @@
 % We only provide this gloss for babel compatibility. Since bahasai is 
 % a malay variety, we use 'malay' with variant 'indonesian' now.
 
-\input{gloss-malay.ldf}
+\xpg at load@master at language{malay}
 
-\PolyglossiaSetup{bahasai}{%
-  language=Indonesian,
-  langtag=IND,
-  hyphennames={indonesian,indon,bahasai,bahasa,bahasam,malay,melayu},
-  hyphenmins={2,2},
-  fontsetup=true}
-
-\let\captionsbahasai\captionsmalay at indonesian
-\let\datebahasai\datemalay at indonesian
-
-\DefineFormatHijriDate{bahasai}{%
-  \number\value{Hijriday}\space\hijrimonthmalay at indonesian{\value{Hijrimonth}}\space\number\value{Hijriyear}}
-
 %    \end{macrocode}
 % \iffalse
 %</gloss-bahasai.ldf>
@@ -2298,24 +2886,11 @@
 %    \begin{macrocode}
 \ProvidesFile{gloss-bahasam.ldf}[polyglossia: module for bahasa melayu]
 
-% We only provide this gloss for babel compatibility. Since bahasai is 
-% a malay variety, we use 'malay' with variant 'indonesian' now.
+% We only provide this gloss for babel compatibility. Since bahasam is 
+% a malay variety, we use 'malay' with variant 'malaysian' now.
 
-\input{gloss-malay.ldf}
+\xpg at load@master at language{malay}
 
-\PolyglossiaSetup{bahasam}{%
-  language=Malay,
-  langtag=MLY,
-  hyphennames={malay,melayu,bahasam,bahasa,bahasai,indonesian,indon},
-  hyphenmins={2,2},
-  fontsetup=true}
-
-\let\captionsbahasam\captionsmalay at malay
-\let\datebahasam\datemalay at malay
-
-\DefineFormatHijriDate{bahasam}{%
-  \number\value{Hijriday}\space\hijrimonthmalay at malay{\value{Hijrimonth}}\space\number\value{Hijriyear}}
-
 %    \end{macrocode}
 % \iffalse
 %</gloss-bahasam.ldf>
@@ -2368,6 +2943,285 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-basque.ldf>
+%<*gloss-belarusian.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-belarusian.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-belarusian.ldf}[polyglossia: module for belarusian]
+
+\RequirePackage{xpg-cyrillicnumbers}
+
+\PolyglossiaSetup{belarusian}{
+  script=Cyrillic,
+  scripttag=cyrl,
+  langtag=BEL,
+  hyphennames={belarusian},
+  hyphenmins={2,2},
+  frenchspacing=true,
+  fontsetup,
+  localnumeral=belarusiannumerals,
+  Localnumeral=Belarusiannumerals
+}
+
+\def\belarusian at spelling{modern}
+\define at choicekey*+{belarusian}{spelling}[\val\nr]{modern,classic,tarask}[modern]{%
+   \ifcase\nr\relax
+      % modern:
+      \def\belarusian at spelling{modern}
+   \or
+      % classic:
+      \def\belarusian at spelling{tarask}
+   \or
+      % tarask:
+      \def\belarusian at spelling{tarask}
+   \fi
+}{\xpg at warning{Unknown Belarusian spelling `#1'}}
+
+\newif\ifcyrillic at numerals
+\define at key{belarusian}{numerals}[arabic]{%
+   \ifstrequal{#1}{cyrillic}%
+      {\cyrillic at numeralstrue}%
+      {\cyrillic at numeralsfalse}%
+}
+
+\define at boolkey{belarusian}[belarusian@]{babelshorthands}[false]{}
+
+\setkeys{belarusian}{numerals}
+
+\ifsystem at babelshorthands
+  \setkeys{belarusian}{babelshorthands=true}
+\else
+  \setkeys{belarusian}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate at active@char}{%
+  \input{babelsh.def}%
+  \initiate at active@char{"}%
+  \shorthandoff{"}%
+}{}
+
+\def\belarusian at shorthands{%
+  \bbl at activate{"}%
+  \def\language at group{belarusian}%
+  \declare at shorthand{belarusian}{"`}{„}%
+  \declare at shorthand{belarusian}{"'}{“}%
+  \declare at shorthand{belarusian}{"<}{«}%
+  \declare at shorthand{belarusian}{">}{»}%
+  \declare at shorthand{belarusian}{""}{\hskip\z at skip}%
+  \declare at shorthand{belarusian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
+  \declare at shorthand{belarusian}{"=}{\nobreak-\hskip\z at skip}%
+  \declare at shorthand{belarusian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
+  \declare at shorthand{belarusian}{"-}{%
+     \def\belarusian at sh@tmp{%
+       \if\belarusian at sh@next-\expandafter\belarusian at sh@emdash%
+       \else\expandafter\belarusian at sh@hyphen\fi%
+     }%
+     \futurelet\belarusian at sh@next\belarusian at sh@tmp%
+  }%
+  \def\belarusian at sh@hyphen{%
+    \nobreak\-\bbl at allowhyphens}%
+  \def\belarusian at sh@emdash##1##2{\cdash-##1##2}%
+  \def\cdash##1##2##3{\def\tempx@{##3}%
+  \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+   \ifx\tempx@\tempa@\@Acdash\else
+    \ifx\tempx@\tempb@\@Bcdash\else
+     \ifx\tempx@\tempc@\@Ccdash\else
+      \errmessage{Wrong usage of cdash}\fi\fi\fi}%
+  \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+    \cyrdash\hskip.2em\ignorespaces}%
+  \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+   \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z at skip\ignorespaces}%
+  \def\@Ccdash{\leavevmode
+   \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+  \ifx\cyrdash\undefined
+    \def\cyrdash{\hbox to.8em{--\hss--}}%
+  \fi
+  \declare at shorthand{belarusian}{",}{\nobreak\hskip.2em\ignorespaces}%
+}
+
+\def\nobelarusian at shorthands{%
+  \@ifundefined{initiate at active@char}{}{\bbl at deactivate{"}}%
+}
+
+% Taken from babel-belarusian
+\def\captionsbelarusian at modern{%
+    \def\prefacename{Прадмова}%
+    \def\refname{Спіс літаратуры}%
+    \def\abstractname{Анатацыя}%
+    \def\bibname{Літаратура}%
+    \def\chaptername{Глава}%
+    \def\appendixname{Дадатак}%
+    \def\contentsname{Змест}%
+    \def\listfigurename{Спіс ілюстрацый}%
+    \def\listtablename{Спіс табліц}%
+    \def\indexname{Прадметны паказальнік}%
+    \def\authorname{Паказальнік імён}%
+    \def\figurename{Рыс.}%
+    \def\tablename{Табліца}%
+    \def\partname{Частка}%
+    \def\enclname{укл.}%
+    \def\ccname{зых.}%
+    \def\headtoname{вх.}%
+    \def\pagename{с.}%
+    \def\seename{гл.}%
+    \def\alsoname{гл.\ таксама}%
+    \def\proofname{Доказ}%
+    \def\glossaryname{Слоўнік тэрмінаў}%
+    \def\acronymname{Абрэвіятуры}%
+    \def\lstlistingname{Лістынг}%
+    \def\lstlistlistingname{Лістынгі}%
+    \def\notesname{Нататкі}%
+}
+
+\def\captionsbelarusian at tarask{%
+    \def\prefacename{Прадмова}%
+    \def\refname{Сьпіс літаратуры}%
+    \def\abstractname{Анатацыя}%
+    \def\bibname{Літаратура}%
+    \def\chaptername{Глава}%
+    \def\appendixname{Дадатак}%
+    \def\contentsname{Зьмест}%
+    \let\tocname=\contentsname
+    \def\listfigurename{Сьпіс ілюстрацый}%
+    \def\listtablename{Сьпіс табліц}%
+    \def\indexname{Прадметны паказальнік}%
+    \def\authorname{Паказальнік імён}%
+    \def\figurename{Рыс.}%
+    \def\tablename{Табліца}%
+    \def\partname{Частка}%
+    \def\enclname{укл.}%
+    \def\ccname{зых.}%
+    \def\headtoname{вх.}%
+    \def\pagename{с.}%
+    \def\seename{гл.}%
+    \def\alsoname{гл.\ таксама}%
+    \def\proofname{Доказ}%
+    \def\glossaryname{Слоўнік тэрмінаў}%
+    \def\acronymname{Абрэвіятуры}%
+    \def\lstlistingname{Лістынг}%
+    \def\lstlistlistingname{Лістынгі}%
+    \def\nomname{Азначэньні}%
+    \def\notesname{Нататкі}%
+}
+
+\def\captionsbelarusian{%
+  \csuse{captionsbelarusian@\belarusian at spelling}%
+}
+
+\def\datebelarusian at modern{%
+   \def\today{\number\day~\ifcase\month\or
+    студзеня\or
+    лютага\or
+    сакавіка\or
+    красавіка\or
+    мая\or
+    чэрвеня\or
+    ліпеня\or
+    жніўня\or
+    верасня\or
+    кастрычніка\or
+    лістапада\or
+    снежня\fi
+    \space \number\year~г.}%
+}
+
+\def\datebelarusian at tarask{%
+   \def\today{\number\day~\ifcase\month\or%
+    студзеня\or
+    лютага\or
+    сакавіка\or
+    красавіка\or
+    траўня\or
+    чэрвеня\or
+    ліпеня\or
+    жніўня\or
+    верасьня\or
+    кастрычніка\or
+    лістапада\or
+    сьнежня\fi%
+    \space \number\year~г.}%
+}
+
+\def\datebelarusian{%
+  \csuse{datebelarusian@\belarusian at spelling}%
+}
+
+\newcommand{\belarusiannumerals}[2]{\belarusiannumber{#2}}
+\newcommand{\Belarusiannumerals}[2]{\Belarusiannumber{#2}}
+
+\def\belarusiannumber#1{%
+  \ifcyrillic at numerals
+    \cyr at alph{#1}%
+  \else
+    \number#1%
+  \fi%
+}
+
+\def\Belarusiannumber#1{%
+  \ifcyrillic at numerals
+    \cyr at Alph{#1}%
+  \else
+    \number#1%
+  \fi%
+}
+
+\let\belarusiannumeral=\belarusiannumber
+\let\Belarusiannumeral=\Belarusiannumber
+
+\def\Asbuk#1{\expandafter\cyr at Alph\csname c@#1\endcsname}
+
+\def\asbuk#1{\expandafter\cyr at alph\csname c@#1\endcsname}
+
+% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and
+% thus ends at 30. We now use proper cyrillic numbering.
+
+%\def\belarusian at Alph#1{\ifcase#1\or
+%   А\or Б\or В\or Г\or Д\or Е\or Ж\or
+%   З\or И\or К\or Л\or М\or Н\or О\or
+%   П\or Р\or С\or Т\or У\or Ф\or Х\or
+%   Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я\else\xpg at ill@value{#1}{belarusian at Alph}\fi}
+
+%\def\belarusian at alph#1{\ifcase#1\or
+%   а\or б\or в\or г\or д\or е\or ж\or
+%   з\or и\or к\or л\or м\or н\or о\or
+%   п\or р\or с\or т\or у\or ф\or х\or
+%   ц\or ч\or ш\or щ\or э\or ю\or я\else\xpg at ill@value{#1}{belarusian at alph}\fi}
+
+\def\belarusian at numbers{%
+   \let\latin at alph\@alph
+   \let\latin at Alph\@Alph
+   \ifcyrillic at numerals%
+     \def\belarusian at alph##1{\expandafter\belarusiannumeral\expandafter{\the##1}}%
+     \def\belarusian at Alph##1{\expandafter\belarusiannumeral\expandafter{\the##1}}%
+      \let\@alph\belarusian at alph%
+      \let\@Alph\belarusian at Alph%
+   \fi
+}
+
+\def\nobelarusian at numbers{%
+   \let\@alph\latin at alph%
+   \let\@Alph\latin at Alph%
+}
+
+\def\noextras at belarusian{%
+   \ifcyrillic at numerals\nobelarusian at numbers\fi%
+   \nobelarusian at shorthands%
+}
+
+\def\blockextras at belarusian{%
+   \ifcyrillic at numerals\belarusian at numbers\fi%
+   \ifbelarusian at babelshorthands\belarusian at shorthands\fi%
+}
+
+\def\inlineextras at belarusian{%
+   \ifbelarusian at babelshorthands\belarusian at shorthands\fi%
+}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-belarusian.ldf>
 %<*gloss-bengali.ldf>
 % \fi
 % \clearpage
@@ -2523,6 +3377,60 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-bengali.ldf>
+%<*gloss-bosnian.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-bosnian.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-bosnian.ldf}[polyglossia: module for bosnian]
+
+\PolyglossiaSetup{bosnian}{
+  langtag=BOS,
+  hyphennames={bosnian,croatian},
+  hyphenmins={2,2}, % adapted from gloss-croatian
+  frenchspacing=true, % adapted from gloss-croatian
+  indentfirst=false, % adapted from gloss-croatian
+  fontsetup=true
+}
+
+% TODO: Add script=Cyrillic
+
+% from babel-bosnian
+\def\captionsbosnian{%
+  \def\prefacename{Predgovor}%
+  \def\refname{Literatura}%
+  \def\abstractname{Sažetak}%
+  \def\bibname{Bibliografija}%
+  \def\chaptername{Poglavlje}%
+  \def\appendixname{Dodatak}%
+  \def\contentsname{Sadržaj}%
+  \def\listfigurename{Popis slika}%
+  \def\listtablename{Popis tablica}%
+  \def\indexname{Indeks}%
+  \def\figurename{Slika}%
+  \def\tablename{Tablica}%
+  \def\partname{Dio}%
+  \def\enclname{Prilozi}%
+  \def\ccname{Kopija}%
+  \def\headtoname{Prima}%
+  \def\pagename{Stranica}%
+  \def\seename{Vidjeti}%
+  \def\alsoname{Također vidjeti}%
+  \def\proofname{Dokaz}%
+  \def\glossaryname{Rječnik}%
+}
+
+\def\datebosnian{%
+  \def\today{\number\day.~\ifcase\month\or
+    januar\or februar\or mart\or april\or maj\or
+    juni\or juli\or august\or septembar\or oktobar\or novembar\or
+    decembar\fi \space \number\year.~}%
+}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-bosnian.ldf>
 %<*gloss-brazil.ldf>
 % \fi
 % \clearpage
@@ -2535,24 +3443,8 @@
 % 'brazil' was selected in accordance with babel.
 % Since brazil is a variety of portuguese, we use 'portuguese' now.
 
-% FIXME: Once we support babel aliases (#112) this gloss can go.
+\xpg at load@master at language{portuguese}
 
-\xpg at warning{The language name 'brazil' is deprectated.\MessageBreak
-             Please use 'portuguese' with variant 'brazilian' instead.}
-
-\input{gloss-portuguese.ldf}
-
-\PolyglossiaSetup{brazil}{
-  language=Brazilian Portuguese,
-  langtag=PTG,
-  hyphennames={brazil,portuguese,portuges},
-  hyphenmins={2,3},
-  fontsetup=true,
-}
-
-\let\captionsportuges\captionsportuguese at brazil
-\let\dateportuges\dateportuguese at brazil
-     
 %    \end{macrocode}
 % \iffalse
 %</gloss-brazil.ldf>
@@ -2655,6 +3547,21 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-breton.ldf>
+%<*gloss-british.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-british.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for british english]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{english}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-british.ldf>
 %<*gloss-bulgarian.ldf>
 % \fi
 % \clearpage
@@ -2747,6 +3654,36 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-bulgarian.ldf>
+%<*gloss-canadian.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-canadian.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-canadian.ldf}[polyglossia: module for canadian english]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{english}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-canadian.ldf>
+%<*gloss-canadien.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-canadien.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for canadian french]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{french}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-canadien.ldf>
 %<*gloss-catalan.ldf>
 % \fi
 % \clearpage
@@ -3022,6 +3959,10 @@
   fontsetup=true,
 }
 
+\ifluatex
+  \RequirePackage{luavlna}
+\fi
+
 \define at boolkey{czech}[czech@]{babelshorthands}[true]{}
 
 \define at boolkey{czech}[czech@]{splithyphens}[true]{}
@@ -3028,6 +3969,8 @@
 
 \define at boolkey{czech}[czech@]{vlna}[true]{}
 
+\setkeys{czech}{splithyphens,vlna}
+
 \ifsystem at babelshorthands
   \setkeys{czech}{babelshorthands=true}
 \else
@@ -3085,8 +4028,7 @@
 
 \def\czech at hyphens{%
     \ifluatex
-      \xpg at warning{The 'splithyphens' option only works for XeLaTeX.\MessageBreak
-                   Please use the luavlna package to enable the feature for LuaLaTeX}
+      \AfterPreamble{\enablesplithyphens{czech}}%
     \else
       \XeTeXinterchartokenstate=1
       \XeTeXcharclass `\- \czech at hyphen
@@ -3097,7 +4039,9 @@
 }
 
 \def\noczech at hyphens{%
-    \ifxetex
+    \ifluatex
+      \AfterPreamble{\disablesplithyphens{czech}}%
+    \else
       \XeTeXcharclass `\- \z@
     \fi%
 }
@@ -3106,8 +4050,7 @@
 % prevent them to land at the end of a line
 \def\czech at vlna{%
     \ifluatex
-       \xpg at warning{The 'vlna' option only works for XeLaTeX.\MessageBreak
-                    Please use the luavlna package to enable the feature for LuaLaTeX}
+       \preventsingleon
     \else
         % Code taken and adapted from xevlna.sty
         \XeTeXinterchartokenstate=1
@@ -3151,6 +4094,7 @@
 
 \def\noczech at vlna{%
     \ifluatex
+        \preventsingleoff
     \else
         \XeTeXcharclass`\(\z@
         \XeTeXcharclass`\[\z@
@@ -3218,14 +4162,14 @@
 
 \def\blockextras at czech{%
   \ifczech at babelshorthands\czech at shorthands\fi%
-  \ifczech at vlna\czech at vlna\fi%
-  \ifczech at splithyphens\czech at hyphens\fi%
+  \ifczech at vlna\czech at vlna\else\noczech at vlna\fi%
+  \ifczech at splithyphens\czech at hyphens\else\noczech at hyhens\fi%
 }
 
 \def\inlineextras at czech{%
   \ifczech at babelshorthands\czech at shorthands\fi%
-  \ifczech at vlna\czech at vlna\fi%
-  \ifczech at splithyphens\czech at hyphens\fi%
+  \ifczech at vlna\czech at vlna\else\noczech at vlna\fi%
+  \ifczech at splithyphens\czech at hyphens\else\noczech at hyhens\fi%
 }
 
 %    \end{macrocode}
@@ -3412,11 +4356,15 @@
     \def\alsoname{zie ook}%
     \def\proofname{Bewijs}%
     \def\glossaryname{Verklarende woordenlijst}%
+}
+
+\def\datedutch{%
     \def\today{\number\day~\ifcase\month%
       \or januari\or februari\or maart\or april\or mei\or juni\or
       juli\or augustus\or september\or oktober\or november\or
       december\fi
-      \space \number\year}}
+      \space \number\year}%
+}
 
 \def\noextras at dutch{%
   \nodutch at shorthands%
@@ -3440,6 +4388,7 @@
 % \subsection{gloss-english.ldf}
 %    \begin{macrocode}
 \ProvidesFile{gloss-english.ldf}[polyglossia: module for english]
+
 \PolyglossiaSetup{english}{
   hyphennames={english,american,usenglish,USenglish},
   hyphenmins={2,3},
@@ -3447,6 +4396,13 @@
   fontsetup=true,
 }
 
+% Babel aliases
+\setlanguagealias[variant=us]{english}{american}
+\setlanguagealias[variant=australian]{english}{australian}
+\setlanguagealias[variant=british]{english}{british}
+\setlanguagealias[variant=canadian]{english}{canadian}
+\setlanguagealias[variant=newzealand]{english}{newzealand}
+
 \providebool{british at hyphen}
 \providebool{english at ordinalmonthday}
 \providebool{british at dateformat}
@@ -3741,42 +4697,8 @@
 % We only provide this gloss for babel compatibility.
 % The proper English language name is Persian.
 
-\input{gloss-persian.ldf}
+\xpg at load@master at language{persian}
 
-\PolyglossiaSetup{farsi}{
-  script=Arabic,
-  direction=RL,
-  scripttag=arab,
-  langtag=FAR,
-  hyphennames={nohyphenation},
-  fontsetup=true,
-  localnumeral=farsinumerals
-}
-
-\define at key{farsi}{numerals}[eastern]{%
-  \setkeys{persian}{numerals=#1}}
-
-\define at key{farsi}{abjadjimnotail}[true]{%
-  \setkeys{persian}{abjadjimnotail=#1}}
-
-\define at key{farsi}{locale}[default]{%
-  \setkeys{persian}{locale=#1}}
-
-\setkeys{farsi}{locale,numerals}
-
-%\Hijritoday is now locale-aware and will format the date with this macro:
-\DefineFormatHijriDate{farsi}{\@ensure at RTL{%
-   \farsinumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\farsinumber{\value{Hijriyear}}}}
-
-\let\captionsfarsi\captionspersian
-\let\datefarsi\datepersian
-\let\farsi at numbers\persian at numbers
-\let\nofarsi at numbers\nopersian at numbers
-\let\farsi at globalnumbers\persian at globalnumbers
-\let\nofarsi at globalnumbers\nopersian at globalnumbers
-\let\blockextras at farsi\blockextras at persian
-\let\noextras at farsi\noextras at persian
-
 %    \end{macrocode}
 % \iffalse
 %</gloss-farsi.ldf>
@@ -3889,6 +4811,10 @@
   hyphenmins={2,2},
   fontsetup=true}
 
+% Babel aliases
+\setlanguagealias[variant=acadian]{french}{acadien}
+\setlanguagealias[variant=canadian]{french}{canadien}
+
 \def\french at variant{french}
 \define at choicekey*+{french}{variant}[\val\nr]{french,canadian,acadian}[french]{%
    \ifcase\nr\relax
@@ -3899,17 +4825,17 @@
       \def\french at variant{canadien}%
       \SetLanguageKeys{french}{babelname=canadien}%
       \xpg at ifdefined{canadien}{}%
-	    {\xpg at warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
-	      I will use the standard patterns for French instead}%
-	    \adddialect\l at canadien\l at french\relax}%
+      {\xpg at warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
+        I will use the standard patterns for French instead}%
+      \adddialect\l at canadien\l at french\relax}%
    \or
       % acadian:
       \def\french at variant{acadian}%
       \SetLanguageKeys{french}{babelname=canadien}%
       \xpg at ifdefined{acadian}{}%
-	    {\xpg at warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
-	      I will use the standard patterns for French instead}%
-	    \adddialect\l at acadian\l at french\relax}%
+      {\xpg at warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
+        I will use the standard patterns for French instead}%
+      \adddialect\l at acadian\l at french\relax}%
    \fi
    \xpg at info{Option: French, variant=\val}%
 }{\xpg at warning{Unknown French variant `#1'}}
@@ -3920,8 +4846,7 @@
 }%
 
 \ifluatex
-  \newluatexattribute\xpg at frpt %
-  \directlua{polyglossia.load_frpt()}%
+  \directlua{require('polyglossia-french')}%
 \else
   \newXeTeXintercharclass\french at openbrackets % ( ] {
   \newXeTeXintercharclass\french at closebrackets % ( ] {
@@ -3962,6 +4887,10 @@
 \define at boolkey{french}[french@]{autospaceguillemets}[true]{}
 \french at autospaceguillemetstrue
 
+\newif\iffrench at thincolonspace
+\define at boolkey{french}[french@]{thincolonspace}[true]{}
+\french at thincolonspacefalse
+
 % Backwards compatibility
 \define at boolkey{french}[french@]{automaticspacesaroundguillemets}[true]{%
    \iffrench at automaticspacesaroundguillemets
@@ -3988,6 +4917,51 @@
    \fi
 }
 
+% Configuration of item labels
+\def\french at itemi{\textemdash}
+\def\french at itemii{\textemdash}
+\def\french at itemiii{\textemdash}
+\def\french at itemiv{\textemdash}
+
+\define at key{french}{itemlabels}[\textemdash]{%
+  \def\french at itemi{#1}
+  \def\french at itemii{#1}
+  \def\french at itemiii{#1}
+  \def\french at itemiv{#1}
+}
+
+\define at key{french}{itemlabeli}[\textemdash]{%
+  \def\french at itemi{#1}
+}
+
+\define at key{french}{itemlabelii}[\textemdash]{%
+  \def\french at itemii{#1}
+}
+
+\define at key{french}{itemlabeliii}[\textemdash]{%
+  \def\french at itemiii{#1}
+}
+
+\define at key{french}{itemlabeliv}[\textemdash]{%
+  \def\french at itemiv{#1}
+}
+
+\define at boolkey{french}[french@]{frenchitemlabels}[true]{%
+  \AfterPreamble{%
+    \ifdefstring{\xpg at main@language}{french}{%
+      \iffrench at frenchitemlabels
+         \renewcommand{\labelitemi}{\french at itemi}%
+         \renewcommand{\labelitemii}{\french at itemii}%
+         \renewcommand{\labelitemiii}{\french at itemiii}%
+         \renewcommand{\labelitemiv}{\french at itemiv}%
+      \else
+         \let\@makefntext\xpg at orig@makefntext
+      \fi
+    }{\xpg at warning{Option 'frenchitemlabels' only supported if French is main language!}}%
+  }%
+}
+
+
 \def\french at fontsetup{%
   \unless\iffrench at autospacetypewriter
     \let\ttfamily\french at ttfamilyFB
@@ -3999,11 +4973,24 @@
   \let\ttfamily\french at ttfamilyORI
 }
 
+\def\xpg at french@thinsp{\kern 0.5\fontdimen2\font}
+
 \def\french at punctuation{%
     \lccode"2019="2019
     \ifluatex
-      \xpg at frpt=1\relax %
-      \directlua{polyglossia.activate_frpt()}%
+      \iffrench at thincolonspace
+        \iffrench at autospaceguillemets
+          \directlua{polyglossia.activate_french_punct(true, true)}%
+        \else
+          \directlua{polyglossia.activate_french_punct(true, false)}%
+        \fi
+      \else
+        \iffrench at autospaceguillemets
+          \directlua{polyglossia.activate_french_punct(false, true)}%
+        \else
+          \directlua{polyglossia.activate_french_punct(false, false)}%
+        \fi
+      \fi
     \else
       \XeTeXinterchartokenstate=1
       \XeTeXcharclass `\! \french at punctthin
@@ -4013,7 +5000,11 @@
       \XeTeXcharclass `\⁈ \french at punctthin
       \XeTeXcharclass `\⁉ \french at punctthin
       \XeTeXcharclass `\; \french at punctthin
-      \XeTeXcharclass `\: \french at punctthick
+      \iffrench at thincolonspace
+        \XeTeXcharclass `\: \french at punctthin
+      \else
+        \XeTeXcharclass `\: \french at punctthick
+      \fi
       \XeTeXcharclass `\« \french at punctguillstart
       \XeTeXcharclass `\» \french at punctguillend
       \XeTeXcharclass `\‹ \french at punctguillstart
@@ -4020,43 +5011,42 @@
       \XeTeXcharclass `\› \french at punctguillend
       \XeTeXcharclass `\( \french at openbrackets
       \XeTeXcharclass `\) \french at closebrackets
-      \XeTeXcharclass `\] \french at openbrackets
-      \XeTeXcharclass `\[ \french at closebrackets
+      \XeTeXcharclass `\[ \french at openbrackets
+      \XeTeXcharclass `\] \french at closebrackets
       \XeTeXcharclass `\{ \french at openbrackets
       \XeTeXcharclass `\} \french at closebrackets
-      \XeTeXinterchartoks \z@ \french at punctthin = {\thinspace}%
+      \XeTeXcharclass `\⟨ \french at openbrackets
+      \XeTeXcharclass `\⟩ \french at closebrackets
+      \XeTeXinterchartoks \z@ \french at punctthin = {\xpg at french@thinsp}%
       \XeTeXinterchartoks \z@ \french at punctthick = {\nobreakspace}%
-      \XeTeXinterchartoks \xpg at boundaryclass \french at punctthin = {\xpg at unskip\thinspace}%
+      \XeTeXinterchartoks \xpg at boundaryclass \french at punctthin = {\xpg at unskip\xpg at french@thinsp}%
       \XeTeXinterchartoks \xpg at boundaryclass \french at punctthick = {\xpg at unskip\nobreakspace}%
       \iffrench at autospaceguillemets
-        \XeTeXinterchartoks \french at punctguillstart \z@ = {\thinspace}% "«a" -> "«\,a"
-  %     \XeTeXinterchartoks \z@ \french at punctguillstart = {\nobreakspace}% "a«" unchanged?
-  %     \XeTeXinterchartoks \french at punctguillend \z@ = {\nobreakspace}% "»a" unchanged?
-        \XeTeXinterchartoks \z@ \french at punctguillend = {\thinspace}% "a»" -> "a\,»"
-        \XeTeXinterchartoks \french at punctguillstart \xpg at boundaryclass = {\thinspace\ignorespaces}% "«  " -> "«\,"
-        \XeTeXinterchartoks \xpg at boundaryclass \french at punctguillend = {\xpg at unskip\thinspace}% "  »" -> "\,»"
+        \let\xpg at french@guillspace\xpg at french@thinsp%
+        \XeTeXinterchartoks \french at punctguillstart \z@ = {\xpg at french@guillspace}% "«a" -> "«\,a"
+ %      \XeTeXinterchartoks \z@ \french at punctguillstart = {\nobreakspace}% "a«" unchanged?
+ %      \XeTeXinterchartoks \french at punctguillend \z@ = {\nobreakspace}% "»a" unchanged?
+        \XeTeXinterchartoks \z@ \french at punctguillend = {\xpg at french@guillspace}% "a»" -> "a\,»"
+        \XeTeXinterchartoks \french at punctguillstart \xpg at boundaryclass = {\xpg at french@guillspace\ignorespaces}% "«  " -> "«\,"
+        \XeTeXinterchartoks \xpg at boundaryclass \french at punctguillend = {\xpg at unskip\xpg at french@guillspace}% "  »" -> "\,»"
+        \XeTeXinterchartoks \french at closebrackets \french at punctguillend = {\xpg at french@guillspace}% ")»" -> ")\,»"
+     \else
+       \def\xpg at french@guillspace{}%
      \fi
-     \XeTeXinterchartoks \french at punctguillend \french at punctthin = {\thinspace}% "»;" -> "»\,;"
+     \XeTeXinterchartoks \french at punctguillend \french at punctthin = {\xpg at french@thinsp}% "»;" -> "»\,;"
      \XeTeXinterchartoks \french at punctguillend \french at punctthick = {\nobreakspace}% "»:" -> "» :"
-     \XeTeXinterchartoks \french at punctthin \french at punctguillend  = {\thinspace}% "?»" -> "?\,»"
+     \XeTeXinterchartoks \french at punctthin \french at punctguillend  = {\xpg at french@thinsp}% "?»" -> "?\,»"
      \XeTeXinterchartoks \french at openbrackets \french at punctthin = {\xpg at unskip}% "(?" -> "(?" and not "( ?"      
      \XeTeXinterchartoks \french at punctthin \french at closebrackets = {\xpg at unskip}% "?)" -> "?)" (code not need, just for symetry with previous one)
-     \XeTeXinterchartoks \french at closebrackets \french at punctthin = {\thinspace}% ")?" -> ")\,?"
+     \XeTeXinterchartoks \french at closebrackets \french at punctthin = {\xpg at french@thinsp}% ")?" -> ")\,?"
      \XeTeXinterchartoks \french at closebrackets \french at punctthick = {\nobreakspace}% "):" -> ") :"
     \fi
-    }
+}
 
 \def\nofrench at punctuation{%
     \lccode"2019=\z@
     \ifluatex
-      \xpg at frpt=0\relax %
-      % Though it would make compilation slightly faster, it is not possible to
-      % safely uncomment the following line. Imagine the following case: you start
-      % a paragraph by some french text, then, in the same paragraph, you change
-      % the language to something else, and thus call the following line. This means
-      % that, at then end of the paragraph, the function won't be in the callback,
-      % so the beginning of the paragraph won't be processed by it.
-      %\directlua{polyglossia.desactivate_frpt()}
+      \directlua{polyglossia.deactivate_french_punct()}%
     \else
       \XeTeXcharclass `\! \z@
       \XeTeXcharclass `\? \z@
@@ -4070,9 +5060,17 @@
       \XeTeXcharclass `\» \z@
       \XeTeXcharclass `\‹ \z@
       \XeTeXcharclass `\› \z@
+      \XeTeXcharclass `\( \z@
+      \XeTeXcharclass `\) \z@
+      \XeTeXcharclass `\[ \z@
+      \XeTeXcharclass `\] \z@
+      \XeTeXcharclass `\{ \z@
+      \XeTeXcharclass `\} \z@
+      \XeTeXcharclass `\⟨ \z@
+      \XeTeXcharclass `\⟩ \z@
       \XeTeXinterchartokenstate=0
     \fi
-    }
+}
 
 \def\captionsfrench{%
    \def\refname{Références}%
@@ -4102,7 +5100,7 @@
    \def\ccname{Copie à }%
    \def\headtoname{}%
    \def\proofname{Démonstration}%
-   }
+}
 
 \def\datefrench{%
    \def\today{\ifx\ier\undefined\def\ier{er}\fi
@@ -4172,24 +5170,8 @@
 
 % We only provide this gloss for babel compatibility.
 
-\input{gloss-friulian.ldf}
+\xpg at load@master at language{friulian}
 
-\PolyglossiaSetup{friulan}{%
-  language=Friulian,
-  hyphennames={friulan,furlan},
-  hyphenmins={2,2},
-  langtag=FRL,
-  indentfirst=false,
-  fontsetup=true,
-  frenchspacing=true,
-}
-
-\let\captionsfriulan\captionsfriulian
-\let\datefriulan\datefriulian
-\let\noextras at friulan\noextras at friulian
-\let\blockextras at friulan\blockextras at friulian
-\let\inlineextras at friulan\inlineextras at friulian
-
 %    \end{macrocode}
 % \iffalse
 %</gloss-friulan.ldf>
@@ -4212,6 +5194,9 @@
   frenchspacing=true,
 }
 
+% Babel and backwards compat. alias
+\setlanguagealias{friulian}{friulan}
+
 \def\captionsfriulian{%
     \def\prefacename{Prefazion}%
     \def\refname{Riferiments}%
@@ -4285,6 +5270,10 @@
   fontsetup=true,
 }
 
+% Babel aliases
+\setlanguagealias[variant=irish]{gaelic}{irish}
+\setlanguagealias[variant=scottish]{gaelic}{scottish}
+
 \def\gaelic at variant{irish}
 \define at choicekey*+{gaelic}{variant}[\val\nr]{irish,scottish}[irish]{%
    \ifcase\nr\relax
@@ -4431,6 +5420,239 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-galician.ldf>
+%<*gloss-georgian.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-georgian.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-georgian.ldf}[polyglossia: module for georgian]
+
+\PolyglossiaSetup{georgian}{
+  script=Georgian,
+  scripttag=geor,
+  langtag=KAT,
+  hyphennames={georgian},
+  fontsetup=true,
+  localnumeral=georgiannumerals
+}
+
+\newif\ifgeorgian at numerals
+\define at key{georgian}{numerals}[arabic]{%
+   \ifstrequal{#1}{georgian}%
+      {\georgian at numeralstrue}%
+      {\georgian at numeralsfalse}%
+}
+
+\define at boolkey{georgian}[georgian@]{babelshorthands}[true]{}
+
+\define at boolkey{georgian}[georgian@]{oldmonthnames}[true]{}
+
+\ifsystem at babelshorthands
+  \setkeys{georgian}{babelshorthands=true}
+\else
+  \setkeys{georgian}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate at active@char}{%
+  \input{babelsh.def}%
+  \initiate at active@char{"}%
+  \shorthandoff{"}%
+}{}
+
+\def\georgian at shorthands{%
+  \bbl at activate{"}%
+  \def\language at group{georgian}%
+  \declare at shorthand{georgian}{"`}{„}%
+  \declare at shorthand{georgian}{"'}{“}%
+  \declare at shorthand{georgian}{"<}{«}%
+  \declare at shorthand{georgian}{">}{»}%
+  \declare at shorthand{georgian}{""}{\hskip\z at skip}%
+  \declare at shorthand{georgian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
+  \declare at shorthand{georgian}{"=}{\nobreak-\hskip\z at skip}%
+  \declare at shorthand{georgian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
+  \declare at shorthand{georgian}{"-}{%
+    \def\georgian at sh@tmp{%
+      \if\georgian at sh@next-\expandafter\georgian at sh@emdash%
+      \else\expandafter\georgian at sh@hyphen\fi%
+    }%
+    \futurelet\georgian at sh@next\georgian at sh@tmp}%
+  \def\georgian at sh@hyphen{%
+    \nobreak\-\bbl at allowhyphens}%
+  \def\georgian at sh@emdash##1##2{\cdash-##1##2}%
+  \def\cdash##1##2##3{\def\tempx@{##3}%
+  \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+   \ifx\tempx@\tempa@\@Acdash\else
+    \ifx\tempx@\tempb@\@Bcdash\else
+     \ifx\tempx@\tempc@\@Ccdash\else
+      \errmessage{Wrong usage of cdash}\fi\fi\fi}%
+  \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+    \cyrdash\hskip.2em\ignorespaces}%
+  \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+   \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z at skip\ignorespaces}%
+  \def\@Ccdash{\leavevmode
+   \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+  \ifx\cyrdash\undefined
+    \def\cyrdash{\hbox to.8em{--\hss--}}%
+  \fi
+  \declare at shorthand{georgian}{",}{\nobreak\hskip.2em\ignorespaces}%
+}
+
+\def\nogeorgian at shorthands{%
+  \@ifundefined{initiate at active@char}{}{\bbl at deactivate{"}}%
+}
+
+\def\captionsgeorgian{%
+    \def\prefacename{წინასიტყვაობა}%
+    \def\refname{ლიტერატურა}%
+    \def\abstractname{ანოტაცია}%
+    \def\bibname{ლიტერატურა}%
+    \def\chaptername{თავი}%
+    \def\appendixname{დანართი}%
+    \@ifundefined{thechapter}
+      {\def\contentsname{შინაარსი}}%
+      {\def\contentsname{შინაარსი}}%
+    \let\tocname=\contentsname
+    \def\listfigurename{სურათი}%
+    \def\listtablename{ცხრილი}%
+    \def\indexname{საძიებელი}%
+    \def\authorname{სახელთა საძიებელი}%
+    \def\figurename{სურ.}%
+    \def\tablename{ცხრ.}%
+    \def\partname{ნაწილი}%
+    \def\enclname{ჩათვ.}%
+    \def\ccname{წყარ.}%
+    \def\headtoname{შ.}%
+    \def\pagename{გვ.}%
+    \def\seename{იხ.}%
+    \def\alsoname{იხ.\ ასევე}%
+    \def\proofname{დამტკიცება}%
+    \def\glossaryname{ტერმინები}%
+}%
+
+\def\dategeorgian{%
+   \def\today{\number\day~\ifcase\month\or
+    იანვარი\or
+    თებერვალი\or
+    მარტი\or
+    აპრილი\or
+    მაისი\or
+    ივნისი\or
+    ივლისი\or
+    აგვისტო\or
+    სექტემბერი\or
+    ოქტომბერი\or
+    ნოემბერი\or
+    დეკემბერი\fi
+    \space \number\year~წ.}%
+    \ifgeorgian at oldmonthnames
+       \dategeorgian at old%
+    \fi
+}
+
+\def\dategeorgian at old{%
+   \def\today{\number\day~\ifcase\month\or
+    აპნისი\or
+    სურწყუნისი\or
+    მირკანი\or
+    იგრიკა\or
+    ვარდობისთვე\or
+    თიბათვე\or
+    მკათათვე\or
+    მარიამობისთვე\or
+    ახალწლისა ენკენისთვე\or
+    ღვინობისთვე\or
+    გიორგობისთვე\or
+    ქრისტეშობისთვე\fi
+    \space \number\year~წ.}%
+}
+
+\def\georgian at numbers{%
+   \ifgeorgian at numerals%
+     \def\georgian at alph##1{\expandafter\georgiannumeral\expandafter{\the##1}}%
+     \let\@alph\georgian@@alph%
+   \fi
+}
+
+\def\nogeorgian at numbers{%
+   \let\@alph\latin at alph%
+   \let\georgian at alph\@undefined%
+}
+
+\def\georgian at globalnumbers{%
+  \ifgeorgian at numerals
+    \let\@arabic\georgiannumber%
+    \renewcommand\thefootnote{\localnumeral*{footnote}}%
+    \renewcommand\theequation{\localnumeral*{equation}}%
+  \fi
+}
+
+% Store original definition
+\let\xpg at save@arabic\@arabic
+
+\def\nogeorgian at globalnumbers{
+   \let\@arabic\xpg at save@arabic%
+}
+
+\newcommand{\georgiannumerals}[2]{%
+  \ifgeorgian at numerals
+     \georgiannumber{#2}%
+  \else
+     #2%
+  \fi%
+}
+
+\protected\def\georgiannumber#1{\expandafter\@georgiannumber\expandafter{\number#1}}
+\def\@georgiannumber#1{%
+  \ifnum#1<\@ne\space\geor at ill@value{#1}%
+  \else
+    \ifnum#1<10\expandafter\geor at num@i\number#1%
+    \else
+      \ifnum#1<100\expandafter\geor at num@ii\number#1%
+      \else
+        \ifnum#1<\@m\expandafter\geor at num@iii\number#1%
+        \else
+          \ifnum#1<\@M\expandafter\geor at num@iv\number#1%
+          \else
+             \space\geor at ill@value{#1}%
+          \fi
+        \fi
+      \fi
+    \fi
+  \fi
+}
+
+\let\georgiannumeral=\georgiannumber
+\def\geor at num@i#1{% 1--9
+  \ifcase#1\or ა\or ბ\or გ\or დ\or ე\or ვ\or ზ\or ჱ\or თ\fi}
+\def\geor at num@ii#1{% 10--90
+  \ifcase#1\or ი\or კ\or ლ\or მ\or ნ\or ჲ\or ო\or პ\or ჟ\fi
+  \geor at num@i}
+\def\geor at num@iii#1{% 100--900
+  \ifcase#1\or რ\or ს\or ტ\or ჳ\or ფ\or ქ\or ღ\or ყ\or შ\fi
+  \geor at num@ii}
+\def\geor at num@iv#1{% 1000--9000
+  \ifcase#1\or ჩ\or ც\or ძ\or წ\or ჭ\or ხ\or ჴ\or ჯ\or ჰ\fi
+  \geor at num@iii}
+\def\geor at ill@value#1{\xpg at warning{Illegal value (#1) for Georgian numeral}[$#1$]}
+
+\def\noextras at georgian{%
+   \ifgeorgian at numerals\nogeorgian at numbers\fi%
+   \nogeorgian at shorthands%
+}
+
+\def\blockextras at georgian{%
+   \ifgeorgian at numerals\georgian at numbers\fi%
+   \ifgeorgian at babelshorthands\georgian at shorthands\fi%
+}
+
+\def\inlineextras at georgian{%
+   \ifgeorgian at babelshorthands\georgian at shorthands\fi%
+}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-georgian.ldf>
 %<*gloss-german.ldf>
 % \fi
 % \clearpage
@@ -4438,6 +5660,7 @@
 % \subsection{gloss-german.ldf}
 %    \begin{macrocode}
 \ProvidesFile{gloss-german.ldf}[polyglossia: module for german]
+
 \PolyglossiaSetup{german}{
   hyphenmins={2,2},
   frenchspacing=true,
@@ -4446,6 +5669,14 @@
   babelname=ngerman
 }
 
+% Babel aliases
+\setlanguagealias[variant=austrian,spelling=old]{german}{austrian}
+\setlanguagealias[variant=austrian,spelling=new]{german}{naustrian}
+\setlanguagealias[variant=german,spelling=old]{german}{germanb}
+\setlanguagealias[variant=german,spelling=new]{german}{ngerman}
+\setlanguagealias[variant=swiss,spelling=old]{german}{swissgerman}
+\setlanguagealias[variant=swiss,spelling=new]{german}{nswissgerman}
+
 \newif\if at german@oldspelling
 \@german at oldspellingfalse
 \define at choicekey*+{german}{spelling}[\val\nr]{new,old,1901}[new]{%
@@ -4504,21 +5735,26 @@
   \else
      \if at swiss@locale
          \SetLanguageKeys{german}{babelname=nswissgerman}%
-     \fi
+     \else
      \if at austrian@locale
          \SetLanguageKeys{german}{babelname=naustrian}%
-     \fi
+     \else
+         \SetLanguageKeys{german}{babelname=ngerman}%
+     \fi\fi
   \fi
 }
 
-\newif\if at german@fraktur
-\define at choicekey*+{german}{script}[\val\nr]{latin,fraktur}[latin]{%
+\newif\if at german@blackletter
+\define at choicekey*+{german}{script}[\val\nr]{latin,blackletter,fraktur}[latin]{%
    \ifcase\nr\relax
       % latin:
-      \@german at frakturfalse%
+      \@german at blackletterfalse%
    \or
+      % blackletter:
+      \@german at blacklettertrue%
+   \or
       % fraktur:
-      \@german at frakturtrue%
+      \@german at blacklettertrue%
    \fi
    \xpg at info{Option: German, script=\val}%
 }{\xpg at warning{Unknown German script `#1'}}
@@ -4626,7 +5862,7 @@
 }
 
 %%Strings for Fraktur contributed by Gerrit <z0idberg . gmx . de>
-\def\captions at german@fraktur{%
+\def\captions at german@blackletter{%
   \captions at german%
   \def\abstractname{Zuſammenfaſſung}%
   \def\seename{ſiehe}%
@@ -4634,7 +5870,7 @@
   \def\glossaryname{Gloſſar}%
 }
 
-\def\date at german@fraktur{%
+\def\date at german@blackletter{%
   \def\today{\number\day.%
     \space \ifcase\month%
     \or\if at austrian@locale Jänner\else Januar\fi\or Februar\or März\or%
@@ -4644,13 +5880,13 @@
 }
 
 \def\captionsgerman{%
-  \if at german@fraktur\captions at german@fraktur\else\captions at german\fi
+  \if at german@blackletter\captions at german@blackletter\else\captions at german\fi
   \if at austrian@locale\captions at german@austrian\fi
   \if at swiss@locale\captions at german@swiss\fi
 }
 
 \def\dategerman{%
-  \if at german@fraktur\date at german@fraktur\else\date at german\fi
+  \if at german@blackletter\date at german@blackletter\else\date at german\fi
 }
 
 \def\german at language{%
@@ -4692,6 +5928,21 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-german.ldf>
+%<*gloss-germanb.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-germanb.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-germanb.ldf}[polyglossia: module for german (old spelling)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{german}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-germanb.ldf>
 %<*gloss-greek.ldf>
 % \fi
 % \clearpage
@@ -4699,6 +5950,7 @@
 % \subsection{gloss-greek.ldf}
 %    \begin{macrocode}
 \ProvidesFile{gloss-greek.ldf}[polyglossia: module for greek]
+
 \PolyglossiaSetup{greek}{
   script=Greek,
   scripttag=grek,
@@ -4711,6 +5963,9 @@
   %TODO localalph={greek at alph,greek at Alph}
 }
 
+% Babel aliases
+\setlanguagealias[variant=polytonic]{greek}{polutonikogreek}
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% The code in this file was initially adapted from the antomega
 %% module for greek. Currently large parts of it derive from the 
@@ -5366,7 +6621,7 @@
 
 \PolyglossiaSetup{hungarian}{
   babelname=magyar,
-  hyphennames={magyar,hungarian},
+  hyphennames={hungarian,magyar},
   langtag=HUN,
   hyphenmins={2,2},
   fontsetup=true,
@@ -5374,6 +6629,49 @@
 
 \frenchspacing
 
+% Babel and backwards compat. alias
+\setlanguagealias{hungarian}{magyar}
+
+\newif\if at hungarian@swapcaptions
+\newif\if at hungarian@swapheadings
+\newif\if at hungarian@swapheaders
+\define at choicekey*+{hungarian}{swapstrings}[\val\nr]{all,captions,headings,headers,hheaders,none}[all]{%
+   \ifcase\nr\relax
+      % all:
+      \@hungarian at swapcaptionstrue%
+      \@hungarian at swapheadingstrue%
+      \@hungarian at swapheaderstrue%
+   \or
+      % captions:
+      \@hungarian at swapcaptionstrue%
+      \@hungarian at swapheadingsfalse%
+      \@hungarian at swapheadersfalse%
+   \or
+      % headings:
+      \@hungarian at swapcaptionsfalse%
+      \@hungarian at swapheadingstrue%
+      \@hungarian at swapheadersfalse%
+   \or
+      % headers:
+      \@hungarian at swapcaptionsfalse%
+      \@hungarian at swapheadingsfalse%
+      \@hungarian at swapheaderstrue%
+   \or
+      % hheaders:
+      \@hungarian at swapcaptionsfalse%
+      \@hungarian at swapheadingstrue%
+      \@hungarian at swapheaderstrue%
+   \or
+      % none:
+      \@hungarian at swapcaptionsfalse%
+      \@hungarian at swapheadingsfalse%
+      \@hungarian at swapheadersfalse%
+   \fi
+   \xpg at info{Option: Hungarian, swapstrings=\val}%
+}{\xpg at warning{Unknown Hungarian swapstrings value `#1'}}
+
+\setkeys{hungarian}{swapstrings}
+
 \def\captionshungarian{%
    \def\refname{Hivatkozások}%
    \def\abstractname{Kivonat}%
@@ -5421,25 +6719,188 @@
      21-én\or 22-én\or 23-án\or 24-én\or 25-én\or
      26-án\or 27-én\or 28-án\or 29-én\or 30-án\or
      31-én\fi}%
-   \let\ontoday\ondatehungarian}
+   \let\ontoday\ondatehungarian%
+   \let\ondatemagyar\ondatehungarian%
+}
 
-% change 'táblázat x.x' to 'x.x. táblázat'
-\def\xpg at hungarian@fnum at table{\thetable.~\tablename}
+% Save original capsformats
 \let\xpg at save@fnum at table\fnum at table
-
-% change 'ábra x.x' to 'x.x. ábra'
-\def\xpg at hungarian@fnum at figure{\thefigure.~\figurename}
 \let\xpg at save@fnum at figure\fnum at figure
 
+\def\hungarian at capsformat{%
+  %
+  % Change captions
+  \if at hungarian@swapcaptions
+     % change 'ábra x.x' to 'x.x. ábra'
+     \def\fnum at figure{\thefigure.~\figurename}
+     %
+     % change 'táblázat x.x' to 'x.x. táblázat'
+     \def\fnum at table{\thetable.~\tablename}
+  \fi
+  %
+  % change chapter and part headings
+  \if at hungarian@swapheadings
+     % With titlesec
+     \ifdefined\titleformat%
+       \ifdefined\@part%
+          \let\xpg at save@part at format\@part%
+          \patchcmd{\@part}%
+                    {\partname\nobreakspace\thepart}%
+                    {\thepart.\nobreakspace\partname}%
+                    {}%
+                    {\xpg at warning{Failed to patch part for Hungarian}}%
+       \fi%
+       \ifdefined\chapter%
+          \titleformat\chapter[display]%
+             {\@ifundefined{ttl at fil}{\raggedright}{\ttl at fil}\ttl at fonts\ttl at sizes6}
+             {\thechapter.\space\@chapapp}{.8\baselineskip}{\ttl at sizes\z@\ttl at passexplicit}
+       \fi%
+     \else% (not \ifdefined\titleformat)
+       % With KOMA
+       \ifdefined\sectionformat%
+          \ifdefined\partformat%
+            \let\xpg at save@part at format\partformat%
+            \renewcommand{\partformat}{\thepart.~\partname}%
+          \fi%
+          \ifdefined\chapterformat%
+            \let\xpg at save@chap at format\chapterformat%
+            \renewcommand{\chapterformat}{\mbox{\thechapter\autodot%
+                                          \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
+          \fi%
+       \else%  (not \ifdefined\sectionformat)
+         % With memoir
+         \ifdefined\@memptsize%
+           \ifdefined\@makechapterhead%
+              \let\xpg at save@chap at format\@makechapterhead%
+              \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
+                       {\printchapternum.\chapternamenum\printchaptername}%
+                       {}%
+                       {\xpg at warning{Failed to patch chapter for Hungarian}}%
+           \fi%
+           \ifdefined\@part%
+              \let\xpg at save@part at format\@part%
+              \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
+                               {\printpartnum.\partnamenum\printpartname}%
+                               {}%
+                               {\xpg at warning{Failed to patch part for Hungarian}}%
+           \fi%
+         \else%  (not \ifdefined\@memptsize)
+           % With standard classes
+            \ifdefined\@makechapterhead%
+              \let\xpg at save@chap at format\@makechapterhead%
+              \patchcmd{\@makechapterhead}%
+                       {\@chapapp\space \thechapter}%
+                       {\thechapter.\space \@chapapp}%
+                       {}%
+                       {\xpg at warning{Failed to patch chapter for Hungarian}}%
+            \fi%
+            \ifdefined\@part%
+              \let\xpg at save@part at format\@part%
+              \patchcmd{\@part}%
+                       {\partname\nobreakspace\thepart}%
+                       {\thepart.\nobreakspace\partname}%
+                       {}%
+                       {\xpg at warning{Failed to patch part for Hungarian}}%
+            \fi%  (end \ifdefined\@part)
+          \fi% (end \ifdefined\@memptsize)
+        \fi% (end \ifdefined\sectionformat)
+     \fi% (end \ifdefined\titleformat)
+  \fi% (end \if at hungarian@swapheadings)
+  %
+  % Change running headers
+  \if at hungarian@swapheaders
+    \ifdefined\chapterformat%
+      % With KOMA
+      \let\xpg at save@chaptermark at format\chaptermarkformat%
+      \renewcommand*\chaptermarkformat{%
+         \thechapter\autodot\ \IfChapterUsesPrefixLine{\chapapp\enskip}{}}
+    \else% (not \ifdefined\chapterformat)
+      \ifdefined\@memptsize%
+        % With memoir
+        \let\xpg at save@chaptermark at format\chaptermark%
+        \renewcommand*\chaptermark[1]{%
+          \markboth{\memUChead{%
+            \ifnum \c at secnumdepth >\m at ne
+              \if at mainmatter
+                \thechapter.\ \@chapapp\ %
+              \fi
+            \fi
+            ##1}}{}}%
+      \else% (not \ifdefined\@memptsize)
+        % With standard classes
+        \ifdefined\chaptermark%
+           \let\xpg at save@chaptermark at format\chaptermark%
+           \patchcmd{\chaptermark}%
+                    {\@chapapp\ \thechapter.}%
+                    {\thechapter.\ \@chapapp}%
+                    {}%
+                    {\xpg at warning{Failed to patch chaptermark for Hungarian}}%
+        \fi% (end \ifdefined\chaptermark)
+      \fi% (end \ifdefined\@memptsize)
+    \fi% (end \ifdefined\chapterformat)
+  \fi% (end \if at hungarian@swapheaders)
+}
+
+\def\nohungarian at capsformat{%
+   %
+   % Reset changes of \hungarian at capsformat
+   \let\fnum at table\xpg at save@fnum at table%
+   \let\fnum at figure\xpg at save@fnum at figure%
+   %
+   % Reset chapter and part heading
+   \ifdefined\titleformat%
+      % With titlesec
+     \ifdefined\xpg at save@part at format
+        \let\@part\xpg at save@part at format
+     \fi%
+     \ifdefined\chapter
+        \titleformat\chapter[display]%
+          {\@ifundefined{ttl at fil}{\raggedright}{\ttl at fil}\ttl at fonts\ttl at sizes6}
+          {\@chapapp\space\thechapter}{.8\baselineskip}{\ttl at sizes\z@\ttl at passexplicit}
+     \fi%
+   \else% (not \ifdefined\titleformat)
+     \ifdefined\sectionformat%
+        % With KOMA
+        \ifdefined\xpg at save@part at format
+           \let\partformat\xpg at save@part at format
+        \fi%
+        \ifdefined\xpg at save@chap at format
+           \let\chapterformat\xpg at save@chap at format
+        \fi%
+     \else%
+        % With memoir and standard classes
+        \ifdefined\xpg at save@part at format
+           \let\@part\xpg at save@part at format
+        \fi%
+        \ifdefined\xpg at save@chap at format
+          \let\@makechapterhead\xpg at save@chap at format
+        \fi%
+     \fi% (end \ifdefined\sectionformat)
+   \fi% (end \ifdefined\titleformat)
+  %
+  % Reset headers
+  \ifdefined\chaptermarkformat%
+     % With KOMA
+     \ifdefined\xpg at save@chaptermark at format
+       \let\chaptermarkformat\xpg at save@chaptermark at format%
+     \fi
+  \else%
+     \ifdefined\chaptermark%
+       % With memoir and standard classes
+       \ifdefined\xpg at save@chaptermark at format
+         \let\chaptermark\xpg at save@chaptermark at format%
+       \fi
+     \fi% (end \ifdefined\chaptermark)
+  \fi% (end \ifdefined\chapterformat)
+}
+
 \def\blockextras at hungarian{%
-   \let\fnum at table\xpg at hungarian@fnum at table
-   \let\fnum at figure\xpg at hungarian@fnum at figure
+   \hungarian at capsformat%
 }
 
 \def\noextras at hungarian{%
-   \let\fnum at table\xpg at save@fnum at table
-   \let\fnum at figure\xpg at save@fnum at figure
-   \let\ontoday\@undefined
+   \nohungarian at capsformat%
+   \let\ontoday\@undefined%
 }
 
 %    \end{macrocode}
@@ -5556,18 +7017,8 @@
 % We only provide this gloss for babel compatibility. Since irish is 
 % a gaelic variety, we use 'gaelic' with variant 'irish' now.
 
-\input{gloss-gaelic.ldf}
+\xpg at load@master at language{gaelic}
 
-\PolyglossiaSetup{irish}{
-  hyphennames={irish},
-  hyphenmins={2,2},
-  langtag=IRI,
-  fontsetup=true,
-}
-
-\let\captionsirish\captionsgaelic at irish
-\let\dateirish\dategaelic at irish
-
 %    \end{macrocode}
 % \iffalse
 %</gloss-irish.ldf>
@@ -6445,6 +7896,9 @@
   localnumeral=kurdishnumerals
 }
 
+% Babel aliases
+\setlanguagealias[variant=kurmanji]{kurdish}{kurmanji}
+
 \newif\if at kurdish@kurmanji
 \def\kurdish at variant{sorani}
 \define at choicekey*+{kurdish}{variant}[\val\nr]{sorani,kurmanji}[sorani]{%
@@ -6966,301 +8420,910 @@
 % 
 % \subsection{gloss-latin.ldf}
 %    \begin{macrocode}
-%%
-%% This is file `gloss-latin.ldf',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% gloss-latin.dtx  (with options: `lamodern')
-%%   ------------------------------------------------------------------
-%%   Latin module for polyglossia
-%%   Copyright (C) Claudio Beccari 2013-2016
-%%   Copyright (C) Élie Roux 2016
-%%   This work is distributed under the MIT License.
-%% 
-%%   See the postamble.
-%%   ------------------------------------------------------------------
-\ProvidesFile{gloss-latin.ldf}
-        [2016/09/10 v.1.03 Latin support from polyglossia]
-%%
+\ProvidesFile{gloss-latin.ldf}[polyglossia: module for Latin v.2.0 2019-10-28]
 
+\ExplSyntaxOn
 
-\PolyglossiaSetup{latin}{%
-      hyphennames={latin},
-      hyphenmins={2,2},
-      langtag=LAT,
-      frenchspacing=true,
-      fontsetup=true,
-}
-\def\classicuclccodes{\lccode`\V=`\u \uccode`\u=`\V}
-\def\noclassicuclccodes{\lccode`\V=`\v \uccode`\u=`\U}
-\def\tmp at modern{modern}
-\def\tmp at medieval{medieval}
-\unless\ifluatex
-  \def\tmp at classic{classic}
-  \def\tmp at liturgical{liturgical}
-\fi
-\newif\ifmedieval\medievalfalse
-\newif\ifclassic\classicfalse
-\define at boolkey{latin}[latin@]{ecclesiastic}[true]{}
+\PolyglossiaSetup {latin}
+  {
+    hyphennames = {latin},
+    hyphenmins = {2,2},
+    frenchspacing = true,
+    fontsetup = true,
+    langtag = LAT
+  }
 
-\let\latin at variant\l at latin
-\ifluatex
-  \ifcsname l at latin\endcsname\xpg at set@language at luatex@ii{latin}\fi
-\fi
-\def\captionslatin{\latincaptions}%
-\def\datelatin{\latindate}%
-\define at key{latin}{variant}[modern]{%
-\def\@tempa{#1}%
-\ifx\@tempa\tmp at medieval
-  \ifluatex
-    \ifcsname l at latin\endcsname\xpg at set@language at luatex@ii{latin}\fi
-  \fi
-  \let\latin at variant\l at latin
-  \xpg at set@language at luatex@ii{latin}
-  \medievaltrue \classictrue
-  \xpg at info{Option: Medieval Latin}%
-\else
-  \ifx\@tempa\tmp at classic
-    \unless\ifluatex
-      \unless\ifcsname l at classiclatin\endcsname
-         \xpg at nopatterns{Classic Latin}%
-         \adddialect\l at classiclatin\l at latin
-         \let\latin at variant\l at latin
-      \else
-         \let\latin at variant\l at classiclatin
-      \fi
-    \fi
-    \medievalfalse\classictrue
-    \xpg at info{Option: Classic Latin}%
-  \else
-   \ifx\@tempa\tmp at liturgical\unless\ifluatex
-      \unless\ifcsname l at liturgicallatin\endcsname
-         \xpg at nopatterns{Liturgical Latin}%
-         \adddialect\l at liturgicallatin\l at latin
-         \def\latin at variant{\l at latin}%
-      \else
-         \let\latin at variant\l at liturgicallatin
-      \fi
-        \medievaltrue\classicfalse
-        \xpg at info{Option: Liturgical Latin}\fi
-   \else
-      \ifx\@tempa\tmp at modern
-        \let\latin at variant\l at latin
-        \ifluatex\xpg at set@language at luatex@ii{latin}\fi
-        \xpg at info{Option: Modern Latin}%
-      \else
-        \def\latin at variant{\l at nohyphenation}%
-        \PackageWarning{polyglossia}{%
-          *******************\MessageBreak
-          No hyphenation set for \@tempa
-          *******************\MessageBreak
-        }{}%
-      \fi
-    \fi
-  \fi
-\fi
-}
+% Babel aliases
+\setlanguagealias[variant=classic]{latin}{latinclassic}
+\setlanguagealias[variant=ecclesiastic]{latin}{latinecclesiastic}
+\setlanguagealias[variant=medieval]{latin}{latinmedieval}
 
-\def\latin at language{\language=\latin at variant}%
-\ifluatex
-       \PackageWarning{polyglossia}{\MessageBreak\MessageBreak
-       *****************\MessageBreak
-       The ecclesiastic option is not active\MessageBreak
-       when typesetting with LuaLaTeX\MessageBreak
-       *****************\MessageBreak
-       \MessageBreak}{}
-  \else
-   \def\ecclesiasticlatin at punctuation{%
-      \def\xpg at unskip{\ifhmode\ifdim\lastskip>\z@\unskip\fi\fi}
-      \lccode\string"2019=\string"2019
-      \newXeTeXintercharclass\ecclesiasticlatin at punctthin
-      \newXeTeXintercharclass\ecclesiasticlatin at punctguillstart
-      \newXeTeXintercharclass\ecclesiasticlatin at punctguillend
-      \XeTeXinterchartokenstate=1
-      \XeTeXcharclass `\! \ecclesiasticlatin at punctthin
-      \XeTeXcharclass `\? \ecclesiasticlatin at punctthin
-      \XeTeXcharclass `\; \ecclesiasticlatin at punctthin
-      \XeTeXcharclass `\: \ecclesiasticlatin at punctthin
-      \XeTeXcharclass `\« \ecclesiasticlatin at punctguillstart
-      \XeTeXcharclass `\» \ecclesiasticlatin at punctguillend
-      \XeTeXinterchartoks \z@ \ecclesiasticlatin at punctthin = {\penalty\@M
-      \hskip.2\fontdimen2\font \@plus\z@\@minus\z@}%
-      \XeTeXinterchartoks 255 \ecclesiasticlatin at punctthin = {\xpg at unskip}
-      \XeTeXinterchartoks \ecclesiasticlatin at punctguillstart \z@ = {\penalty\@M
-      \hskip.2\fontdimen2\font \@plus\z@\@minus\z@\ignorespaces}
-      \XeTeXinterchartoks \z@ \ecclesiasticlatin at punctguillend = {\xpg at unskip
-      \penalty\@M\hskip.2\fontdimen2\font \@plus\z@\@minus\z@}
-    }
 
-   \def\noecclesiasticlatin at punctuation{%
-      \lccode\string"2019=\z@
+%%%%% Variables and commands concerning spelling
+
+\bool_new:N \l_polyglossia_latin_use_j_bool
+\bool_new:N \l_polyglossia_latin_use_v_bool
+\bool_new:N \l_polyglossia_latin_use_digraphs_bool
+\bool_new:N \l_polyglossia_latin_capitalize_month_bool
+
+\cs_new:Npn \polyglossia_latin_classical_character_codes:
+  {
+    \char_set_lccode:nn {`\V} {`\u}
+    \char_set_uccode:nn {`\u} {`\V}
+    \char_set_uccode:nn {`\ú} {`\V}
+    \char_set_uccode:nn {`\ū} {`\V}
+    \char_set_uccode:nn {`\ŭ} {`\V}
+  }
+
+\cs_new:Npn \polyglossia_latin_modern_character_codes:
+  {
+    \char_set_lccode:nn {`\V} {`\v}
+    \char_set_uccode:nn {`\u} {`\U}
+    \char_set_uccode:nn {`\ú} {`\Ú}
+    \char_set_uccode:nn {`\ū} {`\Ū}
+    \char_set_uccode:nn {`\ŭ} {`\Ŭ}
+  }
+
+
+%%%%% Messages and commands concerning hyphenation
+
+\msg_new:nnn {polyglossia} {latin / missing modern patterns}
+  {
+    No~hyphenation~patterns~were~found~for~Latin~\msg_line_context:.~
+    I~will~not~hyphenate~Latin~words.
+  }
+
+\msg_new:nnn {polyglossia} {latin / missing patterns}
+  {
+    The~"#1"~hyphenation~patterns~were~not~found~\msg_line_context:.~
+    I~will~use~the~patterns~for~modern~Latin~instead.
+  }
+
+\cs_new:Npn \polyglossia_latin_use_modern_patterns:
+  {
+    \xpg at ifdefined {latin}
+      {
+        \def \latin at language
+          {
+            \polyglossia at setup@language at patterns {latin}
+          }
+      }
+      {
+        \msg_warning:nn {polyglossia} {latin / missing modern patterns}
+        \adddialect \l at latin \l at nohyphenation
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_set_patterns:n #1
+% #1 may be "classiclatin" or "liturgicallatin"
+  {
+    \xpg at ifdefined {#1}
+      {
+        \def \latin at language
+          {
+            \polyglossia at setup@language at patterns {#1}
+          }
+      }
+      {
+        \xpg at ifdefined {latin}
+          {
+            \msg_warning:nnn {polyglossia} {latin / missing patterns} {#1}
+            \adddialect \l@ #1 \l at latin
+            \polyglossia_latin_use_modern_patterns:
+          }
+          {
+            \msg_warning:nn {polyglossia} {latin / missing modern patterns}
+            \adddialect \l@ #1 \l at nohyphenation
+          }
+      }
+  }
+
+
+%%%%% Settings for the spacing of the punctuation for ecclesiastical Latin
+
+\bool_new:N \g_polyglossia_latin_punctuation_spacing_bool
+
+\sys_if_engine_luatex:TF
+  {
+    \directlua { require('polyglossia-latin') }
+  }
+  {
+    \newXeTeXintercharclass \g_polyglossia_latin_punctuation_class
+    \newXeTeXintercharclass \g_polyglossia_latin_opening_guillemet_class
+    \newXeTeXintercharclass \g_polyglossia_latin_closing_guillemet_class
+    \newXeTeXintercharclass \g_polyglossia_latin_opening_bracket_class
+    \newXeTeXintercharclass \g_polyglossia_latin_closing_bracket_class
+
+    \cs_new:Npn \polyglossia_latin_insert_punctuation_space:
+      {
+        \nobreak
+        \skip_horizontal:n { 0.08333 \fontdimen6 \font } % 1/12 quad
+      }
+    \cs_new:Npn \polyglossia_latin_replace_preceding_space:
+      {
+        \dim_compare:nNnT {\lastskip} > {\c_zero_dim} {\unskip}
+        \polyglossia_latin_insert_punctuation_space:
+      }
+    \cs_new:Npn \polyglossia_latin_replace_following_space:
+      {
+        \polyglossia_latin_insert_punctuation_space:
+        \ignorespaces
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_punctuation_spacing:
+  {
+    \sys_if_engine_luatex:TF
+      {
+        \directlua { polyglossia.activate_latin_punct() }
+      }
+      {
+        \XeTeXinterchartokenstate = 1
+        \XeTeXcharclass `\! \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\? \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\‼ \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\⁇ \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\⁈ \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\⁉ \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\; \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\: \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\« \g_polyglossia_latin_opening_guillemet_class
+        \XeTeXcharclass `\» \g_polyglossia_latin_closing_guillemet_class
+        \XeTeXcharclass `\‹ \g_polyglossia_latin_opening_guillemet_class
+        \XeTeXcharclass `\› \g_polyglossia_latin_closing_guillemet_class
+        \XeTeXcharclass `\( \g_polyglossia_latin_opening_bracket_class
+        \XeTeXcharclass `\) \g_polyglossia_latin_closing_bracket_class
+        \XeTeXcharclass `\[ \g_polyglossia_latin_opening_bracket_class
+        \XeTeXcharclass `\] \g_polyglossia_latin_closing_bracket_class
+        \XeTeXcharclass `\{ \g_polyglossia_latin_opening_bracket_class
+        \XeTeXcharclass `\} \g_polyglossia_latin_closing_bracket_class
+        \XeTeXcharclass `\⟨ \g_polyglossia_latin_opening_bracket_class
+        \XeTeXcharclass `\⟩ \g_polyglossia_latin_closing_bracket_class
+
+        % punctuation followed by a closing guillemet
+        \XeTeXinterchartoks \g_polyglossia_latin_punctuation_class \g_polyglossia_latin_closing_guillemet_class =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+        % closing bracket followed by punctuation
+        \XeTeXinterchartoks \g_polyglossia_latin_closing_bracket_class \g_polyglossia_latin_punctuation_class =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+        % closing bracket followed by a closing guillemet
+        \XeTeXinterchartoks \g_polyglossia_latin_closing_bracket_class \g_polyglossia_latin_closing_guillemet_class =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+        % opening guillemet followed by a space
+        \XeTeXinterchartoks \g_polyglossia_latin_opening_guillemet_class \xpg at boundaryclass =
+          {
+            \polyglossia_latin_replace_following_space:
+          }
+        % opening guillemet followed by an ordinary character
+        \XeTeXinterchartoks \g_polyglossia_latin_opening_guillemet_class \z@ =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+        % closing guillemet followed by punctuation
+        \XeTeXinterchartoks \g_polyglossia_latin_closing_guillemet_class \g_polyglossia_latin_punctuation_class =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+        % space followed by punctuation
+        \XeTeXinterchartoks \xpg at boundaryclass \g_polyglossia_latin_punctuation_class =
+          {
+            \polyglossia_latin_replace_preceding_space:
+          }
+        % space followed by closing guillemet
+        \XeTeXinterchartoks \xpg at boundaryclass \g_polyglossia_latin_closing_guillemet_class =
+          {
+            \polyglossia_latin_replace_preceding_space:
+          }
+        % ordinary character followed by punctuation
+        \XeTeXinterchartoks \z@ \g_polyglossia_latin_punctuation_class =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+        % ordinary character followed by closing guillemet
+        \XeTeXinterchartoks \z@ \g_polyglossia_latin_closing_guillemet_class =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_no_punctuation_spacing:
+  {
+    \sys_if_engine_luatex:TF
+      {
+        \directlua { polyglossia.deactivate_latin_punct() }
+      }
+      {
         \XeTeXcharclass `\! \z@
         \XeTeXcharclass `\? \z@
+        \XeTeXcharclass `\‼ \z@
+        \XeTeXcharclass `\⁇ \z@
+        \XeTeXcharclass `\⁈ \z@
+        \XeTeXcharclass `\⁉ \z@
         \XeTeXcharclass `\; \z@
         \XeTeXcharclass `\: \z@
         \XeTeXcharclass `\« \z@
         \XeTeXcharclass `\» \z@
-        \XeTeXinterchartokenstate=0
+        \XeTeXcharclass `\‹ \z@
+        \XeTeXcharclass `\› \z@
+        \XeTeXcharclass `\( \z@
+        \XeTeXcharclass `\) \z@
+        \XeTeXcharclass `\[ \z@
+        \XeTeXcharclass `\] \z@
+        \XeTeXcharclass `\{ \z@
+        \XeTeXcharclass `\} \z@
+        \XeTeXcharclass `\⟨ \z@
+        \XeTeXcharclass `\⟩ \z@
+        \XeTeXinterchartokenstate = 0
       }
-    \let\latin at original@makefntext\@makefntext
-    \newcommand\latin at ecclesiastic@makefntext[1]{%
-        \parindent 1em \noindent
-        \latin at Makefnmark{\enspace #1}}
-    \newcommand\latin at Makefnmark{\hbox{\normalfont\@thefnmark.}}
-\fi
-\setkeys{latin}{variant,ecclesiastic=false}
-\def\latincaptions{%
-   \def\prefacename{\ifmedieval Præfatio\else Praefatio\fi}%
-   \def\refname{Conspectus librorum}%
-   \def\abstractname{Summarium}%
-   \def\bibname{Conspectus librorum}%
-   \def\chaptername{Caput}%
-   \def\appendixname{Additamentum}%
-   \def\contentsname{Index}%
-   \def\listfigurename{Conspectus descriptionum}%
-   \def\listtablename{Conspectus tabularum}%
-   \def\indexname{Index rerum notabilium}%
-   \def\figurename{Descriptio}%
-   \def\tablename{Tabula}%
-   \def\partname{Pars}%
-   \def\enclname{Additur}%
-   \def\ccname{Exemplar}%
-   \def\headtoname{\ignorespaces}%
-   \def\pagename{charta}%
-   \def\seename{cfr.}%
-   \def\alsoname{cfr.}%
-   \def\proofname{Demonstratio}%
-   \def\glossaryname{Glossarium}%
-   }
+  }
 
-\def\latindate{%
-   \def\today{\uppercase\expandafter{\romannumeral\day}%
-      \space \ifcase\month%
-      \or Januarii\or Februarii\or Martii\or Aprilis\or Maji\or
-      Junii\or Julii\or Augusti\or Septembris\or Octobris\or
-        \ifclassic Nouembris\else Novembris\fi
-      \or Decembris\fi%
-      \space \uppercase\expandafter{\romannumeral\year}}}
-%%%%%%%%% Latin shorthands
 
-\define at boolkey{latin}[latin@]{babelshorthands}[true]{}
+%%%%% Messages and commands concerning footnotes
 
+\cs_if_exist:NT \@makefntext
+  {
+    \cs_set_eq:NN \polyglossia_latin_original_footnote:n \@makefntext
+  }
+
+% This is the footnote style as defined by the "ecclesiastic" package.
+\cs_new:Npn \polyglossia_latin_variant_footnote:n #1
+  {
+    \parindent 1em
+    \noindent
+    \hbox { \normalfont \@thefnmark . }
+    \enspace #1
+  }
+
+\msg_new:nnn {polyglossia} {latin / ineffective footnote option}
+  {
+    The~option~"ecclesiasticfootnotes"~is~ineffective~\msg_line_context:
+    \c_space_tl as~Latin~is~not~the~main~language.
+  }
+
+\cs_new:Npn \polyglossia_latin_apply_footnote_option:
+  {
+    \str_if_eq:VnTF \xpg at main@language {latin}
+      {
+        \cs_if_exist:NT \@makefntext
+          {
+            \iflatin at ecclesiasticfootnotes
+              \let \@makefntext \polyglossia_latin_variant_footnote:n
+            \else
+              \let \@makefntext \polyglossia_latin_original_footnote:n
+            \fi
+          }
+      }
+      {
+        \msg_warning:nn {polyglossia} {latin / ineffective footnote option}
+      }
+  }
+
+\define at boolkey {latin} [latin@] {ecclesiasticfootnotes} [true]
+  {
+    \token_if_eq_meaning:NNTF \@onlypreamble \@notprerr
+      {
+        % within the document
+        \polyglossia_latin_apply_footnote_option:
+      }
+      {
+        % within the preamble
+        % The application of the option has to be postponed as the main
+        % language may be undefined when the option is called.
+        \AtBeginDocument { \polyglossia_latin_apply_footnote_option: }
+      }
+  }
+
+
+%%%%% Language variants: classic, medieval, modern, and ecclesiastic
+
+\msg_new:nnn {polyglossia} {latin / language variant}
+  {
+    Activating~Latin~language~variant~"#1"~\msg_line_context:.
+  }
+
+\msg_new:nnn {polyglossia} {latin / illegal language variant}
+  {
+    The~Latin~language~variant~"#1"~is~undefined~\msg_line_context:.
+  }
+
+\cs_new:Npn \polyglossia_latin_classic_settings:
+  {
+    \bool_set_false:N \l_polyglossia_latin_use_j_bool
+    \bool_set_false:N \l_polyglossia_latin_use_v_bool
+    \bool_set_false:N \l_polyglossia_latin_use_digraphs_bool
+    \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
+    \bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool
+    \SetLanguageKeys {latin} { babelname = latin.classic }
+    \polyglossia_latin_set_patterns:n {classiclatin}
+  }
+
+\cs_new:Npn \polyglossia_latin_medieval_settings:
+  {
+    \bool_set_false:N \l_polyglossia_latin_use_j_bool
+    \bool_set_false:N \l_polyglossia_latin_use_v_bool
+    \bool_set_true:N \l_polyglossia_latin_use_digraphs_bool
+    \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
+    \bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool
+    \SetLanguageKeys {latin} { babelname = latin.medieval }
+    \polyglossia_latin_use_modern_patterns:
+  }
+
+\cs_new:Npn \polyglossia_latin_modern_settings:
+  {
+    \bool_set_false:N \l_polyglossia_latin_use_j_bool
+    \bool_set_true:N \l_polyglossia_latin_use_v_bool
+    \bool_set_false:N \l_polyglossia_latin_use_digraphs_bool
+    \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
+    \bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool
+    \SetLanguageKeys {latin} { babelname = latin }
+    \polyglossia_latin_use_modern_patterns:
+  }
+
+\cs_new:Npn \polyglossia_latin_ecclesiastic_settings:
+  {
+    \bool_set_false:N \l_polyglossia_latin_use_j_bool
+    \bool_set_true:N \l_polyglossia_latin_use_v_bool
+    \bool_set_true:N \l_polyglossia_latin_use_digraphs_bool
+    \bool_set_false:N \l_polyglossia_latin_capitalize_month_bool
+    \bool_set_true:N \l_polyglossia_latin_punctuation_spacing_bool
+    \SetLanguageKeys {latin} { babelname = latin.ecclesiastic }
+    \polyglossia_latin_use_modern_patterns:
+  }
+
+\define at key{latin}{variant}
+  {
+    \str_case:nnF {#1}
+      {
+        {classic}
+        {
+          \msg_info:nnn {polyglossia} {latin / language variant} {classic}
+          \polyglossia_latin_classic_settings:
+        }
+        {medieval}
+        {
+          \msg_info:nnn {polyglossia} {latin / language variant} {medieval}
+          \polyglossia_latin_medieval_settings:
+        }
+        {modern}
+        {
+          \msg_info:nnn {polyglossia} {latin / language variant} {modern}
+          \polyglossia_latin_modern_settings:
+        }
+        {ecclesiastic}
+        {
+          \msg_info:nnn {polyglossia} {latin / language variant} {ecclesiastic}
+          \polyglossia_latin_ecclesiastic_settings:
+        }
+      }
+      {
+        \msg_warning:nnn {polyglossia} {latin / illegal language variant} {#1}
+      }
+  }
+
+
+%%%%% Boolean options concerning spelling
+
+\define at boolkey{latin}[latin@]{usej}[true]
+  {
+    \iflatin at usej
+      \bool_set_true:N \l_polyglossia_latin_use_j_bool
+    \else
+      \bool_set_false:N \l_polyglossia_latin_use_j_bool
+    \fi
+  }
+
+\define at boolkey{latin}[latin@]{capitalizemonth}[true]
+  {
+    \iflatin at capitalizemonth
+      \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
+    \else
+      \bool_set_false:N \l_polyglossia_latin_capitalize_month_bool
+    \fi
+  }
+
+
+%%%%% Hyphenation variants: classic, liturgical, and modern
+
+\msg_new:nnn {polyglossia} {latin / hyphenation variant}
+  {
+    Activating~hyphenation~patterns~for~#1~Latin~\msg_line_context:.
+  }
+
+\msg_new:nnn {polyglossia} {latin / illegal hyphenation variant}
+  {
+    The~Latin~hyphenation~variant~"#1"~is~undefined~\msg_line_context:.
+  }
+
+\define at key{latin}{hyphenation}
+  {
+    \str_case:nnTF {#1}
+      {
+        {classic}    { \polyglossia_latin_set_patterns:n {classiclatin} }
+        {liturgical} { \polyglossia_latin_set_patterns:n {liturgicallatin} }
+        {modern}     { \polyglossia_latin_use_modern_patterns: }
+      }
+      {
+        \msg_info:nnn {polyglossia} {latin / hyphenation variant} {#1}
+      }
+      {
+        \msg_warning:nnn {polyglossia} {latin / illegal hyphenation variant} {#1}
+      }
+  }
+
+
+%%%%% Latin captions and date
+
+\def \captionslatin
+  {
+    \def \prefacename
+      {
+        \bool_if:NTF \l_polyglossia_latin_use_digraphs_bool {Præfatio} {Praefatio}
+      }
+    \def \refname {Conspectus~librorum}
+    \def \abstractname {Summarium}
+    \def \bibname {Conspectus~librorum}
+    \def \chaptername {Caput}
+    \def \appendixname {Additamentum}
+    \def \contentsname {Index}
+    \def \listfigurename {Conspectus~descriptionum}
+    \def \listtablename {Conspectus~tabularum}
+    \def \indexname {Index~rerum~notabilium}
+    \def \figurename {Descriptio}
+    \def \tablename {Tabula}
+    \def \partname {Pars}
+    \def \enclname {Additur}
+    \def \ccname {Exemplar}
+    \def \headtoname {\ignorespaces}
+    \def \pagename {charta}
+    \def \seename {cfr.}
+    \def \alsoname {cfr.}
+    \def \proofname {Demonstratio}
+    \def \glossaryname {Glossarium}
+  }
+
+\cs_new:Npn \polyglossia_latin_month_name:
+  {
+    \str_set:Nx \l_tmpa_str
+      {
+        \int_case:nn { \month }
+          {
+            {1} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {januarii} {ianuarii} }
+            {2} {februarii}
+            {3} {martii}
+            {4} {aprilis}
+            {5} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {maji} {maii} }
+            {6} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {junii} {iunii} }
+            {7} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {julii} {iulii} }
+            {8} {augusti}
+            {9} {septembris}
+            {10} {octobris}
+            {11} { \bool_if:NTF \l_polyglossia_latin_use_v_bool {novembris} {nouembris} }
+            {12} {decembris}
+          }
+      }
+    \bool_if:NTF \l_polyglossia_latin_capitalize_month_bool
+      {
+        \tl_mixed_case:n { \l_tmpa_str }
+      }
+      {
+        \str_use:N \l_tmpa_str
+      }
+  }
+
+\def \datelatin
+  {
+    \def \today
+      {
+        \int_to_Roman:n { \day }
+        \c_space_tl
+        \polyglossia_latin_month_name:
+        \c_space_tl
+        \int_to_Roman:n { \year }
+      }
+  }
+
+
+%%%%% Latin shorthands
+
+\define at boolkey{latin}[latin@]{babelshorthands}[true]
+  {
+  }
+
+\define at boolkey{latin}[latin@]{prosodicshorthands}[true]
+  {
+  }
+
 \ifsystem at babelshorthands
   \setkeys{latin}{babelshorthands=true}
 \else
   \setkeys{latin}{babelshorthands=false}
 \fi
-\ifcsundef{initiate at active@char}{%
-\input{babelsh.def}%
-\initiate at active@char{"}%
-\initiate at active@char{'}%
-}{}
-\def\latin at shorthands{%
-  \def\language at group{latin}%
-  \bbl at activate{"}%
-  \declare at shorthand{latin}{"}{\relax
-    \ifmmode
-      \def\xpgla at nextdq{''}%
-    \else
-      \def\xpgla at nextdq{\futurelet\xpgla at temp\xpgla at cwm}%
-    \fi
-  \xpgla at nextdq}%
-  \bbl at activate{'}%
-  \declare at shorthand{latin}{'}{\relax
-    \ifmmode
-      \def\xpgla at nextsq{'}%
-    \else
-      \def\xpgla at nextsq{\futurelet\xpgla at temp@A\xpgla at putacute}%
-    \fi
-  \xpgla at nextsq}%
-}
-\def\xpgla at allowhyphens{\bbl at allowhyphens
-        \discretionary{-}{}{}\bbl at allowhyphens}
-\newcommand*{\xpgla at cwm}{\let\xpgla@@nextdq\relax
-  \ifcat\noexpand\xpgla at temp a%
-    \let\xpgla@@nextdq\xpgla at allowhyphens
-  \else
-    \ifx\xpgla at temp\ae
-        \let\xpgla@@nextdq\xpgla at allowhyphens
-    \else
-        \ifx\xpgla at temp\oe
-           \let\xpgla@@nextdq\xpgla at allowhyphens
+
+\ExplSyntaxOff % babelsh.def does not support expl3 syntax
+\ifcsundef{initiate at active@char}{\input{babelsh.def}}{}
+\ExplSyntaxOn
+
+\initiate at active@char {"}
+\initiate at active@char {'}
+\initiate at active@char {^}
+\initiate at active@char {=}
+
+\shorthandoff {"}
+\shorthandoff {'}
+\shorthandoff {^}
+\shorthandoff {=}
+
+% The active '=' character may cause problems with key=value interfaces.
+% We have to make sure here that no problems can occur outside a Latin
+% prosodic shorthand environment.
+
+\protected at write \@auxout { } { \shorthandoff {=} } % for the aux file
+
+\AtBeginDocument
+  {
+    \str_if_eq:VnTF \xpg at main@language {latin}
+      {
+        \iflatin at prosodicshorthands
         \else
-           \if\noexpand\xpgla at temp\string|%
-              \def\xpgla@@nextdq{\xpgla at allowhyphens\@gobble}%
-           \fi
+          \shorthandoff {=}
         \fi
+      }
+      {
+        % The following command should not be called if the main language
+        % defines a '=' shorthand. However, there are no languages besides
+        % Latin defining such a shorthand in polyglossia.
+        \shorthandoff {=}
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_shorthands:
+  {
+    \def \language at group {latin}
+    \bbl at activate {"}
+    \declare at shorthand {latin} {"}
+      {
+        \mode_if_math:TF
+          {
+            \token_to_str:N "
+          }
+          {
+            \polyglossia_latin_apply_quotemark:N
+          }
+      }
+    \bbl at activate {'}
+    \declare at shorthand {latin} {'}
+      {
+        \mode_if_math:TF
+          {
+            \active at math@prime % defined in "latex.ltx"
+          }
+          {
+            \polyglossia_latin_put_acute:N
+          }
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_prosodic_shorthands:
+  {
+    \def \language at group {latin}
+    % The '=' shorthand is normally turned off to avoid problems with key=value
+    % interfaces. We turn it on here to enable prosodic shorthands.
+    \shorthandon {=}
+    \bbl at activate {=}
+    \declare at shorthand {latin} {=}
+      {
+        \mode_if_math:TF
+          {
+            \token_to_str:N =
+          }
+          {
+            \polyglossia_latin_put_macron:N
+          }
+      }
+    \bbl at activate {^}
+    \declare at shorthand {latin} {^}
+      {
+        \mode_if_math:TF
+          {
+            \token_to_str:N ^
+          }
+          {
+            \polyglossia_latin_put_breve:N
+          }
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_apply_quotemark:N #1
+  {
+    \str_case:nnF {#1}
+      {
+        {A} { \polyglossia_latin_digraph_shorthand:Nnn E { Æ }
+                {
+                  \polyglossia_latin_digraph_shorthand:Nnn e { Æ }
+                    {
+                      \polyglossia_latin_allow_hyphens: A
+                    }
+                }
+            }
+        {a} { \polyglossia_latin_digraph_shorthand:Nnn e { æ }
+                {
+                  \polyglossia_latin_allow_hyphens: a
+                }
+            }
+        {O} { \polyglossia_latin_digraph_shorthand:Nnn E { Π}
+                {
+                  \polyglossia_latin_digraph_shorthand:Nnn e { Π}
+                    {
+                      \polyglossia_latin_allow_hyphens: O
+                    }
+                }
+            }
+        {o} { \polyglossia_latin_digraph_shorthand:Nnn e { œ }
+                {
+                  \polyglossia_latin_allow_hyphens: o
+                }
+            }
+        {|} { \polyglossia_latin_allow_hyphens: }
+        {<} { « }
+        {>} { » }
+      }
+      {
+        \token_if_letter:NTF #1 { \polyglossia_latin_allow_hyphens: #1 }
+          {
+            \token_if_eq_meaning:NNTF #1 \AE { \polyglossia_latin_allow_hyphens: #1 }
+              {
+                \token_if_eq_meaning:NNTF #1 \ae { \polyglossia_latin_allow_hyphens: #1 }
+                  {
+                    \token_if_eq_meaning:NNTF #1 \OE { \polyglossia_latin_allow_hyphens: #1 }
+                      {
+                        \token_if_eq_meaning:NNTF #1 \oe { \polyglossia_latin_allow_hyphens: #1 }
+                          {
+                            \token_to_str:N "
+                            #1
+                          }
+                      }
+                  }
+              }
+          }
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_put_acute:N #1
+  {
+    \str_case:nnF {#1}
+      {
+        {A} { \polyglossia_latin_digraph_shorthand:Nnn E { Ǽ }
+                {
+                  \polyglossia_latin_digraph_shorthand:Nnn e { Ǽ } { Á }
+                }
+            }
+        {a} { \polyglossia_latin_digraph_shorthand:Nnn e { ǽ } { á } }
+        {E} { É }
+        {e} { é }
+        {I} { Í }
+        {i} { í }
+        {O} { \polyglossia_latin_digraph_shorthand:Nnn E { \'Π}
+                {
+                  \polyglossia_latin_digraph_shorthand:Nnn e { \'Œ } { Ó }
+                }
+            }
+        {o} { \polyglossia_latin_digraph_shorthand:Nnn e { \'œ } { ó } }
+        {U} { Ú }
+        {u} { ú }
+        {V} { \' V } % V may be a vowel, but lowercase v is never used as a vowel.
+        {Y} { Ý }
+        {y} { ý }
+        {Æ} { Ǽ }
+        {æ} { ǽ }
+        {Œ} { \'Œ }
+        {œ} { \'œ }
+      }
+      {
+        \token_if_eq_meaning:NNTF #1 \AE { Ǽ }
+          {
+            \token_if_eq_meaning:NNTF #1 \ae { ǽ }
+              {
+                \token_if_eq_meaning:NNTF #1 \OE { \'Π}
+                  {
+                    \token_if_eq_meaning:NNTF #1 \oe { \'œ }
+                      {
+                        \token_to_str:N '
+                        #1
+                      }
+                  }
+              }
+          }
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_put_macron:N #1
+  {
+    \str_case:nnF {#1}
+      {
+        {A} { \polyglossia_latin_diphthong_macron:NNn AE
+                {
+                  \polyglossia_latin_diphthong_macron:NNn Ae
+                    {
+                      \polyglossia_latin_diphthong_macron:NNn AU
+                        {
+                          \polyglossia_latin_diphthong_macron:NNn Au { Ā }
+                        }
+                    }
+                }
+            }
+        {a} { \polyglossia_latin_diphthong_macron:NNn ae
+                {
+                  \polyglossia_latin_diphthong_macron:NNn au { ā }
+                }
+            }
+        {E} { \polyglossia_latin_diphthong_macron:NNn EU
+                {
+                  \polyglossia_latin_diphthong_macron:NNn Eu { Ē }
+                }
+            }
+        {e} { \polyglossia_latin_diphthong_macron:NNn eu { ē } }
+        {I} { Ī }
+        {i} { ī }
+        {O} { \polyglossia_latin_diphthong_macron:NNn OE
+                {
+                  \polyglossia_latin_diphthong_macron:NNn Oe { Ō }
+                }
+            }
+        {o} { \polyglossia_latin_diphthong_macron:NNn oe { ō } }
+        {U} { Ū }
+        {u} { ū }
+        {V} { \= V } % V may be a vowel, but lowercase v is never used as a vowel.
+        {Y} { Ȳ }
+        {y} { ȳ }
+      }
+      {
+        \token_to_str:N =
+        #1
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_put_breve:N #1
+  {
+    \str_case:nnF {#1}
+      {
+        {A} { Ă }
+        {a} { ă }
+        {E} { Ĕ }
+        {e} { ĕ }
+        {I} { Ĭ }
+        {i} { ĭ }
+        {O} { Ŏ }
+        {o} { ŏ }
+        {U} { Ŭ }
+        {u} { ŭ }
+        {V} { \u{V} } % V may be a vowel, but lowercase v is never used as a vowel.
+        {Y} { \u{Y} }
+        {y} { \u{y} }
+      }
+      {
+        \token_to_str:N ^
+        #1
+      }
+  }
+
+
+\cs_new:Npn \polyglossia_latin_allow_hyphens:
+  {
+    \bbl at allowhyphens
+    \discretionary {-} {} {}
+    \bbl at allowhyphens
+  }
+
+\cs_new:Npn \polyglossia_latin_digraph_shorthand:Nnn #1#2#3
+% #1: second letter of digraph (E or e)
+% #2: digraph character
+% #3: non-digraph code
+  {
+    \bool_if:NTF \l_polyglossia_latin_use_digraphs_bool
+      {
+        \peek_meaning_remove:NTF #1 {#2} {#3}
+      }
+      {
+        #3
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_diphthong_macron:NNn #1#2#3
+% #1: first character of diphthong
+% #2: second character of diphthong
+% #3: non-diphthong code
+  {
+    \peek_meaning:NTF #2 { #1 \char "35E \relax } {#3} % U+35E: combining double macron
+  }
+
+\cs_new:Npn \polyglossia_latin_no_shorthands:
+  {
+    \bbl at deactivate {"}
+    \bbl at deactivate {'}
+    \bbl at deactivate {=}
+    \bbl at deactivate {^}
+    % The active '=' character may cause problems with key=value interfaces.
+    % We have to make sure here that no problems can occur outside a Latin
+    % prosodic shorthand environment.
+    \shorthandoff {=}
+  }
+
+
+%%%%% Further settings
+
+\let \xpgla at savedvalues \empty
+
+\AtEndPreamble
+  {
+    \edef \xpgla at savedvalues
+      {
+        \clubpenalty = \the \clubpenalty \space
+        \@clubpenalty = \the \@clubpenalty \space
+        \widowpenalty = \the \widowpenalty \space
+        \finalhyphendemerits = \the \finalhyphendemerits
+      }
+  }
+
+\def \noextras at latin
+  {
+    \polyglossia_latin_no_shorthands:
+    \xpgla at savedvalues
+    \polyglossia_latin_no_punctuation_spacing:
+    \polyglossia_latin_modern_character_codes:
+  }
+
+\cs_new:Npn \polyglossia_latin_inline_extras:
+  {
+    \bool_if:NF \l_polyglossia_latin_use_v_bool
+      {
+        \polyglossia_latin_classical_character_codes:
+      }
+    \bool_if:NT \l_polyglossia_latin_punctuation_spacing_bool
+      {
+        \polyglossia_latin_punctuation_spacing:
+      }
+    \iflatin at babelshorthands
+      \polyglossia_latin_shorthands:
     \fi
-  \fi
-  \xpgla@@nextdq}%
-\def\xpgla at putacute#1{\let\xpgla at nextsq\relax%
-\if a\xpgla at temp@A
-  æ\kern-0.175em^^^^0301\kern0.175em\xpgla at allowhyphens
-\else
-\if o\xpgla at temp@A
-  œ\kern-0.175em^^^^0301\kern0.175em\xpgla at allowhyphens
-\else
-  \if æ\xpgla at temp@A
-    æ^^^^0301%
-  \else
-    \if œ\xpgla at temp@A
-      œ^^^^0301%
-    \else
-      \string'%
+    \iflatin at prosodicshorthands
+      \polyglossia_latin_prosodic_shorthands:
     \fi
-  \fi
-\fi
-\fi}%
+  }
 
-\def\nolatin at shorthands{%
-  \@ifundefined{initiate at active@char}{}{\bbl at deactivate{"}}%
-  \@ifundefined{initiate at active@char}{}{\bbl at deactivate{'}}%
-}
+\def \blockextras at latin
+  {
+    % The following four values were overtaken from the Italian language module.
+    % It is unclear why they were chosen.
+    \clubpenalty = 3000
+    \@clubpenalty = 3000
+    \widowpenalty = 3000
+    \finalhyphendemerits = 50000000
+    \polyglossia_latin_inline_extras:
+  }
 
-\let\xpgla at savedvalues\empty
-\AtEndPreamble{%
-  \edef\xpgla at savedvalues{%
-    \clubpenalty=\the\clubpenalty\space
-    \@clubpenalty=\the\@clubpenalty\space
-    \widowpenalty=\the\widowpenalty\space
-    \finalhyphendemerits=\the\finalhyphendemerits}
-}
-\def\noextras at latin{%
-   \lccode\string"2019=\z@
-   \nolatin at shorthands
-   \xpgla at savedvalues
-   \noclassicuclccodes
-  \iflatin at ecclesiastic
-    \unless\ifluatex\noecclesiasticlatin at punctuation
-    \let\@makefntext\latin at original@makefntext\fi
-  \fi
-}
+\def \inlineextras at latin
+  {
+    \polyglossia_latin_inline_extras:
+  }
 
-\def\blockextras at latin{%
-   \lccode\string"2019=\string"2019
-   \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000
-   \finalhyphendemerits=50000000
-   \ifclassic\classicuclccodes\fi
-   \iflatin at babelshorthands\latin at shorthands\fi
-   \iflatin at ecclesiastic\unless\ifluatex\ecclesiasticlatin at punctuation
-   \let\@makefntext\latin at ecclesiastic@makefntext\fi
-   \fi
-}
 
-\def\inlineextras at latin{%
-   \lccode\string"2019=\string"2019
-   \ifclassic\classicuclccodes\fi
-   \iflatin at babelshorthands\latin at shorthands\fi
-   \iflatin at ecclesiastic
-      \unless\ifluatex\ecclesiasticlatin at punctuation
-      \let\@makefntext\latin at ecclesiastic@makefntext\fi
-   \fi
-}
+%% Default settings
+
+\polyglossia_latin_modern_settings:
+
+\ExplSyntaxOff
+
 %%   Copyright (C) Claudio Beccari 2013-2016
-%%   Copyright (C) Élie Roux 2016
-%% 
+%%   Copyright (C) Élie Roux 2016-2019
+%%   Copyright (C) Keno Wehr 2019
+%%
 %%   Permission is hereby granted, free of charge, to any person obtaining
 %%   a copy of this software and associated documentation files
 %%   (the "Software"), to deal in the Software without restriction, including
@@ -7268,10 +9331,10 @@
 %%   distribute, sublicense, and/or sell copies of the Software, and to permit
 %%   persons to whom the Software is furnished to do so, subject to the following
 %%   conditions:
-%% 
+%%
 %%   The above copyright notice and this permission notice shall be included in
 %%   all copies or substantial portions of the Software.
-%% 
+%%
 %%   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 %%   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 %%   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -7284,6 +9347,51 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-latin.ldf>
+%<*gloss-latinclassic.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-latinclassic.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-latinclassic.ldf}[polyglossia: module for classic latin]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{latin}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-latinclassic.ldf>
+%<*gloss-latinecclesiastic.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-latinecclesiastic.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-latinecclesiastic.ldf}[polyglossia: module for ecclesiastic latin]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{latin}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-latinecclesiastic.ldf>
+%<*gloss-latinmedieval.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-latinmedieval.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-latinmedieval.ldf}[polyglossia: module for medieval latin]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{latin}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-latinmedieval.ldf>
 %<*gloss-latvian.ldf>
 % \fi
 % \clearpage
@@ -7406,6 +9514,21 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-lithuanian.ldf>
+%<*gloss-lowersorbian.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-lowersorbian.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-lowersorbian.ldf}[polyglossia: module for lower sorbian]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{sorbian}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-lowersorbian.ldf>
 %<*gloss-lsorbian.ldf>
 % \fi
 % \clearpage
@@ -7417,20 +9540,8 @@
 % We only provide this gloss for babel compatibility. Since lsorbian is 
 % a sorbian variety, we use 'sorbian' with variant 'lower' now.
 
-\input{gloss-sorbian.ldf}
+\xpg at load@master at language{sorbian}
 
-\PolyglossiaSetup{lsorbian}{
-  language=Lower Sorbian,
-  babelname=lowersorbian,
-  hyphennames={lsorbian,lowersorbian,Lsorbian},
-  langtag=LSB,
-  hyphenmins={2,2},
-  fontsetup=true,
-}
-
-\let\captionslsorbian\captionssorbian at lsorbian
-\let\datelsorbian\datesorbian at lsorbian
-
 %    \end{macrocode}
 % \iffalse
 %</gloss-lsorbian.ldf>
@@ -7535,21 +9646,8 @@
 
 % We only provide this gloss for babel compatibility.
 
-\input{gloss-hungarian.ldf}
+\xpg at load@master at language{hungarian}
 
-\PolyglossiaSetup{magyar}{
-  hyphennames={magyar,hungarian},
-  langtag=HUN,
-  hyphenmins={2,2},
-  fontsetup=true,
-}
-
-\let\captionsmagyar\captionshungarian
-\let\datemagyar\datehungarian
-\let\ondatemagyar\ondatehungarian
-\let\blockextras at magyar\blockextras at hungarian
-\let\noextras at magyar\noextras at hungarian
-
 %    \end{macrocode}
 % \iffalse
 %</gloss-magyar.ldf>
@@ -7570,6 +9668,13 @@
   hyphenmins={2,2},
   fontsetup=true}
 
+% Babel aliases
+\setlanguagealias[variant=indonesian]{malay}{bahasai}
+\setlanguagealias[variant=malaysian]{malay}{bahasa}
+
+% Backwards compat. alias
+\setlanguagealias[variant=malaysian]{malay}{bahasam}
+
 \providebool{malay at melayu}
 \malay at melayufalse
 \def\malay at variant{malay}
@@ -7902,7 +10007,7 @@
 %    \begin{macrocode}
 \ProvidesFile{gloss-mongolian.ldf}[polyglossia: module for mongolian]
 
-\RequirePackage{cyrillicnumbers}
+\RequirePackage{xpg-cyrillicnumbers}
 
 \PolyglossiaSetup{mongolian}{
   script=Cyrillic,
@@ -8095,6 +10200,51 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-mongolian.ldf>
+%<*gloss-naustrian.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-naustrian.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-naustrian.ldf}[polyglossia: module for austrian german (current spelling)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{german}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-naustrian.ldf>
+%<*gloss-newzealand.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-newzealand.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-newzealand.ldf}[polyglossia: module for newzealand english]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{english}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-newzealand.ldf>
+%<*gloss-ngerman.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-ngerman.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-ngerman.ldf}[polyglossia: module for german (current spelling)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{german}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-ngerman.ldf>
 %<*gloss-nko.ldf>
 % \fi
 % \clearpage
@@ -8198,19 +10348,8 @@
 % We only provide this gloss for babel compatibility. Since norsk is 
 % actually norwegian bokmal, we use 'norwegian' with variant 'bokmal' now.
 
-\input{gloss-norwegian.ldf}
+\xpg at load@master at language{norwegian}
 
-\PolyglossiaSetup{norsk}{
-  hyphennames={norsk},
-  hyphenmins={2,2},
-  langtag=NOR,
-  frenchspacing=true,
-  fontsetup=true,
-}
-
-\let\captionsnorsk\captionsnorwegian at norsk
-\let\datenorsk\datenorwegian at norsk
-
 %    \end{macrocode}
 % \iffalse
 %</gloss-norsk.ldf>
@@ -8229,6 +10368,10 @@
   fontsetup=false,
 }
 
+% Babel and backwards compat. aliases
+\setlanguagealias[variant=bokmal]{norwegian}{norsk}
+\setlanguagealias[variant=nynorsk]{norwegian}{nynorsk}
+
 \def\norwegian at variant{nynorsk}
 \define at choicekey*+{norwegian}{variant}[\val\nr]{nynorsk,bokmal}[nynorsk]{%
    \ifcase\nr\relax
@@ -8325,6 +10468,21 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-norwegian.ldf>
+%<*gloss-nswissgerman.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-nswissgerman.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-nswissgerman.ldf}[polyglossia: module for swiss german (current spelling)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{german}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-nswissgerman.ldf>
 %<*gloss-nynorsk.ldf>
 % \fi
 % \clearpage
@@ -8336,19 +10494,8 @@
 % We only provide this gloss for babel compatibility. Since nynorsk is 
 % a norwegian variety, we use 'norwegian' with variant 'nynorsk' now.
 
-\input{gloss-norwegian.ldf}
+\xpg at load@master at language{norwegian}
 
-\PolyglossiaSetup{nynorsk}{
-  hyphennames={nynorsk},
-  langtag=NYN,
-  hyphenmins={2,2},
-  frenchspacing=true,
-  fontsetup=true,
-}
-
-\let\captionsnorsk\captionsnorwegian at nynorsk
-\let\datenorsk\datenorwegian at nynorsk
-
 %    \end{macrocode}
 % \iffalse
 %</gloss-nynorsk.ldf>
@@ -8550,6 +10697,9 @@
   localnumeral=farsinumerals
 }
 
+% Babel and backwards compat. alias
+\setlanguagealias{persian}{farsi}
+
 \newif\if at western@numerals
 \def\tmp at western{western}
 \define at key{persian}{numerals}[eastern]{%
@@ -8855,6 +11005,21 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-polish.ldf>
+%<*gloss-polutonikogreek.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-polutonikogreek.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-polutonikogreek.ldf}[polyglossia: module for polytonic greek]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{greek}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-polutonikogreek.ldf>
 %<*gloss-portuges.ldf>
 % \fi
 % \clearpage
@@ -8861,7 +11026,7 @@
 % 
 % \subsection{gloss-portuges.ldf}
 %    \begin{macrocode}
-\ProvidesFile{gloss-portuges.ldf}[polyglossia: module for portuguese (DEPRECATED!)]
+\ProvidesFile{gloss-portuges.ldf}[polyglossia: module for portuguese]
 
 % We only provide this gloss for backwards compatibility. The name
 % 'portuges' was selected in accordance with babel (which probably
@@ -8868,22 +11033,7 @@
 % introduced it in 8.3 filename times). Since polyglossia uses full
 % English language names, we use 'portuguese' now.
 
-% FIXME: Once we support babel aliases (#112) this gloss can go.
-
-\xpg at warning{The language name 'portuges' is deprectated.\MessageBreak
-             Please use 'portuguese' instead.}
-
-\input{gloss-portuguese.ldf}
-
-\PolyglossiaSetup{portuges}{
-  hyphennames={portuges,portuguese},
-  hyphenmins={2,3},
-  langtag=PTG,
-  fontsetup=true,
-}
-
-\let\captionsportuges\captionsportuguese at portuges
-\let\dateportuges\dateportuguese at portuges
+\xpg at load@master at language{portuguese}
      
 %    \end{macrocode}
 % \iffalse
@@ -8895,6 +11045,7 @@
 % \subsection{gloss-portuguese.ldf}
 %    \begin{macrocode}
 \ProvidesFile{gloss-portuguese.ldf}[polyglossia: module for portuguese]
+
 \PolyglossiaSetup{portuguese}{
   babelname=portuges,
   hyphennames={portuges,portuguese},
@@ -8903,11 +11054,16 @@
   fontsetup=true,
 }
 
+% Babel aliases
+\setlanguagealias[variant=portuguese]{portuguese}{portuges}
+\setlanguagealias[variant=brazilian]{portuguese}{brazil}
+
 \def\portuguese at variant{portuges}
 \define at choicekey*+{portuguese}{variant}[\val\nr]{portuguese,brazilian}[portuguese]{%
    \ifcase\nr\relax
       % portuguese:
       \def\portuguese at variant{portuges}%
+      \SetLanguageKeys{portuguese}{babelname=portuges}%
    \or
       % brazilian:
       \def\portuguese at variant{brazil}%
@@ -9109,7 +11265,7 @@
 %    \begin{macrocode}
 \ProvidesFile{gloss-russian.ldf}[polyglossia: module for russian]
 
-\RequirePackage{cyrillicnumbers}
+\RequirePackage{xpg-cyrillicnumbers}
 
 \PolyglossiaSetup{russian}{
   script=Cyrillic,
@@ -9118,6 +11274,7 @@
   hyphennames={russian},
   hyphenmins={2,2},
   frenchspacing=true,
+  indentfirst=true,
   fontsetup,
   localnumeral=russiannumerals,
   Localnumeral=Russiannumerals
@@ -9145,6 +11302,14 @@
       {\cyrillic at numeralsfalse}%
 }
 
+\define at boolkey{russian}[russian@]{indentfirst}{
+   \ifrussian at indentfirst
+      \SetLanguageKeys{russian}{indentfirst=true}
+   \else
+      \SetLanguageKeys{russian}{indentfirst=false}
+  \fi
+}
+
 \define at boolkey{russian}[russian@]{babelshorthands}[false]{}
 
 \setkeys{russian}{spelling,numerals}
@@ -9454,6 +11619,10 @@
   fontsetup=true,
 }
 
+% Babel and backwards compat. alias
+\setlanguagealias{sami}{samin}
+%\setlanguagealias[variant=northern]{sami}{samin}
+
 % TODO: Add other Sami varieties
 \def\sami at variant{northern}
 %\define at choicekey*+{sami}{variant}[\val\nr]{northern}[nothern]{%
@@ -9540,19 +11709,8 @@
 % We only provide this gloss for babel compatibility. Since samin is 
 % a sami variety, we use 'sami' with variant 'northern' now.
 
-\input{gloss-sami.ldf}
+\xpg at load@master at language{sami}
 
-\PolyglossiaSetup{samin}{
-  hyphennames={samin},
-  hyphenmins={2,2},
-  language={Northern Sami},
-  langtag=NSM,
-  fontsetup=true,
-}
-
-\let\captionssamin\captionssami at nothern
-\let\datesamin\datesami at nothern
-
 %    \end{macrocode}
 % \iffalse
 %</gloss-samin.ldf>
@@ -9588,6 +11746,8 @@
   }%
 }
 
+\define at key{sanskrit}{script}[Devanagari]{\setkeys{sanskrit}{Script=#1}}
+
 \def\fontsetup at sanskrit@Devanagari{%
   \SetLanguageKeys{sanskrit}{scripttag=deva,script=Devanagari}
   \xpg at fontsetup@nonlatin{sanskrit}}
@@ -9612,16 +11772,20 @@
 
 \setkeys{sanskrit}{Script} %sets the default for Devanagari
 
-\def\tmp at western{Western}
+
 \newif\ifsanskrit at devanagari@numerals
 \sanskrit at devanagari@numeralstrue
+\define at choicekey*+{sanskrit}{numerals}[\val\nr]{Devanagari,Western}[Devanagari]{%
+   \ifcase\nr\relax
+      % Devanagari:
+      \sanskrit at devanagari@numeralstrue%
+   \or
+      % Western:
+      \sanskrit at devanagari@numeralsfalse%
+   \fi
+   \xpg at info{Option: Sanskrit, numerals=\val}%
+}{\xpg at warning{Unknown Sanskrit numeral `#1'}}
 
-\define at key{sanskrit}{numerals}[Devanagari]{%
-  \def\@tmpa{#1}%
-  \ifx\@tmpa\tmp at western
-    \sanskrit at devanagari@numeralsfalse
-  \fi%
-}
 
 \newcommand{\sanskritnumerals}[2]{\sanskritnumber{#2}}
 
@@ -9633,34 +11797,45 @@
   \fi%
 }
 
-% FIXME: Support LuaTeX
-\ifxetex
-  \newXeTeXintercharclass\sanskrit at punctthin % ! ? ; : danda double_danda
+\ifluatex
+  \directlua{require('polyglossia-sanskrit')}%
+\else
+  \newXeTeXintercharclass\sanskrit at punctthin % ! ? ‼ ⁇ ⁈ ⁉ : ; danda double_danda
 \fi
 
 \def\sanskrit at punctthinspace{{\unskip\thinspace}}
 
 \def\sanskrit at punctuation{%
-  % FIXME: Support LuaTeX
-  \ifxetex
+  \ifluatex
+    \directlua{polyglossia.activate_sanskrit_punct()}%
+  \else
     \XeTeXinterchartokenstate=1%
     \XeTeXcharclass `\! \sanskrit at punctthin
     \XeTeXcharclass `\? \sanskrit at punctthin
+    \XeTeXcharclass `\‼ \sanskrit at punctthin
+    \XeTeXcharclass `\⁇ \sanskrit at punctthin
+    \XeTeXcharclass `\⁈ \sanskrit at punctthin
+    \XeTeXcharclass `\⁉ \sanskrit at punctthin
+    \XeTeXcharclass `\: \sanskrit at punctthin
     \XeTeXcharclass `\; \sanskrit at punctthin
-    \XeTeXcharclass `\: \sanskrit at punctthin
-    \XeTeXcharclass `\। \sanskrit at punctthin
-    \XeTeXcharclass `\॥ \sanskrit at punctthin
+    \XeTeXcharclass `\। \sanskrit at punctthin % danda, U+0964
+    \XeTeXcharclass `\॥ \sanskrit at punctthin % double danda, U+0965
     \XeTeXinterchartoks \z@ \sanskrit at punctthin = \sanskrit at punctthinspace
   \fi
 }
 
 \def\nosanskrit at punctuation{%
-  % FIXME: Support LuaTeX
-  \ifxetex
+  \ifluatex
+    \directlua{polyglossia.deactivate_sanskrit_punct()}%
+  \else
     \XeTeXcharclass `\! \z@
     \XeTeXcharclass `\? \z@
+    \XeTeXcharclass `\‼ \z@
+    \XeTeXcharclass `\⁇ \z@
+    \XeTeXcharclass `\⁈ \z@
+    \XeTeXcharclass `\⁉ \z@
+    \XeTeXcharclass `\: \z@
     \XeTeXcharclass `\; \z@
-    \XeTeXcharclass `\: \z@
     \XeTeXcharclass `\। \z@
     \XeTeXcharclass `\॥ \z@
     \XeTeXinterchartokenstate=0%
@@ -9689,18 +11864,8 @@
 % We only provide this gloss for babel compatibility. Since scottish is 
 % a gaelic variety, we use 'gaelic' with variant 'scottish' now.
 
-\input{gloss-gaelic.ldf}
+\xpg at load@master at language{gaelic}
 
-\PolyglossiaSetup{scottish}{
-  hyphennames={scottish},
-  hyphenmins={2,2},
-  langtag=GAE,
-  fontsetup=true,
-}
-
-\let\captionsscottish\captionsgaelic at scottish
-\let\datescottish\dategaelic at scottish
-
 %    \end{macrocode}
 % \iffalse
 %</gloss-scottish.ldf>
@@ -9716,7 +11881,7 @@
 %% same thing for all languages that have a "script" key !
 %% BETTER APPROACH: see gloss-sanskrit!
 
-\RequirePackage{cyrillicnumbers}
+\RequirePackage{xpg-cyrillicnumbers}
 
 \PolyglossiaSetup{serbian}{
   langtag=SRB,
@@ -9729,25 +11894,27 @@
   %TODO localalph
 }
 
+% Babel aliases
+\setlanguagealias[script=Cyrillic]{serbian}{serbianc}
+
 \newif\if at serbian@cyr
+\define at choicekey*+{serbian}{Script}[\val\nr]{cyrillic,latin}[cyrillic]{%
+   \ifcase\nr\relax
+      % cyrillic:
+      \@serbian at cyrtrue
+      \SetLanguageKeys{serbian}{scripttag=cyrl,script=Cyrillic,babelname=serbianc}
+      \xpg at fontsetup@nonlatin{serbian}%
+   \or
+      % latin:
+      \@serbian at cyrfalse
+      \SetLanguageKeys{serbian}{scripttag=latn,script=Latin}
+      \xpg at fontsetup@latin{serbian}%
+      %TODO \def\serbian at language{\language=\l at serbianlat}%
+      % or should we use Croatian patterns as a fallback for the time being???
+   \fi
+   \xpg at info{Option: Serbian, script=\val}%
+}{\xpg at warning{Unknown Serbian script `#1'}}
 
-\define at key{serbian}{Script}[Cyrillic]{%
-  \ifstrequal{#1}{Cyrillic}%
-    {\@serbian at cyrtrue
-     \SetLanguageKeys{serbian}{scripttag=cyrl,script=Cyrillic,babelname=serbianc}
-     \xpg at fontsetup@nonlatin{serbian}%
-    }%
-    {\ifstrequal{#1}{Latin}%
-      {\@serbian at cyrfalse
-       \SetLanguageKeys{serbian}{scripttag=latn,script=Latin}
-       \xpg at fontsetup@latin{serbian}%
-       %TODO \def\serbian at language{\language=\l at serbianlat}%
-       % or should we use Croatian patterns as a fallback for the time being???
-      }%
-      {\xpg at error{Unknown script `#1' for Serbian language\MessageBreak
-      Valid values are "Cyrillic" and "Latin"}}%
-    }%
-}
 \define at key{serbian}{script}[Cyrillic]{\setkeys{serbian}{Script=#1}}
 
 \newif\ifserbian at numerals
@@ -9910,6 +12077,21 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-serbian.ldf>
+%<*gloss-serbianc.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-serbianc.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-serbianc.ldf}[polyglossia: module for serbian (cyrillic)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{serbian}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-serbianc.ldf>
 %<*gloss-slovak.ldf>
 % \fi
 % \clearpage
@@ -9925,6 +12107,176 @@
   fontsetup=true,
 }
 
+\ifluatex
+  \RequirePackage{luavlna}
+\fi
+
+\define at boolkey{slovak}[slovak@]{babelshorthands}[true]{}
+
+\define at boolkey{slovak}[slovak@]{splithyphens}[true]{}
+
+\define at boolkey{slovak}[slovak@]{vlna}[true]{}
+
+\setkeys{slovak}{splithyphens,vlna}
+
+\ifsystem at babelshorthands
+  \setkeys{slovak}{babelshorthands=true}
+\else
+  \setkeys{slovak}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate at active@char}{%
+  \input{babelsh.def}%
+  \initiate at active@char{"}%
+  \shorthandoff{"}%
+}{}
+
+\def\slovak@@splhyphen#1{%
+  \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
+  \nobreak\hskip\z@%
+}
+
+\def\slovak at splhyphen{%
+  \slovak@@splhyphen{-}%
+}
+
+\def\slovak at shorthands{%
+  \bbl at activate{"}%
+  \def\language at group{slovak}%
+  \declare at shorthand{slovak}{"=}{\slovak at splhyphen}%
+  \declare at shorthand{slovak}{""}{\hskip\z at skip}%
+  \declare at shorthand{slovak}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
+  \declare at shorthand{slovak}{"-}{\nobreak\-\bbl at allowhyphens}%
+  \declare at shorthand{slovak}{"|}{%
+      \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
+      \bbl at allowhyphens}{}%
+  }%
+  \declare at shorthand{slovak}{"/}{\textormath
+    {\bbl at allowhyphens\discretionary{/}{}{/}\bbl at allowhyphens}{}}%
+  \declare at shorthand{slovak}{"`}{„}%
+  \declare at shorthand{slovak}{"'}{“}%
+  \declare at shorthand{slovak}{"<}{«}%
+  \declare at shorthand{slovak}{">}{»}%
+}
+
+\def\noslovak at shorthands{%
+  \@ifundefined{initiate at active@char}{}{\bbl at deactivate{"}}%
+}
+
+\ifxetex
+  % splithyphens
+  \newXeTeXintercharclass\slovak at hyphen % -
+  % vlna
+  \newXeTeXintercharclass\slovak at openpunctuation
+  \newXeTeXintercharclass\slovak at nonsyllabicpreposition
+  \ifdefined\e at alloc@intercharclass at top
+    \chardef\slovak at boundary=\e at alloc@intercharclass at top
+  \else
+    \ifdefined\XeTeXinterwordspaceshaping
+      \chardef\slovak at boundary=4095 %
+      \def\newXeTeXintercharclass{%
+        \e at alloc\XeTeXcharclass\chardef
+              \xe at alloc@intercharclass\m at ne\@ucharclass at boundary}
+    \else
+      \chardef\slovak at boundary=255
+    \fi
+  \fi
+\fi
+
+\def\slovak at hyphens{%
+    \ifluatex
+      \AfterPreamble{\enablesplithyphens{slovak}}%
+    \else
+      \XeTeXinterchartokenstate=1
+      \XeTeXcharclass `\- \slovak at hyphen
+      \XeTeXinterchartoks \z@ \slovak at hyphen = {\slovak@@splhyphen}% "-" -> "\slovak@@splhyphen-"
+      % necessary if used together with vlna:
+      \XeTeXinterchartoks \slovak at nonsyllabicpreposition \slovak at hyphen = {\slovak@@splhyphen}% "-" -> "\slovak@@splhyphen-"
+    \fi%
+}
+
+\def\noslovak at hyphens{%
+    \ifluatex
+      \AfterPreamble{\disablesplithyphens{slovak}}%
+    \else
+      \XeTeXcharclass `\- \z@
+    \fi%
+}
+
+% Add nonbreakable space after single-letter word to
+% prevent them to land at the end of a line
+\def\slovak at vlna{%
+    \ifluatex
+       \preventsingleon
+    \else
+        % Code taken and adapted from xevlna.sty
+        \XeTeXinterchartokenstate=1
+        \XeTeXcharclass `\( \slovak at openpunctuation
+        \XeTeXcharclass `\[ \slovak at openpunctuation
+        \XeTeXcharclass `\„ \slovak at openpunctuation
+        \XeTeXcharclass `\» \slovak at openpunctuation
+        \XeTeXcharclass `\K \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\k \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\S \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\s \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\V \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\v \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\Z \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\z \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\O \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\o \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\U \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\u \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\A \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\a \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\I \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\i \slovak at nonsyllabicpreposition
+        \XeTeXinterchartoks \slovak at boundary \slovak at nonsyllabicpreposition {\slovak at interchartoks}
+        \XeTeXinterchartoks \slovak at openpunctuation \slovak at nonsyllabicpreposition {\slovak at interchartoks}
+        \def\slovak at nointerchartoks{\let\slovak at interchartoks\slovak at PreCSpreposition}
+        \def\slovak at PreCSpreposition{\def\next{}%
+           \ifnum\catcode`\ =10 % nothing will be done in verbatim
+           \ifmmode % nothing in math
+           \else
+              \let\slovak at interchartoks\slovak at nointerchartoks
+              \let\next\slovak at ExamineCSpreposition
+           \fi \fi
+          \next%
+        }
+        \def\slovak at ExamineCSpreposition ##1{##1\futurelet\next\slovak at ProcessCSpreposition}
+        \def\slovak at ProcessCSpreposition{\ifx\next\slovak at XeTeXspace\nobreak\fi}
+        \futurelet\slovak at XeTeXspace{ }\slovak at nointerchartoks
+    \fi
+}
+
+\def\noslovak at vlna{%
+    \ifluatex
+        \preventsingleoff
+    \else
+        \XeTeXcharclass`\(\z@
+        \XeTeXcharclass`\[\z@
+        \XeTeXcharclass`\„\z@
+        \XeTeXcharclass`\»\z@
+        \XeTeXcharclass`\K\z@
+        \XeTeXcharclass`\k\z@
+        \XeTeXcharclass`\S\z@
+        \XeTeXcharclass`\s\z@
+        \XeTeXcharclass`\V\z@
+        \XeTeXcharclass`\v\z@
+        \XeTeXcharclass`\Z\z@
+        \XeTeXcharclass`\z\z@
+        \XeTeXcharclass`\O\z@
+        \XeTeXcharclass`\o\z@
+        \XeTeXcharclass`\U\z@
+        \XeTeXcharclass`\u\z@
+        \XeTeXcharclass`\A\z@
+        \XeTeXcharclass`\a\z@
+        \XeTeXcharclass`\I\z@
+        \XeTeXcharclass`\i\z@
+    \fi
+}
+
+
 \def\captionsslovak{%
    \def\refname{Referencie}%
    \def\abstractname{Abstrakt}%
@@ -9948,7 +12300,7 @@
    \def\headtoname{Pre}% was komu
    \def\proofname{Dôkaz}%
    \def\glossaryname{Slovník}%
-   }
+}
 
 \def\dateslovak{%   
   \def\today{\number\day.~\ifcase\month\or
@@ -9956,11 +12308,45 @@
     júna\or júla\or augusta\or septembra\or októbra\or
     novembra\or decembra\fi
     \space \number\year}%
-  }
+}
 
+\def\noextras at slovak{%
+  \noslovak at shorthands%
+  \noslovak at hyphens%
+  \noslovak at vlna%
+  \ifxetex\XeTeXinterchartokenstate=0\fi%
+}
+
+\def\blockextras at slovak{%
+  \ifslovak at babelshorthands\slovak at shorthands\fi%
+  \ifslovak at vlna\slovak at vlna\else\noslovak at vlna\fi%
+  \ifslovak at splithyphens\slovak at hyphens\else\noslovak at hyhens\fi%
+}
+
+\def\inlineextras at slovak{%
+  \ifslovak at babelshorthands\slovak at shorthands\fi%
+  \ifslovak at vlna\slovak at vlna\else\noslovak at vlna\fi%
+  \ifslovak at splithyphens\slovak at hyphens\else\noslovak at hyhens\fi%
+}
+
 %    \end{macrocode}
 % \iffalse
 %</gloss-slovak.ldf>
+%<*gloss-slovene.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-slovene.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-slovene.ldf}[polyglossia: module for slovenian]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{slovenian}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-slovene.ldf>
 %<*gloss-slovenian.ldf>
 % \fi
 % \clearpage
@@ -9977,6 +12363,9 @@
   fontsetup=true,
 }
 
+% Babel aliases
+\setlanguagealias{slovenian}{slovene}
+
 \providebool{slovenian at localalph}
 \define at boolkey{slovenian}[slovenian@]{localalph}[false]{%
   \def\@tmpa{#1}%
@@ -10057,6 +12446,14 @@
   fontsetup=true,
 }
 
+% Backwards compat. aliases
+\setlanguagealias[variant=lower]{sorbian}{lsorbian}
+\setlanguagealias[variant=upper]{sorbian}{usorbian}
+
+% Babel aliases
+\setlanguagealias[variant=lower]{sorbian}{lowersorbian}
+\setlanguagealias[variant=upper]{sorbian}{uppersorbian}
+
 \def\sorbian at variant{usorbian}
 \define at choicekey*+{sorbian}{variant}[\val\nr]{upper,lower}[upper]{%
    \ifcase\nr\relax
@@ -10221,6 +12618,7 @@
 % \subsection{gloss-spanish.ldf}
 %    \begin{macrocode}
 \ProvidesFile{gloss-spanish.ldf}[polyglossia: module for spanish]
+
 \PolyglossiaSetup{spanish}{
   hyphennames={spanish},
   hyphenmins={2,2},
@@ -10228,8 +12626,154 @@
   frenchspacing=true,
   indentfirst=true,
   fontsetup=true,
+  babelname=spanish
 }
 
+% Babel aliases
+\setlanguagealias[variant=mexican]{spanish}{spanishmx}
+
+\newif\if at spanish@mexico
+\@spanish at mexicofalse
+\define at choicekey*+{spanish}{variant}[\val\nr]{spanish,mexican}[spanish]{%
+   \ifcase\nr\relax
+      % spanish:
+      \@spanish at mexicofalse%
+      \SetLanguageKeys{spanish}{babelname=spanish}%
+   \or
+      % mexican:
+      \@spanish at mexicotrue%
+      \SetLanguageKeys{spanish}{babelname=spanishmx}%
+   \fi
+   \xpg at info{Option: spanish, variant=\val}%
+}{\xpg at warning{Unknown spanish variant `#1'}}
+
+% Localized math operators à la babel
+\newif\ifspanish at accentedoperators
+\newif\ifspanish at spacedoperators
+\newif\ifspanish at locoperators
+
+\define at choicekey*+{spanish}{spanishoperators}[\val\nr]{all,accented,spaced,none}[all]{%
+   \ifcase\nr\relax
+      % all:
+      \spanish at locoperatorstrue%
+      \spanish at accentedoperatorstrue%
+      \spanish at spacedoperatorstrue%
+   \or
+      % accented:
+      \spanish at locoperatorsfalse%
+      \spanish at accentedoperatorstrue%
+      \spanish at spacedoperatorsfalse%
+   \or
+      % spaced:
+      \spanish at locoperatorsfalse%
+      \spanish at accentedoperatorsfalse%
+      \spanish at spacedoperatorstrue%
+   \or
+      % none:
+      \spanish at locoperatorsfalse%
+      \spanish at accentedoperatorsfalse%
+      \spanish at spacedoperatorsfalse%
+   \fi
+   \xpg at info{Option: Spanish, spanishoperators=\val}%
+}{\xpg at warning{Unknown spanishoperators value `#1'}}
+
+\let\xpg at save@lim\lim
+\let\xpg at save@limsup\limsup
+\let\xpg at save@liminf\liminf
+\let\xpg at save@max\max
+\let\xpg at save@min\min
+\let\xpg at save@inf\inf
+\let\xpg at save@bmod\bmod
+\let\xpg at save@pmod\pmod
+
+\def\spanish at accentedoperators{%
+  \DeclareRobustCommand\lim{\mathop{\operator at font lím}}%
+  \DeclareRobustCommand\limsup{\mathop{\operator at font lím\,sup}}%
+  \DeclareRobustCommand\liminf{\mathop{\operator at font lím\,inf}}%
+  \DeclareRobustCommand\max{\mathop{\operator at font máx}}%
+  \DeclareRobustCommand\min{\mathop{\operator at font mín}}%
+  \DeclareRobustCommand\inf{\mathop{\operator at font ínf}}%
+  \DeclareRobustCommand\bmod{%
+    \nonscript\mskip-\medmuskip\mkern5mu%
+    \mathbin{\operator at font mód}\penalty900\mkern5mu%
+    \nonscript\mskip-\medmuskip}%
+  \@ifundefined{@amsmath at err}%
+    {\DeclareRobustCommand\pmod[1]{%
+       \allowbreak\mkern18mu({\operator at font mód}\,\,##1)}}%
+    {\let\xpg at save@mod\mod
+     \DeclareRobustCommand\mod[1]{\allowbreak\if at display\mkern18mu
+        \else\mkern12mu\fi{\operator at font mód}\,\,##1}%
+     \DeclareRobustCommand\pmod[1]{\pod{{\operator at font mód}%
+        \mkern6mu##1}}}%
+}
+
+\def\nospanish at accentedoperators{%
+  \let\lim\xpg at save@lim%
+  \let\limsup\xpg at save@limsup%
+  \let\liminf\xpg at save@liminf%
+  \let\max\xpg at save@max%
+  \let\min\xpg at save@min%
+  \let\inf\xpg at save@inf%
+  \let\bmod\xpg at save@bmod%
+  \let\pmod\xpg at save@pmod%
+  \@ifundefined{@amsmath at err}{}{\let\mod\xpg at save@mod}%
+}
+
+\let\xpg at save@arccos\arccos
+\let\xpg at save@arcsin\arcsin
+\let\xpg at save@arctan\arctan
+\let\arcsen\arcsin
+\let\arctg\arctan
+
+
+\def\spanish at spacedoperators{%
+  \DeclareRobustCommand\arccos{\mathop{\operator at font arc\,cos}\nolimits}%
+  \DeclareRobustCommand\arcsin{\mathop{\operator at font arc\,sen}\nolimits}%
+  \DeclareRobustCommand\arctan{\mathop{\operator at font arc\,tg}\nolimits}%
+}
+
+\def\nospanish at spacedoperators{%
+  \let\arccos\xpg at save@arccos%
+  \let\arcsen\arcsin%
+  \let\arctg\arctan%
+}
+
+
+\let\xpg at save@sin\sin
+\let\xpg at save@tan\tan
+\let\xpg at save@sinh\sinh
+\let\xpg at save@tanh\tanh
+\let\sen\sin
+\let\tg\tan
+\let\senh\sinh
+\let\tgh\tanh
+
+\def\spanish at locoperators{%
+  \DeclareRobustCommand\sin{\mathop{\operator at font sen}\nolimits}%
+  \DeclareRobustCommand\tan{\mathop{\operator at font tg}\nolimits}%
+  \DeclareRobustCommand\sinh{\mathop{\operator at font senh}\nolimits}%
+  \DeclareRobustCommand\tanh{\mathop{\operator at font tgh}\nolimits}%
+}
+
+\def\nospanish at locoperators{%
+  \let\sen\xpg at save@sin%
+  \let\tg\xpg at save@tan%
+  \let\sinh\xpg at save@sinh%
+  \let\tanh\xpg at save@tanh%
+  \let\sen\relax%
+  \let\tg\relax%
+  \let\senh\relax%
+  \let\tgh\relax%
+}
+
+\newcommand*\spanishoperator[2][]{%
+  \ifx#1\\\\
+    \protected at csxdef{#2}{\mathop{\operator at font #2}\nolimits}%
+  \else
+    \protected at csxdef{#2}{\mathop{\operator at font #1}\nolimits}%
+  \fi
+}
+
 \def\captionsspanish{%
   \def\prefacename{Prefacio}%
   \def\refname{Referencias}%
@@ -10252,18 +12796,58 @@
   \def\alsoname{véase también}%
   \def\proofname{Prueba}%
   \def\glossaryname{Glosario}%
-  }
+  \if at spanish@mexico
+    \captionsspanish at mexico%
+  \fi%
+}
 
+\def\captionsspanish at mexico{%
+  \def\tablename{Tabla}%
+}
+
 \def\datespanish{%
   \def\today{\number\day~de~\ifcase\month\or
     enero\or febrero\or marzo\or abril\or mayo\or junio\or
     julio\or agosto\or septiembre\or octubre\or noviembre\or
     diciembre\fi\space de~\number\year}%
-  }
+}
 
+\def\noextras at spanish{%
+  \nospanish at accentedoperators%
+  \nospanish at spacedoperators%
+  \nospanish at locoperators%
+}
+
+\def\blockextras at spanish{%
+  \ifspanish at accentedoperators\spanish at accentedoperators\fi%
+  \ifspanish at spacedoperators\spanish at spacedoperators\fi%
+  \ifspanish at locoperators\spanish at locoperators\fi%
+}
+
+\def\inlineextras at spanish{%
+  \ifspanish at accentedoperators\spanish at accentedoperators\fi%
+  \ifspanish at spacedoperators\spanish at spacedoperators\fi%
+  \ifspanish at locoperators\spanish at locoperators\fi%
+}
+
 %    \end{macrocode}
 % \iffalse
 %</gloss-spanish.ldf>
+%<*gloss-spanishmx.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-spanishmx.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-spanishmx.ldf}[polyglossia: module for mexican spanish]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{spanish}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-spanishmx.ldf>
 %<*gloss-swedish.ldf>
 % \fi
 % \clearpage
@@ -10321,6 +12905,21 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-swedish.ldf>
+%<*gloss-swissgerman.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-swissgerman.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-swissgerman.ldf}[polyglossia: module for swiss german (old spelling)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{german}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-swissgerman.ldf>
 %<*gloss-syriac.ldf>
 % \fi
 % \clearpage
@@ -11352,6 +13951,21 @@
 %    \end{macrocode}
 % \iffalse
 %</gloss-ukrainian.ldf>
+%<*gloss-uppersorbian.ldf>
+% \fi
+% \clearpage
+% 
+% \subsection{gloss-uppersorbian.ldf}
+%    \begin{macrocode}
+\ProvidesFile{gloss-uppersorbian.ldf}[polyglossia: module for upper sorbian]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{sorbian}
+
+%    \end{macrocode}
+% \iffalse
+%</gloss-uppersorbian.ldf>
 %<*gloss-urdu.ldf>
 % \fi
 % \clearpage
@@ -11518,20 +14132,8 @@
 % We only provide this gloss for babel compatibility. Since usorbian is 
 % a sorbian variety, we use 'sorbian' with variant 'upper' now.
 
-\input{gloss-sorbian.ldf}
+\xpg at load@master at language{sorbian}
 
-\PolyglossiaSetup{usorbian}{
-  language=Upper Sorbian,
-  babelname=uppersorbian,
-  hyphennames={usorbian,uppersorbian},
-  hyphenmins={2,2},
-  langtag=USB,
-  fontsetup=true,
-}
-
-\let\captionsusorbian\captionssorbian at usorbian
-\let\dateusorbian\datesorbian at usorbian
-
 %    \end{macrocode}
 % \iffalse
 %</gloss-usorbian.ldf>
@@ -11796,239 +14398,67 @@
 %    \end{macrocode}
 % \iffalse
 %</thaidigits.map>
-%<*polyglossia-frpt.lua>
+%<*polyglossia-french.lua>
 % \fi
 % \clearpage
 % 
-% \subsection{polyglossia-frpt.lua}
+% \subsection{polyglossia-french.lua}
 %    \begin{macrocode}
-require('polyglossia') -- just in case...
+require('polyglossia-punct')
 
-local add_to_callback = luatexbase.add_to_callback
-local remove_from_callback = luatexbase.remove_from_callback
-local priority_in_callback = luatexbase.priority_in_callback
-
-local get_quad = luaotfload.aux.get_quad -- needs luaotfload > 20130516
-
-local next, type = next, type
-
-local nodes, fonts, node = nodes, fonts, node
-
-local nodecodes          = nodes.nodecodes
-
-local insert_node_before = node.insert_before
-local insert_node_after  = node.insert_after
-local remove_node        = node.remove
-local has_attribute      = node.has_attribute
-local node_copy          = node.copy
-local new_node           = node.new
-
-local math_code          = nodecodes.math
-local end_of_math        = node.end_of_math
-if not end_of_math then -- luatex < .76
-  local traverse_nodes = node.traverse_id
-  local end_of_math = function (n)
-    for n in traverse_nodes(math_code, n.next) do
-      return n
-    end
-  end
+local function set_left_space(lang, char, kern, rubber)
+    polyglossia.add_left_spaced_character(lang, char, kern, "space", rubber)
 end
 
--- node types according to node.types()
-local glue_code         = nodecodes.glue
-local glue_spec_code    = nodecodes.glue_spec
-local glyph_code        = nodecodes.glyph
-local penalty_code      = nodecodes.penalty
-local kern_code         = nodecodes.kern
-
--- we make a new node, so that we can copy it later on
-local penalty_node   = new_node(penalty_code)
-penalty_node.penalty = 10000
-
-local function get_penalty_node()
-  return node_copy(penalty_node)
+local function set_right_space(lang, char, kern, rubber)
+    polyglossia.add_right_spaced_character(lang, char, kern, "space", rubber)
 end
 
--- same for glue node
-local kern_node       = new_node(kern_code)
-
-local function get_kern_node(dim)
-  local n = node_copy(kern_node)
-  n.kern = dim
-  return n
-end
-
--- we have here all possible space characters, referenced by their
--- unicode slot number, taken from char-def.lua
-local space_chars = {[32]=1, [160]=1, [5760]=1, [6158]=1, [8192]=1, [8193]=1, [8194]=1, [8195]=1, 
-  [8196]=1, [8197]=1, [8198]=1, [8199]=1, [8200]=1, [8201]=1, [8202]=1, [8239]=1, [8287]=1, [12288]=1}
-
--- from nodes-tst.lua, adapted
-local function somespace(n,all)
-    if n then
-        local id = n.id
-        if id == glue_code then
-            return (all or (n.spec.width ~= 0)) and glue_code
-        elseif id == kern_code then
-            return (all or (n.kern ~= 0)) and kern_code
-        elseif id == glyph_code then
-            if space_chars[n.char] then
-                return true
-            else
-                return false
-            end
-        end
+local function activate_french_punct(thincolonspace, autospaceguillemets)
+    -- We need different language tags here to make switching of options possible
+    -- within a paragraph.
+    local lang = "french"
+    if thincolonspace then
+        lang = lang.."-thincolon"
     end
-    return false
-end
-
--- idem
-local function somepenalty(n,value)
-    if n then
-        local id = n.id
-        if id == penalty_code then
-            if value then
-                return n.penalty == value
-            else
-                return true
-            end
-        end
+    if autospaceguillemets then
+        lang = lang.."-autospace"
     end
-    return false
-end
 
-local xpgfrptattr = luatexbase.attributes['xpg at frpt']
+    polyglossia.activate_punct(lang)
+    polyglossia.clear_spaced_characters(lang)
 
-local left=1
-local right=2
-local byte = unicode.utf8.byte
+    if thincolonspace then
+        set_left_space(lang, ':', 0.5)
+    else
+        set_left_space(lang, ':', 1, true) -- stretchable and shrinkable space
+    end
 
--- Now there is a good question: how do we now, in lua, what a \thinspace is?
--- In the LaTeX source (ltspace.dtx) it is defined as:
--- \def\thinspace{\kern .16667em }. I see no way of seeing if it has been
--- overriden or not... So we stick to this value.
-local thinspace  = 0.16667 
--- thickspace is defined in amsmath.sty as:
--- \renewcommand{\;}{\mspace+\thickmuskip{.2777em}}. Same problem as above, we
--- stick to this fixed value.
-local thickspace = 0.2777 -- 5/18
+    set_left_space(lang, '!', 0.5)
+    set_left_space(lang, '?', 0.5)
+    set_left_space(lang, ';', 0.5)
+    set_left_space(lang, '‼', 0.5)
+    set_left_space(lang, '⁇', 0.5)
+    set_left_space(lang, '⁈', 0.5)
+    set_left_space(lang, '⁉', 0.5)
 
-local mappings =  {
- [byte(':')] = {left,  thickspace}, --really?
- [byte('!')] = {left,  thinspace},
- [byte('?')] = {left,  thinspace},
- [byte(';')] = {left,  thinspace},
- [byte('‼')] = {left,  thinspace},
- [byte('⁇')] = {left,  thinspace},
- [byte('⁈')] = {left,  thinspace},
- [byte('⁉')] = {left,  thinspace},
- [byte('»')] = {left,  thinspace},
- [byte('›')] = {left,  thinspace},
- [byte('«')] = {right, thinspace}, 
- [byte('‹')] = {right, thinspace}, 
- }
-
-local function set_spacings(thinsp, thicksp)
-  for _, m in pairs(mappings) do
-    if m[2] == thinspace then
-      m[2] = thinsp
-    elseif m[2] == thickspace then
-      m[2] = thicksp
+    if autospaceguillemets then
+        set_left_space(lang, '»', 0.5)
+        set_left_space(lang, '›', 0.5)
+        set_right_space(lang, '«', 0.5)
+        set_right_space(lang, '‹', 0.5)
     end
-  end
-  thickspace = thicksp
-  thinspace = thinsp
 end
 
--- from typo-spa.lua
-local function process(head)
-    local done = false
-    local start = head
-    -- head is always begin of par (whatsit), so we have at least two prev nodes
-    -- penalty followed by glue
-    while start do
-        local id = start.id
-        if id == glyph_code then
-            local attr = has_attribute(start, xpgfrptattr)
-            if attr and attr > 0 then
-                local char = start.char
-                local map = mappings[char]
-                --node.unset_attribute(start, xpgfrptattr) -- needed?
-                if map then
-                    local quad = get_quad(start.font) -- might be optimized
-                    local prev = start.prev
-                    if map[1] == left and prev then
-                        local prevprev = prev.prev
-                        local somespace = somespace(prev,true)
-                        -- TODO: there is a question here: do we override a preceding space or not?...
-                        if somespace then
-                            local somepenalty = somepenalty(prevprev,10000)
-                            if somepenalty then
-                                head = remove_node(head,prev)
-                                head = remove_node(head,prevprev)
-                            else
-                                head = remove_node(head,prev)
-                            end
-                        end
-                        insert_node_before(head,start,get_penalty_node())
-                        insert_node_before(head,start,get_kern_node(map[2]*quad))
-                        done = true
-                    end
-                    local next = start.next
-                    if map[1] == right and next then
-                        local nextnext = next.next
-                        local somepenalty = somepenalty(next,10000)
-                        if somepenalty then
-                            local somespace = somespace(nextnext,true)
-                            if somespace then
-                                head = remove_node(head,next)
-                                head = remove_node(head,nextnext)
-                            end
-                        else
-                            local somespace = somespace(next,true)
-                            if somespace then
-                                head = remove_node(head,next)
-                            end
-                        end
-                        insert_node_after(head,start,get_kern_node(map[2]*quad))
-                        insert_node_after(head,start,get_penalty_node())
-                        done = true
-                    end
-                end
-            end
-        elseif id == math_code then
-            -- warning: this is a feature of luatex > 0.76
-            start = end_of_math(start) -- weird, can return nil .. no math end?
-        end
-        if start then
-            start = start.next
-        end
-    end
-    return head, done
+local function deactivate_french_punct()
+    polyglossia.deactivate_punct()
 end
 
-local callback_name = "pre_linebreak_filter"
-
-local function activate()
-  if not priority_in_callback (callback_name, "polyglossia-frpt.process") then
-    add_to_callback(callback_name, process, "polyglossia-frpt.process", 1)
-  end
-end
-
-local function desactivate()
-  if priority_in_callback (callback_name, "polyglossia-frpt.process") then
-    remove_from_callback(callback_name, "polyglossia-frpt.process")
-  end
-end
-
-polyglossia.activate_frpt    = activate
-polyglossia.desactivate_frpt = desactivate
-polyglossia.set_spacings     = set_spacings
-polyglossia.thinspace        = thinspace
-polyglossia.thickspace       = thickpace
+polyglossia.activate_french_punct   = activate_french_punct
+polyglossia.deactivate_french_punct = deactivate_french_punct
 %    \end{macrocode}
 % \iffalse
-%</polyglossia-frpt.lua>
+%</polyglossia-french.lua>
 %<*polyglossia-korean.lua>
 % \fi
 % \clearpage
@@ -12641,6 +15071,399 @@
 %    \end{macrocode}
 % \iffalse
 %</polyglossia-korean.lua>
+%<*polyglossia-latin.lua>
+% \fi
+% \clearpage
+% 
+% \subsection{polyglossia-latin.lua}
+%    \begin{macrocode}
+require('polyglossia-punct')
+
+-- For ecclesiastic Latin (and sometimes for Italian) a very small space is
+-- used for the punctuation. The ecclesiastic package uses a space of
+-- 0.3\fontdimen2, where \fontdimen2 is a interword space, which is typically
+-- between 1/4 and 1/3 of a quad. We choose a half of a \thinspace here.
+local hairspace = 0.08333 -- 1/12
+
+local function activate_latin_punct()
+    polyglossia.activate_punct('latin')
+    polyglossia.clear_spaced_characters('latin')
+    polyglossia.add_left_spaced_character('latin',':',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','!',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','?',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin',';',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','‼',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','⁇',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','⁈',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','⁉',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','»',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','›',hairspace,'quad')
+    polyglossia.add_right_spaced_character('latin','«',hairspace,'quad')
+    polyglossia.add_right_spaced_character('latin','‹',hairspace,'quad')
+end
+
+local function deactivate_latin_punct()
+    polyglossia.deactivate_punct()
+end
+
+polyglossia.activate_latin_punct   = activate_latin_punct
+polyglossia.deactivate_latin_punct = deactivate_latin_punct
+%    \end{macrocode}
+% \iffalse
+%</polyglossia-latin.lua>
+%<*polyglossia-punct.lua>
+% \fi
+% \clearpage
+% 
+% \subsection{polyglossia-punct.lua}
+%    \begin{macrocode}
+require('polyglossia') -- just in case...
+
+local add_to_callback      = luatexbase.add_to_callback
+local remove_from_callback = luatexbase.remove_from_callback
+local priority_in_callback = luatexbase.priority_in_callback
+local new_attribute        = luatexbase.new_attribute
+
+local node = node
+
+local insert_node_before = node.insert_before
+local insert_node_after  = node.insert_after
+local remove_node        = node.remove
+local has_attribute      = node.has_attribute
+local node_copy          = node.copy
+local new_node           = node.new
+local end_of_math        = node.end_of_math
+local getnext            = node.getnext
+local getprev            = node.getprev
+
+-- node types according to node.types()
+local glue_code    = node.id"glue"
+local glyph_code   = node.id"glyph"
+local penalty_code = node.id"penalty"
+local kern_code    = node.id"kern"
+local math_code    = node.id"math"
+
+-- we need some node subtypes
+local userkern = 1
+local userskip = 0
+local removable_skip = {
+    [0]  = true, -- userskip
+    [13] = true, -- spaceskip
+    [14] = true, -- xspaceskip
+}
+
+-- we make a new node, so that we can copy it later on
+local kern_node = new_node(kern_code)
+kern_node.subtype = userkern -- this kern can be removed later on
+
+local function get_kern_node(dim)
+    local n = node_copy(kern_node)
+    n.kern = dim
+    return n
+end
+
+local glue_node = new_node(glue_code)
+glue_node.subtype = userskip
+
+local function get_glue_node(dim, stretch, shrink)
+    local n   = node_copy(glue_node)
+    n.width   = dim
+    n.stretch = stretch
+    n.shrink  = shrink
+    return n
+end
+
+local penalty_node   = new_node(penalty_code)
+penalty_node.penalty = 10000
+
+local function get_penalty_node()
+    return node_copy(penalty_node)
+end
+
+-- we have here all possible space characters, referenced by their unicode slot
+-- number, taken from char-def.lua
+local space_chars = {[32] = true, [160] = true, [5760] = true, [6158] = true,
+    [8192] = true, [8193] = true, [8194] = true, [8195] = true, [8196] = true,
+    [8197] = true, [8198] = true, [8199] = true, [8200] = true, [8201] = true,
+    [8202] = true, [8239] = true, [8287] = true, [12288] = true}
+
+-- from nodes-tst.lua, adapted
+local function somespace(n)
+    if n then
+        local id, subtype = n.id, n.subtype
+        if id == glue_code then
+            -- it is dangerous to remove all the type of glue
+            return removable_skip[subtype]
+        elseif id == kern_code then
+            -- remove only user's kern
+            return subtype == userkern
+        elseif id == glyph_code then
+            return space_chars[n.char]
+        end
+    end
+end
+
+-- we have here all left bracket characters, referenced by their unicode slot
+local left_bracket_chars = {[40] = true, [123] = true, [91] = true, [10216] = true}
+
+local function someleftbracket(n)
+    if n then
+        local id = n.id
+        if id == glyph_code then
+            return left_bracket_chars[n.char]
+        end
+    end
+end
+
+-- we have here all right bracket characters, referenced by their unicode slot
+local right_bracket_chars = {[41] = true, [125] = true, [93] = true, [10217] = true}
+
+local function somerightbracket(n)
+    if n then
+        local id = n.id
+        if id == glyph_code then
+            return right_bracket_chars[n.char]
+        end
+    end
+end
+
+-- idem
+local function somepenalty(n, value)
+    if n then
+        local id = n.id
+        if id == penalty_code then
+            if value then
+                return n.penalty == value
+            else
+                return true
+            end
+        end
+    end
+end
+
+local punct_attr = new_attribute("polyglossia_punct")
+
+local lang_id      = {}
+local lang_counter = 0
+local left_space   = {}
+local right_space  = {}
+
+local function ensure_lang_id(lang)
+    if not lang_id[lang] then
+        lang_counter = lang_counter + 1
+        lang_id[lang] = lang_counter
+    end
+    return lang_id[lang]
+end
+
+local function clear_spaced_characters(lang)
+    local id = ensure_lang_id(lang)
+    left_space[id]  = {}
+    right_space[id] = {}
+end
+
+local function illegal_unit(unit)
+    if unit then
+        texio.write_nl('Illegal spacing unit "'..unit..'".')
+    else
+        texio.write_nl('Spacing unit is a nil value.')
+    end
+end
+
+local function add_left_spaced_character(lang, char, kern, unit, rubber)
+-- The parameter kern is a number meant as a fraction of the unit.
+-- The unit can be "quad" (1em) or "space" (interword space).
+-- The parameter rubber is a Boolean value indicating if the inserted space is
+-- stretchable and shrinkable (only relevant if the unit is "space").
+    local id = ensure_lang_id(lang)
+    if unit == "quad" or unit == "space" then
+        left_space[id][char] = {}
+        left_space[id][char]["kern"] = kern
+        left_space[id][char]["unit"] = unit
+        left_space[id][char]["rubber"] = rubber
+    else
+        illegal_unit(unit)
+    end
+end
+
+local function add_right_spaced_character(lang, char, kern, unit, rubber)
+    local id = ensure_lang_id(lang)
+    if unit == "quad" or unit == "space" then
+        right_space[id][char] = {}
+        right_space[id][char]["kern"] = kern
+        right_space[id][char]["unit"] = unit
+        right_space[id][char]["rubber"] = rubber
+    else
+        illegal_unit(unit)
+    end
+end
+
+-- from typo-spa.lua, adapted
+local function process(head)
+    local current = head
+    while current do
+        local id = current.id
+        if id == glyph_code then
+            local attr = has_attribute(current, punct_attr)
+            if attr then
+                local char = utf8.char(current.char) -- requires Lua 5.3
+                local leftspace  = left_space[attr][char]
+                local rightspace = right_space[attr][char]
+                if leftspace or rightspace then
+                    local fontparameters = fonts.hashes.parameters[current.font]
+                    local unit, stretch, shrink, spacing_node
+                    if leftspace then
+                        local prev = getprev(current)
+                        local space_exception = false
+                        if prev then
+                            local prevprev = getprev(prev)
+                            -- do not add space after left (opening) bracket
+                            space_exception = someleftbracket(prev)
+                            if somespace(prev) then
+                            -- TODO: there is a question here: do we override a preceding space or not?...
+                                if somepenalty(prevprev, 10000) then
+                                    head = remove_node(head, prevprev)
+                                end
+                                head = remove_node(head, prev)
+                            end
+                        end
+                        if leftspace.unit == "quad" then
+                            unit = fontparameters.quad
+                            spacing_node = get_kern_node(leftspace.kern*unit)
+                        elseif leftspace.unit == "space" then
+                            unit = fontparameters.space
+                            if leftspace.rubber then
+                                stretch = leftspace.kern*fontparameters.space_stretch
+                                shrink  = leftspace.kern*fontparameters.space_shrink
+                                spacing_node = get_glue_node(leftspace.kern*unit, stretch, shrink)
+                                head = insert_node_before(head, current, get_penalty_node())
+                            else
+                                spacing_node = get_kern_node(leftspace.kern*unit)
+                            end
+                        end
+                        if not space_exception then
+                            head = insert_node_before(head, current, spacing_node)
+                        end
+                    end
+                    if rightspace then
+                        local next = getnext(current)
+                        local space_exception = false
+                        if next then
+                            -- do not add space before right (closing) bracket
+                            space_exception = somerightbracket(next)
+                            local nextnext = getnext(next)
+                            if somepenalty(next, 10000) and somespace(nextnext) then
+                                head = remove_node(head, next)
+                                head = remove_node(head, nextnext)
+                            elseif somespace(next) then
+                                head = remove_node(head, next)
+                            end
+                        end
+                        if rightspace.unit == "quad" then
+                            unit = fontparameters.quad
+                            spacing_node = get_kern_node(rightspace.kern*unit)
+                        elseif rightspace.unit == "space" then
+                            unit = fontparameters.space
+                            if rightspace.rubber then
+                                stretch = rightspace.kern*fontparameters.space_stretch
+                                shrink  = rightspace.kern*fontparameters.space_shrink
+                                spacing_node = get_glue_node(rightspace.kern*unit, stretch, shrink)
+                                if not space_exception then
+                                    head, current = insert_node_after(head, current, get_penalty_node())
+                                end
+                            else
+                                spacing_node = get_kern_node(rightspace.kern*unit)
+                            end
+                        end
+                        if not space_exception then
+                            head, current = insert_node_after(head, current, spacing_node)
+                        end
+                    end
+                end
+            end
+        elseif id == math_code then
+            -- warning: this is a feature of luatex > 0.76
+            current = end_of_math(current) -- weird, can return nil .. no math end?
+        end
+        current = getnext(current) -- no error even if current is nil
+    end
+    return head
+end
+
+local function activate(lang)
+    local id = ensure_lang_id(lang)
+    -- We set the punctuation attribute to a language id here. This is
+    -- important to be able to intermix languages with different spacings
+    -- in one paragraph.
+    tex.setattribute(punct_attr, id)
+    for _, callback_name in ipairs{ "pre_linebreak_filter", "hpack_filter" } do
+        if not priority_in_callback(callback_name, "polyglossia-punct.process") then
+            add_to_callback(callback_name, process, "polyglossia-punct.process", 1)
+        end
+    end
+end
+
+local function deactivate()
+    tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset"
+    -- Though it would make compilation slightly faster, it is not possible to
+    -- safely uncomment the following lines. Imagine the following case: you
+    -- start a paragraph by some spaced punctuation text, then, in the same
+    -- paragraph, you change the language to something else, and thus call the
+    -- following lines. This means that, at the end of the paragraph, the
+    -- function won't be in the callback, so the beginning of the paragraph
+    -- won't be processed by it.
+    -- if priority_in_callback(callback_name, "polyglossia-punct.process") then
+    --     remove_from_callback(callback_name, "polyglossia-punct.process")
+    -- end
+end
+
+polyglossia.activate_punct             = activate
+polyglossia.deactivate_punct           = deactivate
+polyglossia.add_left_spaced_character  = add_left_spaced_character
+polyglossia.add_right_spaced_character = add_right_spaced_character
+polyglossia.clear_spaced_characters    = clear_spaced_characters
+%    \end{macrocode}
+% \iffalse
+%</polyglossia-punct.lua>
+%<*polyglossia-sanskrit.lua>
+% \fi
+% \clearpage
+% 
+% \subsection{polyglossia-sanskrit.lua}
+%    \begin{macrocode}
+require('polyglossia-punct')
+
+-- How do we now, in Lua, what a \thinspace is? In the LaTeX source (latex.ltx)
+-- it is defined as:
+-- \def\thinspace{\leavevmode at ifvmode\kern .16667em }
+-- I see no way of seeing if it has been overriden or not. So we stick to this
+-- value.
+local thinspace = 0.16667 -- 1/6
+
+local function activate_sanskrit_punct()
+    polyglossia.activate_punct('sanskrit')
+    polyglossia.clear_spaced_characters('sanskrit')
+    polyglossia.add_left_spaced_character('sanskrit','!',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit','?',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit','‼',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit','⁇',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit','⁈',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit','⁉',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit',':',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit',';',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit','।',thinspace,'quad') -- danda, U+0964
+    polyglossia.add_left_spaced_character('sanskrit','॥',thinspace,'quad') -- double danda, U+0965
+end
+
+local function deactivate_sanskrit_punct()
+    polyglossia.deactivate_punct()
+end
+
+polyglossia.activate_sanskrit_punct   = activate_sanskrit_punct
+polyglossia.deactivate_sanskrit_punct = deactivate_sanskrit_punct
+%    \end{macrocode}
+% \iffalse
+%</polyglossia-sanskrit.lua>
 %<*polyglossia-tibt.lua>
 % \fi
 % \clearpage
@@ -12745,11 +15568,7 @@
 % 
 % \subsection{polyglossia.lua}
 %    \begin{macrocode}
-require('luatex-hyphen')
 
-local luatexhyphen = luatexhyphen
-local byte = unicode.utf8.byte
-
 local module_name = "polyglossia"
 local polyglossia_module = {
     name          = module_name,
@@ -12763,82 +15582,73 @@
 
 luatexbase.provides_module(polyglossia_module)
 
-local log_info = function(message)
-	luatexbase.module_info(module_name, message)
+local log_info = function(message, ...)
+    luatexbase.module_info(module_name, message:format(...))
 end
-local log_warning = function(message)
-	luatexbase.module_warning(module_name, message)
+local log_warn = function(message, ...)
+    luatexbase.module_warning(module_name, message:format(...))
 end
 
 polyglossia = polyglossia or {}
 local polyglossia = polyglossia
 
--- predefined l at nohyphenation or dummy new language
-local nohyphid = luatexbase.registernumber'l at nohyphenation' or lang.id(lang.new())
--- key `nohyphenation` is for .sty file when possibly undefined l at nohyphenation
-local newloader_loaded_languages = { nohyphenation = nohyphid }
-
-local newloader_available_languages = dofile(kpse.find_file('language.dat.lua'))
--- Suggestion by Dohyun Kim on #129
-local t = { }
-for k, v in pairs(newloader_available_languages) do
-    t[k] = v
-    for _, vv in pairs(v.synonyms) do
-        t[vv] = v
-    end
-end
-newloader_available_languages = t
-
-local function loadlang(lang, id)
-  if luatexhyphen.lookupname(lang) then
-    luatexhyphen.loadlanguage(lang, id) 
-  end
-end
-
 local function select_language(lang, id)
-  loadlang(lang, id)
-  polyglossia.current_language = lang
+    polyglossia.current_language = lang
 end
 
 local function set_default_language(lang, id)
-  polyglossia.default_language = lang
+    polyglossia.default_language = lang
 end
 
+local byte = utf8.codepoint -- use standard module of lua 5.3
+
 local check_char
 
 if luaotfload and luaotfload.aux and luaotfload.aux.font_has_glyph then
-  local font_has_glyph = luaotfload.aux.font_has_glyph
-  function check_char(chr)
-    local codepoint = tonumber(chr)
-    if not codepoint then codepoint = byte(chr) end
-    if font_has_glyph(font.current(), codepoint) then
-      tex.sprint('1')
-    else
-      tex.sprint('0')
+    local font_has_glyph = luaotfload.aux.font_has_glyph
+    function check_char(chr)
+        local codepoint = tonumber(chr) or byte(chr)
+        if font_has_glyph(font.current(), codepoint) then
+            tex.sprint('1')
+        else
+            tex.sprint('0')
+        end
     end
-  end
 else
-  local ids = fonts.identifiers or fonts.ids or fonts.hashes.identifiers
-  function check_char(chr) -- always in current font
-      local otfdata = ids[font.current()].characters
-      local codepoint = tonumber(chr)
-      if not codepoint then codepoint = byte(chr) end
-      if otfdata and otfdata[codepoint] then
-          tex.print('1')
-      else
-          tex.print('0')
-      end
-  end
+    function check_char(chr) -- always in current font
+        local fontid    = font.current()
+        local fontdata  = font.getfont(fontid) or font.fonts[fontid]
+        local chardata  = fontdata.characters
+        local codepoint = tonumber(chr) or byte(chr)
+        if chardata and chardata[codepoint] then
+            tex.sprint('1')
+        else
+            tex.sprint('0')
+        end
+    end
 end
 
-local function load_frpt()
-    require('polyglossia-frpt')
-end
-
 local function load_tibt_eol()
     require('polyglossia-tibt')
 end
 
+-- predefined l at nohyphenation or LuaTeX's maximum value for \language
+local nohyphid = luatexbase.registernumber'l at nohyphenation' or 16383
+
+-- key `nohyphenation` is for .sty file when possibly undefined l at nohyphenation
+local newloader_loaded_languages = { nohyphenation = nohyphid }
+
+local newloader_available_languages = require'language.dat.lua'
+-- Suggestion by Dohyun Kim on #129
+local t = { }
+for k, v in pairs(newloader_available_languages) do
+    t[k] = v
+    for _, vv in pairs(v.synonyms) do
+        t[vv] = v
+    end
+end
+newloader_available_languages = t
+
 -- LaTeX's language register is \count19
 local lang_register = 19
 
@@ -12846,19 +15656,36 @@
 local function newloader(langentry)
     local loaded_language = newloader_loaded_languages[langentry]
     if loaded_language then
-        log_info('Language ' .. langentry .. ' already loaded; id is ' .. lang.id(loaded_language))
-        -- texio.write_nl('term and log', 'Language ' .. langentry .. ' already loaded with patterns ' .. tostring(loaded_language) .. '; id is ' .. lang.id(loaded_language))
-        -- texio.write_nl('term and log', 'Language ' .. langentry .. ' already loaded with patterns ' .. loaded_language['patterns'] .. '; id is ' .. lang.id(loaded_language))
-        return lang.id(loaded_language)
+        local langid = lang.id(loaded_language)
+        log_info('Language %s already loaded; id is %i', langentry, langid)
+        return langid
     else
         local langdata = newloader_available_languages[langentry]
-        if langdata and langdata['special'] == 'language0' then return 0 end
+        if langdata then
 
-        if langdata then
-            local s = "Language data for " .. langentry
+            local special = langdata.special
+            if special then
+                -- language0 (USenglish) is already included in the format
+                if special == 'language0' then
+                    return 0
+
+                -- disabled language should not be used for utf-8 text
+                elseif special:find'^disabled:' then
+                    log_warn('Hyphenation of language %s %s', langentry, special)
+                    return nohyphid
+                end
+            end
+
+            -- language info will be written into the .log file
+            local s = { "Language data for " .. langentry }
             for k, v in pairs(langdata) do
-				s = s .. "\n" .. k .. "\t" .. tostring(v)
+                if type(v) == 'table' then -- for 'synonyms'
+                    s[#s+1] = k .. "\t" .. table.concat(v,',')
+                else
+                    s[#s+1] = k .. "\t" .. tostring(v)
+                end
             end
+            log_info(table.concat(s,"\n"))
 
             --
             -- LaTeX's \newlanguage increases language register (count19),
@@ -12880,47 +15707,47 @@
             local langobject = lang.new()
             local langid = lang.id(langobject)
             -- get bigger one between \newlanguage and new lang obj id
-            local maxlangid = math.max(langcnt, langid)
+            local newlangid = math.max(langcnt, langid)
             -- set language register for possible \newlanguage
-            tex.setcount('global', lang_register, maxlangid)
+            tex.setcount('global', lang_register, newlangid)
             -- get new lang object if needeed
-            if langid ~= maxlangid then
-              langobject = lang.new(maxlangid)
+            if langid ~= newlangid then
+                langobject = lang.new(newlangid)
             end
-			s = s .. "\npatterns: " .. langdata.patterns
-			log_info(s)
-            if langdata.patterns and langdata.patterns ~= '' then
-                local pattfilepath = kpse.find_file(langdata.patterns)
-                if pattfilepath then
-                    local pattfile = io.open(pattfilepath)
-                    lang.patterns(langobject, pattfile:read('*all'))
-                    pattfile:close()
+
+            -- load hyphenation patterns and exceptions
+            for _,v in ipairs{ 'patterns', 'hyphenation' } do
+                local data = langdata[v]
+                if data and data ~= '' then
+                    -- cope with comma separated list, such as serbian
+                    for _,vv in ipairs(data:explode',+') do
+                        local filepath = kpse.find_file(vv)
+                        if filepath then
+                            local fh = io.open(filepath)
+                            lang[v](langobject, fh:read'a')
+                            fh:close()
+                        else
+                            log_warn('Hyphenation file %s not found', vv)
+                        end
+                    end
                 end
             end
-            if langdata.hyphenation and langdata.hyphenation ~= '' then
-                local hyphfilepath = kpse.find_file(langdata.hyphenation)
-                if hyphfilepath then
-                    local hyphfile = io.open(hyphfilepath)
-                    lang.hyphenation(langobject, hyphfile:read('*all'))
-                    hyphfile:close()
-                end
-            end
+
             newloader_loaded_languages[langentry] = langobject
 
-            log_info('Language ' .. langentry .. ' was not yet loaded; created with id ' .. lang.id(langobject))
-            return lang.id(langobject)
+            log_info('Language %s was not yet loaded; created with id %i',
+                     langentry, newlangid)
+            return newlangid
         else
-            log_warning('Language ' .. langentry .. ' not found in language.dat.lua')
+            log_warn('Language %s not found in language.dat.lua', langentry)
             return nohyphid
         end
     end
 end
 
-polyglossia.loadlang = loadlang
 polyglossia.select_language = select_language
 polyglossia.set_default_language = set_default_language
 polyglossia.check_char = check_char
-polyglossia.load_frpt = load_frpt
 polyglossia.load_tibt_eol = load_tibt_eol
 polyglossia.newloader = newloader
 polyglossia.newloader_loaded_languages = newloader_loaded_languages
@@ -12940,7 +15767,7 @@
 
    ¦----------------------------------------------¦
    ¦                                              ¦
-   ¦       THE POLYGLOSSIA PACKAGE v1.45          ¦
+   ¦       THE POLYGLOSSIA PACKAGE v1.46          ¦
    ¦                                              ¦
    ¦     Modern multilingual typesetting          ¦
    ¦        with XeLaTeX and LuaLaTeX             ¦
@@ -12949,8 +15776,8 @@
 
 This package provides an alternative to Babel for users of XeLaTeX and LuaLaTeX
 (with a few languages incompletely supported for the latter). This version
-includes support for 75 different languages, some of which in different regional,
-national or scriptal varieties.
+includes support for 79 different languages, some of which in different
+regional or national varieties, or using a different writing system.
 
 Polyglossia makes it possible to automate the following tasks:
 
@@ -12973,25 +15800,69 @@
 
 LICENSE
 
-Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2019 Arthur Reutenauer
+Copyright (c) 2008-2010 François Charette, 2013 Élie Roux, 2011-2019 Arthur Reutenauer,
+Copyright (c) 2019 Bastien Roucariès, 2019 Jürgen Spitzmüller
 
-Polyglossia is placed under the terms of the LaTeX Project Public Licence
-(LPPL), either version 1.3, or, at your option, any later version.  See
-LICENCE.txt for the text of the LPPL v1.3c, or
-http://www.latex-project.org/lppl.txt for the latest version.
+Except where otherwise noted, Polyglossia is placed under the terms of the MIT licence
+(https://opensource.org/licenses/MIT).
 
-This work has the LPPL maintenance status ‘maintained’.  The current maintainer is
-Arthur Reutenauer.
-
 BUGS
 
 If you run into a bug, or suspect you do, or you have a request or comment, please
 use the GitHub issue tracker: http://github.com/reutenauer/polyglossia/issues
 
-This is more efficient than contacting me by email as it allows me to track the
-issues and follow progress.
+This is more efficient than contacting the maintainer by email as it allows me
+to track the issues and follow progress.
 %</../README>
 %<*Changelog>
+1.46 (15-11-2019)
+
+New features:
+  * Add option "indentfirst" to Russian (#78).
+  * Add options to set and customize French-style itemize item labels to French (#89).
+  * Polyglossia now understands all babel language names in \setdefaultlanguage,
+    \setotherlanguage and the language switching commands (#112, #132).
+  * Add optional localized math operators to Spanish (#123).
+  * Swap section headings in Hungarian (#344). New option "swapstrings" provides control
+    over this.
+  * Introduce macro \setlanguagealias and \setlanguagealias*.
+  * Introduce language switching command \textlang{lang}{...} (equivalent to \text<lang>,
+    but also available with \setlanguagealias* which does not define \text<alias>).
+  * Add support for Afrikaans.
+  * Add support for Belarusian.
+  * Add support for Bosnian.
+  * Add support for Georgian.
+  * Add Spanish variant "mexican".
+  * Add babelshorthands as well as options "splithyphens" and "vlna" to Slovak.
+  * Add Latin language variant "ecclesiastic".
+  * Add Latin language options "capitalizemonth", "ecclesiasticfootnotes", "hyphenation",
+    "prosodicshorthands", and "usej".
+  * Add Latin shorthands for "«", "»", "æ", "Æ", "œ", and "Œ".
+  * Add French language option "thincolonspace".
+
+Bug fixes:
+  * Fix problems with fragile font settings (#24).
+  * Fix clash of French punctuation spacing with the soul package (#52).
+  * Re-enable the possibility to pass a macro as main argumente to \setmainlanguage and
+    \setotherlanguage (#331).
+  * Fix detection of default \languagevariant (#332).
+  * Fix LaTeX error with undefined hyphenation pattern (#346).
+  * Fix some babel shorthand issues by updating the shorthand code from recent babel.
+  * Fix some problems with French and Latin auto-spacing (#345, #352).
+  * Fix an expl3 declaration (#348).
+
+Interface and defaults changes:
+  * Per TeXLive request, the sub-package cyrillicnumbers.sty has been renamed to
+    xpg-cyrillicnumbers.sty.
+  * In Russian, all paragraphs are now indented by default, as common in Russian typography.
+    The behavior can be opted out by indentfirst=false.
+  * In Czech, splithyphens and lvna are enabled by default. Also, the option does now work
+    as well with LuaTeX.
+  * Changed option name "fraktur" to "blackletter" in German (the former is still available
+    as an alias).
+  * In French, high punctuation characters and guillemets are spaced by half an interword
+    space now instead of a \thinspace (cf. #345).
+
 1.45 (27-10-2019)
 
 New features:
@@ -13581,7 +16452,7 @@
 مباشرا أو غير مباشر على كثير من اللغات الأخرى في العالم الإسلامي، كالتركية
 والفارسية والأردية مثلا.
 
-\textfarsi{\bfseries فارسی}\footnote{%
+\textlang{farsi}{\bfseries فارسی}\footnote{%
 از «\LR{\textenglish{\url{http://fa.wikipedia.org/wiki/}}\RL{\ttfamily فارسي}}»}
 \begin{farsi}
 یا پارسی، (که دری، فارسی دری، و پارسی دری نیز نامیده می‌شود) زبانی است که

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/babelsh.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/babelsh.def	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/babelsh.def	2019-11-15 21:41:34 UTC (rev 52808)
@@ -3,31 +3,74 @@
   \bbl at afterfi\endinput
 \fi
 \ProvidesFile{babelsh.def}
-         [2013/04/30 %
+         [2019/09/30 %
          Babel common definitions for shorthands^^J
-         Taken verbatim from babel.def (2013/04/15 v3.9e)]
+         Taken verbatim from babel files (2019/09/27 v3.34)]
 %
 % ------------------------------------------------------------------------------
 %
-% XXX: from babel.sty
+% lines 52 to 56 from babel.sty
 %
 % ------------------------------------------------------------------------------
 %
+\def\bbl at stripslash{\expandafter\@gobble\string}
+\def\bbl at add#1#2{%
+  \bbl at ifunset{\bbl at stripslash#1}%
+    {\def#1{#2}}%
+    {\expandafter\def\expandafter#1\expandafter{#1#2}}}
+%
+% ------------------------------------------------------------------------------
+%
+% line 73 to 74 from babel.sty
+%
+% ------------------------------------------------------------------------------
+%
+\long\def\bbl at afterelse#1\else#2\fi{\fi#1}
+\long\def\bbl at afterfi#1\fi{\fi#1}
+%
+% ------------------------------------------------------------------------------
+%
+% line 399 from babel.sty
+%
+% ------------------------------------------------------------------------------
+%
+\let\bbl at opt@shorthands\@nnil
+%
+% ------------------------------------------------------------------------------
+%
+% lines 432 to 445 from babel.sty
+%
+% ------------------------------------------------------------------------------
+%
+\ifx\bbl at opt@shorthands\@nnil
+  \def\bbl at ifshorthand#1#2#3{#2}%
+\else\ifx\bbl at opt@shorthands\@empty
+  \def\bbl at ifshorthand#1#2#3{#3}%
+\else
   \def\bbl at ifshorthand#1{%
-    \@expandtwoargs\in@{\string#1}{\bbl at opt@shorthands}%
+    \bbl at xin@{\string#1}{\bbl at opt@shorthands}%
     \ifin@
       \expandafter\@firstoftwo
     \else
       \expandafter\@secondoftwo
     \fi}
-\let\bbl at opt@shorthands\@nnil
+  \edef\bbl at opt@shorthands{%
+    \expandafter\bbl at sh@string\bbl at opt@shorthands\@empty}%
 %
 % ------------------------------------------------------------------------------
 %
-% XXX: from switch.def
+% line 450 from babel.sty
 %
 % ------------------------------------------------------------------------------
 %
+\fi\fi
+%
+% ------------------------------------------------------------------------------
+%
+% lines 389 to 424 from switch.def
+%
+% ------------------------------------------------------------------------------
+%
 \ifx\PackageError\@undefined
   \def\bbl at error#1#2{%
     \begingroup
@@ -67,18 +110,90 @@
 %
 % ------------------------------------------------------------------------------
 %
-% XXX: from babel.def
+% lines 48 to 69 from babel.def
 %
 % ------------------------------------------------------------------------------
 %
-\def\bbl at for#1#2#3{\@for#1:=#2\do{\ifx#1\@empty\else#3\fi}}
-\def\bbl at add#1#2{%
-  \@ifundefined{\expandafter\@gobble\string#1}%
-    {\def#1{#2}}%
-    {\expandafter\def\expandafter#1\expandafter{#1#2}}}
-\long\def\bbl at afterelse#1\else#2\fi{\fi#1}
-\long\def\bbl at afterfi#1\fi{\fi#1}
+\ifx\bbl at ifshorthand\@undefined
+  \let\bbl at opt@shorthands\@nnil
+  \def\bbl at ifshorthand#1#2#3{#2}%
+  \let\bbl at language@opts\@empty
+  \ifx\babeloptionstrings\@undefined
+    \let\bbl at opt@strings\@nnil
+  \else
+    \let\bbl at opt@strings\babeloptionstrings
+  \fi
+  \def\BabelStringsDefault{generic}
+  \def\bbl at tempa{normal}
+  \ifx\babeloptionmath\bbl at tempa
+    \def\bbl at mathnormal{\noexpand\textormath}
+  \fi
+  \def\AfterBabelLanguage#1#2{}
+  \ifx\BabelModifiers\@undefined\let\BabelModifiers\relax\fi
+  \let\bbl at afterlang\relax
+  \def\bbl at opt@safe{BR}
+  \ifx\@uclclist\@undefined\let\@uclclist\@empty\fi
+  \ifx\bbl at trace\@undefined\def\bbl at trace#1{}\fi
+  \expandafter\newif\csname ifbbl at single\endcsname
+\fi
+%
+% ------------------------------------------------------------------------------
+%
+% line 108 from babel.def
+%
+% ------------------------------------------------------------------------------
+%
 \def\bbl at csarg#1#2{\expandafter#1\csname bbl@#2\endcsname}%
+%
+% ------------------------------------------------------------------------------
+%
+% lines 125 to 130 from babel.def
+%
+% ------------------------------------------------------------------------------
+%
+\def\bbl at exp#1{%
+  \begingroup
+    \let\\\noexpand
+    \def\<##1>{\expandafter\noexpand\csname##1\endcsname}%
+    \edef\bbl at exp@aux{\endgroup#1}%
+  \bbl at exp@aux}
+%
+% ------------------------------------------------------------------------------
+%
+% lines 144 to 149 from babel.def
+%
+% ------------------------------------------------------------------------------
+%
+\def\bbl at ifunset#1{%
+  \expandafter\ifx\csname#1\endcsname\relax
+    \expandafter\@firstoftwo
+  \else
+    \expandafter\@secondoftwo
+  \fi}
+%
+% ------------------------------------------------------------------------------
+%
+% lines 234 to 243 from babel.def
+%
+% ------------------------------------------------------------------------------
+%
+\chardef\bbl at engine=%
+  \ifx\directlua\@undefined
+    \ifx\XeTeXinputencoding\@undefined
+      \z@
+    \else
+      \tw@
+    \fi
+  \else
+    \@ne
+  \fi
+%
+% ------------------------------------------------------------------------------
+%
+% lines 255 to 258 from babel.def
+%
+% ------------------------------------------------------------------------------
+%
 \def\bbl at withactive#1#2{%
   \begingroup
     \lccode`~=`#2\relax
@@ -86,20 +201,24 @@
 %
 % ------------------------------------------------------------------------------
 %
-% XXX: a bit further in babel.def
+% lines 443 to 558 from babel.def
 %
 % ------------------------------------------------------------------------------
 %
-\def\bbl at add@special#1{%
-  \begingroup
-    \def\do{\noexpand\do\noexpand}%
-    \def\@makeother{\noexpand\@makeother\noexpand}%
-  \edef\x{\endgroup
-    \def\noexpand\dospecials{\dospecials\do#1}%
-    \expandafter\ifx\csname @sanitize\endcsname\relax \else
-      \def\noexpand\@sanitize{\@sanitize\@makeother#1}%
-    \fi}%
-  \x}
+\def\bbl at add@special#1{% 1:a macro like \", \?, etc.
+  \bbl at add\dospecials{\do#1}% test @sanitize = \relax, for back. compat.
+  \bbl at ifunset{@sanitize}{}{\bbl at add\@sanitize{\@makeother#1}}%
+  \ifx\nfss at catcodes\@undefined\else % TODO - same for above
+    \begingroup
+      \catcode`#1\active
+      \nfss at catcodes
+      \ifnum\catcode`#1=\active
+        \endgroup
+        \bbl at add\nfss at catcodes{\@makeother#1}%
+      \else
+        \endgroup
+      \fi
+  \fi}
 \def\bbl at remove@special#1{%
   \begingroup
     \def\x##1##2{\ifnum`#1=`##2\noexpand\@empty
@@ -108,7 +227,7 @@
     \def\@makeother{\x\@makeother}%
   \edef\x{\endgroup
     \def\noexpand\dospecials{\dospecials}%
-    \expandafter\ifx\csname @sanitize\endcsname\relax \else
+    \expandafter\ifx\csname @sanitize\endcsname\relax\else
       \def\noexpand\@sanitize{\@sanitize}%
     \fi}%
   \x}
@@ -126,19 +245,17 @@
       \bbl at afterfi\csname#2 at sh@#1@\string##1@\endcsname
     \fi}}%
 \def\initiate at active@char#1{%
-  \expandafter\ifx\csname active at char\string#1\endcsname\relax
-    \bbl at withactive
-      {\expandafter\@initiate at active@char\expandafter}#1\string#1#1%
-  \fi}
+  \bbl at ifunset{active at char\string#1}%
+    {\bbl at withactive
+      {\expandafter\@initiate at active@char\expandafter}#1\string#1#1}%
+    {}}
 \def\@initiate at active@char#1#2#3{%
-  \expandafter\edef\csname bbl at oricat@#2\endcsname{%
-    \catcode`#2=\the\catcode`#2\relax}%
+  \bbl at csarg\edef{oricat@#2}{\catcode`#2=\the\catcode`#2\relax}%
   \ifx#1\@undefined
-    \expandafter\edef\csname bbl at oridef@#2\endcsname{%
-      \let\noexpand#1\noexpand\@undefined}%
+    \bbl at csarg\edef{oridef@#2}{\let\noexpand#1\noexpand\@undefined}%
   \else
-    \expandafter\let\csname bbl at oridef@@#2\endcsname#1%
-    \expandafter\edef\csname bbl at oridef@#2\endcsname{%
+    \bbl at csarg\let{oridef@@#2}#1%
+    \bbl at csarg\edef{oridef@#2}{%
       \let\noexpand#1%
       \expandafter\noexpand\csname bbl at oridef@@#2\endcsname}%
   \fi
@@ -146,7 +263,7 @@
     \expandafter\let\csname normal at char#2\endcsname#3%
   \else
     \bbl at info{Making #2 an active character}%
-    \ifnum\mathcode`#2="8000
+    \ifnum\mathcode`#2=\ifodd\bbl at engine"1000000 \else"8000 \fi
       \@namedef{normal at char#2}{%
         \textormath{#3}{\csname bbl at oridef@@#2\endcsname}}%
     \else
@@ -176,9 +293,11 @@
          \expandafter\noexpand\csname normal at char#2\endcsname
        \noexpand\else
          \noexpand\expandafter
-         \expandafter\noexpand\csname user at active#2\endcsname
+         \expandafter\noexpand\csname bbl at doactive#2\endcsname
        \noexpand\fi}%
      {\expandafter\noexpand\csname normal at char#2\endcsname}}%
+  \bbl at csarg\edef{doactive#2}{%
+    \expandafter\noexpand\csname user at active#2\endcsname}%
   \bbl at csarg\edef{active@#2}{%
     \noexpand\active at prefix\noexpand#1%
     \expandafter\noexpand\csname active at char#2\endcsname}%
@@ -196,22 +315,21 @@
   \if\string'#2%
     \let\prim at s\bbl at prim@s
     \let\active at math@prime#1%
-  \fi}
+  \fi
+  \bbl at usehooks{initiateactive}{{#1}{#2}{#3}}}
 \@ifpackagewith{babel}{KeepShorthandsActive}%
   {\let\bbl at restoreactive\@gobble}%
   {\def\bbl at restoreactive#1{%
-     \edef\bbl at tempa{%
+     \bbl at exp{%
 %
 % ------------------------------------------------------------------------------
 %
-% XXX: WARNING: this has been commented in babelsh.def
+% lines 561 to 755 from babel.def
 %
 % ------------------------------------------------------------------------------
 %
-%       \noexpand\AfterBabelLanguage\noexpand\CurrentOption
-%         {\catcode`#1=\the\catcode`#1\relax}%
-       \noexpand\AtEndOfPackage{\catcode`#1=\the\catcode`#1\relax}}%
-     \bbl at tempa}%
+       \\\AtEndOfPackage
+         {\catcode`#1=\the\catcode`#1\relax}}}%
    \AtEndOfPackage{\let\bbl at restoreactive\@gobble}}
 \def\bbl at sh@select#1#2{%
   \expandafter\ifx\csname#1 at sh@#2 at sel\endcsname\relax
@@ -245,7 +363,7 @@
   \def\bbl at tempa{#3}%
   \ifx\bbl at tempa\@empty
     \expandafter\let\csname #1 at sh@\string#2 at sel\endcsname\bbl at scndcs
-    \@ifundefined{#1 at sh@\string#2@}{}%
+    \bbl at ifunset{#1 at sh@\string#2@}{}%
       {\def\bbl at tempa{#4}%
        \expandafter\ifx\csname#1 at sh@\string#2@\endcsname\bbl at tempa
        \else
@@ -256,7 +374,7 @@
     \@namedef{#1 at sh@\string#2@}{#4}%
   \else
     \expandafter\let\csname #1 at sh@\string#2 at sel\endcsname\bbl at firstcs
-    \@ifundefined{#1 at sh@\string#2@\string#3@}{}%
+    \bbl at ifunset{#1 at sh@\string#2@\string#3@}{}%
       {\def\bbl at tempa{#4}%
        \expandafter\ifx\csname#1 at sh@\string#2@\string#3@\endcsname\bbl at tempa
        \else
@@ -293,7 +411,7 @@
         turned off in the package options}}}
 \def\user at language@group{user@\language at group}
 \def\bbl at set@user at generic#1#2{%
-  \@ifundefined{user at generic@active#1}%
+  \bbl at ifunset{user at generic@active#1}%
     {\bbl at active@def#1\user at language@group{user at active}{user at generic@active}%
      \bbl at active@def#1\user at group{user at generic@active}{language at active}%
      \expandafter\edef\csname#2 at sh@#1@@\endcsname{%
@@ -334,7 +452,8 @@
     The character `\string #1' should be made a shorthand character;\\%
     add the command \string\useshorthands\string{#1\string} to
     the preamble.\\%
-    I will ignore your instruction}{}}
+    I will ignore your instruction}%
+   {You may proceed, but expect unexpected results}}
 \newcommand*\shorthandon[1]{\bbl at switch@sh\@ne#1\@nnil}
 \DeclareRobustCommand*\shorthandoff{%
   \@ifstar{\bbl at shorthandoff\tw@}{\bbl at shorthandoff\z@}}
@@ -341,7 +460,7 @@
 \def\bbl at shorthandoff#1#2{\bbl at switch@sh#1#2\@nnil}
 \def\bbl at switch@sh#1#2{%
   \ifx#2\@nnil\else
-    \@ifundefined{bbl at active@\string#2}%
+    \bbl at ifunset{bbl at active@\string#2}%
       {\bbl at error
          {I cannot switch `\string#2' on or off--not a shorthand}%
          {This character is not a shorthand. Maybe you made\\%
@@ -358,9 +477,9 @@
   \fi}
 \def\babelshorthand{\active at prefix\babelshorthand\bbl at putsh}
 \def\bbl at putsh#1{%
-   \@ifundefined{bbl at active@\string#1}%
-      {\bbl at putsh@i#1\@empty\@nnil}%
-      {\csname bbl at active@\string#1\endcsname}}
+  \bbl at ifunset{bbl at active@\string#1}%
+     {\bbl at putsh@i#1\@empty\@nnil}%
+     {\csname bbl at active@\string#1\endcsname}}
 \def\bbl at putsh@i#1#2\@nnil{%
   \csname\languagename @sh@\string#1@%
     \ifx\@empty#2\else\string#2@\fi\endcsname}
@@ -381,6 +500,7 @@
   \def\bbl at deactivate#1{%
     \bbl at ifshorthand{#1}{\bbl at s@deactivate{#1}}{}}
 \fi
+\newcommand\ifbabelshorthand[3]{\bbl at ifunset{bbl at active@\string#1}{#3}{#2}}
 \def\bbl at prim@s{%
   \prime\futurelet\@let at token\bbl at pr@m at s}
 \def\bbl at if@primes#1#2{%
@@ -403,17 +523,15 @@
 \initiate at active@char{~}
 \declare at shorthand{system}{~}{\leavevmode\nobreak\ }
 \bbl at activate{~}
-\def\bbl at disc#1#2{\nobreak\discretionary{#2-}{}{#1}\bbl at allowhyphens}
-\def\bbl at t@one{T1}
-\def\bbl at allowhyphens{\nobreak\hskip\z at skip}
-\def\bbl at t@one{T1}
 %
 % ------------------------------------------------------------------------------
 %
-% XXX: later in babel.def
+% lines 890 to 927 from babel.def
 %
 % ------------------------------------------------------------------------------
 %
+\def\bbl at allowhyphens{\ifvmode\else\nobreak\hskip\z at skip\fi}
+\def\bbl at t@one{T1}
 \def\allowhyphens{\ifx\cf at encoding\bbl at t@one\else\bbl at allowhyphens\fi}
 \newcommand\babelnullhyphen{\char\hyphenchar\font}
 \def\babelhyphen{\active at prefix\babelhyphen\bbl at hyphen}
@@ -420,13 +538,13 @@
 \def\bbl at hyphen{%
   \@ifstar{\bbl at hyphen@i @}{\bbl at hyphen@i\@empty}}
 \def\bbl at hyphen@i#1#2{%
-  \@ifundefined{bbl at hy@#1#2\@empty}%
+  \bbl at ifunset{bbl at hy@#1#2\@empty}%
     {\csname bbl@#1usehyphen\endcsname{\discretionary{#2}{}{#2}}}%
     {\csname bbl at hy@#1#2\@empty\endcsname}}
 \def\bbl at usehyphen#1{%
   \leavevmode
-  \ifdim\lastskip>\z@\mbox{#1}\nobreak\else\nobreak#1\fi
-  \hskip\z at skip}
+  \ifdim\lastskip>\z@\mbox{#1}\else\nobreak#1\fi
+  \nobreak\hskip\z at skip}
 \def\bbl@@usehyphen#1{%
   \leavevmode\ifdim\lastskip>\z@\mbox{#1}\else#1\fi}
 \def\bbl at hyphenchar{%
@@ -439,12 +557,11 @@
 \def\bbl at hy@@soft{\bbl@@usehyphen{\discretionary{\bbl at hyphenchar}{}{}}}
 \def\bbl at hy@hard{\bbl at usehyphen\bbl at hyphenchar}
 \def\bbl at hy@@hard{\bbl@@usehyphen\bbl at hyphenchar}
-\def\bbl at hy@nobreak{\bbl at usehyphen{\mbox{\bbl at hyphenchar}\nobreak}}
+\def\bbl at hy@nobreak{\bbl at usehyphen{\mbox{\bbl at hyphenchar}}}
 \def\bbl at hy@@nobreak{\mbox{\bbl at hyphenchar}}
 \def\bbl at hy@repeat{%
   \bbl at usehyphen{%
-    \discretionary{\bbl at hyphenchar}{\bbl at hyphenchar}{\bbl at hyphenchar}%
-    \nobreak}}
+    \discretionary{\bbl at hyphenchar}{\bbl at hyphenchar}{\bbl at hyphenchar}}}
 \def\bbl at hy@@repeat{%
   \bbl@@usehyphen{%
     \discretionary{\bbl at hyphenchar}{\bbl at hyphenchar}{\bbl at hyphenchar}}}
@@ -454,7 +571,7 @@
 %
 % ------------------------------------------------------------------------------
 %
-% XXX: end of the code copied from babel files
+% end of the code copied from babel files
 %
 % ------------------------------------------------------------------------------
 %

Deleted: trunk/Master/texmf-dist/tex/latex/polyglossia/cyrillicnumbers.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/cyrillicnumbers.sty	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/cyrillicnumbers.sty	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,119 +0,0 @@
-\ProvidesPackage{cyrillicnumbers}
-        [2019/09/13 v0.1 %
-         Formatting of Cyrillic alphabetic numbers]
-
-%% This follows https://en.wikipedia.org/wiki/Cyrillic_numerals
-
-% Numbers are often distinguished from text by centered dots.
-% The commented code does this. We leave it deactivated until
-% we get some expertise.
-\newrobustcmd\cnw at print{}
-\newrobustcmd\cnw at false{%
-  \renewrobustcmd\cnw at print{}}
-\newrobustcmd\cnw at true{%
-%   \renewrobustcmd\cnw at print{$\cdot$}%
-}
-\cnw at true
-
-\protected\def\cyr at alph#1{\expandafter\@cyr at alph\expandafter{\number#1}}
-\def\@cyr at alph#1{%
-  \ifnum#1<\@ne\space\cyr at ill@value{#1}%
-  \else
-    \cnw at print
-    \ifnum#1<10\expandafter\cyr at num@i\number#1%
-    \else
-      \ifnum#1<100\expandafter\cyr at num@ii\number#1%
-      \else
-        \ifnum#1<\@m\expandafter\cyr at num@iii\number#1%
-        \else
-          \ifnum#1<\@M\expandafter\cyr at num@iv\number#1%
-          \else
-            \ifnum#1<100000\expandafter\cyr at num@v\number#1%
-            \else
-              \ifnum#1<1000000\expandafter\cyr at num@vi\number#1%
-              \else
-                \space\cyr at ill@value{#1}%
-              \fi
-            \fi
-          \fi
-        \fi
-      \fi
-    \fi
-  \fi
-}
-
-\protected\def\cyr at Alph#1{\expandafter\@cyr at Alph\expandafter{\number#1}}
-\def\@cyr at Alph#1{%
-  \ifnum#1<\@ne\space\cyr at ill@value{#1}%
-  \else
-    \cnw at print
-    \ifnum#1<10\expandafter\cyr at Num@i\number#1%
-    \else
-      \ifnum#1<100\expandafter\cyr at Num@ii\number#1%
-      \else
-        \ifnum#1<\@m\expandafter\cyr at Num@iii\number#1%
-        \else
-          \ifnum#1<\@M\expandafter\cyr at Num@iv\number#1%
-          \else
-            \ifnum#1<100000\expandafter\cyr at Num@v\number#1%
-            \else
-              \ifnum#1<1000000\expandafter\cyr at Num@vi\number#1%
-              \else
-                \space\cyr at ill@value{#1}%
-              \fi
-            \fi
-          \fi
-        \fi
-      \fi
-    \fi
-  \fi
-}
-
-% Lowercase
-\def\cyr at num@i#1{%
-  \ifcase#1 \or а\or в\or г\or д\or е\or ѕ\or з\or и\or ѳ\fi
-  \ifnum#1=\z@\else\cnw at true\fi\cnw at print}
-\def\cyr at num@ii#1{%
-  \ifcase#1 \or і\or к\or л\or м\or н\or ѯ\or о\or п\or ч\fi
-  \ifnum#1=\z@\else\cnw at true\fi\cyr at num@i}
-\def\cyr at num@iii#1{%
-  \ifcase#1 \or р\or с\or т\or у\or ф\or х\or ѱ\or ѡ\or ц\fi
-  \ifnum#1=\z@\cnw at false\else\cnw at true\fi\cyr at num@ii}
-\def\cyr at num@iv#1{%
-  \ifnum#1=\z@\else ҂\fi
-  \ifcase#1 \or а\or в\or г\or д\or е\or ѕ\or з\or и\or ѳ\fi
-  \cyr at num@iii}
-\def\cyr at num@v#1{%
-  \ifnum#1=\z@\else ҂\fi
-  \ifcase#1 \or і\or к\or л\or м\or н\or ѯ\or о\or п\or ч\fi
-  \cyr at num@iv}
-\def\cyr at Num@vi#1{%
-  \ifnum#1=\z@\else ҂\fi
-  \ifcase#1 \or р\or с\or т\or у\or ф\or х\or ѱ\or ѡ\or ц\fi
-  \cyr at num@v}
-
-% Uppercase
-\def\cyr at Num@i#1{%
-  \ifcase#1 \or А\or В\or Г\or Д\or Е\or Ѕ\or З\or И\or Ѳ\fi
-  \ifnum#1=\z@\else\cnw at true\fi\cnw at print}
-\def\cyr at Num@ii#1{%
-  \ifcase#1 \or І\or К\or Л\or М\or Н\or Ѯ\or О\or П\or Ч\fi
-  \ifnum#1=\z@\else\cnw at true\fi\cyr at Num@i}
-\def\cyr at Num@iii#1{%
-  \ifcase#1 \or Р\or С\or Т\or У\or Ф\or Х\or Ѱ\or Ѡ\or Ц\fi
-  \ifnum#1=\z@\cnw at false\else\cnw at true\fi\cyr at Num@ii}
-\def\cyr at Num@iv#1{%
-  \ifnum#1=\z@\else ҂\fi
-  \ifcase#1 \or А\or В\or Г\or Д\or Е\or Ѕ\or З\or И\or Ѳ\fi
-  \cyr at Num@iii}
-\def\cyr at Num@v#1{%
-  \ifnum#1=\z@\else ҂\fi
-  \ifcase#1 \or І\or К\or Л\or М\or Н\or Ѯ\or О\or П\or Ч\fi
-  \cyr at Num@iv}
-\def\cyr at Num@vi#1{%
-  \ifnum#1=\z@\else ҂\fi
-  \ifcase#1 \or Р\or С\or Т\or У\or Ф\or Х\or Ѱ\or Ѡ\or Ц\fi
-  \cyr at Num@v}
-\def\cyr at ill@value#1{\xpg at warning{Illegal value (#1) for cyr numeral}[$#1$]}
-
-\endinput

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-acadien.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-acadien.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-acadien.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for canadian (acadian) french]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{french}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-acadien.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,86 @@
+\ProvidesFile{gloss-afrikaans.ldf}[polyglossia: module for afrikaans]
+
+\PolyglossiaSetup{afrikaans}{
+  hyphennames={afrikaans,dutch},
+  hyphenmins={2,2},
+  langtag=AFK,
+  frenchspacing=true,
+  fontsetup=true,
+}
+
+\define at boolkey{afrikaans}[afrikaans@]{babelshorthands}[true]{}
+
+\ifsystem at babelshorthands
+  \setkeys{afrikaans}{babelshorthands=true}
+\else
+  \setkeys{afrikaans}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate at active@char}{%
+  \input{babelsh.def}%
+  \initiate at active@char{"}%
+  \shorthandoff{"}%
+}{}
+
+\def\afrikaans at shorthands{%
+  \bbl at activate{"}%
+  \def\language at group{afrikaans}%
+  \declare at shorthand{afrikaans}{"-}{\nobreak-\bbl at allowhyphens}
+  \declare at shorthand{afrikaans}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+  \declare at shorthand{afrikaans}{"|}{%
+    \textormath{\discretionary{-}{}{\kern.03em}}{}}
+  \declare at shorthand{afrikaans}{""}{\hskip\z at skip}
+  \declare at shorthand{afrikaans}{"/}{\textormath
+    {\bbl at allowhyphens\discretionary{/}{}{/}\bbl at allowhyphens}{}}%
+  \def\-{\bbl at allowhyphens\discretionary{-}{}{}\bbl at allowhyphens}%
+}
+
+\def\noafrikaans at shorthands{%
+  \@ifundefined{initiate at active@char}{}{\bbl at deactivate{"}}%
+}
+
+\def\captionsafrikaans{%
+    \def\prefacename{Voorwoord}%
+    \def\refname{Verwysings}%
+    \def\abstractname{Samevatting}%
+    \def\bibname{Bibliografie}%
+    \def\chaptername{Hoofstuk}%
+    \def\appendixname{Bylae}%
+    \def\contentsname{Inhoudsopgawe}%
+    \def\listfigurename{Lys van figure}%
+    \def\listtablename{Lys van tabelle}%
+    \def\indexname{Inhoud}%
+    \def\figurename{Figuur}%
+    \def\tablename{Tabel}%
+    \def\partname{Deel}%
+    \def\enclname{Bylae(n)}%
+    \def\ccname{a.\,a.}%
+    \def\headtoname{Aan}%
+    \def\pagename{Bladsy}%
+    \def\seename{sien}%
+    \def\alsoname{sien ook}%
+    \def\proofname{Bewys}%
+%   \def\glossaryname{}%
+}
+
+\def\dateafrikaans{%
+    \def\today{\number\day~\ifcase\month\or
+      Januarie\or Februarie\or Maart\or April\or Mei\or Junie\or
+      Julie\or  Augustus\or September\or Oktober\or November\or
+      Desember\fi
+      \space \number\year}%
+}
+
+\def\noextras at afrikaans{%
+  \noafrikaans at shorthands%
+}
+
+\def\blockextras at afrikaans{%
+  \ifafrikaans at babelshorthands\afrikaans at shorthands\fi%
+}
+
+\def\inlineextras at afrikaans{%
+  \ifafrikaans at babelshorthands\afrikaans at shorthands\fi%
+}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-american.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-american.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-american.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-american.ldf}[polyglossia: module for american english]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{english}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-american.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -143,9 +143,8 @@
 
 \def\arabicnumber#1{%
   \ifeastern at numerals
-    \arabicdigits{\number#1}%
+    \@ensure at dir{\arabicdigits{\number#1}}%
   \else
-    %%\RL{\protect\reset at font\number#1}%
     \number#1%
   \fi}
 

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-australian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-australian.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-australian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-australian.ldf}[polyglossia: module for australian english]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{english}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-australian.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-austrian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-austrian.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-austrian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for austrian german (old spelling)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{german}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-austrian.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasa.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasa.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasa.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-kurmanji.ldf}[polyglossia: module for kurmanji kurdish]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{kurdish}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasa.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -3,19 +3,6 @@
 % We only provide this gloss for babel compatibility. Since bahasai is 
 % a malay variety, we use 'malay' with variant 'indonesian' now.
 
-\input{gloss-malay.ldf}
+\xpg at load@master at language{malay}
 
-\PolyglossiaSetup{bahasai}{%
-  language=Indonesian,
-  langtag=IND,
-  hyphennames={indonesian,indon,bahasai,bahasa,bahasam,malay,melayu},
-  hyphenmins={2,2},
-  fontsetup=true}
-
-\let\captionsbahasai\captionsmalay at indonesian
-\let\datebahasai\datemalay at indonesian
-
-\DefineFormatHijriDate{bahasai}{%
-  \number\value{Hijriday}\space\hijrimonthmalay at indonesian{\value{Hijrimonth}}\space\number\value{Hijriyear}}
-
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,21 +1,8 @@
 \ProvidesFile{gloss-bahasam.ldf}[polyglossia: module for bahasa melayu]
 
-% We only provide this gloss for babel compatibility. Since bahasai is 
-% a malay variety, we use 'malay' with variant 'indonesian' now.
+% We only provide this gloss for babel compatibility. Since bahasam is 
+% a malay variety, we use 'malay' with variant 'malaysian' now.
 
-\input{gloss-malay.ldf}
+\xpg at load@master at language{malay}
 
-\PolyglossiaSetup{bahasam}{%
-  language=Malay,
-  langtag=MLY,
-  hyphennames={malay,melayu,bahasam,bahasa,bahasai,indonesian,indon},
-  hyphenmins={2,2},
-  fontsetup=true}
-
-\let\captionsbahasam\captionsmalay at malay
-\let\datebahasam\datemalay at malay
-
-\DefineFormatHijriDate{bahasam}{%
-  \number\value{Hijriday}\space\hijrimonthmalay at malay{\value{Hijrimonth}}\space\number\value{Hijriyear}}
-
 \endinput

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,272 @@
+\ProvidesFile{gloss-belarusian.ldf}[polyglossia: module for belarusian]
+
+\RequirePackage{xpg-cyrillicnumbers}
+
+\PolyglossiaSetup{belarusian}{
+  script=Cyrillic,
+  scripttag=cyrl,
+  langtag=BEL,
+  hyphennames={belarusian},
+  hyphenmins={2,2},
+  frenchspacing=true,
+  fontsetup,
+  localnumeral=belarusiannumerals,
+  Localnumeral=Belarusiannumerals
+}
+
+\def\belarusian at spelling{modern}
+\define at choicekey*+{belarusian}{spelling}[\val\nr]{modern,classic,tarask}[modern]{%
+   \ifcase\nr\relax
+      % modern:
+      \def\belarusian at spelling{modern}
+   \or
+      % classic:
+      \def\belarusian at spelling{tarask}
+   \or
+      % tarask:
+      \def\belarusian at spelling{tarask}
+   \fi
+}{\xpg at warning{Unknown Belarusian spelling `#1'}}
+
+\newif\ifcyrillic at numerals
+\define at key{belarusian}{numerals}[arabic]{%
+   \ifstrequal{#1}{cyrillic}%
+      {\cyrillic at numeralstrue}%
+      {\cyrillic at numeralsfalse}%
+}
+
+\define at boolkey{belarusian}[belarusian@]{babelshorthands}[false]{}
+
+\setkeys{belarusian}{numerals}
+
+\ifsystem at babelshorthands
+  \setkeys{belarusian}{babelshorthands=true}
+\else
+  \setkeys{belarusian}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate at active@char}{%
+  \input{babelsh.def}%
+  \initiate at active@char{"}%
+  \shorthandoff{"}%
+}{}
+
+\def\belarusian at shorthands{%
+  \bbl at activate{"}%
+  \def\language at group{belarusian}%
+  \declare at shorthand{belarusian}{"`}{„}%
+  \declare at shorthand{belarusian}{"'}{“}%
+  \declare at shorthand{belarusian}{"<}{«}%
+  \declare at shorthand{belarusian}{">}{»}%
+  \declare at shorthand{belarusian}{""}{\hskip\z at skip}%
+  \declare at shorthand{belarusian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
+  \declare at shorthand{belarusian}{"=}{\nobreak-\hskip\z at skip}%
+  \declare at shorthand{belarusian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
+  \declare at shorthand{belarusian}{"-}{%
+     \def\belarusian at sh@tmp{%
+       \if\belarusian at sh@next-\expandafter\belarusian at sh@emdash%
+       \else\expandafter\belarusian at sh@hyphen\fi%
+     }%
+     \futurelet\belarusian at sh@next\belarusian at sh@tmp%
+  }%
+  \def\belarusian at sh@hyphen{%
+    \nobreak\-\bbl at allowhyphens}%
+  \def\belarusian at sh@emdash##1##2{\cdash-##1##2}%
+  \def\cdash##1##2##3{\def\tempx@{##3}%
+  \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+   \ifx\tempx@\tempa@\@Acdash\else
+    \ifx\tempx@\tempb@\@Bcdash\else
+     \ifx\tempx@\tempc@\@Ccdash\else
+      \errmessage{Wrong usage of cdash}\fi\fi\fi}%
+  \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+    \cyrdash\hskip.2em\ignorespaces}%
+  \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+   \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z at skip\ignorespaces}%
+  \def\@Ccdash{\leavevmode
+   \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+  \ifx\cyrdash\undefined
+    \def\cyrdash{\hbox to.8em{--\hss--}}%
+  \fi
+  \declare at shorthand{belarusian}{",}{\nobreak\hskip.2em\ignorespaces}%
+}
+
+\def\nobelarusian at shorthands{%
+  \@ifundefined{initiate at active@char}{}{\bbl at deactivate{"}}%
+}
+
+% Taken from babel-belarusian
+\def\captionsbelarusian at modern{%
+    \def\prefacename{Прадмова}%
+    \def\refname{Спіс літаратуры}%
+    \def\abstractname{Анатацыя}%
+    \def\bibname{Літаратура}%
+    \def\chaptername{Глава}%
+    \def\appendixname{Дадатак}%
+    \def\contentsname{Змест}%
+    \def\listfigurename{Спіс ілюстрацый}%
+    \def\listtablename{Спіс табліц}%
+    \def\indexname{Прадметны паказальнік}%
+    \def\authorname{Паказальнік імён}%
+    \def\figurename{Рыс.}%
+    \def\tablename{Табліца}%
+    \def\partname{Частка}%
+    \def\enclname{укл.}%
+    \def\ccname{зых.}%
+    \def\headtoname{вх.}%
+    \def\pagename{с.}%
+    \def\seename{гл.}%
+    \def\alsoname{гл.\ таксама}%
+    \def\proofname{Доказ}%
+    \def\glossaryname{Слоўнік тэрмінаў}%
+    \def\acronymname{Абрэвіятуры}%
+    \def\lstlistingname{Лістынг}%
+    \def\lstlistlistingname{Лістынгі}%
+    \def\notesname{Нататкі}%
+}
+
+\def\captionsbelarusian at tarask{%
+    \def\prefacename{Прадмова}%
+    \def\refname{Сьпіс літаратуры}%
+    \def\abstractname{Анатацыя}%
+    \def\bibname{Літаратура}%
+    \def\chaptername{Глава}%
+    \def\appendixname{Дадатак}%
+    \def\contentsname{Зьмест}%
+    \let\tocname=\contentsname
+    \def\listfigurename{Сьпіс ілюстрацый}%
+    \def\listtablename{Сьпіс табліц}%
+    \def\indexname{Прадметны паказальнік}%
+    \def\authorname{Паказальнік імён}%
+    \def\figurename{Рыс.}%
+    \def\tablename{Табліца}%
+    \def\partname{Частка}%
+    \def\enclname{укл.}%
+    \def\ccname{зых.}%
+    \def\headtoname{вх.}%
+    \def\pagename{с.}%
+    \def\seename{гл.}%
+    \def\alsoname{гл.\ таксама}%
+    \def\proofname{Доказ}%
+    \def\glossaryname{Слоўнік тэрмінаў}%
+    \def\acronymname{Абрэвіятуры}%
+    \def\lstlistingname{Лістынг}%
+    \def\lstlistlistingname{Лістынгі}%
+    \def\nomname{Азначэньні}%
+    \def\notesname{Нататкі}%
+}
+
+\def\captionsbelarusian{%
+  \csuse{captionsbelarusian@\belarusian at spelling}%
+}
+
+\def\datebelarusian at modern{%
+   \def\today{\number\day~\ifcase\month\or
+    студзеня\or
+    лютага\or
+    сакавіка\or
+    красавіка\or
+    мая\or
+    чэрвеня\or
+    ліпеня\or
+    жніўня\or
+    верасня\or
+    кастрычніка\or
+    лістапада\or
+    снежня\fi
+    \space \number\year~г.}%
+}
+
+\def\datebelarusian at tarask{%
+   \def\today{\number\day~\ifcase\month\or%
+    студзеня\or
+    лютага\or
+    сакавіка\or
+    красавіка\or
+    траўня\or
+    чэрвеня\or
+    ліпеня\or
+    жніўня\or
+    верасьня\or
+    кастрычніка\or
+    лістапада\or
+    сьнежня\fi%
+    \space \number\year~г.}%
+}
+
+\def\datebelarusian{%
+  \csuse{datebelarusian@\belarusian at spelling}%
+}
+
+\newcommand{\belarusiannumerals}[2]{\belarusiannumber{#2}}
+\newcommand{\Belarusiannumerals}[2]{\Belarusiannumber{#2}}
+
+\def\belarusiannumber#1{%
+  \ifcyrillic at numerals
+    \cyr at alph{#1}%
+  \else
+    \number#1%
+  \fi%
+}
+
+\def\Belarusiannumber#1{%
+  \ifcyrillic at numerals
+    \cyr at Alph{#1}%
+  \else
+    \number#1%
+  \fi%
+}
+
+\let\belarusiannumeral=\belarusiannumber
+\let\Belarusiannumeral=\Belarusiannumber
+
+\def\Asbuk#1{\expandafter\cyr at Alph\csname c@#1\endcsname}
+
+\def\asbuk#1{\expandafter\cyr at alph\csname c@#1\endcsname}
+
+% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and
+% thus ends at 30. We now use proper cyrillic numbering.
+
+%\def\belarusian at Alph#1{\ifcase#1\or
+%   А\or Б\or В\or Г\or Д\or Е\or Ж\or
+%   З\or И\or К\or Л\or М\or Н\or О\or
+%   П\or Р\or С\or Т\or У\or Ф\or Х\or
+%   Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я\else\xpg at ill@value{#1}{belarusian at Alph}\fi}
+
+%\def\belarusian at alph#1{\ifcase#1\or
+%   а\or б\or в\or г\or д\or е\or ж\or
+%   з\or и\or к\or л\or м\or н\or о\or
+%   п\or р\or с\or т\or у\or ф\or х\or
+%   ц\or ч\or ш\or щ\or э\or ю\or я\else\xpg at ill@value{#1}{belarusian at alph}\fi}
+
+\def\belarusian at numbers{%
+   \let\latin at alph\@alph
+   \let\latin at Alph\@Alph
+   \ifcyrillic at numerals%
+     \def\belarusian at alph##1{\expandafter\belarusiannumeral\expandafter{\the##1}}%
+     \def\belarusian at Alph##1{\expandafter\belarusiannumeral\expandafter{\the##1}}%
+      \let\@alph\belarusian at alph%
+      \let\@Alph\belarusian at Alph%
+   \fi
+}
+
+\def\nobelarusian at numbers{%
+   \let\@alph\latin at alph%
+   \let\@Alph\latin at Alph%
+}
+
+\def\noextras at belarusian{%
+   \ifcyrillic at numerals\nobelarusian at numbers\fi%
+   \nobelarusian at shorthands%
+}
+
+\def\blockextras at belarusian{%
+   \ifcyrillic at numerals\belarusian at numbers\fi%
+   \ifbelarusian at babelshorthands\belarusian at shorthands\fi%
+}
+
+\def\inlineextras at belarusian{%
+   \ifbelarusian at babelshorthands\belarusian at shorthands\fi%
+}
+
+\endinput
+


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bosnian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bosnian.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bosnian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,46 @@
+\ProvidesFile{gloss-bosnian.ldf}[polyglossia: module for bosnian]
+
+\PolyglossiaSetup{bosnian}{
+  langtag=BOS,
+  hyphennames={bosnian,croatian},
+  hyphenmins={2,2}, % adapted from gloss-croatian
+  frenchspacing=true, % adapted from gloss-croatian
+  indentfirst=false, % adapted from gloss-croatian
+  fontsetup=true
+}
+
+% TODO: Add script=Cyrillic
+
+% from babel-bosnian
+\def\captionsbosnian{%
+  \def\prefacename{Predgovor}%
+  \def\refname{Literatura}%
+  \def\abstractname{Sažetak}%
+  \def\bibname{Bibliografija}%
+  \def\chaptername{Poglavlje}%
+  \def\appendixname{Dodatak}%
+  \def\contentsname{Sadržaj}%
+  \def\listfigurename{Popis slika}%
+  \def\listtablename{Popis tablica}%
+  \def\indexname{Indeks}%
+  \def\figurename{Slika}%
+  \def\tablename{Tablica}%
+  \def\partname{Dio}%
+  \def\enclname{Prilozi}%
+  \def\ccname{Kopija}%
+  \def\headtoname{Prima}%
+  \def\pagename{Stranica}%
+  \def\seename{Vidjeti}%
+  \def\alsoname{Također vidjeti}%
+  \def\proofname{Dokaz}%
+  \def\glossaryname{Rječnik}%
+}
+
+\def\datebosnian{%
+  \def\today{\number\day.~\ifcase\month\or
+    januar\or februar\or mart\or april\or maj\or
+    juni\or juli\or august\or septembar\or oktobar\or novembar\or
+    decembar\fi \space \number\year.~}%
+}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-bosnian.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -4,22 +4,6 @@
 % 'brazil' was selected in accordance with babel.
 % Since brazil is a variety of portuguese, we use 'portuguese' now.
 
-% FIXME: Once we support babel aliases (#112) this gloss can go.
+\xpg at load@master at language{portuguese}
 
-\xpg at warning{The language name 'brazil' is deprectated.\MessageBreak
-             Please use 'portuguese' with variant 'brazilian' instead.}
-
-\input{gloss-portuguese.ldf}
-
-\PolyglossiaSetup{brazil}{
-  language=Brazilian Portuguese,
-  langtag=PTG,
-  hyphennames={brazil,portuguese,portuges},
-  hyphenmins={2,3},
-  fontsetup=true,
-}
-
-\let\captionsportuges\captionsportuguese at brazil
-\let\dateportuges\dateportuguese at brazil
-     
 \endinput

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-british.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-british.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-british.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for british english]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{english}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-british.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-canadian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-canadian.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-canadian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-canadian.ldf}[polyglossia: module for canadian english]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{english}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-canadian.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-canadien.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-canadien.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-canadien.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for canadian french]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{french}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-canadien.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -8,6 +8,10 @@
   fontsetup=true,
 }
 
+\ifluatex
+  \RequirePackage{luavlna}
+\fi
+
 \define at boolkey{czech}[czech@]{babelshorthands}[true]{}
 
 \define at boolkey{czech}[czech@]{splithyphens}[true]{}
@@ -14,6 +18,8 @@
 
 \define at boolkey{czech}[czech@]{vlna}[true]{}
 
+\setkeys{czech}{splithyphens,vlna}
+
 \ifsystem at babelshorthands
   \setkeys{czech}{babelshorthands=true}
 \else
@@ -71,8 +77,7 @@
 
 \def\czech at hyphens{%
     \ifluatex
-      \xpg at warning{The 'splithyphens' option only works for XeLaTeX.\MessageBreak
-                   Please use the luavlna package to enable the feature for LuaLaTeX}
+      \AfterPreamble{\enablesplithyphens{czech}}%
     \else
       \XeTeXinterchartokenstate=1
       \XeTeXcharclass `\- \czech at hyphen
@@ -83,7 +88,9 @@
 }
 
 \def\noczech at hyphens{%
-    \ifxetex
+    \ifluatex
+      \AfterPreamble{\disablesplithyphens{czech}}%
+    \else
       \XeTeXcharclass `\- \z@
     \fi%
 }
@@ -92,8 +99,7 @@
 % prevent them to land at the end of a line
 \def\czech at vlna{%
     \ifluatex
-       \xpg at warning{The 'vlna' option only works for XeLaTeX.\MessageBreak
-                    Please use the luavlna package to enable the feature for LuaLaTeX}
+       \preventsingleon
     \else
         % Code taken and adapted from xevlna.sty
         \XeTeXinterchartokenstate=1
@@ -137,6 +143,7 @@
 
 \def\noczech at vlna{%
     \ifluatex
+        \preventsingleoff
     \else
         \XeTeXcharclass`\(\z@
         \XeTeXcharclass`\[\z@
@@ -204,14 +211,14 @@
 
 \def\blockextras at czech{%
   \ifczech at babelshorthands\czech at shorthands\fi%
-  \ifczech at vlna\czech at vlna\fi%
-  \ifczech at splithyphens\czech at hyphens\fi%
+  \ifczech at vlna\czech at vlna\else\noczech at vlna\fi%
+  \ifczech at splithyphens\czech at hyphens\else\noczech at hyhens\fi%
 }
 
 \def\inlineextras at czech{%
   \ifczech at babelshorthands\czech at shorthands\fi%
-  \ifczech at vlna\czech at vlna\fi%
-  \ifczech at splithyphens\czech at hyphens\fi%
+  \ifczech at vlna\czech at vlna\else\noczech at vlna\fi%
+  \ifczech at splithyphens\czech at hyphens\else\noczech at hyhens\fi%
 }
 
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -61,11 +61,15 @@
     \def\alsoname{zie ook}%
     \def\proofname{Bewijs}%
     \def\glossaryname{Verklarende woordenlijst}%
+}
+
+\def\datedutch{%
     \def\today{\number\day~\ifcase\month%
       \or januari\or februari\or maart\or april\or mei\or juni\or
       juli\or augustus\or september\or oktober\or november\or
       december\fi
-      \space \number\year}}
+      \space \number\year}%
+}
 
 \def\noextras at dutch{%
   \nodutch at shorthands%

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,4 +1,5 @@
 \ProvidesFile{gloss-english.ldf}[polyglossia: module for english]
+
 \PolyglossiaSetup{english}{
   hyphennames={english,american,usenglish,USenglish},
   hyphenmins={2,3},
@@ -6,6 +7,13 @@
   fontsetup=true,
 }
 
+% Babel aliases
+\setlanguagealias[variant=us]{english}{american}
+\setlanguagealias[variant=australian]{english}{australian}
+\setlanguagealias[variant=british]{english}{british}
+\setlanguagealias[variant=canadian]{english}{canadian}
+\setlanguagealias[variant=newzealand]{english}{newzealand}
+
 \providebool{british at hyphen}
 \providebool{english at ordinalmonthday}
 \providebool{british at dateformat}

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -3,40 +3,6 @@
 % We only provide this gloss for babel compatibility.
 % The proper English language name is Persian.
 
-\input{gloss-persian.ldf}
+\xpg at load@master at language{persian}
 
-\PolyglossiaSetup{farsi}{
-  script=Arabic,
-  direction=RL,
-  scripttag=arab,
-  langtag=FAR,
-  hyphennames={nohyphenation},
-  fontsetup=true,
-  localnumeral=farsinumerals
-}
-
-\define at key{farsi}{numerals}[eastern]{%
-  \setkeys{persian}{numerals=#1}}
-
-\define at key{farsi}{abjadjimnotail}[true]{%
-  \setkeys{persian}{abjadjimnotail=#1}}
-
-\define at key{farsi}{locale}[default]{%
-  \setkeys{persian}{locale=#1}}
-
-\setkeys{farsi}{locale,numerals}
-
-%\Hijritoday is now locale-aware and will format the date with this macro:
-\DefineFormatHijriDate{farsi}{\@ensure at RTL{%
-   \farsinumber{\value{Hijriday}}\space\HijriMonthArabic{\value{Hijrimonth}}\space\farsinumber{\value{Hijriyear}}}}
-
-\let\captionsfarsi\captionspersian
-\let\datefarsi\datepersian
-\let\farsi at numbers\persian at numbers
-\let\nofarsi at numbers\nopersian at numbers
-\let\farsi at globalnumbers\persian at globalnumbers
-\let\nofarsi at globalnumbers\nopersian at globalnumbers
-\let\blockextras at farsi\blockextras at persian
-\let\noextras at farsi\noextras at persian
-
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -10,6 +10,10 @@
   hyphenmins={2,2},
   fontsetup=true}
 
+% Babel aliases
+\setlanguagealias[variant=acadian]{french}{acadien}
+\setlanguagealias[variant=canadian]{french}{canadien}
+
 \def\french at variant{french}
 \define at choicekey*+{french}{variant}[\val\nr]{french,canadian,acadian}[french]{%
    \ifcase\nr\relax
@@ -20,17 +24,17 @@
       \def\french at variant{canadien}%
       \SetLanguageKeys{french}{babelname=canadien}%
       \xpg at ifdefined{canadien}{}%
-	    {\xpg at warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
-	      I will use the standard patterns for French instead}%
-	    \adddialect\l at canadien\l at french\relax}%
+      {\xpg at warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
+        I will use the standard patterns for French instead}%
+      \adddialect\l at canadien\l at french\relax}%
    \or
       % acadian:
       \def\french at variant{acadian}%
       \SetLanguageKeys{french}{babelname=canadien}%
       \xpg at ifdefined{acadian}{}%
-	    {\xpg at warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
-	      I will use the standard patterns for French instead}%
-	    \adddialect\l at acadian\l at french\relax}%
+      {\xpg at warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
+        I will use the standard patterns for French instead}%
+      \adddialect\l at acadian\l at french\relax}%
    \fi
    \xpg at info{Option: French, variant=\val}%
 }{\xpg at warning{Unknown French variant `#1'}}
@@ -41,8 +45,7 @@
 }%
 
 \ifluatex
-  \newluatexattribute\xpg at frpt %
-  \directlua{polyglossia.load_frpt()}%
+  \directlua{require('polyglossia-french')}%
 \else
   \newXeTeXintercharclass\french at openbrackets % ( ] {
   \newXeTeXintercharclass\french at closebrackets % ( ] {
@@ -83,6 +86,10 @@
 \define at boolkey{french}[french@]{autospaceguillemets}[true]{}
 \french at autospaceguillemetstrue
 
+\newif\iffrench at thincolonspace
+\define at boolkey{french}[french@]{thincolonspace}[true]{}
+\french at thincolonspacefalse
+
 % Backwards compatibility
 \define at boolkey{french}[french@]{automaticspacesaroundguillemets}[true]{%
    \iffrench at automaticspacesaroundguillemets
@@ -109,6 +116,51 @@
    \fi
 }
 
+% Configuration of item labels
+\def\french at itemi{\textemdash}
+\def\french at itemii{\textemdash}
+\def\french at itemiii{\textemdash}
+\def\french at itemiv{\textemdash}
+
+\define at key{french}{itemlabels}[\textemdash]{%
+  \def\french at itemi{#1}
+  \def\french at itemii{#1}
+  \def\french at itemiii{#1}
+  \def\french at itemiv{#1}
+}
+
+\define at key{french}{itemlabeli}[\textemdash]{%
+  \def\french at itemi{#1}
+}
+
+\define at key{french}{itemlabelii}[\textemdash]{%
+  \def\french at itemii{#1}
+}
+
+\define at key{french}{itemlabeliii}[\textemdash]{%
+  \def\french at itemiii{#1}
+}
+
+\define at key{french}{itemlabeliv}[\textemdash]{%
+  \def\french at itemiv{#1}
+}
+
+\define at boolkey{french}[french@]{frenchitemlabels}[true]{%
+  \AfterPreamble{%
+    \ifdefstring{\xpg at main@language}{french}{%
+      \iffrench at frenchitemlabels
+         \renewcommand{\labelitemi}{\french at itemi}%
+         \renewcommand{\labelitemii}{\french at itemii}%
+         \renewcommand{\labelitemiii}{\french at itemiii}%
+         \renewcommand{\labelitemiv}{\french at itemiv}%
+      \else
+         \let\@makefntext\xpg at orig@makefntext
+      \fi
+    }{\xpg at warning{Option 'frenchitemlabels' only supported if French is main language!}}%
+  }%
+}
+
+
 \def\french at fontsetup{%
   \unless\iffrench at autospacetypewriter
     \let\ttfamily\french at ttfamilyFB
@@ -120,11 +172,24 @@
   \let\ttfamily\french at ttfamilyORI
 }
 
+\def\xpg at french@thinsp{\kern 0.5\fontdimen2\font}
+
 \def\french at punctuation{%
     \lccode"2019="2019
     \ifluatex
-      \xpg at frpt=1\relax %
-      \directlua{polyglossia.activate_frpt()}%
+      \iffrench at thincolonspace
+        \iffrench at autospaceguillemets
+          \directlua{polyglossia.activate_french_punct(true, true)}%
+        \else
+          \directlua{polyglossia.activate_french_punct(true, false)}%
+        \fi
+      \else
+        \iffrench at autospaceguillemets
+          \directlua{polyglossia.activate_french_punct(false, true)}%
+        \else
+          \directlua{polyglossia.activate_french_punct(false, false)}%
+        \fi
+      \fi
     \else
       \XeTeXinterchartokenstate=1
       \XeTeXcharclass `\! \french at punctthin
@@ -134,7 +199,11 @@
       \XeTeXcharclass `\⁈ \french at punctthin
       \XeTeXcharclass `\⁉ \french at punctthin
       \XeTeXcharclass `\; \french at punctthin
-      \XeTeXcharclass `\: \french at punctthick
+      \iffrench at thincolonspace
+        \XeTeXcharclass `\: \french at punctthin
+      \else
+        \XeTeXcharclass `\: \french at punctthick
+      \fi
       \XeTeXcharclass `\« \french at punctguillstart
       \XeTeXcharclass `\» \french at punctguillend
       \XeTeXcharclass `\‹ \french at punctguillstart
@@ -141,43 +210,42 @@
       \XeTeXcharclass `\› \french at punctguillend
       \XeTeXcharclass `\( \french at openbrackets
       \XeTeXcharclass `\) \french at closebrackets
-      \XeTeXcharclass `\] \french at openbrackets
-      \XeTeXcharclass `\[ \french at closebrackets
+      \XeTeXcharclass `\[ \french at openbrackets
+      \XeTeXcharclass `\] \french at closebrackets
       \XeTeXcharclass `\{ \french at openbrackets
       \XeTeXcharclass `\} \french at closebrackets
-      \XeTeXinterchartoks \z@ \french at punctthin = {\thinspace}%
+      \XeTeXcharclass `\⟨ \french at openbrackets
+      \XeTeXcharclass `\⟩ \french at closebrackets
+      \XeTeXinterchartoks \z@ \french at punctthin = {\xpg at french@thinsp}%
       \XeTeXinterchartoks \z@ \french at punctthick = {\nobreakspace}%
-      \XeTeXinterchartoks \xpg at boundaryclass \french at punctthin = {\xpg at unskip\thinspace}%
+      \XeTeXinterchartoks \xpg at boundaryclass \french at punctthin = {\xpg at unskip\xpg at french@thinsp}%
       \XeTeXinterchartoks \xpg at boundaryclass \french at punctthick = {\xpg at unskip\nobreakspace}%
       \iffrench at autospaceguillemets
-        \XeTeXinterchartoks \french at punctguillstart \z@ = {\thinspace}% "«a" -> "«\,a"
-  %     \XeTeXinterchartoks \z@ \french at punctguillstart = {\nobreakspace}% "a«" unchanged?
-  %     \XeTeXinterchartoks \french at punctguillend \z@ = {\nobreakspace}% "»a" unchanged?
-        \XeTeXinterchartoks \z@ \french at punctguillend = {\thinspace}% "a»" -> "a\,»"
-        \XeTeXinterchartoks \french at punctguillstart \xpg at boundaryclass = {\thinspace\ignorespaces}% "«  " -> "«\,"
-        \XeTeXinterchartoks \xpg at boundaryclass \french at punctguillend = {\xpg at unskip\thinspace}% "  »" -> "\,»"
+        \let\xpg at french@guillspace\xpg at french@thinsp%
+        \XeTeXinterchartoks \french at punctguillstart \z@ = {\xpg at french@guillspace}% "«a" -> "«\,a"
+ %      \XeTeXinterchartoks \z@ \french at punctguillstart = {\nobreakspace}% "a«" unchanged?
+ %      \XeTeXinterchartoks \french at punctguillend \z@ = {\nobreakspace}% "»a" unchanged?
+        \XeTeXinterchartoks \z@ \french at punctguillend = {\xpg at french@guillspace}% "a»" -> "a\,»"
+        \XeTeXinterchartoks \french at punctguillstart \xpg at boundaryclass = {\xpg at french@guillspace\ignorespaces}% "«  " -> "«\,"
+        \XeTeXinterchartoks \xpg at boundaryclass \french at punctguillend = {\xpg at unskip\xpg at french@guillspace}% "  »" -> "\,»"
+        \XeTeXinterchartoks \french at closebrackets \french at punctguillend = {\xpg at french@guillspace}% ")»" -> ")\,»"
+     \else
+       \def\xpg at french@guillspace{}%
      \fi
-     \XeTeXinterchartoks \french at punctguillend \french at punctthin = {\thinspace}% "»;" -> "»\,;"
+     \XeTeXinterchartoks \french at punctguillend \french at punctthin = {\xpg at french@thinsp}% "»;" -> "»\,;"
      \XeTeXinterchartoks \french at punctguillend \french at punctthick = {\nobreakspace}% "»:" -> "» :"
-     \XeTeXinterchartoks \french at punctthin \french at punctguillend  = {\thinspace}% "?»" -> "?\,»"
+     \XeTeXinterchartoks \french at punctthin \french at punctguillend  = {\xpg at french@thinsp}% "?»" -> "?\,»"
      \XeTeXinterchartoks \french at openbrackets \french at punctthin = {\xpg at unskip}% "(?" -> "(?" and not "( ?"      
      \XeTeXinterchartoks \french at punctthin \french at closebrackets = {\xpg at unskip}% "?)" -> "?)" (code not need, just for symetry with previous one)
-     \XeTeXinterchartoks \french at closebrackets \french at punctthin = {\thinspace}% ")?" -> ")\,?"
+     \XeTeXinterchartoks \french at closebrackets \french at punctthin = {\xpg at french@thinsp}% ")?" -> ")\,?"
      \XeTeXinterchartoks \french at closebrackets \french at punctthick = {\nobreakspace}% "):" -> ") :"
     \fi
-    }
+}
 
 \def\nofrench at punctuation{%
     \lccode"2019=\z@
     \ifluatex
-      \xpg at frpt=0\relax %
-      % Though it would make compilation slightly faster, it is not possible to
-      % safely uncomment the following line. Imagine the following case: you start
-      % a paragraph by some french text, then, in the same paragraph, you change
-      % the language to something else, and thus call the following line. This means
-      % that, at then end of the paragraph, the function won't be in the callback,
-      % so the beginning of the paragraph won't be processed by it.
-      %\directlua{polyglossia.desactivate_frpt()}
+      \directlua{polyglossia.deactivate_french_punct()}%
     \else
       \XeTeXcharclass `\! \z@
       \XeTeXcharclass `\? \z@
@@ -191,9 +259,17 @@
       \XeTeXcharclass `\» \z@
       \XeTeXcharclass `\‹ \z@
       \XeTeXcharclass `\› \z@
+      \XeTeXcharclass `\( \z@
+      \XeTeXcharclass `\) \z@
+      \XeTeXcharclass `\[ \z@
+      \XeTeXcharclass `\] \z@
+      \XeTeXcharclass `\{ \z@
+      \XeTeXcharclass `\} \z@
+      \XeTeXcharclass `\⟨ \z@
+      \XeTeXcharclass `\⟩ \z@
       \XeTeXinterchartokenstate=0
     \fi
-    }
+}
 
 \def\captionsfrench{%
    \def\refname{Références}%
@@ -223,7 +299,7 @@
    \def\ccname{Copie à }%
    \def\headtoname{}%
    \def\proofname{Démonstration}%
-   }
+}
 
 \def\datefrench{%
    \def\today{\ifx\ier\undefined\def\ier{er}\fi

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -2,21 +2,7 @@
 
 % We only provide this gloss for babel compatibility.
 
-\input{gloss-friulian.ldf}
+\xpg at load@master at language{friulian}
 
-\PolyglossiaSetup{friulan}{%
-  language=Friulian,
-  hyphennames={friulan,furlan},
-  hyphenmins={2,2},
-  langtag=FRL,
-  indentfirst=false,
-  fontsetup=true,
-  frenchspacing=true,
-}
+\endinput
 
-\let\captionsfriulan\captionsfriulian
-\let\datefriulan\datefriulian
-\let\noextras at friulan\noextras at friulian
-\let\blockextras at friulan\blockextras at friulian
-\let\inlineextras at friulan\inlineextras at friulian
-

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -11,6 +11,9 @@
   frenchspacing=true,
 }
 
+% Babel and backwards compat. alias
+\setlanguagealias{friulian}{friulan}
+
 \def\captionsfriulian{%
     \def\prefacename{Prefazion}%
     \def\refname{Riferiments}%

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -9,6 +9,10 @@
   fontsetup=true,
 }
 
+% Babel aliases
+\setlanguagealias[variant=irish]{gaelic}{irish}
+\setlanguagealias[variant=scottish]{gaelic}{scottish}
+
 \def\gaelic at variant{irish}
 \define at choicekey*+{gaelic}{variant}[\val\nr]{irish,scottish}[irish]{%
    \ifcase\nr\relax

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,225 @@
+\ProvidesFile{gloss-georgian.ldf}[polyglossia: module for georgian]
+
+\PolyglossiaSetup{georgian}{
+  script=Georgian,
+  scripttag=geor,
+  langtag=KAT,
+  hyphennames={georgian},
+  fontsetup=true,
+  localnumeral=georgiannumerals
+}
+
+\newif\ifgeorgian at numerals
+\define at key{georgian}{numerals}[arabic]{%
+   \ifstrequal{#1}{georgian}%
+      {\georgian at numeralstrue}%
+      {\georgian at numeralsfalse}%
+}
+
+\define at boolkey{georgian}[georgian@]{babelshorthands}[true]{}
+
+\define at boolkey{georgian}[georgian@]{oldmonthnames}[true]{}
+
+\ifsystem at babelshorthands
+  \setkeys{georgian}{babelshorthands=true}
+\else
+  \setkeys{georgian}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate at active@char}{%
+  \input{babelsh.def}%
+  \initiate at active@char{"}%
+  \shorthandoff{"}%
+}{}
+
+\def\georgian at shorthands{%
+  \bbl at activate{"}%
+  \def\language at group{georgian}%
+  \declare at shorthand{georgian}{"`}{„}%
+  \declare at shorthand{georgian}{"'}{“}%
+  \declare at shorthand{georgian}{"<}{«}%
+  \declare at shorthand{georgian}{">}{»}%
+  \declare at shorthand{georgian}{""}{\hskip\z at skip}%
+  \declare at shorthand{georgian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
+  \declare at shorthand{georgian}{"=}{\nobreak-\hskip\z at skip}%
+  \declare at shorthand{georgian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
+  \declare at shorthand{georgian}{"-}{%
+    \def\georgian at sh@tmp{%
+      \if\georgian at sh@next-\expandafter\georgian at sh@emdash%
+      \else\expandafter\georgian at sh@hyphen\fi%
+    }%
+    \futurelet\georgian at sh@next\georgian at sh@tmp}%
+  \def\georgian at sh@hyphen{%
+    \nobreak\-\bbl at allowhyphens}%
+  \def\georgian at sh@emdash##1##2{\cdash-##1##2}%
+  \def\cdash##1##2##3{\def\tempx@{##3}%
+  \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+   \ifx\tempx@\tempa@\@Acdash\else
+    \ifx\tempx@\tempb@\@Bcdash\else
+     \ifx\tempx@\tempc@\@Ccdash\else
+      \errmessage{Wrong usage of cdash}\fi\fi\fi}%
+  \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+    \cyrdash\hskip.2em\ignorespaces}%
+  \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+   \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z at skip\ignorespaces}%
+  \def\@Ccdash{\leavevmode
+   \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+  \ifx\cyrdash\undefined
+    \def\cyrdash{\hbox to.8em{--\hss--}}%
+  \fi
+  \declare at shorthand{georgian}{",}{\nobreak\hskip.2em\ignorespaces}%
+}
+
+\def\nogeorgian at shorthands{%
+  \@ifundefined{initiate at active@char}{}{\bbl at deactivate{"}}%
+}
+
+\def\captionsgeorgian{%
+    \def\prefacename{წინასიტყვაობა}%
+    \def\refname{ლიტერატურა}%
+    \def\abstractname{ანოტაცია}%
+    \def\bibname{ლიტერატურა}%
+    \def\chaptername{თავი}%
+    \def\appendixname{დანართი}%
+    \@ifundefined{thechapter}
+      {\def\contentsname{შინაარსი}}%
+      {\def\contentsname{შინაარსი}}%
+    \let\tocname=\contentsname
+    \def\listfigurename{სურათი}%
+    \def\listtablename{ცხრილი}%
+    \def\indexname{საძიებელი}%
+    \def\authorname{სახელთა საძიებელი}%
+    \def\figurename{სურ.}%
+    \def\tablename{ცხრ.}%
+    \def\partname{ნაწილი}%
+    \def\enclname{ჩათვ.}%
+    \def\ccname{წყარ.}%
+    \def\headtoname{შ.}%
+    \def\pagename{გვ.}%
+    \def\seename{იხ.}%
+    \def\alsoname{იხ.\ ასევე}%
+    \def\proofname{დამტკიცება}%
+    \def\glossaryname{ტერმინები}%
+}%
+
+\def\dategeorgian{%
+   \def\today{\number\day~\ifcase\month\or
+    იანვარი\or
+    თებერვალი\or
+    მარტი\or
+    აპრილი\or
+    მაისი\or
+    ივნისი\or
+    ივლისი\or
+    აგვისტო\or
+    სექტემბერი\or
+    ოქტომბერი\or
+    ნოემბერი\or
+    დეკემბერი\fi
+    \space \number\year~წ.}%
+    \ifgeorgian at oldmonthnames
+       \dategeorgian at old%
+    \fi
+}
+
+\def\dategeorgian at old{%
+   \def\today{\number\day~\ifcase\month\or
+    აპნისი\or
+    სურწყუნისი\or
+    მირკანი\or
+    იგრიკა\or
+    ვარდობისთვე\or
+    თიბათვე\or
+    მკათათვე\or
+    მარიამობისთვე\or
+    ახალწლისა ენკენისთვე\or
+    ღვინობისთვე\or
+    გიორგობისთვე\or
+    ქრისტეშობისთვე\fi
+    \space \number\year~წ.}%
+}
+
+\def\georgian at numbers{%
+   \ifgeorgian at numerals%
+     \def\georgian at alph##1{\expandafter\georgiannumeral\expandafter{\the##1}}%
+     \let\@alph\georgian@@alph%
+   \fi
+}
+
+\def\nogeorgian at numbers{%
+   \let\@alph\latin at alph%
+   \let\georgian at alph\@undefined%
+}
+
+\def\georgian at globalnumbers{%
+  \ifgeorgian at numerals
+    \let\@arabic\georgiannumber%
+    \renewcommand\thefootnote{\localnumeral*{footnote}}%
+    \renewcommand\theequation{\localnumeral*{equation}}%
+  \fi
+}
+
+% Store original definition
+\let\xpg at save@arabic\@arabic
+
+\def\nogeorgian at globalnumbers{
+   \let\@arabic\xpg at save@arabic%
+}
+
+\newcommand{\georgiannumerals}[2]{%
+  \ifgeorgian at numerals
+     \georgiannumber{#2}%
+  \else
+     #2%
+  \fi%
+}
+
+\protected\def\georgiannumber#1{\expandafter\@georgiannumber\expandafter{\number#1}}
+\def\@georgiannumber#1{%
+  \ifnum#1<\@ne\space\geor at ill@value{#1}%
+  \else
+    \ifnum#1<10\expandafter\geor at num@i\number#1%
+    \else
+      \ifnum#1<100\expandafter\geor at num@ii\number#1%
+      \else
+        \ifnum#1<\@m\expandafter\geor at num@iii\number#1%
+        \else
+          \ifnum#1<\@M\expandafter\geor at num@iv\number#1%
+          \else
+             \space\geor at ill@value{#1}%
+          \fi
+        \fi
+      \fi
+    \fi
+  \fi
+}
+
+\let\georgiannumeral=\georgiannumber
+\def\geor at num@i#1{% 1--9
+  \ifcase#1\or ა\or ბ\or გ\or დ\or ე\or ვ\or ზ\or ჱ\or თ\fi}
+\def\geor at num@ii#1{% 10--90
+  \ifcase#1\or ი\or კ\or ლ\or მ\or ნ\or ჲ\or ო\or პ\or ჟ\fi
+  \geor at num@i}
+\def\geor at num@iii#1{% 100--900
+  \ifcase#1\or რ\or ს\or ტ\or ჳ\or ფ\or ქ\or ღ\or ყ\or შ\fi
+  \geor at num@ii}
+\def\geor at num@iv#1{% 1000--9000
+  \ifcase#1\or ჩ\or ც\or ძ\or წ\or ჭ\or ხ\or ჴ\or ჯ\or ჰ\fi
+  \geor at num@iii}
+\def\geor at ill@value#1{\xpg at warning{Illegal value (#1) for Georgian numeral}[$#1$]}
+
+\def\noextras at georgian{%
+   \ifgeorgian at numerals\nogeorgian at numbers\fi%
+   \nogeorgian at shorthands%
+}
+
+\def\blockextras at georgian{%
+   \ifgeorgian at numerals\georgian at numbers\fi%
+   \ifgeorgian at babelshorthands\georgian at shorthands\fi%
+}
+
+\def\inlineextras at georgian{%
+   \ifgeorgian at babelshorthands\georgian at shorthands\fi%
+}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,4 +1,5 @@
 \ProvidesFile{gloss-german.ldf}[polyglossia: module for german]
+
 \PolyglossiaSetup{german}{
   hyphenmins={2,2},
   frenchspacing=true,
@@ -7,6 +8,14 @@
   babelname=ngerman
 }
 
+% Babel aliases
+\setlanguagealias[variant=austrian,spelling=old]{german}{austrian}
+\setlanguagealias[variant=austrian,spelling=new]{german}{naustrian}
+\setlanguagealias[variant=german,spelling=old]{german}{germanb}
+\setlanguagealias[variant=german,spelling=new]{german}{ngerman}
+\setlanguagealias[variant=swiss,spelling=old]{german}{swissgerman}
+\setlanguagealias[variant=swiss,spelling=new]{german}{nswissgerman}
+
 \newif\if at german@oldspelling
 \@german at oldspellingfalse
 \define at choicekey*+{german}{spelling}[\val\nr]{new,old,1901}[new]{%
@@ -65,21 +74,26 @@
   \else
      \if at swiss@locale
          \SetLanguageKeys{german}{babelname=nswissgerman}%
-     \fi
+     \else
      \if at austrian@locale
          \SetLanguageKeys{german}{babelname=naustrian}%
-     \fi
+     \else
+         \SetLanguageKeys{german}{babelname=ngerman}%
+     \fi\fi
   \fi
 }
 
-\newif\if at german@fraktur
-\define at choicekey*+{german}{script}[\val\nr]{latin,fraktur}[latin]{%
+\newif\if at german@blackletter
+\define at choicekey*+{german}{script}[\val\nr]{latin,blackletter,fraktur}[latin]{%
    \ifcase\nr\relax
       % latin:
-      \@german at frakturfalse%
+      \@german at blackletterfalse%
    \or
+      % blackletter:
+      \@german at blacklettertrue%
+   \or
       % fraktur:
-      \@german at frakturtrue%
+      \@german at blacklettertrue%
    \fi
    \xpg at info{Option: German, script=\val}%
 }{\xpg at warning{Unknown German script `#1'}}
@@ -187,7 +201,7 @@
 }
 
 %%Strings for Fraktur contributed by Gerrit <z0idberg . gmx . de>
-\def\captions at german@fraktur{%
+\def\captions at german@blackletter{%
   \captions at german%
   \def\abstractname{Zuſammenfaſſung}%
   \def\seename{ſiehe}%
@@ -195,7 +209,7 @@
   \def\glossaryname{Gloſſar}%
 }
 
-\def\date at german@fraktur{%
+\def\date at german@blackletter{%
   \def\today{\number\day.%
     \space \ifcase\month%
     \or\if at austrian@locale Jänner\else Januar\fi\or Februar\or März\or%
@@ -205,13 +219,13 @@
 }
 
 \def\captionsgerman{%
-  \if at german@fraktur\captions at german@fraktur\else\captions at german\fi
+  \if at german@blackletter\captions at german@blackletter\else\captions at german\fi
   \if at austrian@locale\captions at german@austrian\fi
   \if at swiss@locale\captions at german@swiss\fi
 }
 
 \def\dategerman{%
-  \if at german@fraktur\date at german@fraktur\else\date at german\fi
+  \if at german@blackletter\date at german@blackletter\else\date at german\fi
 }
 
 \def\german at language{%

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-germanb.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-germanb.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-germanb.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-germanb.ldf}[polyglossia: module for german (old spelling)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{german}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-germanb.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,4 +1,5 @@
 \ProvidesFile{gloss-greek.ldf}[polyglossia: module for greek]
+
 \PolyglossiaSetup{greek}{
   script=Greek,
   scripttag=grek,
@@ -11,6 +12,9 @@
   %TODO localalph={greek at alph,greek at Alph}
 }
 
+% Babel aliases
+\setlanguagealias[variant=polytonic]{greek}{polutonikogreek}
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %% The code in this file was initially adapted from the antomega
 %% module for greek. Currently large parts of it derive from the 

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -2,7 +2,7 @@
 
 \PolyglossiaSetup{hungarian}{
   babelname=magyar,
-  hyphennames={magyar,hungarian},
+  hyphennames={hungarian,magyar},
   langtag=HUN,
   hyphenmins={2,2},
   fontsetup=true,
@@ -10,6 +10,49 @@
 
 \frenchspacing
 
+% Babel and backwards compat. alias
+\setlanguagealias{hungarian}{magyar}
+
+\newif\if at hungarian@swapcaptions
+\newif\if at hungarian@swapheadings
+\newif\if at hungarian@swapheaders
+\define at choicekey*+{hungarian}{swapstrings}[\val\nr]{all,captions,headings,headers,hheaders,none}[all]{%
+   \ifcase\nr\relax
+      % all:
+      \@hungarian at swapcaptionstrue%
+      \@hungarian at swapheadingstrue%
+      \@hungarian at swapheaderstrue%
+   \or
+      % captions:
+      \@hungarian at swapcaptionstrue%
+      \@hungarian at swapheadingsfalse%
+      \@hungarian at swapheadersfalse%
+   \or
+      % headings:
+      \@hungarian at swapcaptionsfalse%
+      \@hungarian at swapheadingstrue%
+      \@hungarian at swapheadersfalse%
+   \or
+      % headers:
+      \@hungarian at swapcaptionsfalse%
+      \@hungarian at swapheadingsfalse%
+      \@hungarian at swapheaderstrue%
+   \or
+      % hheaders:
+      \@hungarian at swapcaptionsfalse%
+      \@hungarian at swapheadingstrue%
+      \@hungarian at swapheaderstrue%
+   \or
+      % none:
+      \@hungarian at swapcaptionsfalse%
+      \@hungarian at swapheadingsfalse%
+      \@hungarian at swapheadersfalse%
+   \fi
+   \xpg at info{Option: Hungarian, swapstrings=\val}%
+}{\xpg at warning{Unknown Hungarian swapstrings value `#1'}}
+
+\setkeys{hungarian}{swapstrings}
+
 \def\captionshungarian{%
    \def\refname{Hivatkozások}%
    \def\abstractname{Kivonat}%
@@ -57,25 +100,188 @@
      21-én\or 22-én\or 23-án\or 24-én\or 25-én\or
      26-án\or 27-én\or 28-án\or 29-én\or 30-án\or
      31-én\fi}%
-   \let\ontoday\ondatehungarian}
+   \let\ontoday\ondatehungarian%
+   \let\ondatemagyar\ondatehungarian%
+}
 
-% change 'táblázat x.x' to 'x.x. táblázat'
-\def\xpg at hungarian@fnum at table{\thetable.~\tablename}
+% Save original capsformats
 \let\xpg at save@fnum at table\fnum at table
-
-% change 'ábra x.x' to 'x.x. ábra'
-\def\xpg at hungarian@fnum at figure{\thefigure.~\figurename}
 \let\xpg at save@fnum at figure\fnum at figure
 
+\def\hungarian at capsformat{%
+  %
+  % Change captions
+  \if at hungarian@swapcaptions
+     % change 'ábra x.x' to 'x.x. ábra'
+     \def\fnum at figure{\thefigure.~\figurename}
+     %
+     % change 'táblázat x.x' to 'x.x. táblázat'
+     \def\fnum at table{\thetable.~\tablename}
+  \fi
+  %
+  % change chapter and part headings
+  \if at hungarian@swapheadings
+     % With titlesec
+     \ifdefined\titleformat%
+       \ifdefined\@part%
+          \let\xpg at save@part at format\@part%
+          \patchcmd{\@part}%
+                    {\partname\nobreakspace\thepart}%
+                    {\thepart.\nobreakspace\partname}%
+                    {}%
+                    {\xpg at warning{Failed to patch part for Hungarian}}%
+       \fi%
+       \ifdefined\chapter%
+          \titleformat\chapter[display]%
+             {\@ifundefined{ttl at fil}{\raggedright}{\ttl at fil}\ttl at fonts\ttl at sizes6}
+             {\thechapter.\space\@chapapp}{.8\baselineskip}{\ttl at sizes\z@\ttl at passexplicit}
+       \fi%
+     \else% (not \ifdefined\titleformat)
+       % With KOMA
+       \ifdefined\sectionformat%
+          \ifdefined\partformat%
+            \let\xpg at save@part at format\partformat%
+            \renewcommand{\partformat}{\thepart.~\partname}%
+          \fi%
+          \ifdefined\chapterformat%
+            \let\xpg at save@chap at format\chapterformat%
+            \renewcommand{\chapterformat}{\mbox{\thechapter\autodot%
+                                          \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
+          \fi%
+       \else%  (not \ifdefined\sectionformat)
+         % With memoir
+         \ifdefined\@memptsize%
+           \ifdefined\@makechapterhead%
+              \let\xpg at save@chap at format\@makechapterhead%
+              \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
+                       {\printchapternum.\chapternamenum\printchaptername}%
+                       {}%
+                       {\xpg at warning{Failed to patch chapter for Hungarian}}%
+           \fi%
+           \ifdefined\@part%
+              \let\xpg at save@part at format\@part%
+              \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
+                               {\printpartnum.\partnamenum\printpartname}%
+                               {}%
+                               {\xpg at warning{Failed to patch part for Hungarian}}%
+           \fi%
+         \else%  (not \ifdefined\@memptsize)
+           % With standard classes
+            \ifdefined\@makechapterhead%
+              \let\xpg at save@chap at format\@makechapterhead%
+              \patchcmd{\@makechapterhead}%
+                       {\@chapapp\space \thechapter}%
+                       {\thechapter.\space \@chapapp}%
+                       {}%
+                       {\xpg at warning{Failed to patch chapter for Hungarian}}%
+            \fi%
+            \ifdefined\@part%
+              \let\xpg at save@part at format\@part%
+              \patchcmd{\@part}%
+                       {\partname\nobreakspace\thepart}%
+                       {\thepart.\nobreakspace\partname}%
+                       {}%
+                       {\xpg at warning{Failed to patch part for Hungarian}}%
+            \fi%  (end \ifdefined\@part)
+          \fi% (end \ifdefined\@memptsize)
+        \fi% (end \ifdefined\sectionformat)
+     \fi% (end \ifdefined\titleformat)
+  \fi% (end \if at hungarian@swapheadings)
+  %
+  % Change running headers
+  \if at hungarian@swapheaders
+    \ifdefined\chapterformat%
+      % With KOMA
+      \let\xpg at save@chaptermark at format\chaptermarkformat%
+      \renewcommand*\chaptermarkformat{%
+         \thechapter\autodot\ \IfChapterUsesPrefixLine{\chapapp\enskip}{}}
+    \else% (not \ifdefined\chapterformat)
+      \ifdefined\@memptsize%
+        % With memoir
+        \let\xpg at save@chaptermark at format\chaptermark%
+        \renewcommand*\chaptermark[1]{%
+          \markboth{\memUChead{%
+            \ifnum \c at secnumdepth >\m at ne
+              \if at mainmatter
+                \thechapter.\ \@chapapp\ %
+              \fi
+            \fi
+            ##1}}{}}%
+      \else% (not \ifdefined\@memptsize)
+        % With standard classes
+        \ifdefined\chaptermark%
+           \let\xpg at save@chaptermark at format\chaptermark%
+           \patchcmd{\chaptermark}%
+                    {\@chapapp\ \thechapter.}%
+                    {\thechapter.\ \@chapapp}%
+                    {}%
+                    {\xpg at warning{Failed to patch chaptermark for Hungarian}}%
+        \fi% (end \ifdefined\chaptermark)
+      \fi% (end \ifdefined\@memptsize)
+    \fi% (end \ifdefined\chapterformat)
+  \fi% (end \if at hungarian@swapheaders)
+}
+
+\def\nohungarian at capsformat{%
+   %
+   % Reset changes of \hungarian at capsformat
+   \let\fnum at table\xpg at save@fnum at table%
+   \let\fnum at figure\xpg at save@fnum at figure%
+   %
+   % Reset chapter and part heading
+   \ifdefined\titleformat%
+      % With titlesec
+     \ifdefined\xpg at save@part at format
+        \let\@part\xpg at save@part at format
+     \fi%
+     \ifdefined\chapter
+        \titleformat\chapter[display]%
+          {\@ifundefined{ttl at fil}{\raggedright}{\ttl at fil}\ttl at fonts\ttl at sizes6}
+          {\@chapapp\space\thechapter}{.8\baselineskip}{\ttl at sizes\z@\ttl at passexplicit}
+     \fi%
+   \else% (not \ifdefined\titleformat)
+     \ifdefined\sectionformat%
+        % With KOMA
+        \ifdefined\xpg at save@part at format
+           \let\partformat\xpg at save@part at format
+        \fi%
+        \ifdefined\xpg at save@chap at format
+           \let\chapterformat\xpg at save@chap at format
+        \fi%
+     \else%
+        % With memoir and standard classes
+        \ifdefined\xpg at save@part at format
+           \let\@part\xpg at save@part at format
+        \fi%
+        \ifdefined\xpg at save@chap at format
+          \let\@makechapterhead\xpg at save@chap at format
+        \fi%
+     \fi% (end \ifdefined\sectionformat)
+   \fi% (end \ifdefined\titleformat)
+  %
+  % Reset headers
+  \ifdefined\chaptermarkformat%
+     % With KOMA
+     \ifdefined\xpg at save@chaptermark at format
+       \let\chaptermarkformat\xpg at save@chaptermark at format%
+     \fi
+  \else%
+     \ifdefined\chaptermark%
+       % With memoir and standard classes
+       \ifdefined\xpg at save@chaptermark at format
+         \let\chaptermark\xpg at save@chaptermark at format%
+       \fi
+     \fi% (end \ifdefined\chaptermark)
+  \fi% (end \ifdefined\chapterformat)
+}
+
 \def\blockextras at hungarian{%
-   \let\fnum at table\xpg at hungarian@fnum at table
-   \let\fnum at figure\xpg at hungarian@fnum at figure
+   \hungarian at capsformat%
 }
 
 \def\noextras at hungarian{%
-   \let\fnum at table\xpg at save@fnum at table
-   \let\fnum at figure\xpg at save@fnum at figure
-   \let\ontoday\@undefined
+   \nohungarian at capsformat%
+   \let\ontoday\@undefined%
 }
 
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -3,16 +3,6 @@
 % We only provide this gloss for babel compatibility. Since irish is 
 % a gaelic variety, we use 'gaelic' with variant 'irish' now.
 
-\input{gloss-gaelic.ldf}
+\xpg at load@master at language{gaelic}
 
-\PolyglossiaSetup{irish}{
-  hyphennames={irish},
-  hyphenmins={2,2},
-  langtag=IRI,
-  fontsetup=true,
-}
-
-\let\captionsirish\captionsgaelic at irish
-\let\dateirish\dategaelic at irish
-
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -17,6 +17,9 @@
   localnumeral=kurdishnumerals
 }
 
+% Babel aliases
+\setlanguagealias[variant=kurmanji]{kurdish}{kurmanji}
+
 \newif\if at kurdish@kurmanji
 \def\kurdish at variant{sorani}
 \define at choicekey*+{kurdish}{variant}[\val\nr]{sorani,kurmanji}[sorani]{%

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,298 +1,907 @@
-%%
-%% This is file `gloss-latin.ldf',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% gloss-latin.dtx  (with options: `lamodern')
-%%   ------------------------------------------------------------------
-%%   Latin module for polyglossia
-%%   Copyright (C) Claudio Beccari 2013-2016
-%%   Copyright (C) Élie Roux 2016
-%%   This work is distributed under the MIT License.
-%% 
-%%   See the postamble.
-%%   ------------------------------------------------------------------
-\ProvidesFile{gloss-latin.ldf}
-        [2016/09/10 v.1.03 Latin support from polyglossia]
-%%
+\ProvidesFile{gloss-latin.ldf}[polyglossia: module for Latin v.2.0 2019-10-28]
 
+\ExplSyntaxOn
 
-\PolyglossiaSetup{latin}{%
-      hyphennames={latin},
-      hyphenmins={2,2},
-      langtag=LAT,
-      frenchspacing=true,
-      fontsetup=true,
-}
-\def\classicuclccodes{\lccode`\V=`\u \uccode`\u=`\V}
-\def\noclassicuclccodes{\lccode`\V=`\v \uccode`\u=`\U}
-\def\tmp at modern{modern}
-\def\tmp at medieval{medieval}
-\unless\ifluatex
-  \def\tmp at classic{classic}
-  \def\tmp at liturgical{liturgical}
-\fi
-\newif\ifmedieval\medievalfalse
-\newif\ifclassic\classicfalse
-\define at boolkey{latin}[latin@]{ecclesiastic}[true]{}
+\PolyglossiaSetup {latin}
+  {
+    hyphennames = {latin},
+    hyphenmins = {2,2},
+    frenchspacing = true,
+    fontsetup = true,
+    langtag = LAT
+  }
 
-\let\latin at variant\l at latin
-\ifluatex
-  \ifcsname l at latin\endcsname\xpg at set@language at luatex@ii{latin}\fi
-\fi
-\def\captionslatin{\latincaptions}%
-\def\datelatin{\latindate}%
-\define at key{latin}{variant}[modern]{%
-\def\@tempa{#1}%
-\ifx\@tempa\tmp at medieval
-  \ifluatex
-    \ifcsname l at latin\endcsname\xpg at set@language at luatex@ii{latin}\fi
-  \fi
-  \let\latin at variant\l at latin
-  \xpg at set@language at luatex@ii{latin}
-  \medievaltrue \classictrue
-  \xpg at info{Option: Medieval Latin}%
-\else
-  \ifx\@tempa\tmp at classic
-    \unless\ifluatex
-      \unless\ifcsname l at classiclatin\endcsname
-         \xpg at nopatterns{Classic Latin}%
-         \adddialect\l at classiclatin\l at latin
-         \let\latin at variant\l at latin
-      \else
-         \let\latin at variant\l at classiclatin
-      \fi
-    \fi
-    \medievalfalse\classictrue
-    \xpg at info{Option: Classic Latin}%
-  \else
-   \ifx\@tempa\tmp at liturgical\unless\ifluatex
-      \unless\ifcsname l at liturgicallatin\endcsname
-         \xpg at nopatterns{Liturgical Latin}%
-         \adddialect\l at liturgicallatin\l at latin
-         \def\latin at variant{\l at latin}%
-      \else
-         \let\latin at variant\l at liturgicallatin
-      \fi
-        \medievaltrue\classicfalse
-        \xpg at info{Option: Liturgical Latin}\fi
-   \else
-      \ifx\@tempa\tmp at modern
-        \let\latin at variant\l at latin
-        \ifluatex\xpg at set@language at luatex@ii{latin}\fi
-        \xpg at info{Option: Modern Latin}%
-      \else
-        \def\latin at variant{\l at nohyphenation}%
-        \PackageWarning{polyglossia}{%
-          *******************\MessageBreak
-          No hyphenation set for \@tempa
-          *******************\MessageBreak
-        }{}%
-      \fi
-    \fi
-  \fi
-\fi
-}
+% Babel aliases
+\setlanguagealias[variant=classic]{latin}{latinclassic}
+\setlanguagealias[variant=ecclesiastic]{latin}{latinecclesiastic}
+\setlanguagealias[variant=medieval]{latin}{latinmedieval}
 
-\def\latin at language{\language=\latin at variant}%
-\ifluatex
-       \PackageWarning{polyglossia}{\MessageBreak\MessageBreak
-       *****************\MessageBreak
-       The ecclesiastic option is not active\MessageBreak
-       when typesetting with LuaLaTeX\MessageBreak
-       *****************\MessageBreak
-       \MessageBreak}{}
-  \else
-   \def\ecclesiasticlatin at punctuation{%
-      \def\xpg at unskip{\ifhmode\ifdim\lastskip>\z@\unskip\fi\fi}
-      \lccode\string"2019=\string"2019
-      \newXeTeXintercharclass\ecclesiasticlatin at punctthin
-      \newXeTeXintercharclass\ecclesiasticlatin at punctguillstart
-      \newXeTeXintercharclass\ecclesiasticlatin at punctguillend
-      \XeTeXinterchartokenstate=1
-      \XeTeXcharclass `\! \ecclesiasticlatin at punctthin
-      \XeTeXcharclass `\? \ecclesiasticlatin at punctthin
-      \XeTeXcharclass `\; \ecclesiasticlatin at punctthin
-      \XeTeXcharclass `\: \ecclesiasticlatin at punctthin
-      \XeTeXcharclass `\« \ecclesiasticlatin at punctguillstart
-      \XeTeXcharclass `\» \ecclesiasticlatin at punctguillend
-      \XeTeXinterchartoks \z@ \ecclesiasticlatin at punctthin = {\penalty\@M
-      \hskip.2\fontdimen2\font \@plus\z@\@minus\z@}%
-      \XeTeXinterchartoks 255 \ecclesiasticlatin at punctthin = {\xpg at unskip}
-      \XeTeXinterchartoks \ecclesiasticlatin at punctguillstart \z@ = {\penalty\@M
-      \hskip.2\fontdimen2\font \@plus\z@\@minus\z@\ignorespaces}
-      \XeTeXinterchartoks \z@ \ecclesiasticlatin at punctguillend = {\xpg at unskip
-      \penalty\@M\hskip.2\fontdimen2\font \@plus\z@\@minus\z@}
-    }
 
-   \def\noecclesiasticlatin at punctuation{%
-      \lccode\string"2019=\z@
+%%%%% Variables and commands concerning spelling
+
+\bool_new:N \l_polyglossia_latin_use_j_bool
+\bool_new:N \l_polyglossia_latin_use_v_bool
+\bool_new:N \l_polyglossia_latin_use_digraphs_bool
+\bool_new:N \l_polyglossia_latin_capitalize_month_bool
+
+\cs_new:Npn \polyglossia_latin_classical_character_codes:
+  {
+    \char_set_lccode:nn {`\V} {`\u}
+    \char_set_uccode:nn {`\u} {`\V}
+    \char_set_uccode:nn {`\ú} {`\V}
+    \char_set_uccode:nn {`\ū} {`\V}
+    \char_set_uccode:nn {`\ŭ} {`\V}
+  }
+
+\cs_new:Npn \polyglossia_latin_modern_character_codes:
+  {
+    \char_set_lccode:nn {`\V} {`\v}
+    \char_set_uccode:nn {`\u} {`\U}
+    \char_set_uccode:nn {`\ú} {`\Ú}
+    \char_set_uccode:nn {`\ū} {`\Ū}
+    \char_set_uccode:nn {`\ŭ} {`\Ŭ}
+  }
+
+
+%%%%% Messages and commands concerning hyphenation
+
+\msg_new:nnn {polyglossia} {latin / missing modern patterns}
+  {
+    No~hyphenation~patterns~were~found~for~Latin~\msg_line_context:.~
+    I~will~not~hyphenate~Latin~words.
+  }
+
+\msg_new:nnn {polyglossia} {latin / missing patterns}
+  {
+    The~"#1"~hyphenation~patterns~were~not~found~\msg_line_context:.~
+    I~will~use~the~patterns~for~modern~Latin~instead.
+  }
+
+\cs_new:Npn \polyglossia_latin_use_modern_patterns:
+  {
+    \xpg at ifdefined {latin}
+      {
+        \def \latin at language
+          {
+            \polyglossia at setup@language at patterns {latin}
+          }
+      }
+      {
+        \msg_warning:nn {polyglossia} {latin / missing modern patterns}
+        \adddialect \l at latin \l at nohyphenation
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_set_patterns:n #1
+% #1 may be "classiclatin" or "liturgicallatin"
+  {
+    \xpg at ifdefined {#1}
+      {
+        \def \latin at language
+          {
+            \polyglossia at setup@language at patterns {#1}
+          }
+      }
+      {
+        \xpg at ifdefined {latin}
+          {
+            \msg_warning:nnn {polyglossia} {latin / missing patterns} {#1}
+            \adddialect \l@ #1 \l at latin
+            \polyglossia_latin_use_modern_patterns:
+          }
+          {
+            \msg_warning:nn {polyglossia} {latin / missing modern patterns}
+            \adddialect \l@ #1 \l at nohyphenation
+          }
+      }
+  }
+
+
+%%%%% Settings for the spacing of the punctuation for ecclesiastical Latin
+
+\bool_new:N \g_polyglossia_latin_punctuation_spacing_bool
+
+\sys_if_engine_luatex:TF
+  {
+    \directlua { require('polyglossia-latin') }
+  }
+  {
+    \newXeTeXintercharclass \g_polyglossia_latin_punctuation_class
+    \newXeTeXintercharclass \g_polyglossia_latin_opening_guillemet_class
+    \newXeTeXintercharclass \g_polyglossia_latin_closing_guillemet_class
+    \newXeTeXintercharclass \g_polyglossia_latin_opening_bracket_class
+    \newXeTeXintercharclass \g_polyglossia_latin_closing_bracket_class
+
+    \cs_new:Npn \polyglossia_latin_insert_punctuation_space:
+      {
+        \nobreak
+        \skip_horizontal:n { 0.08333 \fontdimen6 \font } % 1/12 quad
+      }
+    \cs_new:Npn \polyglossia_latin_replace_preceding_space:
+      {
+        \dim_compare:nNnT {\lastskip} > {\c_zero_dim} {\unskip}
+        \polyglossia_latin_insert_punctuation_space:
+      }
+    \cs_new:Npn \polyglossia_latin_replace_following_space:
+      {
+        \polyglossia_latin_insert_punctuation_space:
+        \ignorespaces
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_punctuation_spacing:
+  {
+    \sys_if_engine_luatex:TF
+      {
+        \directlua { polyglossia.activate_latin_punct() }
+      }
+      {
+        \XeTeXinterchartokenstate = 1
+        \XeTeXcharclass `\! \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\? \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\‼ \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\⁇ \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\⁈ \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\⁉ \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\; \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\: \g_polyglossia_latin_punctuation_class
+        \XeTeXcharclass `\« \g_polyglossia_latin_opening_guillemet_class
+        \XeTeXcharclass `\» \g_polyglossia_latin_closing_guillemet_class
+        \XeTeXcharclass `\‹ \g_polyglossia_latin_opening_guillemet_class
+        \XeTeXcharclass `\› \g_polyglossia_latin_closing_guillemet_class
+        \XeTeXcharclass `\( \g_polyglossia_latin_opening_bracket_class
+        \XeTeXcharclass `\) \g_polyglossia_latin_closing_bracket_class
+        \XeTeXcharclass `\[ \g_polyglossia_latin_opening_bracket_class
+        \XeTeXcharclass `\] \g_polyglossia_latin_closing_bracket_class
+        \XeTeXcharclass `\{ \g_polyglossia_latin_opening_bracket_class
+        \XeTeXcharclass `\} \g_polyglossia_latin_closing_bracket_class
+        \XeTeXcharclass `\⟨ \g_polyglossia_latin_opening_bracket_class
+        \XeTeXcharclass `\⟩ \g_polyglossia_latin_closing_bracket_class
+
+        % punctuation followed by a closing guillemet
+        \XeTeXinterchartoks \g_polyglossia_latin_punctuation_class \g_polyglossia_latin_closing_guillemet_class =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+        % closing bracket followed by punctuation
+        \XeTeXinterchartoks \g_polyglossia_latin_closing_bracket_class \g_polyglossia_latin_punctuation_class =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+        % closing bracket followed by a closing guillemet
+        \XeTeXinterchartoks \g_polyglossia_latin_closing_bracket_class \g_polyglossia_latin_closing_guillemet_class =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+        % opening guillemet followed by a space
+        \XeTeXinterchartoks \g_polyglossia_latin_opening_guillemet_class \xpg at boundaryclass =
+          {
+            \polyglossia_latin_replace_following_space:
+          }
+        % opening guillemet followed by an ordinary character
+        \XeTeXinterchartoks \g_polyglossia_latin_opening_guillemet_class \z@ =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+        % closing guillemet followed by punctuation
+        \XeTeXinterchartoks \g_polyglossia_latin_closing_guillemet_class \g_polyglossia_latin_punctuation_class =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+        % space followed by punctuation
+        \XeTeXinterchartoks \xpg at boundaryclass \g_polyglossia_latin_punctuation_class =
+          {
+            \polyglossia_latin_replace_preceding_space:
+          }
+        % space followed by closing guillemet
+        \XeTeXinterchartoks \xpg at boundaryclass \g_polyglossia_latin_closing_guillemet_class =
+          {
+            \polyglossia_latin_replace_preceding_space:
+          }
+        % ordinary character followed by punctuation
+        \XeTeXinterchartoks \z@ \g_polyglossia_latin_punctuation_class =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+        % ordinary character followed by closing guillemet
+        \XeTeXinterchartoks \z@ \g_polyglossia_latin_closing_guillemet_class =
+          {
+            \polyglossia_latin_insert_punctuation_space:
+          }
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_no_punctuation_spacing:
+  {
+    \sys_if_engine_luatex:TF
+      {
+        \directlua { polyglossia.deactivate_latin_punct() }
+      }
+      {
         \XeTeXcharclass `\! \z@
         \XeTeXcharclass `\? \z@
+        \XeTeXcharclass `\‼ \z@
+        \XeTeXcharclass `\⁇ \z@
+        \XeTeXcharclass `\⁈ \z@
+        \XeTeXcharclass `\⁉ \z@
         \XeTeXcharclass `\; \z@
         \XeTeXcharclass `\: \z@
         \XeTeXcharclass `\« \z@
         \XeTeXcharclass `\» \z@
-        \XeTeXinterchartokenstate=0
+        \XeTeXcharclass `\‹ \z@
+        \XeTeXcharclass `\› \z@
+        \XeTeXcharclass `\( \z@
+        \XeTeXcharclass `\) \z@
+        \XeTeXcharclass `\[ \z@
+        \XeTeXcharclass `\] \z@
+        \XeTeXcharclass `\{ \z@
+        \XeTeXcharclass `\} \z@
+        \XeTeXcharclass `\⟨ \z@
+        \XeTeXcharclass `\⟩ \z@
+        \XeTeXinterchartokenstate = 0
       }
-    \let\latin at original@makefntext\@makefntext
-    \newcommand\latin at ecclesiastic@makefntext[1]{%
-        \parindent 1em \noindent
-        \latin at Makefnmark{\enspace #1}}
-    \newcommand\latin at Makefnmark{\hbox{\normalfont\@thefnmark.}}
-\fi
-\setkeys{latin}{variant,ecclesiastic=false}
-\def\latincaptions{%
-   \def\prefacename{\ifmedieval Præfatio\else Praefatio\fi}%
-   \def\refname{Conspectus librorum}%
-   \def\abstractname{Summarium}%
-   \def\bibname{Conspectus librorum}%
-   \def\chaptername{Caput}%
-   \def\appendixname{Additamentum}%
-   \def\contentsname{Index}%
-   \def\listfigurename{Conspectus descriptionum}%
-   \def\listtablename{Conspectus tabularum}%
-   \def\indexname{Index rerum notabilium}%
-   \def\figurename{Descriptio}%
-   \def\tablename{Tabula}%
-   \def\partname{Pars}%
-   \def\enclname{Additur}%
-   \def\ccname{Exemplar}%
-   \def\headtoname{\ignorespaces}%
-   \def\pagename{charta}%
-   \def\seename{cfr.}%
-   \def\alsoname{cfr.}%
-   \def\proofname{Demonstratio}%
-   \def\glossaryname{Glossarium}%
-   }
+  }
 
-\def\latindate{%
-   \def\today{\uppercase\expandafter{\romannumeral\day}%
-      \space \ifcase\month%
-      \or Januarii\or Februarii\or Martii\or Aprilis\or Maji\or
-      Junii\or Julii\or Augusti\or Septembris\or Octobris\or
-        \ifclassic Nouembris\else Novembris\fi
-      \or Decembris\fi%
-      \space \uppercase\expandafter{\romannumeral\year}}}
-%%%%%%%%% Latin shorthands
 
-\define at boolkey{latin}[latin@]{babelshorthands}[true]{}
+%%%%% Messages and commands concerning footnotes
 
+\cs_if_exist:NT \@makefntext
+  {
+    \cs_set_eq:NN \polyglossia_latin_original_footnote:n \@makefntext
+  }
+
+% This is the footnote style as defined by the "ecclesiastic" package.
+\cs_new:Npn \polyglossia_latin_variant_footnote:n #1
+  {
+    \parindent 1em
+    \noindent
+    \hbox { \normalfont \@thefnmark . }
+    \enspace #1
+  }
+
+\msg_new:nnn {polyglossia} {latin / ineffective footnote option}
+  {
+    The~option~"ecclesiasticfootnotes"~is~ineffective~\msg_line_context:
+    \c_space_tl as~Latin~is~not~the~main~language.
+  }
+
+\cs_new:Npn \polyglossia_latin_apply_footnote_option:
+  {
+    \str_if_eq:VnTF \xpg at main@language {latin}
+      {
+        \cs_if_exist:NT \@makefntext
+          {
+            \iflatin at ecclesiasticfootnotes
+              \let \@makefntext \polyglossia_latin_variant_footnote:n
+            \else
+              \let \@makefntext \polyglossia_latin_original_footnote:n
+            \fi
+          }
+      }
+      {
+        \msg_warning:nn {polyglossia} {latin / ineffective footnote option}
+      }
+  }
+
+\define at boolkey {latin} [latin@] {ecclesiasticfootnotes} [true]
+  {
+    \token_if_eq_meaning:NNTF \@onlypreamble \@notprerr
+      {
+        % within the document
+        \polyglossia_latin_apply_footnote_option:
+      }
+      {
+        % within the preamble
+        % The application of the option has to be postponed as the main
+        % language may be undefined when the option is called.
+        \AtBeginDocument { \polyglossia_latin_apply_footnote_option: }
+      }
+  }
+
+
+%%%%% Language variants: classic, medieval, modern, and ecclesiastic
+
+\msg_new:nnn {polyglossia} {latin / language variant}
+  {
+    Activating~Latin~language~variant~"#1"~\msg_line_context:.
+  }
+
+\msg_new:nnn {polyglossia} {latin / illegal language variant}
+  {
+    The~Latin~language~variant~"#1"~is~undefined~\msg_line_context:.
+  }
+
+\cs_new:Npn \polyglossia_latin_classic_settings:
+  {
+    \bool_set_false:N \l_polyglossia_latin_use_j_bool
+    \bool_set_false:N \l_polyglossia_latin_use_v_bool
+    \bool_set_false:N \l_polyglossia_latin_use_digraphs_bool
+    \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
+    \bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool
+    \SetLanguageKeys {latin} { babelname = latin.classic }
+    \polyglossia_latin_set_patterns:n {classiclatin}
+  }
+
+\cs_new:Npn \polyglossia_latin_medieval_settings:
+  {
+    \bool_set_false:N \l_polyglossia_latin_use_j_bool
+    \bool_set_false:N \l_polyglossia_latin_use_v_bool
+    \bool_set_true:N \l_polyglossia_latin_use_digraphs_bool
+    \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
+    \bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool
+    \SetLanguageKeys {latin} { babelname = latin.medieval }
+    \polyglossia_latin_use_modern_patterns:
+  }
+
+\cs_new:Npn \polyglossia_latin_modern_settings:
+  {
+    \bool_set_false:N \l_polyglossia_latin_use_j_bool
+    \bool_set_true:N \l_polyglossia_latin_use_v_bool
+    \bool_set_false:N \l_polyglossia_latin_use_digraphs_bool
+    \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
+    \bool_set_false:N \l_polyglossia_latin_punctuation_spacing_bool
+    \SetLanguageKeys {latin} { babelname = latin }
+    \polyglossia_latin_use_modern_patterns:
+  }
+
+\cs_new:Npn \polyglossia_latin_ecclesiastic_settings:
+  {
+    \bool_set_false:N \l_polyglossia_latin_use_j_bool
+    \bool_set_true:N \l_polyglossia_latin_use_v_bool
+    \bool_set_true:N \l_polyglossia_latin_use_digraphs_bool
+    \bool_set_false:N \l_polyglossia_latin_capitalize_month_bool
+    \bool_set_true:N \l_polyglossia_latin_punctuation_spacing_bool
+    \SetLanguageKeys {latin} { babelname = latin.ecclesiastic }
+    \polyglossia_latin_use_modern_patterns:
+  }
+
+\define at key{latin}{variant}
+  {
+    \str_case:nnF {#1}
+      {
+        {classic}
+        {
+          \msg_info:nnn {polyglossia} {latin / language variant} {classic}
+          \polyglossia_latin_classic_settings:
+        }
+        {medieval}
+        {
+          \msg_info:nnn {polyglossia} {latin / language variant} {medieval}
+          \polyglossia_latin_medieval_settings:
+        }
+        {modern}
+        {
+          \msg_info:nnn {polyglossia} {latin / language variant} {modern}
+          \polyglossia_latin_modern_settings:
+        }
+        {ecclesiastic}
+        {
+          \msg_info:nnn {polyglossia} {latin / language variant} {ecclesiastic}
+          \polyglossia_latin_ecclesiastic_settings:
+        }
+      }
+      {
+        \msg_warning:nnn {polyglossia} {latin / illegal language variant} {#1}
+      }
+  }
+
+
+%%%%% Boolean options concerning spelling
+
+\define at boolkey{latin}[latin@]{usej}[true]
+  {
+    \iflatin at usej
+      \bool_set_true:N \l_polyglossia_latin_use_j_bool
+    \else
+      \bool_set_false:N \l_polyglossia_latin_use_j_bool
+    \fi
+  }
+
+\define at boolkey{latin}[latin@]{capitalizemonth}[true]
+  {
+    \iflatin at capitalizemonth
+      \bool_set_true:N \l_polyglossia_latin_capitalize_month_bool
+    \else
+      \bool_set_false:N \l_polyglossia_latin_capitalize_month_bool
+    \fi
+  }
+
+
+%%%%% Hyphenation variants: classic, liturgical, and modern
+
+\msg_new:nnn {polyglossia} {latin / hyphenation variant}
+  {
+    Activating~hyphenation~patterns~for~#1~Latin~\msg_line_context:.
+  }
+
+\msg_new:nnn {polyglossia} {latin / illegal hyphenation variant}
+  {
+    The~Latin~hyphenation~variant~"#1"~is~undefined~\msg_line_context:.
+  }
+
+\define at key{latin}{hyphenation}
+  {
+    \str_case:nnTF {#1}
+      {
+        {classic}    { \polyglossia_latin_set_patterns:n {classiclatin} }
+        {liturgical} { \polyglossia_latin_set_patterns:n {liturgicallatin} }
+        {modern}     { \polyglossia_latin_use_modern_patterns: }
+      }
+      {
+        \msg_info:nnn {polyglossia} {latin / hyphenation variant} {#1}
+      }
+      {
+        \msg_warning:nnn {polyglossia} {latin / illegal hyphenation variant} {#1}
+      }
+  }
+
+
+%%%%% Latin captions and date
+
+\def \captionslatin
+  {
+    \def \prefacename
+      {
+        \bool_if:NTF \l_polyglossia_latin_use_digraphs_bool {Præfatio} {Praefatio}
+      }
+    \def \refname {Conspectus~librorum}
+    \def \abstractname {Summarium}
+    \def \bibname {Conspectus~librorum}
+    \def \chaptername {Caput}
+    \def \appendixname {Additamentum}
+    \def \contentsname {Index}
+    \def \listfigurename {Conspectus~descriptionum}
+    \def \listtablename {Conspectus~tabularum}
+    \def \indexname {Index~rerum~notabilium}
+    \def \figurename {Descriptio}
+    \def \tablename {Tabula}
+    \def \partname {Pars}
+    \def \enclname {Additur}
+    \def \ccname {Exemplar}
+    \def \headtoname {\ignorespaces}
+    \def \pagename {charta}
+    \def \seename {cfr.}
+    \def \alsoname {cfr.}
+    \def \proofname {Demonstratio}
+    \def \glossaryname {Glossarium}
+  }
+
+\cs_new:Npn \polyglossia_latin_month_name:
+  {
+    \str_set:Nx \l_tmpa_str
+      {
+        \int_case:nn { \month }
+          {
+            {1} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {januarii} {ianuarii} }
+            {2} {februarii}
+            {3} {martii}
+            {4} {aprilis}
+            {5} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {maji} {maii} }
+            {6} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {junii} {iunii} }
+            {7} { \bool_if:NTF \l_polyglossia_latin_use_j_bool {julii} {iulii} }
+            {8} {augusti}
+            {9} {septembris}
+            {10} {octobris}
+            {11} { \bool_if:NTF \l_polyglossia_latin_use_v_bool {novembris} {nouembris} }
+            {12} {decembris}
+          }
+      }
+    \bool_if:NTF \l_polyglossia_latin_capitalize_month_bool
+      {
+        \tl_mixed_case:n { \l_tmpa_str }
+      }
+      {
+        \str_use:N \l_tmpa_str
+      }
+  }
+
+\def \datelatin
+  {
+    \def \today
+      {
+        \int_to_Roman:n { \day }
+        \c_space_tl
+        \polyglossia_latin_month_name:
+        \c_space_tl
+        \int_to_Roman:n { \year }
+      }
+  }
+
+
+%%%%% Latin shorthands
+
+\define at boolkey{latin}[latin@]{babelshorthands}[true]
+  {
+  }
+
+\define at boolkey{latin}[latin@]{prosodicshorthands}[true]
+  {
+  }
+
 \ifsystem at babelshorthands
   \setkeys{latin}{babelshorthands=true}
 \else
   \setkeys{latin}{babelshorthands=false}
 \fi
-\ifcsundef{initiate at active@char}{%
-\input{babelsh.def}%
-\initiate at active@char{"}%
-\initiate at active@char{'}%
-}{}
-\def\latin at shorthands{%
-  \def\language at group{latin}%
-  \bbl at activate{"}%
-  \declare at shorthand{latin}{"}{\relax
-    \ifmmode
-      \def\xpgla at nextdq{''}%
-    \else
-      \def\xpgla at nextdq{\futurelet\xpgla at temp\xpgla at cwm}%
-    \fi
-  \xpgla at nextdq}%
-  \bbl at activate{'}%
-  \declare at shorthand{latin}{'}{\relax
-    \ifmmode
-      \def\xpgla at nextsq{'}%
-    \else
-      \def\xpgla at nextsq{\futurelet\xpgla at temp@A\xpgla at putacute}%
-    \fi
-  \xpgla at nextsq}%
-}
-\def\xpgla at allowhyphens{\bbl at allowhyphens
-        \discretionary{-}{}{}\bbl at allowhyphens}
-\newcommand*{\xpgla at cwm}{\let\xpgla@@nextdq\relax
-  \ifcat\noexpand\xpgla at temp a%
-    \let\xpgla@@nextdq\xpgla at allowhyphens
-  \else
-    \ifx\xpgla at temp\ae
-        \let\xpgla@@nextdq\xpgla at allowhyphens
-    \else
-        \ifx\xpgla at temp\oe
-           \let\xpgla@@nextdq\xpgla at allowhyphens
+
+\ExplSyntaxOff % babelsh.def does not support expl3 syntax
+\ifcsundef{initiate at active@char}{\input{babelsh.def}}{}
+\ExplSyntaxOn
+
+\initiate at active@char {"}
+\initiate at active@char {'}
+\initiate at active@char {^}
+\initiate at active@char {=}
+
+\shorthandoff {"}
+\shorthandoff {'}
+\shorthandoff {^}
+\shorthandoff {=}
+
+% The active '=' character may cause problems with key=value interfaces.
+% We have to make sure here that no problems can occur outside a Latin
+% prosodic shorthand environment.
+
+\protected at write \@auxout { } { \shorthandoff {=} } % for the aux file
+
+\AtBeginDocument
+  {
+    \str_if_eq:VnTF \xpg at main@language {latin}
+      {
+        \iflatin at prosodicshorthands
         \else
-           \if\noexpand\xpgla at temp\string|%
-              \def\xpgla@@nextdq{\xpgla at allowhyphens\@gobble}%
-           \fi
+          \shorthandoff {=}
         \fi
+      }
+      {
+        % The following command should not be called if the main language
+        % defines a '=' shorthand. However, there are no languages besides
+        % Latin defining such a shorthand in polyglossia.
+        \shorthandoff {=}
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_shorthands:
+  {
+    \def \language at group {latin}
+    \bbl at activate {"}
+    \declare at shorthand {latin} {"}
+      {
+        \mode_if_math:TF
+          {
+            \token_to_str:N "
+          }
+          {
+            \polyglossia_latin_apply_quotemark:N
+          }
+      }
+    \bbl at activate {'}
+    \declare at shorthand {latin} {'}
+      {
+        \mode_if_math:TF
+          {
+            \active at math@prime % defined in "latex.ltx"
+          }
+          {
+            \polyglossia_latin_put_acute:N
+          }
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_prosodic_shorthands:
+  {
+    \def \language at group {latin}
+    % The '=' shorthand is normally turned off to avoid problems with key=value
+    % interfaces. We turn it on here to enable prosodic shorthands.
+    \shorthandon {=}
+    \bbl at activate {=}
+    \declare at shorthand {latin} {=}
+      {
+        \mode_if_math:TF
+          {
+            \token_to_str:N =
+          }
+          {
+            \polyglossia_latin_put_macron:N
+          }
+      }
+    \bbl at activate {^}
+    \declare at shorthand {latin} {^}
+      {
+        \mode_if_math:TF
+          {
+            \token_to_str:N ^
+          }
+          {
+            \polyglossia_latin_put_breve:N
+          }
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_apply_quotemark:N #1
+  {
+    \str_case:nnF {#1}
+      {
+        {A} { \polyglossia_latin_digraph_shorthand:Nnn E { Æ }
+                {
+                  \polyglossia_latin_digraph_shorthand:Nnn e { Æ }
+                    {
+                      \polyglossia_latin_allow_hyphens: A
+                    }
+                }
+            }
+        {a} { \polyglossia_latin_digraph_shorthand:Nnn e { æ }
+                {
+                  \polyglossia_latin_allow_hyphens: a
+                }
+            }
+        {O} { \polyglossia_latin_digraph_shorthand:Nnn E { Π}
+                {
+                  \polyglossia_latin_digraph_shorthand:Nnn e { Π}
+                    {
+                      \polyglossia_latin_allow_hyphens: O
+                    }
+                }
+            }
+        {o} { \polyglossia_latin_digraph_shorthand:Nnn e { œ }
+                {
+                  \polyglossia_latin_allow_hyphens: o
+                }
+            }
+        {|} { \polyglossia_latin_allow_hyphens: }
+        {<} { « }
+        {>} { » }
+      }
+      {
+        \token_if_letter:NTF #1 { \polyglossia_latin_allow_hyphens: #1 }
+          {
+            \token_if_eq_meaning:NNTF #1 \AE { \polyglossia_latin_allow_hyphens: #1 }
+              {
+                \token_if_eq_meaning:NNTF #1 \ae { \polyglossia_latin_allow_hyphens: #1 }
+                  {
+                    \token_if_eq_meaning:NNTF #1 \OE { \polyglossia_latin_allow_hyphens: #1 }
+                      {
+                        \token_if_eq_meaning:NNTF #1 \oe { \polyglossia_latin_allow_hyphens: #1 }
+                          {
+                            \token_to_str:N "
+                            #1
+                          }
+                      }
+                  }
+              }
+          }
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_put_acute:N #1
+  {
+    \str_case:nnF {#1}
+      {
+        {A} { \polyglossia_latin_digraph_shorthand:Nnn E { Ǽ }
+                {
+                  \polyglossia_latin_digraph_shorthand:Nnn e { Ǽ } { Á }
+                }
+            }
+        {a} { \polyglossia_latin_digraph_shorthand:Nnn e { ǽ } { á } }
+        {E} { É }
+        {e} { é }
+        {I} { Í }
+        {i} { í }
+        {O} { \polyglossia_latin_digraph_shorthand:Nnn E { \'Π}
+                {
+                  \polyglossia_latin_digraph_shorthand:Nnn e { \'Œ } { Ó }
+                }
+            }
+        {o} { \polyglossia_latin_digraph_shorthand:Nnn e { \'œ } { ó } }
+        {U} { Ú }
+        {u} { ú }
+        {V} { \' V } % V may be a vowel, but lowercase v is never used as a vowel.
+        {Y} { Ý }
+        {y} { ý }
+        {Æ} { Ǽ }
+        {æ} { ǽ }
+        {Œ} { \'Œ }
+        {œ} { \'œ }
+      }
+      {
+        \token_if_eq_meaning:NNTF #1 \AE { Ǽ }
+          {
+            \token_if_eq_meaning:NNTF #1 \ae { ǽ }
+              {
+                \token_if_eq_meaning:NNTF #1 \OE { \'Π}
+                  {
+                    \token_if_eq_meaning:NNTF #1 \oe { \'œ }
+                      {
+                        \token_to_str:N '
+                        #1
+                      }
+                  }
+              }
+          }
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_put_macron:N #1
+  {
+    \str_case:nnF {#1}
+      {
+        {A} { \polyglossia_latin_diphthong_macron:NNn AE
+                {
+                  \polyglossia_latin_diphthong_macron:NNn Ae
+                    {
+                      \polyglossia_latin_diphthong_macron:NNn AU
+                        {
+                          \polyglossia_latin_diphthong_macron:NNn Au { Ā }
+                        }
+                    }
+                }
+            }
+        {a} { \polyglossia_latin_diphthong_macron:NNn ae
+                {
+                  \polyglossia_latin_diphthong_macron:NNn au { ā }
+                }
+            }
+        {E} { \polyglossia_latin_diphthong_macron:NNn EU
+                {
+                  \polyglossia_latin_diphthong_macron:NNn Eu { Ē }
+                }
+            }
+        {e} { \polyglossia_latin_diphthong_macron:NNn eu { ē } }
+        {I} { Ī }
+        {i} { ī }
+        {O} { \polyglossia_latin_diphthong_macron:NNn OE
+                {
+                  \polyglossia_latin_diphthong_macron:NNn Oe { Ō }
+                }
+            }
+        {o} { \polyglossia_latin_diphthong_macron:NNn oe { ō } }
+        {U} { Ū }
+        {u} { ū }
+        {V} { \= V } % V may be a vowel, but lowercase v is never used as a vowel.
+        {Y} { Ȳ }
+        {y} { ȳ }
+      }
+      {
+        \token_to_str:N =
+        #1
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_put_breve:N #1
+  {
+    \str_case:nnF {#1}
+      {
+        {A} { Ă }
+        {a} { ă }
+        {E} { Ĕ }
+        {e} { ĕ }
+        {I} { Ĭ }
+        {i} { ĭ }
+        {O} { Ŏ }
+        {o} { ŏ }
+        {U} { Ŭ }
+        {u} { ŭ }
+        {V} { \u{V} } % V may be a vowel, but lowercase v is never used as a vowel.
+        {Y} { \u{Y} }
+        {y} { \u{y} }
+      }
+      {
+        \token_to_str:N ^
+        #1
+      }
+  }
+
+
+\cs_new:Npn \polyglossia_latin_allow_hyphens:
+  {
+    \bbl at allowhyphens
+    \discretionary {-} {} {}
+    \bbl at allowhyphens
+  }
+
+\cs_new:Npn \polyglossia_latin_digraph_shorthand:Nnn #1#2#3
+% #1: second letter of digraph (E or e)
+% #2: digraph character
+% #3: non-digraph code
+  {
+    \bool_if:NTF \l_polyglossia_latin_use_digraphs_bool
+      {
+        \peek_meaning_remove:NTF #1 {#2} {#3}
+      }
+      {
+        #3
+      }
+  }
+
+\cs_new:Npn \polyglossia_latin_diphthong_macron:NNn #1#2#3
+% #1: first character of diphthong
+% #2: second character of diphthong
+% #3: non-diphthong code
+  {
+    \peek_meaning:NTF #2 { #1 \char "35E \relax } {#3} % U+35E: combining double macron
+  }
+
+\cs_new:Npn \polyglossia_latin_no_shorthands:
+  {
+    \bbl at deactivate {"}
+    \bbl at deactivate {'}
+    \bbl at deactivate {=}
+    \bbl at deactivate {^}
+    % The active '=' character may cause problems with key=value interfaces.
+    % We have to make sure here that no problems can occur outside a Latin
+    % prosodic shorthand environment.
+    \shorthandoff {=}
+  }
+
+
+%%%%% Further settings
+
+\let \xpgla at savedvalues \empty
+
+\AtEndPreamble
+  {
+    \edef \xpgla at savedvalues
+      {
+        \clubpenalty = \the \clubpenalty \space
+        \@clubpenalty = \the \@clubpenalty \space
+        \widowpenalty = \the \widowpenalty \space
+        \finalhyphendemerits = \the \finalhyphendemerits
+      }
+  }
+
+\def \noextras at latin
+  {
+    \polyglossia_latin_no_shorthands:
+    \xpgla at savedvalues
+    \polyglossia_latin_no_punctuation_spacing:
+    \polyglossia_latin_modern_character_codes:
+  }
+
+\cs_new:Npn \polyglossia_latin_inline_extras:
+  {
+    \bool_if:NF \l_polyglossia_latin_use_v_bool
+      {
+        \polyglossia_latin_classical_character_codes:
+      }
+    \bool_if:NT \l_polyglossia_latin_punctuation_spacing_bool
+      {
+        \polyglossia_latin_punctuation_spacing:
+      }
+    \iflatin at babelshorthands
+      \polyglossia_latin_shorthands:
     \fi
-  \fi
-  \xpgla@@nextdq}%
-\def\xpgla at putacute#1{\let\xpgla at nextsq\relax%
-\if a\xpgla at temp@A
-  æ\kern-0.175em^^^^0301\kern0.175em\xpgla at allowhyphens
-\else
-\if o\xpgla at temp@A
-  œ\kern-0.175em^^^^0301\kern0.175em\xpgla at allowhyphens
-\else
-  \if æ\xpgla at temp@A
-    æ^^^^0301%
-  \else
-    \if œ\xpgla at temp@A
-      œ^^^^0301%
-    \else
-      \string'%
+    \iflatin at prosodicshorthands
+      \polyglossia_latin_prosodic_shorthands:
     \fi
-  \fi
-\fi
-\fi}%
+  }
 
-\def\nolatin at shorthands{%
-  \@ifundefined{initiate at active@char}{}{\bbl at deactivate{"}}%
-  \@ifundefined{initiate at active@char}{}{\bbl at deactivate{'}}%
-}
+\def \blockextras at latin
+  {
+    % The following four values were overtaken from the Italian language module.
+    % It is unclear why they were chosen.
+    \clubpenalty = 3000
+    \@clubpenalty = 3000
+    \widowpenalty = 3000
+    \finalhyphendemerits = 50000000
+    \polyglossia_latin_inline_extras:
+  }
 
-\let\xpgla at savedvalues\empty
-\AtEndPreamble{%
-  \edef\xpgla at savedvalues{%
-    \clubpenalty=\the\clubpenalty\space
-    \@clubpenalty=\the\@clubpenalty\space
-    \widowpenalty=\the\widowpenalty\space
-    \finalhyphendemerits=\the\finalhyphendemerits}
-}
-\def\noextras at latin{%
-   \lccode\string"2019=\z@
-   \nolatin at shorthands
-   \xpgla at savedvalues
-   \noclassicuclccodes
-  \iflatin at ecclesiastic
-    \unless\ifluatex\noecclesiasticlatin at punctuation
-    \let\@makefntext\latin at original@makefntext\fi
-  \fi
-}
+\def \inlineextras at latin
+  {
+    \polyglossia_latin_inline_extras:
+  }
 
-\def\blockextras at latin{%
-   \lccode\string"2019=\string"2019
-   \clubpenalty=3000 \@clubpenalty=3000 \widowpenalty=3000
-   \finalhyphendemerits=50000000
-   \ifclassic\classicuclccodes\fi
-   \iflatin at babelshorthands\latin at shorthands\fi
-   \iflatin at ecclesiastic\unless\ifluatex\ecclesiasticlatin at punctuation
-   \let\@makefntext\latin at ecclesiastic@makefntext\fi
-   \fi
-}
 
-\def\inlineextras at latin{%
-   \lccode\string"2019=\string"2019
-   \ifclassic\classicuclccodes\fi
-   \iflatin at babelshorthands\latin at shorthands\fi
-   \iflatin at ecclesiastic
-      \unless\ifluatex\ecclesiasticlatin at punctuation
-      \let\@makefntext\latin at ecclesiastic@makefntext\fi
-   \fi
-}
+%% Default settings
+
+\polyglossia_latin_modern_settings:
+
+\ExplSyntaxOff
+
 %%   Copyright (C) Claudio Beccari 2013-2016
-%%   Copyright (C) Élie Roux 2016
-%% 
+%%   Copyright (C) Élie Roux 2016-2019
+%%   Copyright (C) Keno Wehr 2019
+%%
 %%   Permission is hereby granted, free of charge, to any person obtaining
 %%   a copy of this software and associated documentation files
 %%   (the "Software"), to deal in the Software without restriction, including
@@ -300,10 +909,10 @@
 %%   distribute, sublicense, and/or sell copies of the Software, and to permit
 %%   persons to whom the Software is furnished to do so, subject to the following
 %%   conditions:
-%% 
+%%
 %%   The above copyright notice and this permission notice shall be included in
 %%   all copies or substantial portions of the Software.
-%% 
+%%
 %%   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 %%   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 %%   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinclassic.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinclassic.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinclassic.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-latinclassic.ldf}[polyglossia: module for classic latin]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{latin}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinclassic.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinecclesiastic.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinecclesiastic.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinecclesiastic.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-latinecclesiastic.ldf}[polyglossia: module for ecclesiastic latin]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{latin}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinecclesiastic.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinmedieval.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinmedieval.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinmedieval.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-latinmedieval.ldf}[polyglossia: module for medieval latin]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{latin}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-latinmedieval.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-lowersorbian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-lowersorbian.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-lowersorbian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-lowersorbian.ldf}[polyglossia: module for lower sorbian]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{sorbian}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-lowersorbian.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -3,18 +3,6 @@
 % We only provide this gloss for babel compatibility. Since lsorbian is 
 % a sorbian variety, we use 'sorbian' with variant 'lower' now.
 
-\input{gloss-sorbian.ldf}
+\xpg at load@master at language{sorbian}
 
-\PolyglossiaSetup{lsorbian}{
-  language=Lower Sorbian,
-  babelname=lowersorbian,
-  hyphennames={lsorbian,lowersorbian,Lsorbian},
-  langtag=LSB,
-  hyphenmins={2,2},
-  fontsetup=true,
-}
-
-\let\captionslsorbian\captionssorbian at lsorbian
-\let\datelsorbian\datesorbian at lsorbian
-
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -2,19 +2,6 @@
 
 % We only provide this gloss for babel compatibility.
 
-\input{gloss-hungarian.ldf}
+\xpg at load@master at language{hungarian}
 
-\PolyglossiaSetup{magyar}{
-  hyphennames={magyar,hungarian},
-  langtag=HUN,
-  hyphenmins={2,2},
-  fontsetup=true,
-}
-
-\let\captionsmagyar\captionshungarian
-\let\datemagyar\datehungarian
-\let\ondatemagyar\ondatehungarian
-\let\blockextras at magyar\blockextras at hungarian
-\let\noextras at magyar\noextras at hungarian
-
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -9,6 +9,13 @@
   hyphenmins={2,2},
   fontsetup=true}
 
+% Babel aliases
+\setlanguagealias[variant=indonesian]{malay}{bahasai}
+\setlanguagealias[variant=malaysian]{malay}{bahasa}
+
+% Backwards compat. alias
+\setlanguagealias[variant=malaysian]{malay}{bahasam}
+
 \providebool{malay at melayu}
 \malay at melayufalse
 \def\malay at variant{malay}

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,6 +1,6 @@
 \ProvidesFile{gloss-mongolian.ldf}[polyglossia: module for mongolian]
 
-\RequirePackage{cyrillicnumbers}
+\RequirePackage{xpg-cyrillicnumbers}
 
 \PolyglossiaSetup{mongolian}{
   script=Cyrillic,

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-naustrian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-naustrian.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-naustrian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-naustrian.ldf}[polyglossia: module for austrian german (current spelling)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{german}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-naustrian.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-newzealand.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-newzealand.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-newzealand.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-newzealand.ldf}[polyglossia: module for newzealand english]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{english}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-newzealand.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-ngerman.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-ngerman.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-ngerman.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-ngerman.ldf}[polyglossia: module for german (current spelling)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{german}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-ngerman.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -3,18 +3,7 @@
 % We only provide this gloss for babel compatibility. Since norsk is 
 % actually norwegian bokmal, we use 'norwegian' with variant 'bokmal' now.
 
-\input{gloss-norwegian.ldf}
+\xpg at load@master at language{norwegian}
 
-\PolyglossiaSetup{norsk}{
-  hyphennames={norsk},
-  hyphenmins={2,2},
-  langtag=NOR,
-  frenchspacing=true,
-  fontsetup=true,
-}
-
-\let\captionsnorsk\captionsnorwegian at norsk
-\let\datenorsk\datenorwegian at norsk
-
 \endinput
 

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -7,6 +7,10 @@
   fontsetup=false,
 }
 
+% Babel and backwards compat. aliases
+\setlanguagealias[variant=bokmal]{norwegian}{norsk}
+\setlanguagealias[variant=nynorsk]{norwegian}{nynorsk}
+
 \def\norwegian at variant{nynorsk}
 \define at choicekey*+{norwegian}{variant}[\val\nr]{nynorsk,bokmal}[nynorsk]{%
    \ifcase\nr\relax

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-nswissgerman.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-nswissgerman.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-nswissgerman.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-nswissgerman.ldf}[polyglossia: module for swiss german (current spelling)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{german}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-nswissgerman.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -3,18 +3,7 @@
 % We only provide this gloss for babel compatibility. Since nynorsk is 
 % a norwegian variety, we use 'norwegian' with variant 'nynorsk' now.
 
-\input{gloss-norwegian.ldf}
+\xpg at load@master at language{norwegian}
 
-\PolyglossiaSetup{nynorsk}{
-  hyphennames={nynorsk},
-  langtag=NYN,
-  hyphenmins={2,2},
-  frenchspacing=true,
-  fontsetup=true,
-}
-
-\let\captionsnorsk\captionsnorwegian at nynorsk
-\let\datenorsk\datenorwegian at nynorsk
-
 \endinput
 

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -20,6 +20,9 @@
   localnumeral=farsinumerals
 }
 
+% Babel and backwards compat. alias
+\setlanguagealias{persian}{farsi}
+
 \newif\if at western@numerals
 \def\tmp at western{western}
 \define at key{persian}{numerals}[eastern]{%

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-polutonikogreek.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-polutonikogreek.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-polutonikogreek.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-polutonikogreek.ldf}[polyglossia: module for polytonic greek]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{greek}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-polutonikogreek.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,4 +1,4 @@
-\ProvidesFile{gloss-portuges.ldf}[polyglossia: module for portuguese (DEPRECATED!)]
+\ProvidesFile{gloss-portuges.ldf}[polyglossia: module for portuguese]
 
 % We only provide this gloss for backwards compatibility. The name
 % 'portuges' was selected in accordance with babel (which probably
@@ -5,21 +5,6 @@
 % introduced it in 8.3 filename times). Since polyglossia uses full
 % English language names, we use 'portuguese' now.
 
-% FIXME: Once we support babel aliases (#112) this gloss can go.
-
-\xpg at warning{The language name 'portuges' is deprectated.\MessageBreak
-             Please use 'portuguese' instead.}
-
-\input{gloss-portuguese.ldf}
-
-\PolyglossiaSetup{portuges}{
-  hyphennames={portuges,portuguese},
-  hyphenmins={2,3},
-  langtag=PTG,
-  fontsetup=true,
-}
-
-\let\captionsportuges\captionsportuguese at portuges
-\let\dateportuges\dateportuguese at portuges
+\xpg at load@master at language{portuguese}
      
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,4 +1,5 @@
 \ProvidesFile{gloss-portuguese.ldf}[polyglossia: module for portuguese]
+
 \PolyglossiaSetup{portuguese}{
   babelname=portuges,
   hyphennames={portuges,portuguese},
@@ -7,11 +8,16 @@
   fontsetup=true,
 }
 
+% Babel aliases
+\setlanguagealias[variant=portuguese]{portuguese}{portuges}
+\setlanguagealias[variant=brazilian]{portuguese}{brazil}
+
 \def\portuguese at variant{portuges}
 \define at choicekey*+{portuguese}{variant}[\val\nr]{portuguese,brazilian}[portuguese]{%
    \ifcase\nr\relax
       % portuguese:
       \def\portuguese at variant{portuges}%
+      \SetLanguageKeys{portuguese}{babelname=portuges}%
    \or
       % brazilian:
       \def\portuguese at variant{brazil}%

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,6 +1,6 @@
 \ProvidesFile{gloss-russian.ldf}[polyglossia: module for russian]
 
-\RequirePackage{cyrillicnumbers}
+\RequirePackage{xpg-cyrillicnumbers}
 
 \PolyglossiaSetup{russian}{
   script=Cyrillic,
@@ -9,6 +9,7 @@
   hyphennames={russian},
   hyphenmins={2,2},
   frenchspacing=true,
+  indentfirst=true,
   fontsetup,
   localnumeral=russiannumerals,
   Localnumeral=Russiannumerals
@@ -36,6 +37,14 @@
       {\cyrillic at numeralsfalse}%
 }
 
+\define at boolkey{russian}[russian@]{indentfirst}{
+   \ifrussian at indentfirst
+      \SetLanguageKeys{russian}{indentfirst=true}
+   \else
+      \SetLanguageKeys{russian}{indentfirst=false}
+  \fi
+}
+
 \define at boolkey{russian}[russian@]{babelshorthands}[false]{}
 
 \setkeys{russian}{spelling,numerals}

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -9,6 +9,10 @@
   fontsetup=true,
 }
 
+% Babel and backwards compat. alias
+\setlanguagealias{sami}{samin}
+%\setlanguagealias[variant=northern]{sami}{samin}
+
 % TODO: Add other Sami varieties
 \def\sami at variant{northern}
 %\define at choicekey*+{sami}{variant}[\val\nr]{northern}[nothern]{%

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -3,17 +3,6 @@
 % We only provide this gloss for babel compatibility. Since samin is 
 % a sami variety, we use 'sami' with variant 'northern' now.
 
-\input{gloss-sami.ldf}
+\xpg at load@master at language{sami}
 
-\PolyglossiaSetup{samin}{
-  hyphennames={samin},
-  hyphenmins={2,2},
-  language={Northern Sami},
-  langtag=NSM,
-  fontsetup=true,
-}
-
-\let\captionssamin\captionssami at nothern
-\let\datesamin\datesami at nothern
-
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -24,6 +24,8 @@
   }%
 }
 
+\define at key{sanskrit}{script}[Devanagari]{\setkeys{sanskrit}{Script=#1}}
+
 \def\fontsetup at sanskrit@Devanagari{%
   \SetLanguageKeys{sanskrit}{scripttag=deva,script=Devanagari}
   \xpg at fontsetup@nonlatin{sanskrit}}
@@ -48,16 +50,20 @@
 
 \setkeys{sanskrit}{Script} %sets the default for Devanagari
 
-\def\tmp at western{Western}
+
 \newif\ifsanskrit at devanagari@numerals
 \sanskrit at devanagari@numeralstrue
+\define at choicekey*+{sanskrit}{numerals}[\val\nr]{Devanagari,Western}[Devanagari]{%
+   \ifcase\nr\relax
+      % Devanagari:
+      \sanskrit at devanagari@numeralstrue%
+   \or
+      % Western:
+      \sanskrit at devanagari@numeralsfalse%
+   \fi
+   \xpg at info{Option: Sanskrit, numerals=\val}%
+}{\xpg at warning{Unknown Sanskrit numeral `#1'}}
 
-\define at key{sanskrit}{numerals}[Devanagari]{%
-  \def\@tmpa{#1}%
-  \ifx\@tmpa\tmp at western
-    \sanskrit at devanagari@numeralsfalse
-  \fi%
-}
 
 \newcommand{\sanskritnumerals}[2]{\sanskritnumber{#2}}
 
@@ -69,34 +75,45 @@
   \fi%
 }
 
-% FIXME: Support LuaTeX
-\ifxetex
-  \newXeTeXintercharclass\sanskrit at punctthin % ! ? ; : danda double_danda
+\ifluatex
+  \directlua{require('polyglossia-sanskrit')}%
+\else
+  \newXeTeXintercharclass\sanskrit at punctthin % ! ? ‼ ⁇ ⁈ ⁉ : ; danda double_danda
 \fi
 
 \def\sanskrit at punctthinspace{{\unskip\thinspace}}
 
 \def\sanskrit at punctuation{%
-  % FIXME: Support LuaTeX
-  \ifxetex
+  \ifluatex
+    \directlua{polyglossia.activate_sanskrit_punct()}%
+  \else
     \XeTeXinterchartokenstate=1%
     \XeTeXcharclass `\! \sanskrit at punctthin
     \XeTeXcharclass `\? \sanskrit at punctthin
+    \XeTeXcharclass `\‼ \sanskrit at punctthin
+    \XeTeXcharclass `\⁇ \sanskrit at punctthin
+    \XeTeXcharclass `\⁈ \sanskrit at punctthin
+    \XeTeXcharclass `\⁉ \sanskrit at punctthin
+    \XeTeXcharclass `\: \sanskrit at punctthin
     \XeTeXcharclass `\; \sanskrit at punctthin
-    \XeTeXcharclass `\: \sanskrit at punctthin
-    \XeTeXcharclass `\। \sanskrit at punctthin
-    \XeTeXcharclass `\॥ \sanskrit at punctthin
+    \XeTeXcharclass `\। \sanskrit at punctthin % danda, U+0964
+    \XeTeXcharclass `\॥ \sanskrit at punctthin % double danda, U+0965
     \XeTeXinterchartoks \z@ \sanskrit at punctthin = \sanskrit at punctthinspace
   \fi
 }
 
 \def\nosanskrit at punctuation{%
-  % FIXME: Support LuaTeX
-  \ifxetex
+  \ifluatex
+    \directlua{polyglossia.deactivate_sanskrit_punct()}%
+  \else
     \XeTeXcharclass `\! \z@
     \XeTeXcharclass `\? \z@
+    \XeTeXcharclass `\‼ \z@
+    \XeTeXcharclass `\⁇ \z@
+    \XeTeXcharclass `\⁈ \z@
+    \XeTeXcharclass `\⁉ \z@
+    \XeTeXcharclass `\: \z@
     \XeTeXcharclass `\; \z@
-    \XeTeXcharclass `\: \z@
     \XeTeXcharclass `\। \z@
     \XeTeXcharclass `\॥ \z@
     \XeTeXinterchartokenstate=0%

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -3,16 +3,6 @@
 % We only provide this gloss for babel compatibility. Since scottish is 
 % a gaelic variety, we use 'gaelic' with variant 'scottish' now.
 
-\input{gloss-gaelic.ldf}
+\xpg at load@master at language{gaelic}
 
-\PolyglossiaSetup{scottish}{
-  hyphennames={scottish},
-  hyphenmins={2,2},
-  langtag=GAE,
-  fontsetup=true,
-}
-
-\let\captionsscottish\captionsgaelic at scottish
-\let\datescottish\dategaelic at scottish
-
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -4,7 +4,7 @@
 %% same thing for all languages that have a "script" key !
 %% BETTER APPROACH: see gloss-sanskrit!
 
-\RequirePackage{cyrillicnumbers}
+\RequirePackage{xpg-cyrillicnumbers}
 
 \PolyglossiaSetup{serbian}{
   langtag=SRB,
@@ -17,25 +17,27 @@
   %TODO localalph
 }
 
+% Babel aliases
+\setlanguagealias[script=Cyrillic]{serbian}{serbianc}
+
 \newif\if at serbian@cyr
+\define at choicekey*+{serbian}{Script}[\val\nr]{cyrillic,latin}[cyrillic]{%
+   \ifcase\nr\relax
+      % cyrillic:
+      \@serbian at cyrtrue
+      \SetLanguageKeys{serbian}{scripttag=cyrl,script=Cyrillic,babelname=serbianc}
+      \xpg at fontsetup@nonlatin{serbian}%
+   \or
+      % latin:
+      \@serbian at cyrfalse
+      \SetLanguageKeys{serbian}{scripttag=latn,script=Latin}
+      \xpg at fontsetup@latin{serbian}%
+      %TODO \def\serbian at language{\language=\l at serbianlat}%
+      % or should we use Croatian patterns as a fallback for the time being???
+   \fi
+   \xpg at info{Option: Serbian, script=\val}%
+}{\xpg at warning{Unknown Serbian script `#1'}}
 
-\define at key{serbian}{Script}[Cyrillic]{%
-  \ifstrequal{#1}{Cyrillic}%
-    {\@serbian at cyrtrue
-     \SetLanguageKeys{serbian}{scripttag=cyrl,script=Cyrillic,babelname=serbianc}
-     \xpg at fontsetup@nonlatin{serbian}%
-    }%
-    {\ifstrequal{#1}{Latin}%
-      {\@serbian at cyrfalse
-       \SetLanguageKeys{serbian}{scripttag=latn,script=Latin}
-       \xpg at fontsetup@latin{serbian}%
-       %TODO \def\serbian at language{\language=\l at serbianlat}%
-       % or should we use Croatian patterns as a fallback for the time being???
-      }%
-      {\xpg at error{Unknown script `#1' for Serbian language\MessageBreak
-      Valid values are "Cyrillic" and "Latin"}}%
-    }%
-}
 \define at key{serbian}{script}[Cyrillic]{\setkeys{serbian}{Script=#1}}
 
 \newif\ifserbian at numerals

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-serbianc.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-serbianc.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-serbianc.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-serbianc.ldf}[polyglossia: module for serbian (cyrillic)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{serbian}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-serbianc.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -7,6 +7,176 @@
   fontsetup=true,
 }
 
+\ifluatex
+  \RequirePackage{luavlna}
+\fi
+
+\define at boolkey{slovak}[slovak@]{babelshorthands}[true]{}
+
+\define at boolkey{slovak}[slovak@]{splithyphens}[true]{}
+
+\define at boolkey{slovak}[slovak@]{vlna}[true]{}
+
+\setkeys{slovak}{splithyphens,vlna}
+
+\ifsystem at babelshorthands
+  \setkeys{slovak}{babelshorthands=true}
+\else
+  \setkeys{slovak}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate at active@char}{%
+  \input{babelsh.def}%
+  \initiate at active@char{"}%
+  \shorthandoff{"}%
+}{}
+
+\def\slovak@@splhyphen#1{%
+  \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
+  \nobreak\hskip\z@%
+}
+
+\def\slovak at splhyphen{%
+  \slovak@@splhyphen{-}%
+}
+
+\def\slovak at shorthands{%
+  \bbl at activate{"}%
+  \def\language at group{slovak}%
+  \declare at shorthand{slovak}{"=}{\slovak at splhyphen}%
+  \declare at shorthand{slovak}{""}{\hskip\z at skip}%
+  \declare at shorthand{slovak}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
+  \declare at shorthand{slovak}{"-}{\nobreak\-\bbl at allowhyphens}%
+  \declare at shorthand{slovak}{"|}{%
+      \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
+      \bbl at allowhyphens}{}%
+  }%
+  \declare at shorthand{slovak}{"/}{\textormath
+    {\bbl at allowhyphens\discretionary{/}{}{/}\bbl at allowhyphens}{}}%
+  \declare at shorthand{slovak}{"`}{„}%
+  \declare at shorthand{slovak}{"'}{“}%
+  \declare at shorthand{slovak}{"<}{«}%
+  \declare at shorthand{slovak}{">}{»}%
+}
+
+\def\noslovak at shorthands{%
+  \@ifundefined{initiate at active@char}{}{\bbl at deactivate{"}}%
+}
+
+\ifxetex
+  % splithyphens
+  \newXeTeXintercharclass\slovak at hyphen % -
+  % vlna
+  \newXeTeXintercharclass\slovak at openpunctuation
+  \newXeTeXintercharclass\slovak at nonsyllabicpreposition
+  \ifdefined\e at alloc@intercharclass at top
+    \chardef\slovak at boundary=\e at alloc@intercharclass at top
+  \else
+    \ifdefined\XeTeXinterwordspaceshaping
+      \chardef\slovak at boundary=4095 %
+      \def\newXeTeXintercharclass{%
+        \e at alloc\XeTeXcharclass\chardef
+              \xe at alloc@intercharclass\m at ne\@ucharclass at boundary}
+    \else
+      \chardef\slovak at boundary=255
+    \fi
+  \fi
+\fi
+
+\def\slovak at hyphens{%
+    \ifluatex
+      \AfterPreamble{\enablesplithyphens{slovak}}%
+    \else
+      \XeTeXinterchartokenstate=1
+      \XeTeXcharclass `\- \slovak at hyphen
+      \XeTeXinterchartoks \z@ \slovak at hyphen = {\slovak@@splhyphen}% "-" -> "\slovak@@splhyphen-"
+      % necessary if used together with vlna:
+      \XeTeXinterchartoks \slovak at nonsyllabicpreposition \slovak at hyphen = {\slovak@@splhyphen}% "-" -> "\slovak@@splhyphen-"
+    \fi%
+}
+
+\def\noslovak at hyphens{%
+    \ifluatex
+      \AfterPreamble{\disablesplithyphens{slovak}}%
+    \else
+      \XeTeXcharclass `\- \z@
+    \fi%
+}
+
+% Add nonbreakable space after single-letter word to
+% prevent them to land at the end of a line
+\def\slovak at vlna{%
+    \ifluatex
+       \preventsingleon
+    \else
+        % Code taken and adapted from xevlna.sty
+        \XeTeXinterchartokenstate=1
+        \XeTeXcharclass `\( \slovak at openpunctuation
+        \XeTeXcharclass `\[ \slovak at openpunctuation
+        \XeTeXcharclass `\„ \slovak at openpunctuation
+        \XeTeXcharclass `\» \slovak at openpunctuation
+        \XeTeXcharclass `\K \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\k \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\S \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\s \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\V \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\v \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\Z \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\z \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\O \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\o \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\U \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\u \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\A \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\a \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\I \slovak at nonsyllabicpreposition
+        \XeTeXcharclass `\i \slovak at nonsyllabicpreposition
+        \XeTeXinterchartoks \slovak at boundary \slovak at nonsyllabicpreposition {\slovak at interchartoks}
+        \XeTeXinterchartoks \slovak at openpunctuation \slovak at nonsyllabicpreposition {\slovak at interchartoks}
+        \def\slovak at nointerchartoks{\let\slovak at interchartoks\slovak at PreCSpreposition}
+        \def\slovak at PreCSpreposition{\def\next{}%
+           \ifnum\catcode`\ =10 % nothing will be done in verbatim
+           \ifmmode % nothing in math
+           \else
+              \let\slovak at interchartoks\slovak at nointerchartoks
+              \let\next\slovak at ExamineCSpreposition
+           \fi \fi
+          \next%
+        }
+        \def\slovak at ExamineCSpreposition ##1{##1\futurelet\next\slovak at ProcessCSpreposition}
+        \def\slovak at ProcessCSpreposition{\ifx\next\slovak at XeTeXspace\nobreak\fi}
+        \futurelet\slovak at XeTeXspace{ }\slovak at nointerchartoks
+    \fi
+}
+
+\def\noslovak at vlna{%
+    \ifluatex
+        \preventsingleoff
+    \else
+        \XeTeXcharclass`\(\z@
+        \XeTeXcharclass`\[\z@
+        \XeTeXcharclass`\„\z@
+        \XeTeXcharclass`\»\z@
+        \XeTeXcharclass`\K\z@
+        \XeTeXcharclass`\k\z@
+        \XeTeXcharclass`\S\z@
+        \XeTeXcharclass`\s\z@
+        \XeTeXcharclass`\V\z@
+        \XeTeXcharclass`\v\z@
+        \XeTeXcharclass`\Z\z@
+        \XeTeXcharclass`\z\z@
+        \XeTeXcharclass`\O\z@
+        \XeTeXcharclass`\o\z@
+        \XeTeXcharclass`\U\z@
+        \XeTeXcharclass`\u\z@
+        \XeTeXcharclass`\A\z@
+        \XeTeXcharclass`\a\z@
+        \XeTeXcharclass`\I\z@
+        \XeTeXcharclass`\i\z@
+    \fi
+}
+
+
 \def\captionsslovak{%
    \def\refname{Referencie}%
    \def\abstractname{Abstrakt}%
@@ -30,7 +200,7 @@
    \def\headtoname{Pre}% was komu
    \def\proofname{Dôkaz}%
    \def\glossaryname{Slovník}%
-   }
+}
 
 \def\dateslovak{%   
   \def\today{\number\day.~\ifcase\month\or
@@ -38,6 +208,25 @@
     júna\or júla\or augusta\or septembra\or októbra\or
     novembra\or decembra\fi
     \space \number\year}%
-  }
+}
 
+\def\noextras at slovak{%
+  \noslovak at shorthands%
+  \noslovak at hyphens%
+  \noslovak at vlna%
+  \ifxetex\XeTeXinterchartokenstate=0\fi%
+}
+
+\def\blockextras at slovak{%
+  \ifslovak at babelshorthands\slovak at shorthands\fi%
+  \ifslovak at vlna\slovak at vlna\else\noslovak at vlna\fi%
+  \ifslovak at splithyphens\slovak at hyphens\else\noslovak at hyhens\fi%
+}
+
+\def\inlineextras at slovak{%
+  \ifslovak at babelshorthands\slovak at shorthands\fi%
+  \ifslovak at vlna\slovak at vlna\else\noslovak at vlna\fi%
+  \ifslovak at splithyphens\slovak at hyphens\else\noslovak at hyhens\fi%
+}
+
 \endinput

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovene.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovene.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovene.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-slovene.ldf}[polyglossia: module for slovenian]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{slovenian}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovene.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -8,6 +8,9 @@
   fontsetup=true,
 }
 
+% Babel aliases
+\setlanguagealias{slovenian}{slovene}
+
 \providebool{slovenian at localalph}
 \define at boolkey{slovenian}[slovenian@]{localalph}[false]{%
   \def\@tmpa{#1}%

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -9,6 +9,14 @@
   fontsetup=true,
 }
 
+% Backwards compat. aliases
+\setlanguagealias[variant=lower]{sorbian}{lsorbian}
+\setlanguagealias[variant=upper]{sorbian}{usorbian}
+
+% Babel aliases
+\setlanguagealias[variant=lower]{sorbian}{lowersorbian}
+\setlanguagealias[variant=upper]{sorbian}{uppersorbian}
+
 \def\sorbian at variant{usorbian}
 \define at choicekey*+{sorbian}{variant}[\val\nr]{upper,lower}[upper]{%
    \ifcase\nr\relax

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,4 +1,5 @@
 \ProvidesFile{gloss-spanish.ldf}[polyglossia: module for spanish]
+
 \PolyglossiaSetup{spanish}{
   hyphennames={spanish},
   hyphenmins={2,2},
@@ -6,8 +7,154 @@
   frenchspacing=true,
   indentfirst=true,
   fontsetup=true,
+  babelname=spanish
 }
 
+% Babel aliases
+\setlanguagealias[variant=mexican]{spanish}{spanishmx}
+
+\newif\if at spanish@mexico
+\@spanish at mexicofalse
+\define at choicekey*+{spanish}{variant}[\val\nr]{spanish,mexican}[spanish]{%
+   \ifcase\nr\relax
+      % spanish:
+      \@spanish at mexicofalse%
+      \SetLanguageKeys{spanish}{babelname=spanish}%
+   \or
+      % mexican:
+      \@spanish at mexicotrue%
+      \SetLanguageKeys{spanish}{babelname=spanishmx}%
+   \fi
+   \xpg at info{Option: spanish, variant=\val}%
+}{\xpg at warning{Unknown spanish variant `#1'}}
+
+% Localized math operators à la babel
+\newif\ifspanish at accentedoperators
+\newif\ifspanish at spacedoperators
+\newif\ifspanish at locoperators
+
+\define at choicekey*+{spanish}{spanishoperators}[\val\nr]{all,accented,spaced,none}[all]{%
+   \ifcase\nr\relax
+      % all:
+      \spanish at locoperatorstrue%
+      \spanish at accentedoperatorstrue%
+      \spanish at spacedoperatorstrue%
+   \or
+      % accented:
+      \spanish at locoperatorsfalse%
+      \spanish at accentedoperatorstrue%
+      \spanish at spacedoperatorsfalse%
+   \or
+      % spaced:
+      \spanish at locoperatorsfalse%
+      \spanish at accentedoperatorsfalse%
+      \spanish at spacedoperatorstrue%
+   \or
+      % none:
+      \spanish at locoperatorsfalse%
+      \spanish at accentedoperatorsfalse%
+      \spanish at spacedoperatorsfalse%
+   \fi
+   \xpg at info{Option: Spanish, spanishoperators=\val}%
+}{\xpg at warning{Unknown spanishoperators value `#1'}}
+
+\let\xpg at save@lim\lim
+\let\xpg at save@limsup\limsup
+\let\xpg at save@liminf\liminf
+\let\xpg at save@max\max
+\let\xpg at save@min\min
+\let\xpg at save@inf\inf
+\let\xpg at save@bmod\bmod
+\let\xpg at save@pmod\pmod
+
+\def\spanish at accentedoperators{%
+  \DeclareRobustCommand\lim{\mathop{\operator at font lím}}%
+  \DeclareRobustCommand\limsup{\mathop{\operator at font lím\,sup}}%
+  \DeclareRobustCommand\liminf{\mathop{\operator at font lím\,inf}}%
+  \DeclareRobustCommand\max{\mathop{\operator at font máx}}%
+  \DeclareRobustCommand\min{\mathop{\operator at font mín}}%
+  \DeclareRobustCommand\inf{\mathop{\operator at font ínf}}%
+  \DeclareRobustCommand\bmod{%
+    \nonscript\mskip-\medmuskip\mkern5mu%
+    \mathbin{\operator at font mód}\penalty900\mkern5mu%
+    \nonscript\mskip-\medmuskip}%
+  \@ifundefined{@amsmath at err}%
+    {\DeclareRobustCommand\pmod[1]{%
+       \allowbreak\mkern18mu({\operator at font mód}\,\,##1)}}%
+    {\let\xpg at save@mod\mod
+     \DeclareRobustCommand\mod[1]{\allowbreak\if at display\mkern18mu
+        \else\mkern12mu\fi{\operator at font mód}\,\,##1}%
+     \DeclareRobustCommand\pmod[1]{\pod{{\operator at font mód}%
+        \mkern6mu##1}}}%
+}
+
+\def\nospanish at accentedoperators{%
+  \let\lim\xpg at save@lim%
+  \let\limsup\xpg at save@limsup%
+  \let\liminf\xpg at save@liminf%
+  \let\max\xpg at save@max%
+  \let\min\xpg at save@min%
+  \let\inf\xpg at save@inf%
+  \let\bmod\xpg at save@bmod%
+  \let\pmod\xpg at save@pmod%
+  \@ifundefined{@amsmath at err}{}{\let\mod\xpg at save@mod}%
+}
+
+\let\xpg at save@arccos\arccos
+\let\xpg at save@arcsin\arcsin
+\let\xpg at save@arctan\arctan
+\let\arcsen\arcsin
+\let\arctg\arctan
+
+
+\def\spanish at spacedoperators{%
+  \DeclareRobustCommand\arccos{\mathop{\operator at font arc\,cos}\nolimits}%
+  \DeclareRobustCommand\arcsin{\mathop{\operator at font arc\,sen}\nolimits}%
+  \DeclareRobustCommand\arctan{\mathop{\operator at font arc\,tg}\nolimits}%
+}
+
+\def\nospanish at spacedoperators{%
+  \let\arccos\xpg at save@arccos%
+  \let\arcsen\arcsin%
+  \let\arctg\arctan%
+}
+
+
+\let\xpg at save@sin\sin
+\let\xpg at save@tan\tan
+\let\xpg at save@sinh\sinh
+\let\xpg at save@tanh\tanh
+\let\sen\sin
+\let\tg\tan
+\let\senh\sinh
+\let\tgh\tanh
+
+\def\spanish at locoperators{%
+  \DeclareRobustCommand\sin{\mathop{\operator at font sen}\nolimits}%
+  \DeclareRobustCommand\tan{\mathop{\operator at font tg}\nolimits}%
+  \DeclareRobustCommand\sinh{\mathop{\operator at font senh}\nolimits}%
+  \DeclareRobustCommand\tanh{\mathop{\operator at font tgh}\nolimits}%
+}
+
+\def\nospanish at locoperators{%
+  \let\sen\xpg at save@sin%
+  \let\tg\xpg at save@tan%
+  \let\sinh\xpg at save@sinh%
+  \let\tanh\xpg at save@tanh%
+  \let\sen\relax%
+  \let\tg\relax%
+  \let\senh\relax%
+  \let\tgh\relax%
+}
+
+\newcommand*\spanishoperator[2][]{%
+  \ifx#1\\\\
+    \protected at csxdef{#2}{\mathop{\operator at font #2}\nolimits}%
+  \else
+    \protected at csxdef{#2}{\mathop{\operator at font #1}\nolimits}%
+  \fi
+}
+
 \def\captionsspanish{%
   \def\prefacename{Prefacio}%
   \def\refname{Referencias}%
@@ -30,13 +177,38 @@
   \def\alsoname{véase también}%
   \def\proofname{Prueba}%
   \def\glossaryname{Glosario}%
-  }
+  \if at spanish@mexico
+    \captionsspanish at mexico%
+  \fi%
+}
 
+\def\captionsspanish at mexico{%
+  \def\tablename{Tabla}%
+}
+
 \def\datespanish{%
   \def\today{\number\day~de~\ifcase\month\or
     enero\or febrero\or marzo\or abril\or mayo\or junio\or
     julio\or agosto\or septiembre\or octubre\or noviembre\or
     diciembre\fi\space de~\number\year}%
-  }
+}
 
+\def\noextras at spanish{%
+  \nospanish at accentedoperators%
+  \nospanish at spacedoperators%
+  \nospanish at locoperators%
+}
+
+\def\blockextras at spanish{%
+  \ifspanish at accentedoperators\spanish at accentedoperators\fi%
+  \ifspanish at spacedoperators\spanish at spacedoperators\fi%
+  \ifspanish at locoperators\spanish at locoperators\fi%
+}
+
+\def\inlineextras at spanish{%
+  \ifspanish at accentedoperators\spanish at accentedoperators\fi%
+  \ifspanish at spacedoperators\spanish at spacedoperators\fi%
+  \ifspanish at locoperators\spanish at locoperators\fi%
+}
+
 \endinput

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-spanishmx.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-spanishmx.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-spanishmx.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-spanishmx.ldf}[polyglossia: module for mexican spanish]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{spanish}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-spanishmx.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-swissgerman.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-swissgerman.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-swissgerman.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-swissgerman.ldf}[polyglossia: module for swiss german (old spelling)]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{german}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-swissgerman.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-uppersorbian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-uppersorbian.ldf	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-uppersorbian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,7 @@
+\ProvidesFile{gloss-uppersorbian.ldf}[polyglossia: module for upper sorbian]
+
+% We provide this as a babel alias
+
+\xpg at load@master at language{sorbian}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-uppersorbian.ldf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf	2019-11-15 21:41:34 UTC (rev 52808)
@@ -3,18 +3,6 @@
 % We only provide this gloss for babel compatibility. Since usorbian is 
 % a sorbian variety, we use 'sorbian' with variant 'upper' now.
 
-\input{gloss-sorbian.ldf}
+\xpg at load@master at language{sorbian}
 
-\PolyglossiaSetup{usorbian}{
-  language=Upper Sorbian,
-  babelname=uppersorbian,
-  hyphennames={usorbian,uppersorbian},
-  hyphenmins={2,2},
-  langtag=USB,
-  fontsetup=true,
-}
-
-\let\captionsusorbian\captionssorbian at usorbian
-\let\dateusorbian\datesorbian at usorbian
-
 \endinput

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-french.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-french.lua	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-french.lua	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,52 @@
+require('polyglossia-punct')
+
+local function set_left_space(lang, char, kern, rubber)
+    polyglossia.add_left_spaced_character(lang, char, kern, "space", rubber)
+end
+
+local function set_right_space(lang, char, kern, rubber)
+    polyglossia.add_right_spaced_character(lang, char, kern, "space", rubber)
+end
+
+local function activate_french_punct(thincolonspace, autospaceguillemets)
+    -- We need different language tags here to make switching of options possible
+    -- within a paragraph.
+    local lang = "french"
+    if thincolonspace then
+        lang = lang.."-thincolon"
+    end
+    if autospaceguillemets then
+        lang = lang.."-autospace"
+    end
+
+    polyglossia.activate_punct(lang)
+    polyglossia.clear_spaced_characters(lang)
+
+    if thincolonspace then
+        set_left_space(lang, ':', 0.5)
+    else
+        set_left_space(lang, ':', 1, true) -- stretchable and shrinkable space
+    end
+
+    set_left_space(lang, '!', 0.5)
+    set_left_space(lang, '?', 0.5)
+    set_left_space(lang, ';', 0.5)
+    set_left_space(lang, '‼', 0.5)
+    set_left_space(lang, '⁇', 0.5)
+    set_left_space(lang, '⁈', 0.5)
+    set_left_space(lang, '⁉', 0.5)
+
+    if autospaceguillemets then
+        set_left_space(lang, '»', 0.5)
+        set_left_space(lang, '›', 0.5)
+        set_right_space(lang, '«', 0.5)
+        set_right_space(lang, '‹', 0.5)
+    end
+end
+
+local function deactivate_french_punct()
+    polyglossia.deactivate_punct()
+end
+
+polyglossia.activate_french_punct   = activate_french_punct
+polyglossia.deactivate_french_punct = deactivate_french_punct


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-french.lua
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-frpt.lua	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,224 +0,0 @@
-require('polyglossia') -- just in case...
-
-local add_to_callback = luatexbase.add_to_callback
-local remove_from_callback = luatexbase.remove_from_callback
-local priority_in_callback = luatexbase.priority_in_callback
-
-local get_quad = luaotfload.aux.get_quad -- needs luaotfload > 20130516
-
-local next, type = next, type
-
-local nodes, fonts, node = nodes, fonts, node
-
-local nodecodes          = nodes.nodecodes
-
-local insert_node_before = node.insert_before
-local insert_node_after  = node.insert_after
-local remove_node        = node.remove
-local has_attribute      = node.has_attribute
-local node_copy          = node.copy
-local new_node           = node.new
-
-local math_code          = nodecodes.math
-local end_of_math        = node.end_of_math
-if not end_of_math then -- luatex < .76
-  local traverse_nodes = node.traverse_id
-  local end_of_math = function (n)
-    for n in traverse_nodes(math_code, n.next) do
-      return n
-    end
-  end
-end
-
--- node types according to node.types()
-local glue_code         = nodecodes.glue
-local glue_spec_code    = nodecodes.glue_spec
-local glyph_code        = nodecodes.glyph
-local penalty_code      = nodecodes.penalty
-local kern_code         = nodecodes.kern
-
--- we make a new node, so that we can copy it later on
-local penalty_node   = new_node(penalty_code)
-penalty_node.penalty = 10000
-
-local function get_penalty_node()
-  return node_copy(penalty_node)
-end
-
--- same for glue node
-local kern_node       = new_node(kern_code)
-
-local function get_kern_node(dim)
-  local n = node_copy(kern_node)
-  n.kern = dim
-  return n
-end
-
--- we have here all possible space characters, referenced by their
--- unicode slot number, taken from char-def.lua
-local space_chars = {[32]=1, [160]=1, [5760]=1, [6158]=1, [8192]=1, [8193]=1, [8194]=1, [8195]=1, 
-  [8196]=1, [8197]=1, [8198]=1, [8199]=1, [8200]=1, [8201]=1, [8202]=1, [8239]=1, [8287]=1, [12288]=1}
-
--- from nodes-tst.lua, adapted
-local function somespace(n,all)
-    if n then
-        local id = n.id
-        if id == glue_code then
-            return (all or (n.spec.width ~= 0)) and glue_code
-        elseif id == kern_code then
-            return (all or (n.kern ~= 0)) and kern_code
-        elseif id == glyph_code then
-            if space_chars[n.char] then
-                return true
-            else
-                return false
-            end
-        end
-    end
-    return false
-end
-
--- idem
-local function somepenalty(n,value)
-    if n then
-        local id = n.id
-        if id == penalty_code then
-            if value then
-                return n.penalty == value
-            else
-                return true
-            end
-        end
-    end
-    return false
-end
-
-local xpgfrptattr = luatexbase.attributes['xpg at frpt']
-
-local left=1
-local right=2
-local byte = unicode.utf8.byte
-
--- Now there is a good question: how do we now, in lua, what a \thinspace is?
--- In the LaTeX source (ltspace.dtx) it is defined as:
--- \def\thinspace{\kern .16667em }. I see no way of seeing if it has been
--- overriden or not... So we stick to this value.
-local thinspace  = 0.16667 
--- thickspace is defined in amsmath.sty as:
--- \renewcommand{\;}{\mspace+\thickmuskip{.2777em}}. Same problem as above, we
--- stick to this fixed value.
-local thickspace = 0.2777 -- 5/18
-
-local mappings =  {
- [byte(':')] = {left,  thickspace}, --really?
- [byte('!')] = {left,  thinspace},
- [byte('?')] = {left,  thinspace},
- [byte(';')] = {left,  thinspace},
- [byte('‼')] = {left,  thinspace},
- [byte('⁇')] = {left,  thinspace},
- [byte('⁈')] = {left,  thinspace},
- [byte('⁉')] = {left,  thinspace},
- [byte('»')] = {left,  thinspace},
- [byte('›')] = {left,  thinspace},
- [byte('«')] = {right, thinspace}, 
- [byte('‹')] = {right, thinspace}, 
- }
-
-local function set_spacings(thinsp, thicksp)
-  for _, m in pairs(mappings) do
-    if m[2] == thinspace then
-      m[2] = thinsp
-    elseif m[2] == thickspace then
-      m[2] = thicksp
-    end
-  end
-  thickspace = thicksp
-  thinspace = thinsp
-end
-
--- from typo-spa.lua
-local function process(head)
-    local done = false
-    local start = head
-    -- head is always begin of par (whatsit), so we have at least two prev nodes
-    -- penalty followed by glue
-    while start do
-        local id = start.id
-        if id == glyph_code then
-            local attr = has_attribute(start, xpgfrptattr)
-            if attr and attr > 0 then
-                local char = start.char
-                local map = mappings[char]
-                --node.unset_attribute(start, xpgfrptattr) -- needed?
-                if map then
-                    local quad = get_quad(start.font) -- might be optimized
-                    local prev = start.prev
-                    if map[1] == left and prev then
-                        local prevprev = prev.prev
-                        local somespace = somespace(prev,true)
-                        -- TODO: there is a question here: do we override a preceding space or not?...
-                        if somespace then
-                            local somepenalty = somepenalty(prevprev,10000)
-                            if somepenalty then
-                                head = remove_node(head,prev)
-                                head = remove_node(head,prevprev)
-                            else
-                                head = remove_node(head,prev)
-                            end
-                        end
-                        insert_node_before(head,start,get_penalty_node())
-                        insert_node_before(head,start,get_kern_node(map[2]*quad))
-                        done = true
-                    end
-                    local next = start.next
-                    if map[1] == right and next then
-                        local nextnext = next.next
-                        local somepenalty = somepenalty(next,10000)
-                        if somepenalty then
-                            local somespace = somespace(nextnext,true)
-                            if somespace then
-                                head = remove_node(head,next)
-                                head = remove_node(head,nextnext)
-                            end
-                        else
-                            local somespace = somespace(next,true)
-                            if somespace then
-                                head = remove_node(head,next)
-                            end
-                        end
-                        insert_node_after(head,start,get_kern_node(map[2]*quad))
-                        insert_node_after(head,start,get_penalty_node())
-                        done = true
-                    end
-                end
-            end
-        elseif id == math_code then
-            -- warning: this is a feature of luatex > 0.76
-            start = end_of_math(start) -- weird, can return nil .. no math end?
-        end
-        if start then
-            start = start.next
-        end
-    end
-    return head, done
-end
-
-local callback_name = "pre_linebreak_filter"
-
-local function activate()
-  if not priority_in_callback (callback_name, "polyglossia-frpt.process") then
-    add_to_callback(callback_name, process, "polyglossia-frpt.process", 1)
-  end
-end
-
-local function desactivate()
-  if priority_in_callback (callback_name, "polyglossia-frpt.process") then
-    remove_from_callback(callback_name, "polyglossia-frpt.process")
-  end
-end
-
-polyglossia.activate_frpt    = activate
-polyglossia.desactivate_frpt = desactivate
-polyglossia.set_spacings     = set_spacings
-polyglossia.thinspace        = thinspace
-polyglossia.thickspace       = thickpace

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-latin.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-latin.lua	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-latin.lua	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,31 @@
+require('polyglossia-punct')
+
+-- For ecclesiastic Latin (and sometimes for Italian) a very small space is
+-- used for the punctuation. The ecclesiastic package uses a space of
+-- 0.3\fontdimen2, where \fontdimen2 is a interword space, which is typically
+-- between 1/4 and 1/3 of a quad. We choose a half of a \thinspace here.
+local hairspace = 0.08333 -- 1/12
+
+local function activate_latin_punct()
+    polyglossia.activate_punct('latin')
+    polyglossia.clear_spaced_characters('latin')
+    polyglossia.add_left_spaced_character('latin',':',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','!',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','?',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin',';',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','‼',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','⁇',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','⁈',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','⁉',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','»',hairspace,'quad')
+    polyglossia.add_left_spaced_character('latin','›',hairspace,'quad')
+    polyglossia.add_right_spaced_character('latin','«',hairspace,'quad')
+    polyglossia.add_right_spaced_character('latin','‹',hairspace,'quad')
+end
+
+local function deactivate_latin_punct()
+    polyglossia.deactivate_punct()
+end
+
+polyglossia.activate_latin_punct   = activate_latin_punct
+polyglossia.deactivate_latin_punct = deactivate_latin_punct


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-latin.lua
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,305 @@
+require('polyglossia') -- just in case...
+
+local add_to_callback      = luatexbase.add_to_callback
+local remove_from_callback = luatexbase.remove_from_callback
+local priority_in_callback = luatexbase.priority_in_callback
+local new_attribute        = luatexbase.new_attribute
+
+local node = node
+
+local insert_node_before = node.insert_before
+local insert_node_after  = node.insert_after
+local remove_node        = node.remove
+local has_attribute      = node.has_attribute
+local node_copy          = node.copy
+local new_node           = node.new
+local end_of_math        = node.end_of_math
+local getnext            = node.getnext
+local getprev            = node.getprev
+
+-- node types according to node.types()
+local glue_code    = node.id"glue"
+local glyph_code   = node.id"glyph"
+local penalty_code = node.id"penalty"
+local kern_code    = node.id"kern"
+local math_code    = node.id"math"
+
+-- we need some node subtypes
+local userkern = 1
+local userskip = 0
+local removable_skip = {
+    [0]  = true, -- userskip
+    [13] = true, -- spaceskip
+    [14] = true, -- xspaceskip
+}
+
+-- we make a new node, so that we can copy it later on
+local kern_node = new_node(kern_code)
+kern_node.subtype = userkern -- this kern can be removed later on
+
+local function get_kern_node(dim)
+    local n = node_copy(kern_node)
+    n.kern = dim
+    return n
+end
+
+local glue_node = new_node(glue_code)
+glue_node.subtype = userskip
+
+local function get_glue_node(dim, stretch, shrink)
+    local n   = node_copy(glue_node)
+    n.width   = dim
+    n.stretch = stretch
+    n.shrink  = shrink
+    return n
+end
+
+local penalty_node   = new_node(penalty_code)
+penalty_node.penalty = 10000
+
+local function get_penalty_node()
+    return node_copy(penalty_node)
+end
+
+-- we have here all possible space characters, referenced by their unicode slot
+-- number, taken from char-def.lua
+local space_chars = {[32] = true, [160] = true, [5760] = true, [6158] = true,
+    [8192] = true, [8193] = true, [8194] = true, [8195] = true, [8196] = true,
+    [8197] = true, [8198] = true, [8199] = true, [8200] = true, [8201] = true,
+    [8202] = true, [8239] = true, [8287] = true, [12288] = true}
+
+-- from nodes-tst.lua, adapted
+local function somespace(n)
+    if n then
+        local id, subtype = n.id, n.subtype
+        if id == glue_code then
+            -- it is dangerous to remove all the type of glue
+            return removable_skip[subtype]
+        elseif id == kern_code then
+            -- remove only user's kern
+            return subtype == userkern
+        elseif id == glyph_code then
+            return space_chars[n.char]
+        end
+    end
+end
+
+-- we have here all left bracket characters, referenced by their unicode slot
+local left_bracket_chars = {[40] = true, [123] = true, [91] = true, [10216] = true}
+
+local function someleftbracket(n)
+    if n then
+        local id = n.id
+        if id == glyph_code then
+            return left_bracket_chars[n.char]
+        end
+    end
+end
+
+-- we have here all right bracket characters, referenced by their unicode slot
+local right_bracket_chars = {[41] = true, [125] = true, [93] = true, [10217] = true}
+
+local function somerightbracket(n)
+    if n then
+        local id = n.id
+        if id == glyph_code then
+            return right_bracket_chars[n.char]
+        end
+    end
+end
+
+-- idem
+local function somepenalty(n, value)
+    if n then
+        local id = n.id
+        if id == penalty_code then
+            if value then
+                return n.penalty == value
+            else
+                return true
+            end
+        end
+    end
+end
+
+local punct_attr = new_attribute("polyglossia_punct")
+
+local lang_id      = {}
+local lang_counter = 0
+local left_space   = {}
+local right_space  = {}
+
+local function ensure_lang_id(lang)
+    if not lang_id[lang] then
+        lang_counter = lang_counter + 1
+        lang_id[lang] = lang_counter
+    end
+    return lang_id[lang]
+end
+
+local function clear_spaced_characters(lang)
+    local id = ensure_lang_id(lang)
+    left_space[id]  = {}
+    right_space[id] = {}
+end
+
+local function illegal_unit(unit)
+    if unit then
+        texio.write_nl('Illegal spacing unit "'..unit..'".')
+    else
+        texio.write_nl('Spacing unit is a nil value.')
+    end
+end
+
+local function add_left_spaced_character(lang, char, kern, unit, rubber)
+-- The parameter kern is a number meant as a fraction of the unit.
+-- The unit can be "quad" (1em) or "space" (interword space).
+-- The parameter rubber is a Boolean value indicating if the inserted space is
+-- stretchable and shrinkable (only relevant if the unit is "space").
+    local id = ensure_lang_id(lang)
+    if unit == "quad" or unit == "space" then
+        left_space[id][char] = {}
+        left_space[id][char]["kern"] = kern
+        left_space[id][char]["unit"] = unit
+        left_space[id][char]["rubber"] = rubber
+    else
+        illegal_unit(unit)
+    end
+end
+
+local function add_right_spaced_character(lang, char, kern, unit, rubber)
+    local id = ensure_lang_id(lang)
+    if unit == "quad" or unit == "space" then
+        right_space[id][char] = {}
+        right_space[id][char]["kern"] = kern
+        right_space[id][char]["unit"] = unit
+        right_space[id][char]["rubber"] = rubber
+    else
+        illegal_unit(unit)
+    end
+end
+
+-- from typo-spa.lua, adapted
+local function process(head)
+    local current = head
+    while current do
+        local id = current.id
+        if id == glyph_code then
+            local attr = has_attribute(current, punct_attr)
+            if attr then
+                local char = utf8.char(current.char) -- requires Lua 5.3
+                local leftspace  = left_space[attr][char]
+                local rightspace = right_space[attr][char]
+                if leftspace or rightspace then
+                    local fontparameters = fonts.hashes.parameters[current.font]
+                    local unit, stretch, shrink, spacing_node
+                    if leftspace then
+                        local prev = getprev(current)
+                        local space_exception = false
+                        if prev then
+                            local prevprev = getprev(prev)
+                            -- do not add space after left (opening) bracket
+                            space_exception = someleftbracket(prev)
+                            if somespace(prev) then
+                            -- TODO: there is a question here: do we override a preceding space or not?...
+                                if somepenalty(prevprev, 10000) then
+                                    head = remove_node(head, prevprev)
+                                end
+                                head = remove_node(head, prev)
+                            end
+                        end
+                        if leftspace.unit == "quad" then
+                            unit = fontparameters.quad
+                            spacing_node = get_kern_node(leftspace.kern*unit)
+                        elseif leftspace.unit == "space" then
+                            unit = fontparameters.space
+                            if leftspace.rubber then
+                                stretch = leftspace.kern*fontparameters.space_stretch
+                                shrink  = leftspace.kern*fontparameters.space_shrink
+                                spacing_node = get_glue_node(leftspace.kern*unit, stretch, shrink)
+                                head = insert_node_before(head, current, get_penalty_node())
+                            else
+                                spacing_node = get_kern_node(leftspace.kern*unit)
+                            end
+                        end
+                        if not space_exception then
+                            head = insert_node_before(head, current, spacing_node)
+                        end
+                    end
+                    if rightspace then
+                        local next = getnext(current)
+                        local space_exception = false
+                        if next then
+                            -- do not add space before right (closing) bracket
+                            space_exception = somerightbracket(next)
+                            local nextnext = getnext(next)
+                            if somepenalty(next, 10000) and somespace(nextnext) then
+                                head = remove_node(head, next)
+                                head = remove_node(head, nextnext)
+                            elseif somespace(next) then
+                                head = remove_node(head, next)
+                            end
+                        end
+                        if rightspace.unit == "quad" then
+                            unit = fontparameters.quad
+                            spacing_node = get_kern_node(rightspace.kern*unit)
+                        elseif rightspace.unit == "space" then
+                            unit = fontparameters.space
+                            if rightspace.rubber then
+                                stretch = rightspace.kern*fontparameters.space_stretch
+                                shrink  = rightspace.kern*fontparameters.space_shrink
+                                spacing_node = get_glue_node(rightspace.kern*unit, stretch, shrink)
+                                if not space_exception then
+                                    head, current = insert_node_after(head, current, get_penalty_node())
+                                end
+                            else
+                                spacing_node = get_kern_node(rightspace.kern*unit)
+                            end
+                        end
+                        if not space_exception then
+                            head, current = insert_node_after(head, current, spacing_node)
+                        end
+                    end
+                end
+            end
+        elseif id == math_code then
+            -- warning: this is a feature of luatex > 0.76
+            current = end_of_math(current) -- weird, can return nil .. no math end?
+        end
+        current = getnext(current) -- no error even if current is nil
+    end
+    return head
+end
+
+local function activate(lang)
+    local id = ensure_lang_id(lang)
+    -- We set the punctuation attribute to a language id here. This is
+    -- important to be able to intermix languages with different spacings
+    -- in one paragraph.
+    tex.setattribute(punct_attr, id)
+    for _, callback_name in ipairs{ "pre_linebreak_filter", "hpack_filter" } do
+        if not priority_in_callback(callback_name, "polyglossia-punct.process") then
+            add_to_callback(callback_name, process, "polyglossia-punct.process", 1)
+        end
+    end
+end
+
+local function deactivate()
+    tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset"
+    -- Though it would make compilation slightly faster, it is not possible to
+    -- safely uncomment the following lines. Imagine the following case: you
+    -- start a paragraph by some spaced punctuation text, then, in the same
+    -- paragraph, you change the language to something else, and thus call the
+    -- following lines. This means that, at the end of the paragraph, the
+    -- function won't be in the callback, so the beginning of the paragraph
+    -- won't be processed by it.
+    -- if priority_in_callback(callback_name, "polyglossia-punct.process") then
+    --     remove_from_callback(callback_name, "polyglossia-punct.process")
+    -- end
+end
+
+polyglossia.activate_punct             = activate
+polyglossia.deactivate_punct           = deactivate
+polyglossia.add_left_spaced_character  = add_left_spaced_character
+polyglossia.add_right_spaced_character = add_right_spaced_character
+polyglossia.clear_spaced_characters    = clear_spaced_characters


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-sanskrit.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-sanskrit.lua	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-sanskrit.lua	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,30 @@
+require('polyglossia-punct')
+
+-- How do we now, in Lua, what a \thinspace is? In the LaTeX source (latex.ltx)
+-- it is defined as:
+-- \def\thinspace{\leavevmode at ifvmode\kern .16667em }
+-- I see no way of seeing if it has been overriden or not. So we stick to this
+-- value.
+local thinspace = 0.16667 -- 1/6
+
+local function activate_sanskrit_punct()
+    polyglossia.activate_punct('sanskrit')
+    polyglossia.clear_spaced_characters('sanskrit')
+    polyglossia.add_left_spaced_character('sanskrit','!',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit','?',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit','‼',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit','⁇',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit','⁈',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit','⁉',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit',':',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit',';',thinspace,'quad')
+    polyglossia.add_left_spaced_character('sanskrit','।',thinspace,'quad') -- danda, U+0964
+    polyglossia.add_left_spaced_character('sanskrit','॥',thinspace,'quad') -- double danda, U+0965
+end
+
+local function deactivate_sanskrit_punct()
+    polyglossia.deactivate_punct()
+end
+
+polyglossia.activate_sanskrit_punct   = activate_sanskrit_punct
+polyglossia.deactivate_sanskrit_punct = deactivate_sanskrit_punct


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia-sanskrit.lua
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,8 +1,4 @@
-require('luatex-hyphen')
 
-local luatexhyphen = luatexhyphen
-local byte = unicode.utf8.byte
-
 local module_name = "polyglossia"
 local polyglossia_module = {
     name          = module_name,
@@ -16,82 +12,73 @@
 
 luatexbase.provides_module(polyglossia_module)
 
-local log_info = function(message)
-	luatexbase.module_info(module_name, message)
+local log_info = function(message, ...)
+    luatexbase.module_info(module_name, message:format(...))
 end
-local log_warning = function(message)
-	luatexbase.module_warning(module_name, message)
+local log_warn = function(message, ...)
+    luatexbase.module_warning(module_name, message:format(...))
 end
 
 polyglossia = polyglossia or {}
 local polyglossia = polyglossia
 
--- predefined l at nohyphenation or dummy new language
-local nohyphid = luatexbase.registernumber'l at nohyphenation' or lang.id(lang.new())
--- key `nohyphenation` is for .sty file when possibly undefined l at nohyphenation
-local newloader_loaded_languages = { nohyphenation = nohyphid }
-
-local newloader_available_languages = dofile(kpse.find_file('language.dat.lua'))
--- Suggestion by Dohyun Kim on #129
-local t = { }
-for k, v in pairs(newloader_available_languages) do
-    t[k] = v
-    for _, vv in pairs(v.synonyms) do
-        t[vv] = v
-    end
-end
-newloader_available_languages = t
-
-local function loadlang(lang, id)
-  if luatexhyphen.lookupname(lang) then
-    luatexhyphen.loadlanguage(lang, id) 
-  end
-end
-
 local function select_language(lang, id)
-  loadlang(lang, id)
-  polyglossia.current_language = lang
+    polyglossia.current_language = lang
 end
 
 local function set_default_language(lang, id)
-  polyglossia.default_language = lang
+    polyglossia.default_language = lang
 end
 
+local byte = utf8.codepoint -- use standard module of lua 5.3
+
 local check_char
 
 if luaotfload and luaotfload.aux and luaotfload.aux.font_has_glyph then
-  local font_has_glyph = luaotfload.aux.font_has_glyph
-  function check_char(chr)
-    local codepoint = tonumber(chr)
-    if not codepoint then codepoint = byte(chr) end
-    if font_has_glyph(font.current(), codepoint) then
-      tex.sprint('1')
-    else
-      tex.sprint('0')
+    local font_has_glyph = luaotfload.aux.font_has_glyph
+    function check_char(chr)
+        local codepoint = tonumber(chr) or byte(chr)
+        if font_has_glyph(font.current(), codepoint) then
+            tex.sprint('1')
+        else
+            tex.sprint('0')
+        end
     end
-  end
 else
-  local ids = fonts.identifiers or fonts.ids or fonts.hashes.identifiers
-  function check_char(chr) -- always in current font
-      local otfdata = ids[font.current()].characters
-      local codepoint = tonumber(chr)
-      if not codepoint then codepoint = byte(chr) end
-      if otfdata and otfdata[codepoint] then
-          tex.print('1')
-      else
-          tex.print('0')
-      end
-  end
+    function check_char(chr) -- always in current font
+        local fontid    = font.current()
+        local fontdata  = font.getfont(fontid) or font.fonts[fontid]
+        local chardata  = fontdata.characters
+        local codepoint = tonumber(chr) or byte(chr)
+        if chardata and chardata[codepoint] then
+            tex.sprint('1')
+        else
+            tex.sprint('0')
+        end
+    end
 end
 
-local function load_frpt()
-    require('polyglossia-frpt')
-end
-
 local function load_tibt_eol()
     require('polyglossia-tibt')
 end
 
+-- predefined l at nohyphenation or LuaTeX's maximum value for \language
+local nohyphid = luatexbase.registernumber'l at nohyphenation' or 16383
+
+-- key `nohyphenation` is for .sty file when possibly undefined l at nohyphenation
+local newloader_loaded_languages = { nohyphenation = nohyphid }
+
+local newloader_available_languages = require'language.dat.lua'
+-- Suggestion by Dohyun Kim on #129
+local t = { }
+for k, v in pairs(newloader_available_languages) do
+    t[k] = v
+    for _, vv in pairs(v.synonyms) do
+        t[vv] = v
+    end
+end
+newloader_available_languages = t
+
 -- LaTeX's language register is \count19
 local lang_register = 19
 
@@ -99,19 +86,36 @@
 local function newloader(langentry)
     local loaded_language = newloader_loaded_languages[langentry]
     if loaded_language then
-        log_info('Language ' .. langentry .. ' already loaded; id is ' .. lang.id(loaded_language))
-        -- texio.write_nl('term and log', 'Language ' .. langentry .. ' already loaded with patterns ' .. tostring(loaded_language) .. '; id is ' .. lang.id(loaded_language))
-        -- texio.write_nl('term and log', 'Language ' .. langentry .. ' already loaded with patterns ' .. loaded_language['patterns'] .. '; id is ' .. lang.id(loaded_language))
-        return lang.id(loaded_language)
+        local langid = lang.id(loaded_language)
+        log_info('Language %s already loaded; id is %i', langentry, langid)
+        return langid
     else
         local langdata = newloader_available_languages[langentry]
-        if langdata and langdata['special'] == 'language0' then return 0 end
+        if langdata then
 
-        if langdata then
-            local s = "Language data for " .. langentry
+            local special = langdata.special
+            if special then
+                -- language0 (USenglish) is already included in the format
+                if special == 'language0' then
+                    return 0
+
+                -- disabled language should not be used for utf-8 text
+                elseif special:find'^disabled:' then
+                    log_warn('Hyphenation of language %s %s', langentry, special)
+                    return nohyphid
+                end
+            end
+
+            -- language info will be written into the .log file
+            local s = { "Language data for " .. langentry }
             for k, v in pairs(langdata) do
-				s = s .. "\n" .. k .. "\t" .. tostring(v)
+                if type(v) == 'table' then -- for 'synonyms'
+                    s[#s+1] = k .. "\t" .. table.concat(v,',')
+                else
+                    s[#s+1] = k .. "\t" .. tostring(v)
+                end
             end
+            log_info(table.concat(s,"\n"))
 
             --
             -- LaTeX's \newlanguage increases language register (count19),
@@ -133,47 +137,47 @@
             local langobject = lang.new()
             local langid = lang.id(langobject)
             -- get bigger one between \newlanguage and new lang obj id
-            local maxlangid = math.max(langcnt, langid)
+            local newlangid = math.max(langcnt, langid)
             -- set language register for possible \newlanguage
-            tex.setcount('global', lang_register, maxlangid)
+            tex.setcount('global', lang_register, newlangid)
             -- get new lang object if needeed
-            if langid ~= maxlangid then
-              langobject = lang.new(maxlangid)
+            if langid ~= newlangid then
+                langobject = lang.new(newlangid)
             end
-			s = s .. "\npatterns: " .. langdata.patterns
-			log_info(s)
-            if langdata.patterns and langdata.patterns ~= '' then
-                local pattfilepath = kpse.find_file(langdata.patterns)
-                if pattfilepath then
-                    local pattfile = io.open(pattfilepath)
-                    lang.patterns(langobject, pattfile:read('*all'))
-                    pattfile:close()
+
+            -- load hyphenation patterns and exceptions
+            for _,v in ipairs{ 'patterns', 'hyphenation' } do
+                local data = langdata[v]
+                if data and data ~= '' then
+                    -- cope with comma separated list, such as serbian
+                    for _,vv in ipairs(data:explode',+') do
+                        local filepath = kpse.find_file(vv)
+                        if filepath then
+                            local fh = io.open(filepath)
+                            lang[v](langobject, fh:read'a')
+                            fh:close()
+                        else
+                            log_warn('Hyphenation file %s not found', vv)
+                        end
+                    end
                 end
             end
-            if langdata.hyphenation and langdata.hyphenation ~= '' then
-                local hyphfilepath = kpse.find_file(langdata.hyphenation)
-                if hyphfilepath then
-                    local hyphfile = io.open(hyphfilepath)
-                    lang.hyphenation(langobject, hyphfile:read('*all'))
-                    hyphfile:close()
-                end
-            end
+
             newloader_loaded_languages[langentry] = langobject
 
-            log_info('Language ' .. langentry .. ' was not yet loaded; created with id ' .. lang.id(langobject))
-            return lang.id(langobject)
+            log_info('Language %s was not yet loaded; created with id %i',
+                     langentry, newlangid)
+            return newlangid
         else
-            log_warning('Language ' .. langentry .. ' not found in language.dat.lua')
+            log_warn('Language %s not found in language.dat.lua', langentry)
             return nohyphid
         end
     end
 end
 
-polyglossia.loadlang = loadlang
 polyglossia.select_language = select_language
 polyglossia.set_default_language = set_default_language
 polyglossia.check_char = check_char
-polyglossia.load_frpt = load_frpt
 polyglossia.load_tibt_eol = load_tibt_eol
 polyglossia.newloader = newloader
 polyglossia.newloader_loaded_languages = newloader_loaded_languages

Modified: trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty	2019-11-15 21:40:34 UTC (rev 52807)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty	2019-11-15 21:41:34 UTC (rev 52808)
@@ -1,5 +1,5 @@
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{polyglossia}[2019/10/27 v1.45
+\ProvidesPackage{polyglossia}[2019/11/15 v1.46
   Alternative to Babel for XeLaTeX and LuaLaTeX]
 \RequirePackage{etoolbox}
 \RequirePackage{makecmds}
@@ -324,7 +324,14 @@
             \xpg at set@hyphenation at patterns{#1}
           }
       }
-      {
+      {%
+        % Since this function is sometimes called from the gloss files
+        % directly, we need to check whether the requested hyphenname exists.
+        \xpg at ifdefined{#1}{}%
+        {%
+          \xpg at nopatterns{#1}
+          \expandafter\adddialect\csname l@#1\endcsname\l at nohyphenation\relax%
+        }%
         \xpg at set@hyphenation at patterns{#1}
       }
   }
@@ -667,7 +674,7 @@
 }
 
 \cs_new_nopar:Nn{\polyglossia at lang@frenchspacing:n}{
-  \prop_get:NnNTF \polyglossia at langsetup {#1/frenchspacing} \l_tmpa_tl
+  \prop_get:NxNTF \polyglossia at langsetup {#1/frenchspacing} \l_tmpa_tl
       {
         \str_case_e:nnF{\l_tmpa_tl}{
           {true}{\frenchspacing}
@@ -682,7 +689,7 @@
 }
 
 \cs_new_nopar:Nn{\polyglossia at lang@indentfirst:n}{
-  \prop_get:NnNTF \polyglossia at langsetup {#1/indentfirst} \l_tmpa_tl
+  \prop_get:NxNTF \polyglossia at langsetup {#1/indentfirst} \l_tmpa_tl
       {
         \str_case_e:nnF{\l_tmpa_tl}{
           {true}{\french at indent}
@@ -698,7 +705,7 @@
 
 
 \cs_new:Nn{\polyglossia at lang@setpardirection:n}{
-  \prop_get:NnNTF \polyglossia at langsetup {#1/direction} \l_tmpa_tl
+  \prop_get:NxNTF \polyglossia at langsetup {#1/direction} \l_tmpa_tl
       {
         \polyglossia at setpardirection:n{\l_tmpa_tl}
       }
@@ -710,7 +717,7 @@
 
 
 \cs_new:Nn{\polyglossia at lang@settextdirection:nn}{
-  \prop_get:NnNTF \polyglossia at langsetup {#1/direction} \l_tmpa_tl
+  \prop_get:NxNTF \polyglossia at langsetup {#1/direction} \l_tmpa_tl
       {
         \polyglossia at settextdirection:n{\l_tmpa_tl}{#2}
       }
@@ -1003,21 +1010,73 @@
   }
 }
 
+% load a master language from an alias file
+\newcommand*\xpg at load@master at language[1] {
+   \xpg at input{gloss-#1.ldf}
+   \csgdef{#1 at loaded}{}
+   \global\edef\xpg at loaded{#1\ifx\xpg at loaded\@empty\else,\xpg at loaded\fi}%
+}
 
+
 % define environment and command
 \cs_new:Nn \polyglossia at define@language at cmd:n {
-  \exp_args:Ne
-  \newenvironment {\prop_item:Nn{\polyglossia at langsetup}{#1/envname}} [1] []
-  {
-    \begin{otherlanguage}[##1]{#1}
+  \ifcsundef{#1 at alias@lang}{%
+    \exp_args:Ne
+    \newenvironment {\prop_item:Nn{\polyglossia at langsetup}{#1/envname}} [1] []
+    {
+      \begin{otherlanguage}[##1]{#1}
+    }%
+    {
+      \end{otherlanguage}
+    }%
+    \exp_args:Nc \newcommand {text#1} [2][]
+    {%
+      \xpg at textlanguage[##1]{#1}{##2}%
+    }%
+  }{}
+}
+
+% provide way to define alias environment and command
+% \setlanguagealias[<options>]{<language>}{<alias>}
+\DeclareDocumentCommand \setlanguagealias {s O{} m m}
+{
+  \ifcsundef{#4 at alias@lang}{%
+    \exp_args:Ne
+    \newenvironment {#4}
+    {
+      \begin{otherlanguage}[#2]{#3}
+    }%
+    {
+      \end{otherlanguage}
+    }%
+    % The starred version does not define \text<alias>
+    \IfBooleanF {#1}
+      {
+        \exp_args:Nc \newcommand {text#4} [2][]
+        {%
+          \xpg at textlanguage[#2,##1]{#3}{##2}%
+        }%
+      }%
+  }{%
+    \exp_args:Ne
+    \renewenvironment {#4}
+    {
+      \begin{otherlanguage}[#2]{#3}
+    }%
+    {
+      \end{otherlanguage}
+    }%
+    % The starred version does not (re)define \text<alias>
+    \IfBooleanF {#1}
+      {
+        \exp_args:Nc \renewcommand {text#4} [2][]
+        {%
+          \xpg at textlanguage[#2,##1]{#3}{##2}%
+        }%
+      }%
   }%
-  {
-    \end{otherlanguage}
-  }%
-  \exp_args:Nc \newcommand {text#1} [2][]
-  {%
-    \xpg at textlanguage[##1]{#1}{##2}%
-  }%
+  \csgdef{#4 at alias@lang}{#3}%
+  \tl_if_blank:nF {#2} {\csgdef{#4 at alias@opts}{#2}}%
 }
 
 \newcommand{\setdefaultlanguage}[2][]{%
@@ -1032,7 +1091,7 @@
     \polyglossia_load_lang_definition:nn{#1}{#2}
     % define environment and command (except for internal latex language)
     \ifstrequal{#2}{latex}{}{%
-      \polyglossia at define@language at cmd:n{#2}
+      \exp_args:Nx\polyglossia at define@language at cmd:n{#2}
     }%
     \csgdef{#2 at loaded}{}%
   }
@@ -1039,6 +1098,30 @@
   {
     \relax
   }
+  \ifcsdef{#2 at alias@lang}{%
+     \ifcsdef{#2 at alias@opts}{%
+       \exp_args:Nxx \polyglossia_load_lang_definition:nn {\csuse{#2 at alias@opts},#1} {\csuse{#2 at alias@lang}}%
+       \exp_args:Nxx \polyglossia at set@default at language:nn {\csuse{#2 at alias@opts},#1} {\csuse{#2 at alias@lang}}%
+     }{%
+       \polyglossia at set@default at language:nn {#1} {\csuse{#2 at alias@lang}}%
+     }%
+  }{%
+    \polyglossia at set@default at language:nn {#1} {#2}%
+  }%
+}
+
+\cs_new:Nn \polyglossia at set@default at language:nn
+{
+  \ifcsundef{#2 at loaded}%
+  {
+    % latex is an internal language, so do not record
+    \ifstrequal{#2}{latex}{}{%
+      \global\edef\xpg at loaded{#2\ifx\xpg at loaded\@empty\else,\xpg at loaded\fi}%
+      \global\edef\xpg at bloaded{\prop_item:Nn{\polyglossia at langsetup}{#2/babelname}%
+          \ifx\xpg at bloaded\@empty\else,\xpg at bloaded\fi}%
+    }%
+    \csgdef{#2 at loaded}{}%
+  }{}
   \gdef\xpg at main@language{#2}%
   \tl_if_blank:nTF {#1}{\gdef\mainlanguagevariant{}}{%
      % If the optional argument sets a value for the key “variant”,
@@ -1047,8 +1130,7 @@
          \xpg at parsevariantkeyvalue##1=@xpg at main@langvariant\relax
      }%
   }%
-  % Store babelname of main language (for external packages such as biblatex)
-  \xdef\mainbabelname{\prop_item:Nn{\polyglossia at langsetup}{#2/babelname}}%
+  \csgdef{#2 at gvar}{\mainlanguagevariant}%
   %% The following settings are for the default language and script
   % this tells bidi.sty or luabidi.sty that the document is RTL
   \str_if_eq:eeTF{\prop_item:Nn{\polyglossia at langsetup}{#2/direction}}{RL}{%
@@ -1064,8 +1146,14 @@
   \xpg at info{Default~ language~ is~ #2}%
   \polyglossia at set@language at name[#1]{#2}%
   \def\mainlanguagename{#2}
+  % Store babelname of main language (for external packages such as biblatex)
+  \prop_get:NxNT \polyglossia at langsetup {#2/babelname} \l_tmpa_tl
+      { \edef\mainbabelname{\l_tmpa_tl} }
   % Store babelname of current language (for external packages such as biblatex)
-  \xdef\babelname{\prop_item:Nn{\polyglossia at langsetup}{#2/babelname}}%
+  \prop_get:NxNT \polyglossia at langsetup {#2/babelname} \l_tmpa_tl
+      { \edef\babelname{\l_tmpa_tl}% 
+        \csgdef{#2 at gbabelname}{\babelname}%
+      }
   \ifluatex %
   \directlua{polyglossia.set_default_language('\luatexluaescapestring{\string#2}')}%
   \fi %
@@ -1115,15 +1203,45 @@
   \selectlanguage[#1]{#2}%
   \selectbackgroundlanguage{#2}%
   % Store babelname of current language (for external packages such as biblatex)
-  \xdef\babelname{\prop_item:Nn{\polyglossia at langsetup}{#2/babelname}}%
+  \tl_if_blank:nTF {#1}{%
+    \ifcsundef{#2 at gbabelname}{%
+       \edef\babelname{\prop_item:Nn{\polyglossia at langsetup}{#2/babelname}}%
+    }{%
+       \edef\babelname{\csuse{#2 at gbabelname}}%
+    }%
+  }{%
+    \edef\babelname{\prop_item:Nn{\polyglossia at langsetup}{#2/babelname}}%
+  }%
 }
 
 % This saves the normalfont for the latin script since we may change normalfont in other scripts
 \let\normalfontlatin=\normalfont%
-\let\rmfamilylatin=\rmfamily%
-\let\sffamilylatin=\sffamily%
-\let\ttfamilylatin=\ttfamily%
 
+% Provide default fonts (as set with \setmainfont, \setsansfont and \setmonofont)
+% for Latin scripts and as a fallback for non-Latin scripts.
+\DeclareRobustCommand\xpg at defaultfont@rm{%
+   \tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}%
+   \fontfamily\rmdefault%
+   \selectfont%
+}
+\DeclareRobustCommand\xpg at defaultfont@sf{%
+   \tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}%
+   \fontfamily\sfdefault%
+   \selectfont%
+}
+\DeclareRobustCommand\xpg at defaultfont@tt{%
+   \tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}%
+   \fontfamily\ttdefault%
+   \selectfont%
+}
+
+% These switches activate the default fonts
+% Note that a simple \let\rmfamilylatin=\rmfamily
+% does not work reliably (see #24)
+\cs_gset_eq:cc{rmfamilylatin}{xpg at defaultfont@rm}%
+\cs_gset_eq:cc{sffamilylatin}{xpg at defaultfont@sf}%
+\cs_gset_eq:cc{ttfamilylatin}{xpg at defaultfont@tt}%
+
 \def\xpg at set@familydefault{%
   % We need the \edef route here in order
   % to detect both \renewcommand and \let
@@ -1144,15 +1262,16 @@
   % This (re-)saves the normalfont for the latin script since we may
   % change normalfont in other scripts
   \let\normalfontlatin=\normalfont%
-  \let\rmfamilylatin=\rmfamily%
-  \let\sffamilylatin=\sffamily%
-  \let\ttfamilylatin=\ttfamily%
+  % And for all cases, we also reset \<xx>familylatin
+  \cs_gset_eq:cc{rmfamilylatin}{xpg at defaultfont@rm}%
+  \cs_gset_eq:cc{sffamilylatin}{xpg at defaultfont@sf}%
+  \cs_gset_eq:cc{ttfamilylatin}{xpg at defaultfont@tt}%
 }
 
 \def\resetfontlatin{%
-   \let\rmfamily=\rmfamilylatin%
-   \let\sffamily=\sffamilylatin%
-   \let\ttfamily=\ttfamilylatin%
+   \cs_gset_eq:cc{rmfamily}{xpg at defaultfont@rm}%
+   \cs_gset_eq:cc{sffamily}{xpg at defaultfont@sf}%
+   \cs_gset_eq:cc{ttfamily}{xpg at defaultfont@tt}%
    \global\let\normalfont=\normalfontlatin}
 
 \def\selectfontfamilylatin{%
@@ -1197,19 +1316,42 @@
     \global\edef\xpg at loaded{#2\ifx\xpg at loaded\@empty\else,\xpg at loaded\fi}%
     \polyglossia_load_lang_definition:nn{#1}{#2}
     % define environment and command
-    \polyglossia at define@language at cmd:n{#2}
+    \exp_args:Nx\polyglossia at define@language at cmd:n{#2}
     \csgdef{#2 at loaded}{}%
-    % If a variant is set, store it.
-    \gdef\otherlanguagevariant{}
-    \tl_if_blank:nTF {#1}{}{%
-      % If the optional argument sets a value for the key “variant”,
-      % store it in \xpg at main@langvariant
-      \clist_map_inline:nn { #1 } {%
-         \xpg at parsevariantkeyvalue##1=@xpg at other@langvariant\relax
-      }%
+    \ifcsdef{#2 at alias@lang}{%
+       \ifcsdef{#2 at alias@opts}{%
+         \exp_args:Nxx \polyglossia_load_lang_definition:nn {\csuse{#2 at alias@opts},#1} {\csuse{#2 at alias@lang}}%
+         \exp_args:Nxx \polyglossia at set@other at language:nn {\csuse{#2 at alias@opts},#1} {\csuse{#2 at alias@lang}}%
+       }{%
+         \polyglossia at set@other at language:nn {#1} {\csuse{#2 at alias@lang}}%
+       }%
+    }{%
+      \polyglossia at set@other at language:nn {#1} {#2}%
     }%
-    \csgdef{#2 at gvar}{\otherlanguagevariant}%
+  }
+  {}
+}
+
+\cs_new:Nn \polyglossia at set@other at language:nn
+{
+  \ifcsundef{#2 at loaded}
+  {
+    \global\edef\xpg at loaded{#2\ifx\xpg at loaded\@empty\else,\xpg at loaded\fi}%
+    \csgdef{#2 at loaded}{}%
   }{}
+  % If a variant is set, store it.
+  \gdef\otherlanguagevariant{}
+  \tl_if_blank:nTF {#1}{}{%
+    % If the optional argument sets a value for the key “variant”,
+    % store it in \xpg at other@langvariant
+    \clist_map_inline:nn { #1 } {%
+       \xpg at parsevariantkeyvalue##1=@xpg at other@langvariant\relax
+    }%
+  }%
+  \csgdef{#2 at gvar}{\otherlanguagevariant}%
+  \prop_get:NxNT \polyglossia at langsetup {#2/babelname} \l_tmpa_tl
+    { \xdef\otherlanguagebabelname{\l_tmpa_tl} }
+  \csgdef{#2 at gbabelname}{\otherlanguagebabelname}%
 }
 
 % Store main language variant for external packages
@@ -1219,7 +1361,7 @@
 
 \newcommand\setotherlanguages[1]{%
   \def\do##1{\setotherlanguage{##1}}%
-   \docsvlist{#1}}%
+   \exp_args:Nx\docsvlist{#1}}%
 
 \def\common at language{% FIXME is this really needed???
   \ifbool{xpg at hyphenation@disabled}{%
@@ -1234,6 +1376,23 @@
   \common at language%
 }
 
+
+% Alias to \text<lang>, but more suitable
+% for specific (esp. tag-based) aliases
+% where \text<alias> would cause clashes
+% (e.g., \textit)
+\newcommand\textlang[3][]{%
+  \ifcsdef{#2 at alias@lang}{%
+     \ifcsdef{#2 at alias@opts}{%
+       \xpg at textlanguage[\csuse{#2 at alias@opts},#1]{\csuse{#2 at alias@lang}}{#3}%
+     }{%
+       \xpg at textlanguage[#1]{\csuse{#2 at alias@lang}}{#3}%
+     }%
+  }{%
+    \xpg at textlanguage[#1]{#2}{#3}%
+  }%
+}%
+
 \providecommand{\foreignlanguage}{}
 
 % wrapper for foreignlanguage and otherlanguage*
@@ -1240,7 +1399,15 @@
 \newcommand*\polyglossia at setforeignlanguage[2][]{
   \select@@language[#1]{#2}
   % Store babelname of current language (for external packages such as biblatex)
-  \xdef\babelname{\prop_item:Nn{\polyglossia at langsetup}{#2/babelname}}%
+  \tl_if_blank:nTF {#1}{%
+    \ifcsundef{#2 at gbabelname}{%
+       \edef\babelname{\prop_item:Nn{\polyglossia at langsetup}{#2/babelname}}%
+    }{%
+       \edef\babelname{\csuse{#2 at gbabelname}}%
+    }%
+  }{%
+    \edef\babelname{\prop_item:Nn{\polyglossia at langsetup}{#2/babelname}}%
+  }%
 }
 
 % joint code of \foreignlanguage, otherlanguage*
@@ -1248,7 +1415,7 @@
 \newcommand{\xpg at otherlanguage}[2][]
 {%
   \polyglossia at error@iflangnotloaded:n{#2}
-  \setkeys{#2}{#1}%
+  \exp_args:Nne \setkeys{#2}{#1}%
   \polyglossia at setforeignlanguage[#1]{#2}
   % buggy restoration heure
   \csuse{inlineextras@#2}%
@@ -1259,7 +1426,20 @@
 
 \renewcommand{\foreignlanguage}[3][]
 {%
-  \polyglossia at error@iflangnotloaded:n{#2}
+  \ifcsdef{#2 at alias@lang}{%
+     \ifcsdef{#2 at alias@opts}{%
+       \polyglossia at foreignlanguage:nnn {\csuse{#2 at alias@opts},#1} {\csuse{#2 at alias@lang}} {#3}%
+     }{%
+       \polyglossia at foreignlanguage:nnn {#1} {\csuse{#2 at alias@lang}} {#3}%
+     }%
+  }{%
+    \polyglossia at foreignlanguage:nnn {#1} {#2} {#3}%
+  }%
+}
+
+\cs_new:Nn \polyglossia at foreignlanguage:nnn
+{
+   \polyglossia at error@iflangnotloaded:n{#2}
    \bgroup
    \xpg at otherlanguage[#1]{#2}%
    \polyglossia at lang@settextdirection:nn{#2}{#3}%
@@ -1271,12 +1451,25 @@
 
 \renewenvironment{otherlanguage*}[2][]
 {%
+  \ifcsdef{#2 at alias@lang}{%
+     \ifcsdef{#2 at alias@opts}{%
+       \polyglossia at otherlanguage:nn {\csuse{#2 at alias@opts},#1} {\csuse{#2 at alias@lang}}%
+     }{%
+       \polyglossia at otherlanguage:nn {#1} {\csuse{#2 at alias@lang}}%
+     }%
+  }{%
+    \polyglossia at otherlanguage:nn {#1} {#2}%
+  }%
+}
+{\egroup}
+
+\cs_new:Nn \polyglossia at otherlanguage:nn
+{
   \xpg at otherlanguage[#1]{#2}%
   \polyglossia at lang@settextdirection:nn{#2}\bgroup%
 }
-{\egroup}
 
-% use by \text<lang>. Equivalent to \foreignlanguage,
+% use by \text<lang> and \textlang. Equivalent to \foreignlanguage,
 % except that dates are localized.
 \newcommand*\xpg at textlanguage[3][]{%
   \polyglossia at error@iflangnotloaded:n{#2}
@@ -1315,10 +1508,23 @@
 
 \DeclareDocumentCommand \selectlanguage {s O{} m}
 {%
-  \polyglossia at error@iflangnotloaded:n{#3}
+  \ifcsdef{#3 at alias@lang}{%
+     \ifcsdef{#3 at alias@opts}{%
+       \polyglossia at select@language:nnn {#1} {\csuse{#3 at alias@opts},#2} {\csuse{#3 at alias@lang}}%
+     }{%
+       \polyglossia at select@language:nnn {#1} {#2} {\csuse{#3 at alias@lang}}%
+     }%
+  }{%
+     \polyglossia at error@iflangnotloaded:n{#3}%
+     \polyglossia at select@language:nnn {#1} {#2} {#3}%
+  }
+}
+
+\cs_new:Nn \polyglossia at select@language:nnn
+{
   \IfBooleanF {#1}
     {
-      \tl_set:Nx \xpg at pop@language { \exp_not:N \xpg at pop@language at i {#2} {#3} }
+      \cs_set_nopar:Npx \xpg at pop@language { \exp_not:N \xpg at pop@language at i {#2} {#3} }
       \group_insert_after:N \xpg at pop@language
     }
   \tl_if_blank:nTF {#2}{}{%
@@ -1326,7 +1532,7 @@
     \clist_map_inline:nn { #2 } {%
          \xpg at parsevariantkeyvalue##1=@xpg at langvariant\relax
      }%
-     \setkeys{#3}{#2}%
+     \exp_args:Nne \setkeys{#3}{#2}%
    }%
    % The starred variant does not write to the aux
    \IfBooleanTF#1{%
@@ -1386,7 +1592,15 @@
 
 \newcommand*{\xpg at set@language at aux}[2][]{%
    % Store babelname of current language (for external packages such as biblatex)
-   \xdef\babelname{\prop_item:Nn{\polyglossia at langsetup}{#2/babelname}}%
+   \tl_if_blank:nTF {#1}{%
+     \ifcsundef{#2 at gbabelname}{%
+        \edef\babelname{\prop_item:Nn{\polyglossia at langsetup}{#2/babelname}}%
+     }{%
+        \edef\babelname{\csuse{#2 at gbabelname}}%
+     }%
+   }{%
+     \edef\babelname{\prop_item:Nn{\polyglossia at langsetup}{#2/babelname}}%
+   }%
    \@select at language[#1]{#2}%
     % Write to the aux
    \if at filesw%
@@ -1491,12 +1705,7 @@
   \fi
 }
 
-% FIXME: Remove after gloss-latin (last user) has been rewritten)
-\newcommand\xpg at set@language at luatex@ii[1]{%
-     \xpg at set@bbl at hyphendata{\expandafter\the\csname l@#1\endcsname}
-}
 
-
 \newcommand*\@select at language[2][]{
    % hook for compatibility with biblatex
    \select at language{#2}
@@ -1564,9 +1773,9 @@
 \provideenvironment{otherlanguage}{}{}
 
 \renewenvironment{otherlanguage}[2][]
-{
+{%
   \xpg at set@group at aux%
-  \selectlanguage[#1]{#2}
+  \selectlanguage[#1]{#2}%
 }
 {\xpg at unset@group at aux}
 

Added: trunk/Master/texmf-dist/tex/latex/polyglossia/xpg-cyrillicnumbers.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyglossia/xpg-cyrillicnumbers.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyglossia/xpg-cyrillicnumbers.sty	2019-11-15 21:41:34 UTC (rev 52808)
@@ -0,0 +1,119 @@
+\ProvidesPackage{xpg-cyrillicnumbers}
+        [2019/11/15 v0.2 %
+         Formatting of Cyrillic alphabetic numbers]
+
+%% This follows https://en.wikipedia.org/wiki/Cyrillic_numerals
+
+% Numbers are often distinguished from text by centered dots.
+% The commented code does this. We leave it deactivated until
+% we get some expertise.
+\newrobustcmd\cnw at print{}
+\newrobustcmd\cnw at false{%
+  \renewrobustcmd\cnw at print{}}
+\newrobustcmd\cnw at true{%
+%   \renewrobustcmd\cnw at print{$\cdot$}%
+}
+\cnw at true
+
+\protected\def\cyr at alph#1{\expandafter\@cyr at alph\expandafter{\number#1}}
+\def\@cyr at alph#1{%
+  \ifnum#1<\@ne\space\cyr at ill@value{#1}%
+  \else
+    \cnw at print
+    \ifnum#1<10\expandafter\cyr at num@i\number#1%
+    \else
+      \ifnum#1<100\expandafter\cyr at num@ii\number#1%
+      \else
+        \ifnum#1<\@m\expandafter\cyr at num@iii\number#1%
+        \else
+          \ifnum#1<\@M\expandafter\cyr at num@iv\number#1%
+          \else
+            \ifnum#1<100000\expandafter\cyr at num@v\number#1%
+            \else
+              \ifnum#1<1000000\expandafter\cyr at num@vi\number#1%
+              \else
+                \space\cyr at ill@value{#1}%
+              \fi
+            \fi
+          \fi
+        \fi
+      \fi
+    \fi
+  \fi
+}
+
+\protected\def\cyr at Alph#1{\expandafter\@cyr at Alph\expandafter{\number#1}}
+\def\@cyr at Alph#1{%
+  \ifnum#1<\@ne\space\cyr at ill@value{#1}%
+  \else
+    \cnw at print
+    \ifnum#1<10\expandafter\cyr at Num@i\number#1%
+    \else
+      \ifnum#1<100\expandafter\cyr at Num@ii\number#1%
+      \else
+        \ifnum#1<\@m\expandafter\cyr at Num@iii\number#1%
+        \else
+          \ifnum#1<\@M\expandafter\cyr at Num@iv\number#1%
+          \else
+            \ifnum#1<100000\expandafter\cyr at Num@v\number#1%
+            \else
+              \ifnum#1<1000000\expandafter\cyr at Num@vi\number#1%
+              \else
+                \space\cyr at ill@value{#1}%
+              \fi
+            \fi
+          \fi
+        \fi
+      \fi
+    \fi
+  \fi
+}
+
+% Lowercase
+\def\cyr at num@i#1{%
+  \ifcase#1 \or а\or в\or г\or д\or е\or ѕ\or з\or и\or ѳ\fi
+  \ifnum#1=\z@\else\cnw at true\fi\cnw at print}
+\def\cyr at num@ii#1{%
+  \ifcase#1 \or і\or к\or л\or м\or н\or ѯ\or о\or п\or ч\fi
+  \ifnum#1=\z@\else\cnw at true\fi\cyr at num@i}
+\def\cyr at num@iii#1{%
+  \ifcase#1 \or р\or с\or т\or у\or ф\or х\or ѱ\or ѡ\or ц\fi
+  \ifnum#1=\z@\cnw at false\else\cnw at true\fi\cyr at num@ii}
+\def\cyr at num@iv#1{%
+  \ifnum#1=\z@\else ҂\fi
+  \ifcase#1 \or а\or в\or г\or д\or е\or ѕ\or з\or и\or ѳ\fi
+  \cyr at num@iii}
+\def\cyr at num@v#1{%
+  \ifnum#1=\z@\else ҂\fi
+  \ifcase#1 \or і\or к\or л\or м\or н\or ѯ\or о\or п\or ч\fi
+  \cyr at num@iv}
+\def\cyr at Num@vi#1{%
+  \ifnum#1=\z@\else ҂\fi
+  \ifcase#1 \or р\or с\or т\or у\or ф\or х\or ѱ\or ѡ\or ц\fi
+  \cyr at num@v}
+
+% Uppercase
+\def\cyr at Num@i#1{%
+  \ifcase#1 \or А\or В\or Г\or Д\or Е\or Ѕ\or З\or И\or Ѳ\fi
+  \ifnum#1=\z@\else\cnw at true\fi\cnw at print}
+\def\cyr at Num@ii#1{%
+  \ifcase#1 \or І\or К\or Л\or М\or Н\or Ѯ\or О\or П\or Ч\fi
+  \ifnum#1=\z@\else\cnw at true\fi\cyr at Num@i}
+\def\cyr at Num@iii#1{%
+  \ifcase#1 \or Р\or С\or Т\or У\or Ф\or Х\or Ѱ\or Ѡ\or Ц\fi
+  \ifnum#1=\z@\cnw at false\else\cnw at true\fi\cyr at Num@ii}
+\def\cyr at Num@iv#1{%
+  \ifnum#1=\z@\else ҂\fi
+  \ifcase#1 \or А\or В\or Г\or Д\or Е\or Ѕ\or З\or И\or Ѳ\fi
+  \cyr at Num@iii}
+\def\cyr at Num@v#1{%
+  \ifnum#1=\z@\else ҂\fi
+  \ifcase#1 \or І\or К\or Л\or М\or Н\or Ѯ\or О\or П\or Ч\fi
+  \cyr at Num@iv}
+\def\cyr at Num@vi#1{%
+  \ifnum#1=\z@\else ҂\fi
+  \ifcase#1 \or Р\or С\or Т\or У\or Ф\or Х\or Ѱ\or Ѡ\or Ц\fi
+  \cyr at Num@v}
+\def\cyr at ill@value#1{\xpg at warning{Illegal value (#1) for cyr numeral}[$#1$]}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/polyglossia/xpg-cyrillicnumbers.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property


More information about the tex-live-commits mailing list