summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/README.md2
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdfbin73089 -> 71193 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/example-arabic.tex7
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/example-chinese.pdfbin42567 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/example-japanese.pdfbin22935 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/example-korean.pdfbin20381 -> 20230 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/example-odia.pdfbin65705 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/example-thai.pdfbin13858 -> 14190 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/example-uyghur.tex128
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/examples.pdfbin147509 -> 147304 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/examples.tex7
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdfbin381269 -> 386065 bytes
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex91
-rw-r--r--Master/texmf-dist/doc/latex/polyglossia/test-welsh.pdfbin8886 -> 0 bytes
-rw-r--r--Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx8728
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/arabicnumbers.sty23
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/cal-util.def2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-acadian.ldf (renamed from Master/texmf-dist/tex/latex/polyglossia/gloss-acadien.ldf)4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-aeb.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-af.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-afb.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf21
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-albanian.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-am.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-american.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-amharic.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-apd.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ar-IQ.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ar-JO.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ar-LB.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ar-MR.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ar-PS.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ar-SY.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ar-YE.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ar.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf320
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf70
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-arq.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ary.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-arz.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ast.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-asturian.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-australian.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-austrian.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ayl.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bahasa.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-basque.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-be-tarask.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-be.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf99
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf44
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bg.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bn.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bo.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bosnian.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-br.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-breton.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-british.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bs.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-bulgarian.ldf10
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ca.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-canadian.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-canadien.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf20
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-chinese.ldf93
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ckb-Arab.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ckb-Latn.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ckb.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-classiclatin.ldf9
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-cop.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-coptic.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf54
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-cy.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-cz.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf28
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-da.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT-1901.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT-1996.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH-1901.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH-1996.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE-1901.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE-1996.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT-1901.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT-1996.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH-1901.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH-1996.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE-1901.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE-1996.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-de.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-dsb.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf24
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-dv.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ecclesiasticlatin.ldf9
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-el-monoton.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-el-polyton.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-el.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-en-AU.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-en-CA.ldf6
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-en-GB.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-en-NZ.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-en-US.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-en.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf74
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-eo.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-es-ES.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-es-MX.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-es.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-esperanto.ldf6
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-estonian.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-et.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-eu.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-fa.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-fi.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf85
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CA-u-sd-canb.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CA.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CH.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-fr-FR.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-fr.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf324
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-fur.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ga.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf37
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-galician.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-gd.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf45
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf184
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-germanb.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-gl.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-grc.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf144
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-he.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf69
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-hi.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf40
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-hr.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-hsb.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-hu.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf358
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-hy.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ia.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-icelandic.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-id.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-interlingua.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-is.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-it.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf24
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ja.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-japanese.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ka.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf22
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-khmer.ldf30
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-km.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-kmr-Arab.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-kmr-Latn.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-kmr.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-kn.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ko.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf420
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ku-Arab.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ku-Latn.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ku.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf160
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-kurmanji.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-classic.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-ecclesia.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-medieval.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-la.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf23
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-latex.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf237
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-latinclassic.ldf9
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-latinecclesiastic.ldf9
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-latinmedieval.ldf9
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-latvian.ldf8
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-lithuanian.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-lo.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-lowersorbian.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-lt.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-lv.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-macedonian.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf85
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-malayalam.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf32
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-medievallatin.ldf9
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-mk.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ml.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-mn.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf65
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-mr.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-naustrian.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-nb.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-newzealand.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ngerman.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-nko.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf38
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-nswissgerman.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf20
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-odia.ldf49
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-or.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-pa.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf96
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf20
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-polish.ldf28
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-polutonikogreek.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf57
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-punjabi.ldf35
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-romanian.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-romansh.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf120
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf8
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf59
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf128
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-serbianc.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf30
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-slovene.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf10
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf80
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf84
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-spanishmx.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-swedish.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-swissgerman.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf97
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-tamil.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-telugu.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf30
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-tibetan.ldf26
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-turkish.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-turkmen.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ug.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf77
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-uppersorbian.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf116
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-uyghur.ldf423
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-vietnamese.ldf2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf31
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-zh-CN.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/gloss-zh-TW.ldf4
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/hebrewcal.sty2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/hijrical.sty2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/polyglossia-cjk-spacing.lua (renamed from Master/texmf-dist/tex/latex/polyglossia/polyglossia-korean.lua)196
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/polyglossia-french.lua2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/polyglossia-latin.lua2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua18
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/polyglossia-sanskrit.lua2
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/polyglossia-tibt.lua31
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua13
-rw-r--r--Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty1889
272 files changed, 8413 insertions, 8385 deletions
diff --git a/Master/texmf-dist/doc/latex/polyglossia/README.md b/Master/texmf-dist/doc/latex/polyglossia/README.md
index d0ba2a157a3..a3f65bbb9d6 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/README.md
+++ b/Master/texmf-dist/doc/latex/polyglossia/README.md
@@ -1,4 +1,4 @@
-# THE POLYGLOSSIA PACKAGE v2.1
+# THE POLYGLOSSIA PACKAGE v2.2
## Multilingual typesetting with XeLaTeX and LuaLaTeX
This package provides an alternative to Babel for users of XeLaTeX and LuaLaTeX.
diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf b/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf
index 20caa55173c..4808227a41a 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf
+++ b/Master/texmf-dist/doc/latex/polyglossia/example-arabic.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-arabic.tex b/Master/texmf-dist/doc/latex/polyglossia/example-arabic.tex
index 939f20665da..0e7a197b09d 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/example-arabic.tex
+++ b/Master/texmf-dist/doc/latex/polyglossia/example-arabic.tex
@@ -4,7 +4,12 @@
\usepackage{xltxtra,url,amsmath}
\setmainfont{Linux Libertine O}
\defaultfontfeatures{Scale=MatchLowercase}
-\newfontfamily\arabicfont[Script=Arabic]{Amiri}
+\newfontfamily\arabicfont[Script=Arabic]{Amiri}[%
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ Extension = .ttf,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic]
\newfontfamily\arabicfonttt[Script=Arabic,Scale=.75]{DejaVu Sans Mono}
\newfontfamily\farsifont[Script=Arabic,Scale=1.1,WordSpace=2]{IranNastaliq}
\let\XeTeX\undefined
diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-chinese.pdf b/Master/texmf-dist/doc/latex/polyglossia/example-chinese.pdf
deleted file mode 100644
index 394f0071ca0..00000000000
--- a/Master/texmf-dist/doc/latex/polyglossia/example-chinese.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-japanese.pdf b/Master/texmf-dist/doc/latex/polyglossia/example-japanese.pdf
deleted file mode 100644
index 61c74d82115..00000000000
--- a/Master/texmf-dist/doc/latex/polyglossia/example-japanese.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf b/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf
index 06feebd9740..dba7be728be 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf
+++ b/Master/texmf-dist/doc/latex/polyglossia/example-korean.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-odia.pdf b/Master/texmf-dist/doc/latex/polyglossia/example-odia.pdf
deleted file mode 100644
index a17158697c5..00000000000
--- a/Master/texmf-dist/doc/latex/polyglossia/example-odia.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf b/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf
index 12f2c1f0939..b291acb0b5e 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf
+++ b/Master/texmf-dist/doc/latex/polyglossia/example-thai.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/example-uyghur.tex b/Master/texmf-dist/doc/latex/polyglossia/example-uyghur.tex
new file mode 100644
index 00000000000..b226e61f186
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/polyglossia/example-uyghur.tex
@@ -0,0 +1,128 @@
+% !TeX TS-program = xelatex
+\documentclass[a4paper]{book}
+\usepackage{polyglossia}
+\usepackage{graphicx}
+\usepackage{url,amsmath}
+
+\setmainlanguage{uyghur}
+\newfontfamily\arabicfont[Script=Arabic,Scale=1]{UKIJ Tuz}
+\let\arabicfonttt\ttfamily
+
+\setotherlanguage[variant=british]{english}
+
+\title{لاتېكىس قوللانمىسى}
+\author{neouyghur}
+\date{\today}
+
+\begin{document}
+
+\maketitle
+
+\tableofcontents
+
+\listoffigures
+
+\listoftables
+
+\pagenumbering{arabic}
+
+\chapter{ئۇيغۇرلار}
+
+\section{ئۇيغۇرلار ۋە ئۇلارنىڭ تۇرمۇش مەدەنىيىتى}
+
+ئۇيغۇرلار شىنجاڭ ئۇيغۇر ئاپتونوم رايونىنىڭ ھەقىقىي ئىگىلىرى ۋە مىراسخورلىرى بولۇپ، بۇ رايوندا توپلىشىپ ياشايدىغان غوللۇق، يەرلىك مىللەت ۋە ئاپتونومىيە ھوقۇقى يۈرگۈزگۈچى مىللەت. ئۇيغۇرلار پارچە ھالەتتە، جۇڭگونىڭ بىر قاتار چوڭ شەھەرلىرىدە خىزمەت ۋە تىجارەت قىلىدۇ. ئۇيغۇرلار شىنجاڭ ئۇيغۇر ئاپتونوم رايونىدىن باشقا، يەنە جۇڭگو، قازاقىستان، قىرغىزىستان، ئۆزبېكىستان، تاجىكىستان، تۈركمەنىستان (ئاساسلىقى بايرام ئەلى رايونى)، پاكىستان، ئەرەبىستان، تۈركىيە، ئاۋسترالىيە، گېرمانىيە، نورۋىگىيە، گوللاندىيە، شىۋىتسىيە، فىنلاندىيە، بېلگىيە، روسيە، ئامېرىكا قاتارلىق دۆلەتلەردە كۆرۈنەرلىك نوپۇستا، مۇئەييەن جامائەت تۈركۈمى شەكلىدە ياشايدۇ.
+
+\begin{english}
+The \textbf{Uyghurs}\footnote{%
+ From \url{https://en.wikipedia.org/wiki/Uyghurs}} have traditionally inhabited a series of oases scattered across the Taklamakan Desert within the Tarim Basin. These oases have historically existed as independent states or were controlled by many civilizations including China, the Mongols, the Tibetans and various Turkic polities. The Uyghurs gradually started to become Islamized in the 10th century and most Uyghurs identified as Muslims by the 16th century. Islam has since played an important role in Uyghur culture and identity.
+\end{english}
+
+\section{نىكاھ}
+ئۇيغۇرلاردا نىكاھ مۇناسىۋىتى بىلەن چاي ئىچكۈزۈش، توي ئالدىدىكى مەسلىھەت چايلىرى، نىكاھ ئوقۇپ قىز-يىگىتنىڭ رازىلىقىنى ئېلىش، توي مۇراسىمى، يىگىت-قىزلار ئولتۇرۇشى، قۇدىلار چىللاقلىرى ئىزچىل ساقلىنىپ كەلدى. ئۇيغۇرلاردا دەپنە مۇراسىمى ھەرقايسى دىنىي مەدەنىيەتلەر تەسىرىدە ھەرخىل بولسىمۇ، ئەمما مېيىتنى پاكىزە يۇيۇپ كېپەنلەش، ھازىدارلار ئاق رومال سېلىپ، ئاق بەلۋاغ باغلاپ يىغا-زارە قىلىش، مېيىتنىڭ نامىزىنى چۈشۈرۈش، جىنازىنى ئالمىشىپ تالىشىپ كۈتۈرۈپ قەبرىستانلىققا ئېلىپ بېرىش، لەھەتتە مېيىتنىڭ يۈزىنى قىبلە (غەرب) تەرەپكە قىلىپ ياتقۇزۇش، ئىچ گۆرنىڭ ئاغزىنى كېسەك بىلەن ئېتىپ، تاش گۆرنى توپا بىلەن كۆمۈش، قەبرە بېشىدا مېيىتنىڭ ئىجابىي تەرىپىگە گۇۋاھلىق بېرىش، قەبرە تېشى-گۈمبەز ئورنىتىش، مېيىتنىڭ يەتتە، قىرىق، يىل نەزىرلىرىنى ئۆتكۈزۈش ئادەتلىرى بىردەك ئىزچىل بۇلۇپ كەلدى. ئۇيغۇرلار ۋە ئۇلارنىڭ ئەجدادلىرى مېيىت سۆڭىكىنى كاھىش (ساپال) ساندۇققا سېلىپ يەرلىككە قۇيۇش، مېيىتنى تاش گۆرگە كۆمۈش، مېيىتنى ئاستىغا ياغاچ شادا قويۇلغان گۆرگە ياتقۇزۇپ، ئۈستىگە قىزىل تۇپراق ۋە قۇم تۆكۈپ كۆمۈش، شام گۆرگە قويۇش قاتارلىق دەپنە قىلىش ئۇسۇللىرىنىمۇ قوللاندى.
+
+\section{ھېيت-ئايەم}
+
+
+\begin{figure}
+ \begin{center}
+\includegraphics[scale=1]{example-image-a}
+\caption{ئا رەسىم.}
+ \end{center}
+\end{figure}
+
+\begin{table}
+\begin{center}
+ \begin{tabular}{||c c c c||}
+ \hline
+ Col1 & Col2 & Col2 & Col3 \\ [0.5ex]
+ \hline\hline
+ 1 & 6 & 87837 & 787 \\
+ \hline
+ 2 & 7 & 78 & 5415 \\
+ \hline
+ 3 & 545 & 778 & 7507 \\
+ \hline
+ 4 & 545 & 18744 & 7560 \\
+ \hline
+ 5 & 88 & 788 & 6344 \\ [1ex]
+ \hline
+ \end{tabular}
+ \caption{بىر سىناق جەدۋەل}
+\end{center}
+\end{table}
+
+\begin{equation}
+ x^2 + y^2 = z^2
+ \label{test}
+\end{equation}
+
+
+\chapter{مەڭگۈ تاش يادىكارلىقلىرى}
+
+\section{تەس مەڭگۈ تېشى}
+بۇ مەڭگۈ تاش يادىكارلىقى 1976- يىلى موڭغۇلىيەدىكى تەس دەرياسىنىڭ سول قىرغىدىكى نوغۇن تولغوي ئىگىزلىكىنىڭ يېنىدىن تېپىلغانلىقى ئۈچۈن، «تەس مەڭگۈ تېشى» دەپ ئاتالغان. «تەس مەڭگۈ تېشى» ئورخۇن ئۇيغۇر خانلىقى دەۋرىگە مەنسۇپ يادىكارلىقلارنىڭ ئىچىدە بۇزغۇنچىلىققا ئۇچرىشى ئېغىرراق. ئەڭ مۇھىم بولغان يازما يادىكارلىق. ئۇنىڭدا بۆگۈ قاغان (759- 780- يىللار) ئەجدادى (دادىسى) بولغان ئەل ئەتمىش بىلگە قاغان (مويۇنچۇر، 747- 759- يىللار9 دەۋرىگىچە بولغان ئۇيغۇر قاغانلىرىنىڭ تارىخى، جۈملىدىن بىرىنچى ۋە ئىككىنچى ئۇيغۇر خانلىقىنىڭ تەقدىرى. كۆل بىلگە قاغان ۋە ئەل ئەتمىش بىلگە قاغان باشچىلىقىدىكى ئۈچىنچى ئۇيغۇر خانلىقىنىڭ بەرپا بولۇشى قاتارلىق مەسىلىلەر ھەققىدە مەلۇمات بېرىلگەن. بۇ ھەقتىكى بىر قىسىم مەزمۇنلار كونا- يېڭى تاڭنامىلەردە ئۇچرىمايدۇ. شۇڭا تەس مەڭگۈ تېشىدىكى مەلۇماتلار زور سېلىشتۇرما قىممەتكە ئىگە. تەتقىقاتلارغا قارىغاندا، «تەس مەڭگۈ تېشى» نىڭ ئاپتورى مويۇنچۇر قاغاننىڭ يېقىن تۇققىنى تۈپەك ئالىپ شۇل دېگەن كىشى بولۇپ، مەڭگۈ تاشنى قاغان يېڭىدىن تەختكە چىققان ۋاقىتتا توغرىسى 761- 762- يىللىرى ئورنىتىلغان، دېيىشكە بولىدۇ.
+
+
+\begin{table}
+ \begin{center}
+ \begin{tabular}{||c c c c||}
+ \hline
+ Col1 & Col2 & Col2 & Col3 \\ [0.5ex]
+ \hline\hline
+ 1 & 6 & 87837 & 787 \\
+ \hline
+ 2 & 7 & 78 & 5415 \\
+ \hline
+ 3 & 545 & 778 & 7507 \\
+ \hline
+ 4 & 545 & 18744 & 7560 \\
+ \hline
+ 5 & 88 & 788 & 6344 \\ [1ex]
+ \hline
+ \end{tabular}
+ \caption{يەنە بىر سىناق جەدۋەل}
+ \end{center}
+\end{table}
+
+\section{تېرخىن مەڭگۈ تېشى}
+
+\begin{figure}
+ \begin{center}
+ \includegraphics[scale=0.5]{example-image-b}
+ \caption{ب رەسىم.}
+ \end{center}
+\end{figure}
+
+\begin{thebibliography}{9}
+ \bibitem{latexcompanion}
+ Michel Goossens, Frank Mittelbach, and Alexander Samarin.
+ \textit{The \LaTeX\ Companion}.
+ Addison-Wesley, Reading, Massachusetts, 1993.
+
+ \bibitem{einstein}
+ ئو. تۇرسۇن.
+ \textit{لاتېكىست قوللانمىسى}. (ئۇيغۇرچە)
+ [\textit{بىر ژورنال}]. , 322(10):891–921, 1905.
+\end{thebibliography}
+
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/polyglossia/examples.pdf b/Master/texmf-dist/doc/latex/polyglossia/examples.pdf
index 05d7cac61ce..ad1d2d4f693 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/examples.pdf
+++ b/Master/texmf-dist/doc/latex/polyglossia/examples.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/examples.tex b/Master/texmf-dist/doc/latex/polyglossia/examples.tex
index 7e331b70d45..09beb075e70 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/examples.tex
+++ b/Master/texmf-dist/doc/latex/polyglossia/examples.tex
@@ -16,7 +16,12 @@
\setmainfont{Linux Libertine O}
\defaultfontfeatures{Scale=MatchLowercase}
\setmonofont{Inconsolata}
-\newfontfamily\arabicfont[Script=Arabic]{Amiri}
+\newfontfamily\arabicfont[Script=Arabic]{Amiri}[%
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ Extension = .ttf,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic]
\newfontfamily\syriacfont[Script=Syriac]{Serto Jerusalem}
\newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL}
\newfontfamily\sanskritfont[Script=Devanagari]{Sanskrit 2003}
diff --git a/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf b/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf
index d218332d9b0..f7b12a7bd6b 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf
+++ b/Master/texmf-dist/doc/latex/polyglossia/polyglossia.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex b/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex
index 1d4fc5e4aac..77fb0f02ac3 100644
--- a/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex
+++ b/Master/texmf-dist/doc/latex/polyglossia/polyglossia.tex
@@ -23,8 +23,10 @@
]{hyperref}
\usepackage{array}
\usepackage{metalogo}
-\let\XeTeX\undefined
-\let\XeLaTeX\undefined
+\ifxetex
+ \let\XeTeX\undefined
+ \let\XeLaTeX\undefined
+\fi
\usepackage[babelshorthands]{polyglossia}
\usepackage{farsical}
%
@@ -124,15 +126,23 @@
\usepackage[osf]{libertine}
% Monospace: Package dejavu-otf
\setmonofont[Scale=MatchLowercase]{DejaVuSansMono}
-% Libertine includes Hebrew, but we load it separately since
-% osf is not supported with this script and we want to avoid the
-% respective warnings
-\newfontfamily\hebrewfont[Script=Hebrew]{Linux Libertine O}
+% Package culmus
+\newfontfamily\hebrewfont[Script=Hebrew]{DavidCLM}[
+ UprightFont = *-Medium,
+ BoldFont = *-Bold,
+ Extension = .otf,
+ ItalicFont = *-MediumItalic,
+ BoldItalicFont = *-BoldItalic]
% Package dejavu-otf
\newfontfamily\armenianfont[Script=Armenian,Scale=MatchLowercase]{DejaVuSans}
\newfontfamily\georgianfont[Scale=MatchLowercase]{DejaVuSerif}
% Package amiri
-\newfontfamily\arabicfont[Script=Arabic]{Amiri-Regular}
+\newfontfamily\arabicfont[Script=Arabic]{Amiri}[%
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ Extension = .ttf,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic]
% No Syriac otf/ttf font seems available on CTAN
% This one, from the Syriac Institute, is included on Linux
% in the x11-fonts set and can be downloaded from
@@ -457,7 +467,7 @@ Table~\ref{tab:BCP47-polyglossia} lists the currently supported tags.
dv & divehi & \tabularnewline
el & greek & \tabularnewline
el-monoton & greek & variant=monotonic [\emph{default}] \tabularnewline
- el-polyton & greek & varant=polytonic \tabularnewline
+ el-polyton & greek & variant=polytonic \tabularnewline
en & english & \tabularnewline
en-AU & english & variant=australian \tabularnewline
en-CA & english & variant=canadian \tabularnewline
@@ -771,13 +781,25 @@ see sec.~\ref{sec:langtags}).
\section{Font setup}
-With polyglossia it is possible to associate a specific font with any script or language
+With \pkg{polyglossia} it is possible to associate a specific font with any script or language
that occurs in the document. That font should always be defined as
-\cmd{\⟨script⟩font}\ or \cmd{\⟨language⟩font}.
+\cmd{\⟨script⟩font}\ or \cmd{\⟨language⟩font}. Note that ¦⟨language⟩¦ points to the \pkg{polyglossia}
+language name, ¦⟨script⟩¦ might point either to an OpenType script name as defined by \pkg{fontspec}
+(\eg ¦Latin¦) \new{2.2}or a BCP-47 script tag (\eg ¦Latn¦), though the script is fully lower-cased
+in the \cmd{\⟨script⟩font}\ command.
+
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,\meta{…}]\marg{font}}. }
-Note that polyglossia will use the font defined as is, so assure to do all necessary settings
+\centerline{\cmd\newfontfamily\cmd{\greekfont[Script=Greek,\meta{…}]\marg{font}}}
+%
+If you want to setup a blackletter font specifically for the German blackletter script variant,
+you might do so by:\\
+\centerline{\cmd\newfontfamily\cmd{\latffont[\meta{…}]\marg{font}}}
+%
+Setting up a font specifically for traditional Chinese is possible via:\\
+\centerline{\cmd\newfontfamily\cmd{\hantfont[Script=CJK,\meta{…}]\marg{font}}}
+%
+Note that \pkg{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 \cmd\arabicfont\ is explicitly defined, then the option ¦Script=Arabic¦ should
be included in that definition.
@@ -787,10 +809,12 @@ it can be defined by means of \new{1.2.0}
\cmd{\⟨script⟩fontsf} or \cmd{\⟨language⟩fontsf} and \cmd{\⟨script⟩fonttt} or \cmd{\⟨language⟩fonttt}, respectively.
Whenever a new language is activated, \pkg{polyglossia} will first check whether
-a font has been defined for that language or – for languages in non-Latin scripts –
-for the script it uses. If it is not defined, it will use the currently active font
-and – in the case of OpenType fonts – will attempt to turn on the appropriate
-OpenType tags for the script and language used, in case these are available in
+a font has been defined for that language. If this is not the case, it will check whether a font associated
+with the BCP-47 script tag of the current language is defined. If this also isn't the case, \pkg{polyglossia}
+will finally check (but this only for languages in non-Latin scripts) whether there is a font associated
+with the OpenType script tag. If none of these fonts is defined, \pkg{polyglossia} will use the currently
+active font as defined by ¦\setmainfont¦, ¦\setsansfont¦ or ¦\setmonofont¦ and – in the case of OpenType fonts –
+will attempt to turn on the appropriate OpenType tags for the script and language used, in case these are available in
the font, by means of \pkg{fontspec}’s \cmd\addfontfeature. If the current font
does not appear to support the script of that language, an error message is
displayed.
@@ -1585,7 +1609,7 @@ and that passing \xpgvalue{babelshorthands} (without value) is equivalent to pas
\end{table}
\item \xpgchoicekey[1.46]{hyphenation}{\xpgvalue{classic}, \xpgvalue{modern}, or \xpgvalue{liturgical}}
There are three different sets of hyphenation patterns for Latin. Separate
- documention for them is available on the
+ documentation for them is available on the
Internet.\footnote{Refer to \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
@@ -1657,7 +1681,7 @@ and that passing \xpgvalue{babelshorthands} (without value) is equivalent to pas
\item[¦'AE¦] for Ǽ (AE ligature with acute), also available for \'Œ
\end{shorthands}
\item \xpgboolkeyfalse[1.46]{prosodicshorthands}
- Enable shorthands for prosodic marks (macrons and breves) very similiar to
+ Enable shorthands for prosodic marks (macrons and breves) very similar to
those provided by \pkg{babel-latin} using the ¦withprosodicmarks¦
modifier.
Note that the active ¦=¦ character used for macrons will cause problems with
@@ -2563,7 +2587,7 @@ in Hebrew script or in roman transliteration).
\subsection{Islamic calendar (hijrical.sty)}\label{sec:hijrical}
This package computes dates in the lunar Islamic (Hijra) calendar.\footnote{ %
It makes use of the arithmetical algorithm in chapter 6 of
- Reingold \& Gershowitz, \textit{Calendrical calculation: the Millenium edition}
+ Reingold \& Gershowitz, \textit{Calendrical calculation: the Millennium edition}
(Cambridge University Press, 2001).\label{reingold}}
It provides two macros for the end-user.
The command
@@ -2698,6 +2722,31 @@ where \meta{type} is a supported language id type (such as ¦bcp-47¦) and \meta
\bgroup\footnotesize
+\subsection*{2.2 (2024/07/15)}
+
+\subsubsection*{Bug fixes}
+\begin{itemize}
+ \item Fix \texttt{lang} environment (\TXI{633}).
+ \item Fix first number of Maghrib abjad numbering for Algeria, Morocco and
+ Tunisia (\TXI{640}).
+ \item Fix some captions strings in Bulgarian, Chinese, Esperanto, Estonian, Hindi,
+ Latvian, and Slovak (\TXP{651})
+ \item Improve performance with multilingual documents that have a TOC (\TXI{641}).
+\end{itemize}
+
+\subsubsection*{New Features}
+\begin{itemize}
+ \item Add possibility to associate a font to a language/variant with reference to
+ a BCP-47 script tag (\TXI{636}).
+\end{itemize}
+
+\subsubsection*{Internal work}
+\begin{itemize}
+ \item The major rewrite of the package code has been finished. More code has been cleaned up,
+ and \pkg{polyglossia} employs modern concepts (\pkg{latex3} and modern \LaTeXe).
+ All key-val handling uses \pkg{l3keys} now rather than \pkg{xkeyval}.
+\end{itemize}
+
\subsection*{2.1 (2024/03/07)}
\subsubsection*{Bug fixes}
@@ -3756,7 +3805,7 @@ where \meta{type} is a supported language id type (such as ¦bcp-47¦) and \meta
\section{Acknowledgements (by François Charette)}
\pkg{Polyglossia} is notable for being a recycle box of previous contributions
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
+whose splendid work has made my task almost trivial in comparison: \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 Kryukov} (\pkg{antomega}),
\TA{Will Robertson} (\pkg{fontspec}), \TA{Apostolos Syropoulos} (\pkg{xgreek}), \TA{Youssef Jabri}
@@ -3783,7 +3832,7 @@ Many thanks to all the people who have contributed bugfixes and new features to
since we took over.
In alphabetical order: \TA{Ignas Anikevicius}, \TA{Sina Ahmadi}, \TA{Matthew Bertucci}, \TA{Wouter Bolsterlee}, \TA{Christian Buhtz},
\TA{Ashok Das}, \TA{Oleg Domanov}, user \TA{fakhriaunur}, \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{Enrico Gregorio}, \TA{Khaled Hosny}, \TA{Stephen Huan}, \TA{Najib Idrissi}, user \TA{julroy67}, \TA{Dohyun Kim}, \TA{Phil Kime},
\TA{Mike Kroutikov}, \TA{Ivan Kokan}, \TA{Caleb Maclennan}, \TA{Gyula Magyarkuti}, \TA{José Mancera}, \TA{Miquel Ortega},
\TA{Yevgen Pogribnyi}, \TA{Will Robertson}, \TA{Maïeul Rouquette}, \TA{Elie Roux}, \TA{Hugo Roy}, \TA{Guy Rutenberg},
\TA{Marcin Serwin}, \TA{Arvinder Singh}, \TA{Avisek Jena}, \TA{Philipp Stephani}, \TA{Niranjan Tambe}, \TA{Takuji Tanaka},
diff --git a/Master/texmf-dist/doc/latex/polyglossia/test-welsh.pdf b/Master/texmf-dist/doc/latex/polyglossia/test-welsh.pdf
deleted file mode 100644
index 8f18eb1e9df..00000000000
--- a/Master/texmf-dist/doc/latex/polyglossia/test-welsh.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx b/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
index 09cac66703d..9e018afc668 100644
--- a/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
+++ b/Master/texmf-dist/source/latex/polyglossia/polyglossia.dtx
@@ -8,7 +8,7 @@
\iffalse
%</internal>
%<*README>
-# THE POLYGLOSSIA PACKAGE v2.1
+# THE POLYGLOSSIA PACKAGE v2.2
## Multilingual typesetting with XeLaTeX and LuaLaTeX
This package provides an alternative to Babel for users of XeLaTeX and LuaLaTeX.
@@ -65,7 +65,8 @@ to track the issues and follow progress.
____________________________
The polyglossia package
- (C) 2008–2010 François Charette
+ (C) 2008–2010 François Charette
+ (C) 2023-2024 Udi Fogiel
(C) 2011–2024 Arthur Reutenauer
(C) 2013 Elie Roux
(C) 2019 Bastien Roucariès
@@ -76,19 +77,29 @@ to track the issues and follow progress.
\endpreamble
\postamble
- Copyright (C) 2024 by Arthur Reutenauer <arthur 'dot' reutenauer 'at' normalesup 'dot' org>
+ Copyright (C) 2024 by The Polyglossia Team http://github.com/reutenauer/polyglossia/
- This work may be distributed and/or modified under the
- conditions of the LaTeX Project Public License, either version 1.3
- of this license of (at your option) any later version.
- The latest version of this license is in
- http://www.latex-project.org/lppl.txt
- and version 1.3 or later is part of all distributions of LaTeX
- version 2005/12/01 or later.
-
- This work has the LPPL maintenance status `maintained'.
+ Except where otherwise noted, Polyglossia is placed under the terms of the
+ MIT licence (https://opensource.org/licenses/MIT).
+
+ 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 without limitation
+ the rights to use, copy, modify, merge, publish, 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 THE AUTHORS OR
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
+ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- The Current Maintainer of this work is Arthur Reutenauer.
+ Please report issues to http://github.com/reutenauer/polyglossia/issues
\endpostamble
@@ -98,8 +109,8 @@ to track the issues and follow progress.
\generate{\file{farsical.sty}{\from{polyglossia.dtx}{farsical.sty}}}
\generate{\file{hebrewcal.sty}{\from{polyglossia.dtx}{hebrewcal.sty}}}
\generate{\file{hijrical.sty}{\from{polyglossia.dtx}{hijrical.sty}}}
+\generate{\file{polyglossia-cjk-spacing.lua}{\from{polyglossia.dtx}{polyglossia-cjk-spacing.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}}}
@@ -109,7 +120,7 @@ to track the issues and follow progress.
\generate{\file{babelsh.def}{\from{polyglossia.dtx}{babelsh.def}}}
\generate{\file{cal-util.def}{\from{polyglossia.dtx}{cal-util.def}}}
\generate{\file{xgreek-fixes.def}{\from{polyglossia.dtx}{xgreek-fixes.def}}}
-\generate{\file{gloss-acadien.ldf}{\from{polyglossia.dtx}{gloss-acadien.ldf}}}
+\generate{\file{gloss-acadian.ldf}{\from{polyglossia.dtx}{gloss-acadian.ldf}}}
\generate{\file{gloss-aeb.ldf}{\from{polyglossia.dtx}{gloss-aeb.ldf}}}
\generate{\file{gloss-af.ldf}{\from{polyglossia.dtx}{gloss-af.ldf}}}
\generate{\file{gloss-afb.ldf}{\from{polyglossia.dtx}{gloss-afb.ldf}}}
@@ -163,6 +174,7 @@ to track the issues and follow progress.
\generate{\file{gloss-ckb-Arab.ldf}{\from{polyglossia.dtx}{gloss-ckb-Arab.ldf}}}
\generate{\file{gloss-ckb-Latn.ldf}{\from{polyglossia.dtx}{gloss-ckb-Latn.ldf}}}
\generate{\file{gloss-ckb.ldf}{\from{polyglossia.dtx}{gloss-ckb.ldf}}}
+\generate{\file{gloss-classiclatin.ldf}{\from{polyglossia.dtx}{gloss-classiclatin.ldf}}}
\generate{\file{gloss-cop.ldf}{\from{polyglossia.dtx}{gloss-cop.ldf}}}
\generate{\file{gloss-coptic.ldf}{\from{polyglossia.dtx}{gloss-coptic.ldf}}}
\generate{\file{gloss-croatian.ldf}{\from{polyglossia.dtx}{gloss-croatian.ldf}}}
@@ -195,6 +207,7 @@ to track the issues and follow progress.
\generate{\file{gloss-dsb.ldf}{\from{polyglossia.dtx}{gloss-dsb.ldf}}}
\generate{\file{gloss-dutch.ldf}{\from{polyglossia.dtx}{gloss-dutch.ldf}}}
\generate{\file{gloss-dv.ldf}{\from{polyglossia.dtx}{gloss-dv.ldf}}}
+\generate{\file{gloss-ecclesiasticlatin.ldf}{\from{polyglossia.dtx}{gloss-ecclesiasticlatin.ldf}}}
\generate{\file{gloss-el-monoton.ldf}{\from{polyglossia.dtx}{gloss-el-monoton.ldf}}}
\generate{\file{gloss-el-polyton.ldf}{\from{polyglossia.dtx}{gloss-el-polyton.ldf}}}
\generate{\file{gloss-el.ldf}{\from{polyglossia.dtx}{gloss-el.ldf}}}
@@ -277,9 +290,6 @@ to track the issues and follow progress.
\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-lo.ldf}{\from{polyglossia.dtx}{gloss-lo.ldf}}}
@@ -292,6 +302,7 @@ to track the issues and follow progress.
\generate{\file{gloss-malay.ldf}{\from{polyglossia.dtx}{gloss-malay.ldf}}}
\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-medievallatin.ldf}{\from{polyglossia.dtx}{gloss-medievallatin.ldf}}}
\generate{\file{gloss-mk.ldf}{\from{polyglossia.dtx}{gloss-mk.ldf}}}
\generate{\file{gloss-ml.ldf}{\from{polyglossia.dtx}{gloss-ml.ldf}}}
\generate{\file{gloss-mn.ldf}{\from{polyglossia.dtx}{gloss-mn.ldf}}}
@@ -351,16 +362,9 @@ to track the issues and follow progress.
\generate{\file{gloss-welsh.ldf}{\from{polyglossia.dtx}{gloss-welsh.ldf}}}
\generate{\file{gloss-zh-CN.ldf}{\from{polyglossia.dtx}{gloss-zh-CN.ldf}}}
\generate{\file{gloss-zh-TW.ldf}{\from{polyglossia.dtx}{gloss-zh-TW.ldf}}}
-\generate{\file{arabicdigits.map}{\from{polyglossia.dtx}{arabicdigits.map}}}
-\generate{\file{bengalidigits.map}{\from{polyglossia.dtx}{bengalidigits.map}}}
-\generate{\file{devanagaridigits.map}{\from{polyglossia.dtx}{devanagaridigits.map}}}
-\generate{\file{farsidigits.map}{\from{polyglossia.dtx}{farsidigits.map}}}
-\generate{\file{gurmukhidigits.map}{\from{polyglossia.dtx}{gurmukhidigits.map}}}
-\generate{\file{odiadigits.map}{\from{polyglossia.dtx}{odiadigits.map}}}
-\generate{\file{thaidigits.map}{\from{polyglossia.dtx}{thaidigits.map}}}
\def\MetaPrefix{-- }
+\generate{\file{polyglossia-cjk-spacing.lua}{\from{polyglossia.dtx}{polyglossia-cjk-spacing.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}}}
@@ -405,8 +409,10 @@ to track the issues and follow progress.
]{hyperref}
\usepackage{array}
\usepackage{metalogo}
-\let\XeTeX\undefined
-\let\XeLaTeX\undefined
+\ifxetex
+ \let\XeTeX\undefined
+ \let\XeLaTeX\undefined
+\fi
\usepackage[babelshorthands]{polyglossia}
\usepackage{farsical}
%
@@ -506,15 +512,23 @@ to track the issues and follow progress.
\usepackage[osf]{libertine}
% Monospace: Package dejavu-otf
\setmonofont[Scale=MatchLowercase]{DejaVuSansMono}
-% Libertine includes Hebrew, but we load it separately since
-% osf is not supported with this script and we want to avoid the
-% respective warnings
-\newfontfamily\hebrewfont[Script=Hebrew]{Linux Libertine O}
+% Package culmus
+\newfontfamily\hebrewfont[Script=Hebrew]{DavidCLM}[
+ UprightFont = *-Medium,
+ BoldFont = *-Bold,
+ Extension = .otf,
+ ItalicFont = *-MediumItalic,
+ BoldItalicFont = *-BoldItalic]
% Package dejavu-otf
\newfontfamily\armenianfont[Script=Armenian,Scale=MatchLowercase]{DejaVuSans}
\newfontfamily\georgianfont[Scale=MatchLowercase]{DejaVuSerif}
% Package amiri
-\newfontfamily\arabicfont[Script=Arabic]{Amiri-Regular}
+\newfontfamily\arabicfont[Script=Arabic]{Amiri}[%
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ Extension = .ttf,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic]
% No Syriac otf/ttf font seems available on CTAN
% This one, from the Syriac Institute, is included on Linux
% in the x11-fonts set and can be downloaded from
@@ -850,7 +864,7 @@ to track the issues and follow progress.
% dv & divehi & \tabularnewline
% el & greek & \tabularnewline
% el-monoton & greek & variant=monotonic [\emph{default}] \tabularnewline
-% el-polyton & greek & varant=polytonic \tabularnewline
+% el-polyton & greek & variant=polytonic \tabularnewline
% en & english & \tabularnewline
% en-AU & english & variant=australian \tabularnewline
% en-CA & english & variant=canadian \tabularnewline
@@ -1164,13 +1178,25 @@ to track the issues and follow progress.
%
% \section{Font setup}
%
-% With polyglossia it is possible to associate a specific font with any script or language
+% With \pkg{polyglossia} it is possible to associate a specific font with any script or language
% that occurs in the document. That font should always be defined as
-% \cmd{\⟨script⟩font}\ or \cmd{\⟨language⟩font}.
+% \cmd{\⟨script⟩font}\ or \cmd{\⟨language⟩font}. Note that ¦⟨language⟩¦ points to the \pkg{polyglossia}
+% language name, ¦⟨script⟩¦ might point either to an OpenType script name as defined by \pkg{fontspec}
+% (\eg ¦Latin¦) \new{2.2}or a BCP-47 script tag (\eg ¦Latn¦), though the script is fully lower-cased
+% in the \cmd{\⟨script⟩font}\ command.
+%
% 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,\meta{…}]\marg{font}}. }
-% Note that polyglossia will use the font defined as is, so assure to do all necessary settings
+% \centerline{\cmd\newfontfamily\cmd{\greekfont[Script=Greek,\meta{…}]\marg{font}}}
+% ^^A
+% If you want to setup a blackletter font specifically for the German blackletter script variant,
+% you might do so by:\\
+% \centerline{\cmd\newfontfamily\cmd{\latffont[\meta{…}]\marg{font}}}
+% ^^A
+% Setting up a font specifically for traditional Chinese is possible via:\\
+% \centerline{\cmd\newfontfamily\cmd{\hantfont[Script=CJK,\meta{…}]\marg{font}}}
+% ^^A
+% Note that \pkg{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 \cmd\arabicfont\ is explicitly defined, then the option ¦Script=Arabic¦ should
% be included in that definition.
@@ -1180,10 +1206,12 @@ to track the issues and follow progress.
% \cmd{\⟨script⟩fontsf} or \cmd{\⟨language⟩fontsf} and \cmd{\⟨script⟩fonttt} or \cmd{\⟨language⟩fonttt}, respectively.
%
% Whenever a new language is activated, \pkg{polyglossia} will first check whether
-% a font has been defined for that language or – for languages in non-Latin scripts –
-% for the script it uses. If it is not defined, it will use the currently active font
-% and – in the case of OpenType fonts – will attempt to turn on the appropriate
-% OpenType tags for the script and language used, in case these are available in
+% a font has been defined for that language. If this is not the case, it will check whether a font associated
+% with the BCP-47 script tag of the current language is defined. If this also isn't the case, \pkg{polyglossia}
+% will finally check (but this only for languages in non-Latin scripts) whether there is a font associated
+% with the OpenType script tag. If none of these fonts is defined, \pkg{polyglossia} will use the currently
+% active font as defined by ¦\setmainfont¦, ¦\setsansfont¦ or ¦\setmonofont¦ and – in the case of OpenType fonts –
+% will attempt to turn on the appropriate OpenType tags for the script and language used, in case these are available in
% the font, by means of \pkg{fontspec}’s \cmd\addfontfeature. If the current font
% does not appear to support the script of that language, an error message is
% displayed.
@@ -1978,7 +2006,7 @@ to track the issues and follow progress.
% \end{table}
% \item \xpgchoicekey[1.46]{hyphenation}{\xpgvalue{classic}, \xpgvalue{modern}, or \xpgvalue{liturgical}}
% There are three different sets of hyphenation patterns for Latin. Separate
-% documention for them is available on the
+% documentation for them is available on the
% Internet.\footnote{Refer to \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
@@ -2050,7 +2078,7 @@ to track the issues and follow progress.
% \item[¦'AE¦] for Ǽ (AE ligature with acute), also available for \'Œ
% \end{shorthands}
% \item \xpgboolkeyfalse[1.46]{prosodicshorthands}
-% Enable shorthands for prosodic marks (macrons and breves) very similiar to
+% Enable shorthands for prosodic marks (macrons and breves) very similar to
% those provided by \pkg{babel-latin} using the ¦withprosodicmarks¦
% modifier.
% Note that the active ¦=¦ character used for macrons will cause problems with
@@ -2956,7 +2984,7 @@ to track the issues and follow progress.
% \subsection{Islamic calendar (hijrical.sty)}\label{sec:hijrical}
% This package computes dates in the lunar Islamic (Hijra) calendar.\footnote{ %
% It makes use of the arithmetical algorithm in chapter 6 of
-% Reingold \& Gershowitz, \textit{Calendrical calculation: the Millenium edition}
+% Reingold \& Gershowitz, \textit{Calendrical calculation: the Millennium edition}
% (Cambridge University Press, 2001).\label{reingold}}
% It provides two macros for the end-user.
% The command
@@ -3091,6 +3119,31 @@ to track the issues and follow progress.
%
% \bgroup\footnotesize
%
+% \subsection*{2.2 (2024/07/15)}
+%
+% \subsubsection*{Bug fixes}
+% \begin{itemize}
+% \item Fix \texttt{lang} environment (\TXI{633}).
+% \item Fix first number of Maghrib abjad numbering for Algeria, Morocco and
+% Tunisia (\TXI{640}).
+% \item Fix some captions strings in Bulgarian, Chinese, Esperanto, Estonian, Hindi,
+% Latvian, and Slovak (\TXP{651})
+% \item Improve performance with multilingual documents that have a TOC (\TXI{641}).
+% \end{itemize}
+%
+% \subsubsection*{New Features}
+% \begin{itemize}
+% \item Add possibility to associate a font to a language/variant with reference to
+% a BCP-47 script tag (\TXI{636}).
+% \end{itemize}
+%
+% \subsubsection*{Internal work}
+% \begin{itemize}
+% \item The major rewrite of the package code has been finished. More code has been cleaned up,
+% and \pkg{polyglossia} employs modern concepts (\pkg{latex3} and modern \LaTeXe).
+% All key-val handling uses \pkg{l3keys} now rather than \pkg{xkeyval}.
+% \end{itemize}
+%
% \subsection*{2.1 (2024/03/07)}
%
% \subsubsection*{Bug fixes}
@@ -4149,7 +4202,7 @@ to track the issues and follow progress.
% \section{Acknowledgements (by François Charette)}
% \pkg{Polyglossia} is notable for being a recycle box of previous contributions
% 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
+% whose splendid work has made my task almost trivial in comparison: \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 Kryukov} (\pkg{antomega}),
% \TA{Will Robertson} (\pkg{fontspec}), \TA{Apostolos Syropoulos} (\pkg{xgreek}), \TA{Youssef Jabri}
@@ -4176,7 +4229,7 @@ to track the issues and follow progress.
% since we took over.
% In alphabetical order: \TA{Ignas Anikevicius}, \TA{Sina Ahmadi}, \TA{Matthew Bertucci}, \TA{Wouter Bolsterlee}, \TA{Christian Buhtz},
% \TA{Ashok Das}, \TA{Oleg Domanov}, user \TA{fakhriaunur}, \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{Enrico Gregorio}, \TA{Khaled Hosny}, \TA{Stephen Huan}, \TA{Najib Idrissi}, user \TA{julroy67}, \TA{Dohyun Kim}, \TA{Phil Kime},
% \TA{Mike Kroutikov}, \TA{Ivan Kokan}, \TA{Caleb Maclennan}, \TA{Gyula Magyarkuti}, \TA{José Mancera}, \TA{Miquel Ortega},
% \TA{Yevgen Pogribnyi}, \TA{Will Robertson}, \TA{Maïeul Rouquette}, \TA{Elie Roux}, \TA{Hugo Roy}, \TA{Guy Rutenberg},
% \TA{Marcin Serwin}, \TA{Arvinder Singh}, \TA{Avisek Jena}, \TA{Philipp Stephani}, \TA{Niranjan Tambe}, \TA{Takuji Tanaka},
@@ -4208,33 +4261,28 @@ to track the issues and follow progress.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesExplPackage
- {polyglossia} {2024/03/07} {v2.1}
+ {polyglossia} {2024/07/15} {v2.2}
{Modern multilingual typesetting with XeLaTeX and LuaLaTeX}
+% TODO Handle remaining uses in the gloss files (\patchcmd)
+% and remove package call afterwards
\RequirePackage{etoolbox}
-\RequirePackage{xkeyval}[2008/08/13]
% Will raise error if used with anything else than XeTeX or LuaTeX
\RequirePackage{fontspec}[2010/06/08]% v2.0
\RequirePackage{iftex}
\prg_generate_conditional_variant:Nnn \clist_if_in:Nn {Ne} {TF, T, F} % check if needed
-% correct a bug in tracklang
-\AddToHook{package/tracklang/after}{%
- \IfPackageAtLeastTF{tracklang}{2019/08/30}
- {}
- {\cs_gset_eq:NN \AddTrackedLangage \AddTrackedLanguage}
-}
-
%% The following is for compatibility with Babel-aware package:
% \languageshorthands is provided by babelsh.def, which is
% only loaded by some glosses, but some classes presuppose
% it is there generally. So let's provide a stub:
\ProvideDocumentCommand \languageshorthands { m } {}
% These have to be provided at the end of the preamble
-\AddToHook{begindocument/before}{
- \cs_gset_eq:NN \bbl@set@language \xpg@set@language@aux % for biblatex
- \cs_gset_eq:NN \bbl@main@language \xpg@main@language % for biblatex
+\hook_gput_code:nnn {begindocument/before} {.}
+{
+ \cs_gset_eq:NN \bbl@set@language \xpg_set_language_aux:nn % for biblatex
+ \cs_gset_eq:NN \bbl@main@language \xpg_main_language_tl % for biblatex
\ProvideDocumentCommand \texorpdfstring { m m } { #1 } % dummy command if hyperref is not loaded
}
@@ -4243,16 +4291,15 @@ to track the issues and follow progress.
%% \l@nohyphenation is defined in polyglossia.lua
\sys_if_engine_luatex:TF
{
- \RequirePackage{luatexbase} % already included by fontspec, but needed here
- \RequireLuaModule{polyglossia}
+ \lua_load_module:n{polyglossia}
}{
\cs_if_free:cT { l@nohyphenation }
{ \chardef\l@nohyphenation=255 }
}
-% Which version of XeTeX do we use? What is the boudary class? 4095 or 255
+% Which version of XeTeX do we use? What is the boundary class? 4095 or 255
\cs_if_exist:cTF { e@alloc@intercharclass@top }
- { \let\xpg@boundaryclass=\e@alloc@intercharclass@top }
+ { \cs_gset_eq:NN \xpg@boundaryclass \e@alloc@intercharclass@top }
{ \chardef\xpg@boundaryclass=\@cclv }
% Useful for getting list of loaded languages and variants. Like babel's bbl@loaded
@@ -4288,18 +4335,18 @@ to track the issues and follow progress.
\cs_new_nopar:Nn \__xpg_at_begin_document:
{
% save various command
- \let\latin@alph\@alph % TODO rename when we have the C locale
- \let\latin@Alph\@Alph % TODO rename when we have the C locale
+ \cs_gset_eq:cc{latin@alph}{@alph}% TODO rename when we have the C locale
+ \cs_gset_eq:cc{latin@Alph}{@Alph}% TODO rename when we have the C locale
% push to C language gloss
- \let\polyglossia@Clang@@arabic\@arabic
- \let\polyglossia@Clang@arabic\arabic
+ \cs_gset_eq:cc{xpg_Clang_arabic}{@arabic}
\xpg_initial_setup:
% apply \familydefault changes
- \xpg@set@familydefault
+ \xpg_set_familydefault:
}
-\AddToHook{begindocument}{
+\hook_gput_code:nnn {begindocument} {.}
+{
\__xpg_at_begin_document:
}
@@ -4307,7 +4354,8 @@ to track the issues and follow progress.
% loaded after \set[main|other]language
% Track whether the main language has been set
\bool_new:N \g_xpg_main_lang_set_bool
-\AddToHook{begindocument/end}{
+\hook_gput_code:nnn {begindocument/end} {.}
+{
% now we have the C locale definition: select the language
\__xpg_at_begin_document_selectlanguage:
\bool_gset_true:N \g_xpg_main_lang_set_bool
@@ -4315,99 +4363,177 @@ to track the issues and follow progress.
\__xpg_at_begin_document_hyphenation:
}
-%% custom message macros
-\providecommand*{\xpg@error}[1]{
- \PackageError{polyglossia}{#1}{}
+%
+% MESSAGES
+%
+
+% message templates
+\msg_new:nnn { polyglossia } { general } { #1 }
+
+\msg_new:nnn { polyglossia } { languagenotloaded }
+{
+ The~ language~ #1~ is~ not~ loaded.~ You~ must~ load~ it~ in~ order~ to~ use~ it.
}
+\msg_redirect_name:nnn { polyglossia } { languagenotloaded } { critical }
-\providecommand*{\xpg@warning}[1]{
- \PackageWarning{polyglossia}{#1}
+\msg_new:nnn { polyglossia } { languagenolongerloaded }
+{
+ The~ language~ #1~ is~ no~ longer~ loaded.~ Please~ rerun~ LaTeX.
}
+\msg_redirect_name:nnn { polyglossia } { languagenolongerloaded } { warning }
-\providecommand*{\xpg@info}[1]{
- \PackageInfo{polyglossia}
- {#1\@gobble}
-} %% the \@gobble is to prevent displaying the line nr
+\msg_new:nnn { polyglossia } { unknownlocalnumeral }
+{
+ Unknown~ key~ "#1"~ in~ \string\localnumeral.
+}
-%TODO change all instances of \xpg@nopatterns in gloss-*.ldf files
-\providecommand*{\xpg@nopatterns@fallback}[2][nohyphenation]{
- \xpg@warning{No~ hyphenation~ patterns~ were~ loaded~ for~ `#2'\MessageBreak
- I~ will~ use~ \string\language=\string\l@ #1\space instead}
- \expandafter\adddialect\csname l@#2\expandafter\endcsname\csname l@#1\endcsname\relax}
+\msg_new:nnn { polyglossia } { localnumeralemptyvalue }
+{
+ Keys~ of~ \string\localnumeral~ must~ have~ a~ value.
+}
-\providecommand*{\xpg@nopatterns}[1]{
- \xpg@warning{No~ hyphenation~ patterns~ were~ loaded~ for~ `#1'\MessageBreak
- I~ will~ use~ \string\language=\string\l@nohyphenation\space instead}
- %%TODO? \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax
- }
+\msg_new:nnn { polyglossia } { illvalue }
+{
+ Illegal~ value~ (#1)~ for~ #2!
+}
-\def\xpg@ill@value#1#2{
- \xpg@warning{Illegal~ value~ (#1)~ for~ #2}}
+\msg_new:nnn { polyglossia } { illarg }
+{
+ Invalid~ argument~ (#1)~ for~ #2!
+}
-% error out if lang is not loaded
-\cs_new_nopar:Nn \xpg_error_if_lang_not_loaded:n
+\msg_new:nnn { polyglossia } { nopatterns }
{
- \seq_if_in:NeF \__xpg_langs_loaded {#1}
- {
- \xpg@error{language~ #1~ is~ not~ loaded.~ Please~ load~ it~ before~ using~ it.}
- }
+ No~ hyphenation~ patterns~ were~ loaded~ for~ `#2' \iow_newline:
+ I~ will~ use~ \string\language=\string\l@ #1\space instead.
}
-\msg_new:nnn { polyglossia } { languagenotloaded }
+\msg_new:nnn { polyglossia } { undefcmd }
{
- The~ language~ #1~ is~ not~ loaded.~ You~ should~ load~ it.
+ \tl_to_str:N {#1} ~ is~ not~ defined!
}
-\msg_redirect_name:nnn { polyglossia } { languagenotloaded } { critical }
-\msg_new:nnn { polyglossia } { languagenolongerloaded }
+%% custom message macros
+\cs_new_nopar:Nn \xpg_error_msg:n
{
- The~ language~ #1~ is~ no~ longer~ loaded.~ Please~ rerun~ LaTeX.
+ \exp_args:Nnne \msg_error:nnn { polyglossia } { general } { #1 }
}
-\msg_redirect_name:nnn { polyglossia } { languagenolongerloaded } { warning }
-\msg_new:nnn { polyglossia } { unknownlocalnumeral }
+\cs_new_nopar:Nn \xpg_warning_msg:n
{
- Unknown~ key~ "#1"~ in~ \string\localnumeral.
+ \exp_args:Nnne \msg_warning:nnn { polyglossia } { general } { #1 }
}
-\msg_new:nnn { polyglossia } { localnumeralemptyvalue }
+\cs_new_nopar:Nn \xpg_info_msg:n
+{
+ \exp_args:Nnne \msg_info:nnn { polyglossia } { general } { #1 }
+}
+
+\cs_new_nopar:Nn \xpg_no_patterns_msg:n
{
- Keys~ of~ \string\localnumeral~ must~ have~ value.
+ \msg_warning:nnnn { polyglossia } { nopatterns } { nohyphenation } { #1 }
}
+\cs_new_nopar:Nn \xpg_ill_value_msg:nn
+{
+ \msg_warning:nnnn { polyglossia } { illvalue } { #1 } { #2 }
+}
+
+\cs_new_nopar:Nn \xpg_ill_arg_msg:nn
+{
+ \msg_error:nnnn { polyglossia } { illarg } { #1 } { #2 }
+}
+
+% error out if lang is not loaded
+\cs_new_nopar:Nn \xpg_error_if_lang_not_loaded:n
+{
+ \seq_if_in:NeF \__xpg_langs_loaded {#1}
+ {
+ \msg_error:nnn { polyglossia } { languagenotloaded } { #1 }
+ }
+}
%% use macro if defined, else warn that it is not
\cs_new_nopar:Nn \__xpg_use_or_warn:N
{
\cs_if_exist_use:NF {#1}
{
- \xpg@warning { \tl_to_str:N {#1} ~ is~ not~ defined }
+ \msg_error:nnn { polyglossia } { undefcmd } { #1 }
}
}
\cs_generate_variant:Nn \__xpg_use_or_warn:N {c}
+% gloss message interface
+\cs_set_eq:cc { xpg@error } { xpg_error_msg:n }
+\cs_set_eq:cc { xpg@warning } { xpg_warning_msg:n }
+\cs_set_eq:cc { xpg@info } { xpg_info_msg:n }
+\cs_set_eq:cc { xpg@ill@value } { xpg_ill_value_msg:nn }
+
+
+\NewDocumentCommand \XPGNoPatternsFallback { O{ nohyphenation } m }
+{
+ \msg_warning:nnnn { polyglossia } { nopatterns } { #1 } { #2 }
+ \exp_args:Ncc \adddialect {l@#2} {l@#1}
+}
+
+\NewDocumentCommand \CheckHyphenationPatterns { m }
+{
+ \xpg_if_language_defined:nF {#1}
+ {
+ \XPGNoPatternsFallback{#1}
+ }
+}
+
+%
+% END MESSAGES
+
%% ensure directionality if bidi is loaded, else ignore
-\def\@@ensure@dir#1{\ifcsundef{@ensure@dir}{#1}{\@ensure@dir{#1}}}
-\def\@@ensure@maindir#1{\ifcsundef{@ensure@maindir}{#1}{\@ensure@maindir{#1}}}
+%%% FIXME still used?
+\cs_new_nopar:Npn \@@ensure@dir #1
+{
+ \cs_if_exist_use:c{@ensure@dir}{#1}
+}
-%% Used by the language definitions files for right-to-left languages
-\NewDocumentCommand \RequireBidi {}
+\cs_new_nopar:Npn \@@ensure@maindir #1
{
- \sys_if_engine_luatex:TF
- {\ifx\@onlypreamble\@notprerr\else\RequirePackage{luabidi}\fi}
- {\ifx\@onlypreamble\@notprerr\else\RequirePackage{bidi}\fi}
+ \cs_if_exist_use:c{@ensure@maindir}{#1}
}
-% if #1 is LR run #2 else #3
+% if we are in the document preamble run T else F
+\prg_set_conditional:Nnn \xpg_if_in_preamble: {T, F, TF}
+{
+ \cs_if_eq:NNTF { \@onlypreamble } { \@notprerr }
+ {
+ \prg_return_false:
+ }
+ {
+ \prg_return_true:
+ }
+}
+
+%% Used by the language definitions files for right-to-left languages
+\DeclareDocumentCommand \RequireBidi {}
+ {
+ \xpg_if_in_preamble:T
+ {
+ \sys_if_engine_luatex:TF
+ { \RequirePackage{luabidi} }
+ { \RequirePackage{bidi} }
+ }
+ \DeclareDocumentCommand \RequireBidi {} {}
+ }
+
+% if #1 is LR run T else F
\prg_set_conditional:Nnn \__xpg_if_LR_str:n {p, T, F, TF}
{
- \str_case_e:nnF{#1}{
+ \str_case_e:nnF{#1}
+ {
{LR}{\prg_return_true:}
{RL}{\prg_return_false:}
}
{
- \xpg@error{Unknown~ direction~#1}
+ \xpg_error_msg:n {Unknown~ direction~#1}
\prg_return_false:
}
}
@@ -4420,17 +4546,18 @@ to track the issues and follow progress.
{
\__xpg_if_LR_str:nF {#1}
{
- \xpg@error{right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
+ \xpg_error_msg:n {right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
}
}
\cs_new_nopar:Nn \__xpg_set_text_direction:n
{
\__xpg_if_LR_str:nF {#1}
{
- \xpg@error{right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
+ \xpg_error_msg:n {right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
}
}
-\AddToHook{package/bidi/after}{
+\hook_gput_code:nnn {package/bidi/after} {.}
+{
\cs_gset_nopar:Nn \__xpg_set_par_direction:n
{
\__xpg_if_LR_str:nTF{#1}
@@ -4452,7 +4579,8 @@ to track the issues and follow progress.
}
}
}
-\AddToHook{package/luabidi/after}{
+\hook_gput_code:nnn {package/luabidi/after} {.}
+{
\cs_gset_nopar:Nn \__xpg_set_par_direction:n
{
\__xpg_if_LR_str:nTF{#1}
@@ -4481,13 +4609,21 @@ to track the issues and follow progress.
{ \cs_new_nopar:Nn \__xpg_setRTLmain: { \@RTLmaintrue\setnonlatin } }
%% compatibility with babel
-\let\addto\gappto % gappto is defined in etoolbox
+\cs_set:Npn \addto #1 #2
+{
+ \cs_if_exist:NF { #1 }
+ { \cs_new:Npn { #1 } {} }
+ \tl_gput_right:Nn { #1 } { #2 }
+}
-%% NEW EXPERIMENTAL SETUP INTERFACE FOR GLOSS FILES
+%% SETUP INTERFACE FOR GLOSS FILES
%% options currently available:
%% language : the name of the language (as understood by fontspec)
%% hyphennames : the different hyphenation patterns to try (comma separated list)
-%%% TODO: if pattern is prefixed by !, then it should be loaded as a fallback, with \xpg@nopatterns@fallback - i.e. with a warning: e.g. sanskrit for hindi, or catalan for asturian. – Also for languages with variants! (English and German, etc.)
+%%% TODO: if pattern is prefixed by !, then it should be loaded as a fallback,
+%%%% with \CheckHyphenationPatterns - i.e. with a warning: e.g. sanskrit for hindi,
+%%%% or catalan for asturian. – Also for languages with variants!
+%%%% (English and German, etc.)
%% script : the name of the script (as understood by fontspec) – default is Latin
%% scripttag : the OpenType tag for the script
%% langtag : the OpenType tag for the language
@@ -4495,19 +4631,20 @@ to track the issues and follow progress.
%% frenchspacing : boolean
%% indentfirst : boolean
%% fontsetup : boolean
-%% TODO: nouppercase : boolean (for scripts like Arabic, Devanagari, etc which have no concept of uppercase/lowercase)
+%% TODO: nouppercase : boolean (for scripts like Arabic, Devanagari, etc which have
+%% no concept of uppercase/lowercase)
%% TODO: localalph = {<alph_csname>,<Alph_csname>}
%% TODO: localnumeral = <csname>
%% or even better localdigits = {0123456789} for fully automatic setup
-\newcommand*\PolyglossiaSetup[2]{
+\NewDocumentCommand \PolyglossiaSetup { m m }
+{
\__xpg_keys_define_lang:n{#1}
\keys_set:nn { polyglossia / #1 } { #2 }
\__xpg_setup_hyphen:n {#1}
%define booleans etoolbox style and set defaults
%% TODO ? \providetoggle{#1@setup@done}%
- % we initialize these so that we can use \gappto below
- \csgdef{init@extras@#1}{}
- \csgdef{init@noextras@#1}{} % we don't use this yet: remove?
+ % we initialize this so that we can append below
+ \cs_gset:cpn {init@extras@#1} {}
% here we do the fontsetup:
\__xpg_auto_setupfont:n { #1 }
%% TODO? \toggletrue{#1@setup@done}
@@ -4526,35 +4663,41 @@ to track the issues and follow progress.
\clist_map_inline:nn { #1 } { \keys_set:nn { polyglossia / ##1 } { #2 } }
}
-
+\bool_new:N \l__xpg_have_hyphen_bool
% setup hyphennames from a str list of hyphen
\cs_new:Nn \__xpg_setup_hyphen:n
{
- \clist_set:Ne{\l_tmpa_clist}{\prop_item:Nn \g_xpg_langsetup_prop {#1 / hyphennames}}
- \providebool{havehyphen}
- \boolfalse{havehyphen}
+ \clist_set:Ne{\l_tmpa_clist}{\prop_item:Nn \l_xpg_langsetup_prop {#1 / hyphennames}}
+ \bool_set_false:N \l__xpg_have_hyphen_bool
% for each hyphen in the set until we find one that works
- \clist_map_inline:Nn \l_tmpa_clist {
- \ifbool{havehyphen}{}{
+ \clist_map_inline:Nn \l_tmpa_clist
+ {
+ \bool_if:NF \l__xpg_have_hyphen_bool
+ {
% check if language hyphenname is defined
- \__xpg_check_if_exist_l@:nF{#1}{
+ \__xpg_pattern_check_if_exists:nF{#1}
+ {
% if not, first consider nohyphenation
\str_if_eq:nnTF{##1}{nohyphenation}
{
\cs_gset_eq:cc{l@#1}{l@##1}
- \global\booltrue{havehyphen}
- }{
+ \bool_gset_true:N \l__xpg_have_hyphen_bool
+ }
+ {
% then test if hyphenation is defined
- \xpg@ifdefined{##1}{
+ \xpg_if_language_defined:nT {##1}
+ {
% test if language hyphenation is nohyphenation
- \cs_if_eq:cNF{l@#1}{\l@nohyphenation}{\global\booltrue{havehyphen}}{%
+ \cs_if_eq:cNTF{l@#1}{\l@nohyphenation}
+ { \bool_gset_true:N \l__xpg_have_hyphen_bool }
+ {
% if false define language to hyphenation if it is not equal...
\str_if_eq:nnF{#1}{##1}{\cs_gset_eq:cc{l@#1}{l@##1}}
% ...and load
- \xpg@set@hyphenation@patterns{##1}
- \global\booltrue{havehyphen}
- }
- }{}
+ \xpg_set_hyphenation_patterns:n {##1}
+ \bool_gset_true:N \l__xpg_have_hyphen_bool
+ }
+ }
}
}
}
@@ -4562,19 +4705,17 @@ to track the issues and follow progress.
% if l@#1 does not yet exist,
% we assign it to nohyphenation
% we do this here in case and if the hyphennames key was omitted
- \ifbool{havehyphen}{}{
- \xpg@ifdefined{#1}{}
- {
- \xpg@nopatterns{#1}
- \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax
- }
+ \bool_if:NF \l__xpg_have_hyphen_bool
+ {
+ \CheckHyphenationPatterns{#1}
}
- \csdef{#1@language}{
- \polyglossia@setup@language@patterns{#1}
+ \cs_gset:cpn {#1@language}
+ {
+ \SetupPolyglossiaLangPatterns{#1}
}
% setup hyphenmins
\clist_set:Ne \l_tmpa_clist
- { \prop_item:Nn \g_xpg_langsetup_prop {#1 / hyphenmins} }
+ { \prop_item:Nn \l_xpg_langsetup_prop {#1 / hyphenmins} }
\cs_if_eq:cNF {l@#1} \l@nohyphenation
{
\use:x
@@ -4586,7 +4727,8 @@ to track the issues and follow progress.
}
}
-\newcommand*\polyglossia@setup@language@patterns[1]{
+\NewDocumentCommand \SetupPolyglossiaLangPatterns { m }
+{
\bool_if:NTF \g__xpg_hyphenation_disabled_bool
{
\tl_gset:Ne \g__xpg_lastlanguage_tl {\the\csname l@#1\endcsname}
@@ -4600,32 +4742,29 @@ to track the issues and follow progress.
\language=\l@nohyphenation
}
{
- \xpg@set@hyphenation@patterns{#1}
+ \xpg_set_hyphenation_patterns:n {#1}
}
}
{
% Since this function is sometimes called from the gloss files
% directly, we need to check whether the requested hyphenname exists.
- \xpg@ifdefined{#1}{}
- {
- \xpg@nopatterns{#1}
- \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax%
- }
- \xpg@set@hyphenation@patterns{#1}
+ \CheckHyphenationPatterns{#1}
+ \xpg_set_hyphenation_patterns:n {#1}
}
}
}
-\prop_new:N \g_xpg_langsetup_prop
+\prop_new_linked:N \l_xpg_langsetup_prop
\cs_new_protected:Npn \__xpg_keys_define_lang:n #1
{
- \keys_define:nn {polyglossia}{
+ \keys_define:nn {polyglossia}
+ {
% the script font
#1 / script
.code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/script}{##1}
- \prop_gput:Nne{\g_xpg_langsetup_prop}{#1/lcscript}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/script}{##1}
+ \prop_put:Nne \l_xpg_langsetup_prop {#1/lcscript}
{\tl_if_empty:nF{##1}{\str_lowercase:n{##1}}}
},
#1 / script
@@ -4634,84 +4773,89 @@ to track the issues and follow progress.
.initial:n = latin,
% the opentype script tag
#1 / scripttag
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/scripttag}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/scripttag}{##1}},
#1 / scripttag
.default:n = {},
#1 / scripttag
.initial:n = {},
% the language full name
#1 / language
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/language}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/language}{##1}},
#1 / language
.value_required:n = true,
#1 / language
.initial:x = {\str_uppercase:n#1},
% the language tag
#1 / langtag
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/langtag}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/langtag}{##1}},
#1 / langtag
.value_required:n = true,
#1 / langtag
.initial:n = {},
% the BCP-47 tag
#1 / bcp47
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47}{##1}},
#1 / bcp47
.value_required:n = true,
#1 / bcp47
.initial:n = {},
% the BCP-47 language tag
#1 / bcp47-language
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-language}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-language}{##1}},
#1 / bcp47-language
.value_required:n = true,
#1 / bcp47-language
.initial:n = {},
% the BCP-47 region tag
#1 / bcp47-region
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-region}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-region}{##1}},
#1 / bcp47-region
.value_required:n = false,
#1 / bcp47-region
.initial:n = {},
% the BCP-47 script tag
#1 / bcp47-script
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-script}{##1}},
+ .code:n =
+ {
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-script}{##1}
+ \prop_put:Nne \l_xpg_langsetup_prop {#1/lc-bcp47-script}
+ {\tl_if_empty:nF{##1}{\str_lowercase:n{##1}}}
+ },
#1 / bcp47-script
.value_required:n = true,
#1 / bcp47-script
- .initial:n = {},
+ .initial:n = {Latn},
% the BCP-47 variant tag
#1 / bcp47-variant
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-variant}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-variant}{##1}},
#1 / bcp47-variant
.value_required:n = false,
#1 / bcp47-variant
.initial:n = {},
% the BCP-47 extension-t tag
#1 / bcp47-extension-t
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-extension-t}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-extension-t}{##1}},
#1 / bcp47-extension-t
.value_required:n = false,
#1 / bcp47-extension-t
.initial:n = {},
% the BCP-47 extension-u tag
#1 / bcp47-extension-u
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-extension-u}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-extension-u}{##1}},
#1 / bcp47-extension-u
.value_required:n = false,
#1 / bcp47-extension-u
.initial:n = {},
% the BCP-47 extension-x tag
#1 / bcp47-extension-x
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-extension-x}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-extension-x}{##1}},
#1 / bcp47-extension-x
.value_required:n = false,
#1 / bcp47-extension-x
.initial:n = {},
% the BCP-47 casing alias
#1 / bcp47-casing
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-casing}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-casing}{##1}},
#1 / bcp47-casing
.value_required:n = false,
#1 / bcp47-casing
@@ -4720,7 +4864,7 @@ to track the issues and follow progress.
#1 / hyphennames
.code:n = {
\clist_set:Nn{\l_tmpa_clist}{##1}
- \prop_gput:Nne{\g_xpg_langsetup_prop}{#1/hyphennames}{\clist_use:Nn \l_tmpa_clist {,}}
+ \prop_put:Nne \l_xpg_langsetup_prop {#1/hyphennames}{\clist_use:Nn \l_tmpa_clist {,}}
},
#1 / hyphennames
.value_required:n = true,
@@ -4733,8 +4877,8 @@ to track the issues and follow progress.
{LR}{}
{RL}{\RequireBidi}
}
- {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/direction}{##1}}
- {\xpg@error{Unknown~ direction~ "##1"~ for~ language~ "#1"}}
+ { \prop_put:Nnn \l_xpg_langsetup_prop {#1/direction}{##1} }
+ { \xpg_error_msg:n {Unknown~ direction~ "##1"~ for~ language~ "#1"} }
},
#1 / direction
.value_required:n = true,
@@ -4745,9 +4889,9 @@ to track the issues and follow progress.
.code:n = {
% check syntax
\int_compare:nNnF { \clist_count:n {##1} } = {2}
- {\xpg@error{hypenmins~should~be~a~list~of~two~entries,~got~"##1"}}
+ { \xpg_error_msg:n {hypenmins~should~be~a~list~of~two~entries,~got~"##1"} }
% set prop
- \prop_gput:Nnn \g_xpg_langsetup_prop {#1/hyphenmins} {##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/hyphenmins} {##1}
},
#1 / hyphenmins
.value_required:n = true,
@@ -4758,9 +4902,9 @@ to track the issues and follow progress.
.code:n = {
% check syntax
\int_compare:nNnF { \clist_count:n {##1} } = {1}
- {\xpg@error{totalhyphenhypenmin~should~be~a~single~entry,~got~"##1"}}
+ { \xpg_error_msg:n {totalhyphenhypenmin~should~be~a~single~entry,~got~"##1"} }
% set prop
- \prop_gput:Nnn \g_xpg_langsetup_prop {#1/totalhyphenmin} {##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/totalhyphenmin} {##1}
},
#1 / totalhyphenmin
.value_required:n = false,
@@ -4779,35 +4923,35 @@ to track the issues and follow progress.
% environment name
#1 / envname
.code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/envname}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/envname}{##1}
},
#1/ envname.value_required:n = true,
#1/ envname.initial:n = {#1},
% babel name
#1 / babelname
.code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/babelname}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/babelname}{##1}
},
#1/ babelname.value_required:n = true,
#1/ babelname.initial:n = {#1},
% default numerals
#1 / localnumeral
. code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/localnumeral}{##1}
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/Localnumeral}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/localnumeral}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/Localnumeral}{##1}
},
#1 / localnumeral.value_required:n = true,
- #1 / localnumeral.initial:n = {polyglossia@C@localnumeral},
+ #1 / localnumeral.initial:n = {xpg_C_localnumeral:nn},
% uppercased
#1 / Localnumeral
. code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/Localnumeral}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/Localnumeral}{##1}
},
#1 / Localnumeral.value_required:n = true,
- #1 / Localnumeral.initial:n = {polyglossia@C@localnumeral},
+ #1 / Localnumeral.initial:n = {xpg_C_localnumeral:nn},
% environment define command (by default create the environment)
#1 / DefineCommandsCmd
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/DefineCommandsCmd}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/DefineCommandsCmd}{##1}},
#1 / DefineCommandsCmd
.value_required:n = true,
#1 / DefineCommandsCmd
@@ -4815,9 +4959,20 @@ to track the issues and follow progress.
}
}
+\DeclareExpandableDocumentCommand \babelname { }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \languagename / babelname }
+ }
+
+\DeclareExpandableDocumentCommand \mainbabelname { }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / babelname }
+ }
+
% TODO move to C module
-\newcommand*{\polyglossia@C@localnumeral}[2]{
- \polyglossia@Clang@@arabic{#2}
+\cs_new:Nn \xpg_C_localnumeral:nn
+{
+ \xpg_Clang_arabic{#2}
}
\cs_new:Npn \__xpg_localnumeral_parse:nn #1 #2
@@ -4841,7 +4996,7 @@ to track the issues and follow progress.
\__xpg_localnumeral_parse:nn
} { #2 }
}
- { \use:c { \prop_item:Ne \g_xpg_langsetup_prop
+ { \use:c { \prop_item:Ne \l_xpg_langsetup_prop
{ \languagename / #3 } } { } { #1 } }
}
@@ -4876,31 +5031,31 @@ to track the issues and follow progress.
\cs_new_nopar:Npn \__xpg_indent_first:n #1
{
\bool_if:cTF { g__xpg_#1_if_bool }
- { \french@indent } { \nofrench@indent }
+ { \__xpg_french_indent: } { \__xpg_no_french_indent: }
}
\cs_new:Nn \__xpg_lang_set_par_direction:n
{
- \prop_get:NeNTF \g_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
+ \prop_get:NeNTF \l_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
{
\__xpg_set_par_direction:n{\l_tmpa_tl}
}
{
- \xpg@error{Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
- \prop_show:N{\g_xpg_langsetup_prop}
+ \xpg_error_msg:n {Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
+ \prop_show:N{\l_xpg_langsetup_prop}
}
}
\cs_new:Nn \__xpg_lang_set_text_direction:nn
{
- \prop_get:NeNTF \g_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
+ \prop_get:NeNTF \l_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
{
\__xpg_set_text_direction:n{\l_tmpa_tl}{#2}
}
{
- \xpg@error{Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
- \prop_show:N{\g_xpg_langsetup_prop}
+ \xpg_error_msg:n {Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
+ \prop_show:N{\l_xpg_langsetup_prop}
}
}
@@ -4931,7 +5086,7 @@ to track the issues and follow progress.
{
\bool_gset_true:N \g__xpg_hyphenation_disabled_bool
\tl_gset:Ne \g__xpg_lastlanguage_tl { \the\language }
- % We do not call \xpg@set@hyphenation@patterns here to avoid a warning message.
+ % We do not call \xpg_set_hyphenation_patterns:n here to avoid a warning message.
% "nohyphenation" is not listed in language.dat.lua.
\language=\l@nohyphenation
}
@@ -4943,19 +5098,19 @@ to track the issues and follow progress.
{
\bool_gset_false:N \g__xpg_hyphenation_disabled_bool
\language=\tl_use:N{\g__xpg_lastlanguage_tl}
- }%
+ }
}
\cs_new:Npn \__xpg_auto_setupfont:n #1
{
\bool_if:cTF { g__xpg_#1_fontsetup_bool }
{
- \str_if_eq:eeTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript}}{latin}
- {\xpg@fontsetup@latin{#1}}
- {\xpg@fontsetup@nonlatin{#1}}
+ \str_if_eq:eeTF{\prop_item:Nn{\l_xpg_langsetup_prop}{#1/lcscript}}{latin}
+ {\SetupLatinPolyglossiaFont{#1}}
+ {\SetupNonLatinPolyglossiaFont{#1}}
}
{
- \xpg@info{Skipping~ automatic~ font~ setup~ for~ language~ #1}
+ \xpg_info_msg:n{Skipping~ automatic~ font~ setup~ for~ language~ #1}
}
}
@@ -4967,40 +5122,40 @@ to track the issues and follow progress.
\bool_if:nTF{\tl_if_empty_p:n{#1} || \tl_if_empty_p:n{#2}}
{
% maybe an error ?
- \xpg@warning{Asking~ to~ add~ empty~ feature~to~ main~ font~
+ \xpg_warning_msg:n{Asking~ to~ add~ empty~ feature~to~ main~ font~
(Language="#2"~ to~ langtag~ "#1")}
}
{
- \str_if_eq:nnTF{#2}{Turkish}{
+ \str_if_eq:nnTF{#2}{Turkish}
+ {
\fontspec_if_language:nTF {TRK}
{
\addfontfeature{Language=Turkish}
}
{
- \fontspec_if_language:nTF {TUR}
+ \fontspec_if_language:nT {TUR}
{
\addfontfeature{Language=Turkish}
- }{}
+ }
}
}{
- \fontspec_if_language:nTF{#1}
+ \fontspec_if_language:nT{#1}
{
\addfontfeature{Language=#2}
}
- {}
}
}
}
-\cs_generate_variant:Nn \__xpg_add_font_feature_language:nn { on , no, oo , Vn, nV, VV , xn, nx, xx}
+\cs_generate_variant:Nn \__xpg_add_font_feature_language:nn { ee }
-% add fontfeature Script=#2 to scripttag #1
-% do nothing if #1 or #2 is empty
+% add fontfeature Script=#3 to scripttag #2 for family #1
+% do nothing if #2 or #3 is empty
\cs_new:Nn \__xpg_add_font_feature_script:nnn
{
\bool_if:nTF{\tl_if_empty_p:n{#2} || \tl_if_empty_p:n{#3}}
{
% maybe an error ?
- \xpg@warning{Asking~ to~ add~ empty~ feature~to~ main~ font
+ \xpg_warning_msg:n{Asking~ to~ add~ empty~ feature~to~ main~ font
(Script="#3"~ to~ scripttag~ "#2")}
}
{
@@ -5036,118 +5191,58 @@ to track the issues and follow progress.
\regex_replace_once:nnN { \.[^\.]* \Z } { } \xpg_fname_str
% ... and, finally, quotation marks
\regex_replace_once:nnN { " } { } \xpg_fname_str
- \xpg@error{
- The~ current~ main ~ \xpg_ffamily_tl\space font,~ \xpg_fname_str,~ does~ not~ contain~ the~"#3"~ script!\MessageBreak
- Please~ define~\csname\tl_if_empty:nF{#3}{\str_lowercase:n{#3}}font\xpg_ffamilysh_tl\endcsname~
- with~ \string\newfontfamily\space command
+ \xpg_error_msg:n
+ {
+ The~ current~ main ~ \xpg_ffamily_tl\space font,~ \xpg_fname_str,~ does~ not~ contain~ the~"#3"~ script! \iow_newline:
+ Please~ define~\csname\tl_if_empty:nF{#3}{\str_lowercase:n{#3}}font\xpg_ffamilysh_tl\endcsname~
+ with~ \string\newfontfamily\space command
}
}
}
}
-\cs_generate_variant:Nn \__xpg_add_font_feature_script:nnn { non , nno, noo , nVn, nnV, nVV , nxn, nnx, nxx}
-
-\def\xpg@fontsetup@latin#1{
- \begingroup
- \csgdef{#1@font@rm}{
- \cs_if_exist_use:cF{#1font}{
- \rmfamilylatin
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }
- }
- \csgdef{#1@font@sf}{
- \cs_if_exist_use:cF{#1fontsf}{
- \sffamilylatin
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }
- }
- \csgdef{#1@font@tt}{
- \cs_if_exist_use:cF{#1fonttt}{
- \ttfamilylatin
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }
- }
- \endgroup
-}
+\cs_generate_variant:Nn \__xpg_add_font_feature_script:nnn { nee }
-\def\xpg@fontsetup@nonlatin#1{
- \begingroup
- \csgdef{#1@font@rm}{
- \cs_if_exist_use:cF{#1font}
- {
- \providetoggle{#1@use@script@font}
- \str_if_eq:nnTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- {\rmfamilylatin}
- {\cs_if_exist_use:cTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript} font}
- {
- \toggletrue{#1@use@script@font}
- }
- {
- \rmfamilylatin
- }
- }
- \iftoggle{#1@use@script@font}{}{
- \__xpg_add_font_feature_script:nxx{rm}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/scripttag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}
- }%
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }%
- \def\familytype{rm}
- }%
- \csgdef{#1@font@sf}{
- \cs_if_exist_use:cF{#1fontsf}
+%% TODO: probably can be cleaned a little more
+\cs_new_protected:Npn \__xpg_setup_font:nnnnn #1 #2 #3 #4 #5 % #1 = lang, #2 = family, #3 = family, #4 = gobble, #5 gobble
+ {
+ \cs_set_protected_nopar:cpn { #1@font@#2 }
{
- \providetoggle{#1@use@script@fontsf}
- \str_if_eq:nnTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- {\sffamilylatin}
- {\cs_if_exist_use:cTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript} fontsf}
+ \cs_if_exist_use:cF{ #1font#3 }
{
- \toggletrue{#1@use@script@fontsf}
- }
- {
- \sffamilylatin
- }
- }
- \iftoggle{#1@use@script@fontsf}{}{
- \__xpg_add_font_feature_script:nxx{sf}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/scripttag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}
- }%
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }%
- \def\familytype{sf}
- }%
- \csgdef{#1@font@tt}{
- \cs_if_exist_use:cF{#1fonttt}
- {
- \providetoggle{#1@use@script@fonttt}
- \str_if_eq:nnTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- {\ttfamilylatin}
- {\cs_if_exist_use:cTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript} fonttt}
- {
- \toggletrue{#1@use@script@fonttt}
- }
- {
- \ttfamilylatin
- }
- }
- \iftoggle{#1@use@script@fonttt}{}{
- \__xpg_add_font_feature_script:nxx{tt}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/scripttag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}
- }
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
+ \cs_if_exist_use:cF { \prop_item:Nn \l_xpg_langsetup_prop { #1 / lc-bcp47-script } font#3 }
+ {
+ #4 { \prop_item:Nn \l_xpg_langsetup_prop { #1 / lcscript } font#3 }
+ {
+ \use:c { #2familylatin }
+ #5
+ {
+ \__xpg_add_font_feature_script:nee { #2 }
+ { \prop_item:Nn \l_xpg_langsetup_prop { #1 / scripttag } }
+ { \prop_item:Nn \l_xpg_langsetup_prop { #1 / script } }
+ }
+ }
+ }
+ \__xpg_add_font_feature_language:ee
+ { \prop_item:Nn \l_xpg_langsetup_prop { #1 / langtag } }
+ { \prop_item:Nn \l_xpg_langsetup_prop { #1 / language } }
+ }
+ \tl_set:Nn \familytype { #2 }
}
- \def\familytype{tt}
}
- \endgroup
-}
+
+\NewDocumentCommand \SetupLatinPolyglossiaFont { m }
+ {
+ \__xpg_setup_font:nnnnn { #1 } { rm } { } { \use_ii:nn } { \use_none:n }
+ \__xpg_setup_font:nnnnn { #1 } { sf } { sf } { \use_ii:nn } { \use_none:n }
+ \__xpg_setup_font:nnnnn { #1 } { tt } { tt } { \use_ii:nn } { \use_none:n }
+ }
+
+\NewDocumentCommand \SetupNonLatinPolyglossiaFont { m }
+ {
+ \__xpg_setup_font:nnnnn { #1 } { rm } { } { \cs_if_exist_use:cF } { \use:n }
+ \__xpg_setup_font:nnnnn { #1 } { sf } { sf } { \cs_if_exist_use:cF } { \use:n }
+ \__xpg_setup_font:nnnnn { #1 } { tt } { tt } { \cs_if_exist_use:cF } { \use:n }
+ }
%%% END OF PolyglossiaSetup
@@ -5156,40 +5251,53 @@ to track the issues and follow progress.
\cs_new_nopar:Nn \__xpg_local_marks:n { }
\cs_new_nopar:Nn \__xpg_enable_local_marks:
{
- \xpg@info{Option:~ localmarks}
+ \xpg_info_msg:n{Option:~ localmarks}
\cs_gset_nopar:Nn \__xpg_local_marks:n
{
- \def\xpg@tmp@lang{##1}
- \DeclareRobustCommand\markboth[2]{
- \begingroup
- \let\label\relax \let\index\relax \let\glossary\relax
- \unrestored@protected@xdef\@themark
- {
- {\lowercase{\foreignlanguage{\xpg@tmp@lang}}{\protect\@@ensure@maindir{####1}}}
- {\lowercase{\foreignlanguage{\xpg@tmp@lang}}{\protect\@@ensure@maindir{####2}}}
- }
- \@temptokena \expandafter{\@themark}
- \mark{\the\@temptokena}
- \endgroup
- \if@nobreak\ifvmode\nobreak\fi\fi
- }
- \DeclareRobustCommand\markright[1]{
- \begingroup
- \let\label\relax \let\index\relax \let\glossary\relax
- \expandafter\@markright\@themark
- {\lowercase{\foreignlanguage{\xpg@tmp@lang}}{\protect\@@ensure@maindir{####1}}}
- \@temptokena \expandafter{\@themark}
- \mark{\the\@temptokena}
- \endgroup
- \if@nobreak\ifvmode\nobreak\fi\fi
- }
+ \DeclareDocumentCommand \markboth { m m }
+ {
+ \group_begin:
+ \cs_set_eq:cc { label } { relax }
+ \cs_set_eq:cc { index } { relax }
+ \cs_set_eq:cc { glossary } { relax }
+ \unrestored@protected@xdef\@themark
+ {
+ {\foreignlanguage{##1}{\protect\@@ensure@maindir{####1}}}
+ {\foreignlanguage{##1}{\protect\@@ensure@maindir{####2}}}
+ }
+ \@temptokena \expandafter{\@themark}
+ \mark_insert:nn{2e-left}{####1}
+ \mark_insert:nn{2e-right}{####2}
+ \tl_if_empty:nF{####2}{ \mark_insert:nn{2e-right-nonempty}{####2} }
+ \mark{\the\@temptokena}
+ \group_end:
+ \if@nobreak\ifvmode\nobreak\fi\fi
+ }
+ \DeclareDocumentCommand \markright { m }
+ {
+ \group_begin:
+ \cs_set_eq:cc { label } { relax }
+ \cs_set_eq:cc { index } { relax }
+ \cs_set_eq:cc { glossary } { relax }
+ \expandafter\@markright\@themark
+ {\foreignlanguage{##1}{\protect\@@ensure@maindir{####1}}}
+ \@temptokena \expandafter{\@themark}
+ \mark_insert:nn{2e-right}{####1}
+ \tl_if_empty:nF{####1}{ \mark_insert:nn{2e-right-nonempty}{####1} }
+ \mark{\the\@temptokena}
+ \group_end:
+ \if@nobreak\ifvmode\nobreak\fi\fi
+ }
}
}
%we call this macro when a gloss file is not found for a given language
-\def\xpg@nogloss#1{
- \xpg@warning{File~ gloss-#1.ldf~ do~ not~ exists!\MessageBreak
- I~ will~ nevertheless~ try~ to~ use~ hyphenation~ patterns~ for~ #1.}
+\cs_new_nopar:Nn \__xpg_no_gloss:n
+{
+ \xpg_warning_msg:n
+ {File~ gloss-#1.ldf~ do~ not~ exists! \iow_newline:
+ I~ will~ nevertheless~ try~ to~ use~ hyphenation~ patterns~ for~ #1.}
+
\PolyglossiaSetup{#1}{hyphenmins={2,3},hyphennames={#1},fontsetup=true}
% the above amounts to:
%\ifcsundef{l@#1}%
@@ -5198,59 +5306,64 @@ to track the issues and follow progress.
%\csdef{#1@language}{\language=\csname l@#1\endcsname}%
}
-\newcommand{\xpg@input}[1]{
+\cs_new_nopar:Nn \xpg_input:n
+{
% Store catcode of @ before making at letter
- \chardef\xpg@saved@at@catcode\catcode`\@
- \makeatletter
- \input{#1}
+ \cs_set_protected_nopar:Npx \__xpg_restore_at_catcode:
+ { \char_set_catcode:nn { `@ } { \char_value_catcode:n {`\@ } } }
+ \char_set_catcode_letter:N @
+ \file_input:n { #1 }
% restore former @ catcode
- \catcode`\@=\xpg@saved@at@catcode
+ \__xpg_restore_at_catcode:
}
% try to load a language file
-\cs_new:Nn \__xpg_load_lang_definition:nn {
- \file_if_exist:nTF{gloss-#2.ldf}
+\cs_new:Nn \__xpg_load_lang_definition:nn
+{
+ \file_if_exist:nTF{gloss-#2.ldf}
{
- % Temporarily force catcode of ~ to 13 since babelsh.def
+ \tl_set:Nn \xpg__tmp_default_options_tl { #1 }
+ % Temporarily force catcode of ~ to 13 (active) since babelsh.def
% requires it. This is needed particularly with LaTeX3
% packages which force \ExplSyntaxOn (#425)
- \protected\edef\xpg@restore@tilde@catcode{\catcode 126 = \the\catcode 126\relax}
- \catcode 126 = 13
- \xpg@input{gloss-#2.ldf}
- \setkeys{#2}{#1}
+ \cs_gset_protected:Npx \__xpg_restore_tilde_catcode:
+ { \char_set_catcode:nn { 126 } { \char_value_catcode:n { 126 } } }
+ \char_set_catcode_active:n { 126 }
+ \xpg_input:n {gloss-#2.ldf}
% restore former ~ catcode
- \xpg@restore@tilde@catcode
+ \__xpg_restore_tilde_catcode:
}
{
- \xpg@nogloss{#2}
+ \__xpg_no_gloss:n {#2}
}
}
\cs_generate_variant:Nn \__xpg_load_lang_definition:nn { ee }
% load a master language from an alias file
-\newcommand*\xpg@load@master@language[1] {
- \xpg@input{gloss-#1.ldf}
+\NewDocumentCommand \InheritGlossFile { m }
+{
\seq_if_in:NeF \__xpg_langs_loaded {#1}
{
+ \xpg_input:n {gloss-#1.ldf}
% define environment and command if not alias
\str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#1/target}} {#1} {
- \use:c{\prop_item:Nn{\g_xpg_langsetup_prop}
+ \use:c{\prop_item:Nn{\l_xpg_langsetup_prop}
{#1/DefineCommandsCmd}}
{#1}
}
+ \seq_gput_right:Nn \__xpg_langs_loaded {#1}
}
\__xpg_register_language:nn{}{#1}
- \seq_gput_right:Nn \__xpg_langs_loaded {#1}
}
-\prop_new:N \__xpg_alias
+\prop_new_linked:N \__xpg_alias
% define environment and command if not alias
\cs_new:Nn \xpg_define_language_commands:n {
\str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#1/target}} {#1}
{
\exp_args:Ne
- \NewDocumentEnvironment {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/envname}} { O{} }
+ \NewDocumentEnvironment {\prop_item:Nn{\l_xpg_langsetup_prop}{#1/envname}} { O{} }
{
\otherlanguage [ ##1 ] { #1 }
}
@@ -5278,7 +5391,7 @@ to track the issues and follow progress.
% target to self fall back to language table
\str_if_eq:eeTF { \prop_item:Ne \__xpg_alias {#1/target} } { #1 }
{
- \prop_item:Nn{\g_xpg_langsetup_prop} {#1/#2}
+ \prop_item:Nn{\l_xpg_langsetup_prop} {#1/#2}
}
% load alias by recursion
{
@@ -5401,20 +5514,29 @@ to track the issues and follow progress.
\clist_if_in:NeF \xpg@loaded {#2}{
\clist_gput_right:Ne \xpg@loaded {#2}
}
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@set@langvariant}
+ \group_begin:
+ % set language options
+ \__xpg_set_language_options:nn {#2} {#1}
% register babelname
- \prop_get:NeN \g_xpg_langsetup_prop {#2/babelname} \l_tmpa_tl
+ \prop_get:NeN \l_xpg_langsetup_prop {#2/babelname} \l_tmpa_tl
\clist_if_in:NeF \xpg@bloaded {\l_tmpa_tl}{
\clist_gput_right:Ne \xpg@bloaded {\l_tmpa_tl}
}
% register BCP-47 ID
- \prop_get:NeN \g_xpg_langsetup_prop {#2/bcp47} \l_tmpa_tl
+ \prop_get:NeN \l_xpg_langsetup_prop {#2/bcp47} \l_tmpa_tl
\clist_if_in:NeF \xpg@bcp@loaded {\l_tmpa_tl}{
\clist_gput_right:Ne \xpg@bcp@loaded {\l_tmpa_tl}
}
+ % register variant
+ \prop_get:NnNT \l_xpg_curropt_prop {#2/variant} \l_tmpa_tl {
+ \clist_if_in:NeF \xpg@vloaded {\l_tmpa_tl}{
+ \clist_gput_right:Ne \xpg@vloaded {\l_tmpa_tl}
+ }}
+ \group_end:
}
+\prop_new_linked:N \l_xpg_curropt_prop
+
\DeclareDocumentCommand \setdefaultlanguage { O{} m }
{
% latex is an internal language, so do not record
@@ -5429,12 +5551,13 @@ to track the issues and follow progress.
\__xpg_load_lang_definition:nn{#1}{#2}
% define environment and command if not alias
\str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#2/target}} {#2} {
- \use:c{\prop_item:Ne{\g_xpg_langsetup_prop}
+ \use:c{\prop_item:Ne{\l_xpg_langsetup_prop}
{#2/DefineCommandsCmd}}
{#2}
}
\seq_gput_right:Ne \__xpg_langs_loaded {#2}
}
+ \cs_set_nopar:Npe \mainlanguagevariant { \prop_item:Ne \l_xpg_curropt_prop { \xpg_alias_base_lang:n{#2} / variant } }
\exp_args:Nee \__xpg_set_default_language:nn {\xpg_alias_add_to_option_i:nn{#2}{#1}}
{\xpg_alias_base_lang:n{#2}}
}
@@ -5442,70 +5565,22 @@ to track the issues and follow progress.
\cs_new:Nn \__xpg_set_default_language:nn
{
- \gdef\xpg@main@language{#2}
- \tl_if_blank:nTF {#1}
- {
- \cs_gset_nopar:Npn \mainlanguagevariant {}
- }
- {
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@main@langvariant}
- }
- \csgdef{#2@gvar}{\mainlanguagevariant}
+ \tl_gset:Nn \xpg_main_language_tl {#2}
%% The following settings are for the default language and script
% this tells bidi.sty or luabidi.sty that the document is RTL
- \__xpg_if_LR_str:eF{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/direction}}
+ \__xpg_if_LR_str:eF{\prop_item:Nn{\l_xpg_langsetup_prop}{#2/direction}}
{
\__xpg_setRTLmain:
}
\cs_gset_nopar:Nn \__xpg_at_begin_document_selectlanguage: {
\selectbackgroundlanguage{#2}
- \selectlanguage[#1]{#2}%
+ \selectlanguage[#1]{#2}
}
- \xpg@info{Default~ language~ is~ #2}
- \polyglossia@set@language@name[#1]{#2}
+ \str_if_eq:eeF { #2 } { latex }
+ { \xpg_info_msg:n{Default~ language~ is~ #2} }
+ \xpg_set_language_name:n { #2 }
\cs_gset_nopar:Npn \mainlanguagename {#2}
- % Store babelname of main language (for external packages such as biblatex)
- \cs_gset_nopar:Npe \mainbabelname { \prop_item:Nn \g_xpg_langsetup_prop {#2/babelname} }
- % Store babelname of current language (for external packages such as biblatex)
- \cs_gset_eq:NN \babelname \mainbabelname
- \cs_gset_eq:cc{#2@gbabelname}{babelname}%
- % Store BCP-47 ID and subtags of main language:
- % 1. store main.* (sub)tags
- \cs_gset_nopar:cpe {bcp47.main.tag} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47 } }
- \cs_gset_nopar:cpe {bcp47.main.language} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-language } }
- \cs_gset_nopar:cpe {bcp47.main.region} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-region } }
- \cs_gset_nopar:cpe {bcp47.main.script} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-script } }
- \cs_gset_nopar:cpe {bcp47.main.variant} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-variant } }
- \cs_gset_nopar:cpe {bcp47.main.extension.t} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47extension-t } }
- \cs_gset_nopar:cpe {bcp47.main.extension.u} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-extension-u } }
- \cs_gset_nopar:cpe {bcp47.main.extension.x} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-extension-x } }
- % For casing, we fall back to language if bcp47-casing is not explicitly set
- \cs_set_nopar:cpx {tmpcasing} { \prop_item:Ne \g_xpg_langsetup_prop { #2 / bcp47-casing } }
- \str_if_empty:NTF \tmpcasing
- { \cs_gset_nopar:cpe {bcp47.main.casing} { \prop_item:Nn \g_xpg_langsetup_prop {#2 / bcp47-language} } }
- { \cs_gset_nopar:cpe {bcp47.main.casing} { \tmpcasing } }
- % 2. Store lang (sub)tags
- \cs_gset_eq:cc {bcp47.tag} {bcp47.main.tag}
- \cs_gset_eq:cc {bcp47.language} {bcp47.main.language}
- \cs_gset_eq:cc {bcp47.region} {bcp47.main.region}
- \cs_gset_eq:cc {bcp47.script} {bcp47.main.script}
- \cs_gset_eq:cc {bcp47.variant} {bcp47.main.variant}
- \cs_gset_eq:cc {bcp47.extension.t} {bcp47.main.extension.t}
- \cs_gset_eq:cc {bcp47.extension.u} {bcp47.main.extension.u}
- \cs_gset_eq:cc {bcp47.extension.x} {bcp47.main.extension.x}
- \cs_gset_eq:cc {bcp47.casing} {bcp47.main.casing}
- % 3. Store global language BCP47 settings (with default subtags as set by main language options)
- \cs_gset_eq:cc{#2@g.bcp47.tag}{bcp47.tag}
- \cs_gset_eq:cc{#2@g.bcp47.language}{bcp47.language}
- \cs_gset_eq:cc{#2@g.bcp47.region}{bcp47.region}
- \cs_gset_eq:cc{#2@g.bcp47.script}{bcp47.script}
- \cs_gset_eq:cc{#2@g.bcp47.variant}{bcp47.variant}
- \cs_gset_eq:cc{#2@g.bcp47.extension.t}{bcp47.extension.t}
- \cs_gset_eq:cc{#2@g.bcp47.extension.u}{bcp47.extension.u}
- \cs_gset_eq:cc{#2@g.bcp47.extension.x}{bcp47.extension.x}
- \cs_gset_eq:cc{#2@g.bcp47.casing}{bcp47.casing}
}
\DeclareCommandCopy \setmainlanguage \setdefaultlanguage
@@ -5516,11 +5591,11 @@ to track the issues and follow progress.
{
\str_case:nnF {#1}
{
- {bcp-47} { \csuse{bcp47.tag} }
- {bcp47} { \csuse{bcp47.tag} }
+ {bcp-47} { \use:c{bcp47.tag} }
+ {bcp47} { \use:c{bcp47.tag} }
}
{
- \xpg@error{Invalid~ \string\languageid\space argument:~ #1}
+ \xpg_ill_arg_msg:nn { #1 } { \languageid }
}
}
@@ -5530,11 +5605,11 @@ to track the issues and follow progress.
{
\str_case:nnF {#1}
{
- {bcp-47} { \csuse{bcp47.main.tag} }
- {bcp47} { \csuse{bcp47.main.tag} }
+ {bcp-47} { \use:c{bcp47.main.tag} }
+ {bcp47} { \use:c{bcp47.main.tag} }
}
{
- \xpg@error{Invalid~ \string\mainlanguageid\space argument:~ #1}
+ \xpg_ill_arg_msg:nn { #1 } { \mainlanguageid }
}
}
% Kernel command to access to BCP-47 data.
@@ -5554,281 +5629,205 @@ to track the issues and follow progress.
% and main.* variants thereof
% See https://github.com/latex3/latex2e/issues/1035
\DeclareExpandableDocumentCommand \BCPdata {m}
+ {
+ \cs_if_exist_use:cF{bcp47.#1}
+ { \xpg_ill_arg_msg:nn { #1 } { \BCPdata } }
+ }
+
+\clist_map_inline:nn
+ {
+ language, region, script, variant,
+ extension.t, extension.u, extension.x
+ }{
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_replace_once:Nnn \l_tmpa_tl { . } { - }
+ \cs_gset_nopar:cpe { bcp47.#1 }
+ {
+ \exp_not:n { \prop_item:Ne \l_xpg_langsetup_prop } { \exp_not:N \languagename / bcp47-\l_tmpa_tl }
+ }
+ \cs_gset_nopar:cpe { bcp47.main.#1 }
+ {
+ \exp_not:n { \prop_item:Ne \l_xpg_langsetup_prop } { \exp_not:N \mainlanguagename / bcp47-\l_tmpa_tl }
+ }
+ }
+\cs_gset_nopar:cpn { bcp47.casing }
+ {
+ \tl_if_empty:eTF { \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47-casing } }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47-language }
+ }{
+ \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47-casing }
+ }
+ }
+\cs_gset_nopar:cpn { bcp47.main.casing }
+ {
+ \tl_if_empty:eTF { \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47-casing } }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47-language }
+ }{
+ \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47-casing }
+ }
+ }
+\cs_gset_nopar:cpn { bcp47.tag }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47 }
+ }
+\cs_gset_nopar:cpn { bcp47.main.tag }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47 }
+ }
+
+\cs_new_nopar:Npn \languagevariant
+ {
+ \prop_item:Ne \l_xpg_curropt_prop { \languagename / variant }
+ }
+
+\cs_new:Nn \xpg_set_language_name:n
{
- \cs_if_exist_use:cF{bcp47.#1}
- { \xpg@error{Invalid~ \string\BCPdata\space argument:~ #1} }
-}
-
-% main babel name
-\cs_new_nopar:Npn \mainlanguagename {}
-\cs_new_nopar:Npn \mainbabelname {}
-\cs_new_nopar:cpn {bcp47.main.tag} {}
-\cs_new_nopar:cpn {bcp47.main.language} {}
-\cs_new_nopar:cpn {bcp47.main.region} {}
-\cs_new_nopar:cpn {bcp47.main.script} {}
-\cs_new_nopar:cpn {bcp47.main.variant} {}
-\cs_new_nopar:cpn {bcp47.main.extension.t} {}
-\cs_new_nopar:cpn {bcp47.main.extension.u} {}
-\cs_new_nopar:cpn {bcp47.main.extension.x} {}
-\cs_new_nopar:cpn {bcp47.main.casing} {}
-\cs_new_nopar:Npn \mainlanguagevariant {}%
-% Store main language variant for external packages
-\define@key{xpg@main@langvariant}{variant}{
- \cs_gset_nopar:Npn \mainlanguagevariant {#1}
-}
-
-\cs_new_nopar:Npn \babelname {}
-\def\languagevariant{}
-% Store current language variant for external packages
-\define@key{xpg@set@langvariant}{variant}{
- \def\languagevariant{#1}
-}
-
-\newcommand*\polyglossia@set@language@name[2][]{
- \def\languagename{#2}
- \tl_if_blank:nTF {#1}{
- \ifcsundef{#2@gvar}{\def\languagevariant{}}{\def\languagevariant{\csuse{#2@gvar}}}
- }{
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@set@langvariant}
- \cs_set_eq:cc{#2@var}{languagevariant}
- }%
+ \cs_set:Npn \languagename { #1 }
}
-
-\newcommand*{\resetdefaultlanguage}[2][]{
+\NewDocumentCommand \resetdefaultlanguage { O{} m }
+{
\__xpg_reset_default_language:nn
{\xpg_alias_add_to_option_i:nn{#2}{#1}}
{\xpg_alias_base_lang:n{#2}}
}
-\cs_new:Nn \__xpg_store_bcp_info:nn
-{
- % Store BCP-47 ID and subtags of current language
- \tl_if_blank:nTF {#1}{
- % tag (e.g., en-US)
- \ifcsundef{#2@g.bcp47.tag}{
- \csedef{bcp47.tag}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47 } }
- }{
- \csedef{bcp47.tag}{\csuse{#2@g.bcp47.tag}}
- }
- % language (e.g., en)
- \ifcsundef{#2@g.bcp47.language}{
- \csedef{bcp47.language}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-language } }
- }{
- \csedef{bcp47.language}{\csuse{#2@g.bcp47.language}}
- }
- % region (e.g., US)
- \ifcsundef{#2@g.bcp47.region}{%
- \csedef{bcp47.region}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-region } }
- }{
- \csedef{bcp47.region}{\csuse{#2@g.bcp47.region}}%
- }
- % script (e.g., Latn)
- \ifcsundef{#2@g.bcp47.script}{
- \csedef{bcp47.script}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-script } }
- }{
- \csedef{bcp47.script}{\csuse{#2@g.bcp47.script}}
- }
- % variant (e.g., 1996)
- \ifcsundef{#2@g.bcp47.variant}{
- \csedef{bcp47.variant}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-variant } }
- }{
- \csedef{bcp47.variant}{\csuse{#2@g.bcp47.variant}}
- }
- % extension.t (tranformation)
- \ifcsundef{#2@g.bcp47.extension.t}{%
- \csedef{bcp47.extension.t}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-t } }
- }{
- \csedef{bcp47.extension.t}{\csuse{#2@g.bcp47.extension.t}}
- }
- % extension.u (additional locale information)
- \ifcsundef{#2@g.bcp47.extension.u}{%
- \csedef{bcp47.extension.u}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-u } }
- }{
- \csedef{bcp47.extension.u}{\csuse{#2@g.bcp47.extension.u}}
- }
- % extension.x (private use area)
- \ifcsundef{#2@g.bcp47.extension.x}{
- \csedef{bcp47.extension.x}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-x } }
- }{
- \csedef{bcp47.extension.x}{\csuse{#2@g.bcp47.extension.x}}
- }
- % casing
- \ifcsundef{#2@g.bcp47.casing}{
- % For casing, we fall back to language if bcp47-casing is not explicitly set
- \cs_set_nopar:cpx {tmpcasing} { \prop_item:Ne \g_xpg_langsetup_prop { #2 / bcp47-casing } }
- \str_if_empty:NTF \tmpcasing
- { \cs_gset_eq:cc {bcp47.casing} {bcp47.language} }
- { \csedef{bcp47.casing}{ \tmpcasing } }
- }{
- \csedef{bcp47.casing}{\csuse{#2@g.bcp47.casing}}
- }
- }{
- \csedef{bcp47.tag}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47 } }
- \csedef{bcp47.language}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-language } }
- \csedef{bcp47.region}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-region } }
- \csedef{bcp47.script}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-script } }
- \csedef{bcp47.variant}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-variant } }
- \csedef{bcp47.extension.t}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-t } }
- \csedef{bcp47.extension.u}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-u } }
- \csedef{bcp47.extension.x}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-x } }
- % For casing, we fall back to language if bcp47-casing is not explicitly set
- \cs_set_nopar:cpx {tmpcasing} { \prop_item:Ne \g_xpg_langsetup_prop { #2 / bcp47-casing } }
- \str_if_empty:NTF \tmpcasing
- { \cs_gset_eq:cc {bcp47.casing} {bcp47.language} }
- { \csedef{bcp47.casing}{ \tmpcasing } }
- }
-}
-
\cs_new:Nn \__xpg_reset_default_language:nn
{
\xpg_error_if_lang_not_loaded:n{#2}
% disable globalnumbers of previously defined default language
- \csuse{no\xpg@main@language @globalnumbers}
- \csuse{noextras@\xpg@main@language}%
+ \use:c{no\xpg_main_language_tl @globalnumbers}
+ \use:c{noextras@\xpg_main_language_tl}
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
- \cs_if_exist_use:c{noextras@bbl@\mainbabelname}%
- \csuse{init@noextras@\xpg@main@language}%
- \polyglossia@set@language@name[#1]{#2}%
- \__xpg_if_LR_str:eF{\prop_item:Ne{\g_xpg_langsetup_prop}{#2/direction}}
+ \cs_if_exist_use:c{noextras@bbl@\mainbabelname}
+ \use:c{init@noextras@\xpg_main_language_tl}
+ \xpg_set_language_name:n { #2 }
+ \__xpg_if_LR_str:eF{\prop_item:Ne{\l_xpg_langsetup_prop}{#2/direction}}
{
\@rlmaintrue\@rl@footnotetrue
}
- \selectlanguage[#1]{#2}%
- \selectbackgroundlanguage{#2}%
- % Store babelname of current language (for external packages such as biblatex)
- \tl_if_blank:nTF {#1}{%
- \ifcsundef{#2@gbabelname}{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }{
- \edef\babelname{\csuse{#2@gbabelname}}
- }
- }{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }
- % Store variant
- \tl_if_blank:nTF {#1}
- {
- \cs_gset_nopar:Npn \mainlanguagevariant {}
- }
- {
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@main@langvariant}
- }
- \csgdef{#2@gvar}{\mainlanguagevariant}
- % Store BCP-47 id of current language
- \__xpg_store_bcp_info:nn {#1}{#2}
+ \selectlanguage[#1]{#2}
+ \selectbackgroundlanguage{#2}
+ \cs_set_nopar:Npe \mainlanguagevariant { \prop_item:Ne \l_xpg_curropt_prop { \xpg_alias_base_lang:n{#2} / variant } }
}
% This saves the normalfont for the latin script since we may change normalfont in other scripts
-\let\normalfontlatin=\normalfont
+\cs_set_eq:cc { normalfontlatin } { normalfont }
% Provide default fonts (as set with \setmainfont, \setsansfont and \setmonofont)
% for Latin scripts and as a fallback for non-Latin scripts.
-\DeclareRobustCommand\xpg@defaultfont@rm{
+\cs_set_protected:Nn \xpg_defaultfont_rm:
+{
\tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
\fontfamily\rmdefault
- \ifdefined\UseHook\UseHook{rmfamily}\fi
+ \hook_use:n { rmfamily }
\selectfont
}
-\DeclareRobustCommand\xpg@defaultfont@sf{
+
+\cs_set_protected:Nn \xpg_defaultfont_sf:
+{
\tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
\fontfamily\sfdefault
- \ifdefined\UseHook\UseHook{sffamily}\fi
+ \hook_use:n { sffamily }
\selectfont
}
-\DeclareRobustCommand\xpg@defaultfont@tt{
+
+\cs_set_protected:Nn \xpg_defaultfont_tt:
+{
\tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
\fontfamily\ttdefault
- \ifdefined\UseHook\UseHook{ttfamily}\fi
+ \hook_use:n { ttfamily }
\selectfont
}
-\def\xpg@patch@fontfamilies{
+\cs_new:Nn \__xpg_patch_fontfamilies:
+{
% This robustifies the redefinitions of \<xx>family (suggestion by Enrico Gregorio)
% e.g. to prevent expansion of the \familytype redefinition in auxiliary files
- \csgappto{rmfamily~}{\def\familytype{rm}}
- \csgappto{sffamily~}{\def\familytype{sf}}
- \csgappto{ttfamily~}{\def\familytype{tt}}
+ \tl_put_right:cn {rmfamily~} {\tl_set:Nn \familytype {rm}}
+ \tl_put_right:cn {sffamily~} {\tl_set:Nn \familytype {sf}}
+ \tl_put_right:cn {ttfamily~} {\tl_set:Nn \familytype {tt}}
}
% 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@defaultfont@rm}
-\cs_gset_eq:cc{sffamilylatin}{xpg@defaultfont@sf}
-\cs_gset_eq:cc{ttfamilylatin}{xpg@defaultfont@tt}
-
-\def\xpg@set@familydefault{
- % We need the \edef route here in order
- % to detect both \renewcommand and \let
- % changes.
- \edef\tempa{\familydefault}
- \edef\tempb{\sfdefault}
- \ifcsequal{tempa}{tempb}
- {\def\familytype{sf}}
- {\edef\tempb{\ttdefault}
- \ifcsequal{tempa}{tempb}
- {\def\familytype{tt}}
- {\def\familytype{rm}}}
- \xpg@patch@fontfamilies
+\cs_set_eq:cc{rmfamilylatin}{xpg_defaultfont_rm:}
+\cs_set_eq:cc{sffamilylatin}{xpg_defaultfont_sf:}
+\cs_set_eq:cc{ttfamilylatin}{xpg_defaultfont_tt:}
+
+\cs_new:Nn \xpg_set_familydefault:
+{
+ \tl_set:Ne \l_tmpa_tl { \familydefault }
+ \tl_set:Ne \l_tmpb_tl { \sfdefault }
+ \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
+ { \tl_set:Nn \familytype {sf} }
+ { \tl_set_eq:NN \l_tmpb_tl \ttdefault
+ \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
+ { \tl_set:Nn \familytype {tt} }
+ { \tl_set:Nn \familytype {rm} }
+ }
+ \__xpg_patch_fontfamilies:
% This (re-)saves the normalfont for the latin script since we may
% change normalfont in other scripts
- \let\normalfontlatin=\normalfont
+ \cs_set_eq:cc{ normalfontlatin }{ normalfont }
% And for all cases, we also reset \<xx>familylatin
- \cs_gset_eq:cc{rmfamilylatin}{xpg@defaultfont@rm}
- \cs_gset_eq:cc{sffamilylatin}{xpg@defaultfont@sf}
- \cs_gset_eq:cc{ttfamilylatin}{xpg@defaultfont@tt}
-}
-
-\def\resetfontlatin{
- \DeclareRobustCommand\rmfamily{\xpg@defaultfont@rm}
- \DeclareRobustCommand\sffamily{\xpg@defaultfont@sf}
- \DeclareRobustCommand\ttfamily{\xpg@defaultfont@tt}
- \xpg@patch@fontfamilies
- \global\let\normalfont=\normalfontlatin
-}
-
-\def\selectfontfamilylatin{
- \def\tmp@tt{tt}\def\tmp@sf{sf}
- \ifx\familytype\tmp@tt
- \ttfamilylatin
- \else\ifx\familytype\tmp@sf
- \sffamilylatin
- \else\rmfamilylatin\fi\fi}
-
-\def\xpg@select@fontfamily#1{
- \def\tmp@tt{tt}\def\tmp@sf{sf}
- \ifx\familytype\tmp@tt
- \__xpg_use_or_warn:c{#1@font@tt}
- \else\ifx\familytype\tmp@sf
- \__xpg_use_or_warn:c{#1@font@sf}
- \else\__xpg_use_or_warn:c{#1@font@rm}\fi\fi}
-
-\def\xpg@set@normalfont#1{
- \letcs{\rmfamily}{#1@font@rm}
- \letcs{\sffamily}{#1@font@sf}
- \letcs{\ttfamily}{#1@font@tt}
- \robustify\rmfamily
- \robustify\sffamily
- \robustify\ttfamily
- \gdef\normalfont{\protect\xpg@select@fontfamily{#1}
- \fontseries{\seriesdefault}\selectfont
- \fontshape{\shapedefault}
- \ifdefined\UseHook\UseHook{normalfont}\fi
- \selectfont}
- \gdef\reset@font{\protect\normalfont}
-}
-
-\let\@@fterindentfalse\@afterindentfalse
-\def\french@indent{
- \let\@afterindentfalse\@afterindenttrue
+ \cs_set_eq:cc{ rmfamilylatin }{ xpg_defaultfont_rm: }
+ \cs_set_eq:cc{ sffamilylatin }{ xpg_defaultfont_sf: }
+ \cs_set_eq:cc{ ttfamilylatin }{ xpg_defaultfont_tt: }
+}
+
+\cs_set_nopar:Nn \xpg_select_fontfamily:n
+{
+ \str_if_eq:VnTF \familytype { tt }
+ { \__xpg_use_or_warn:c { #1@font@tt } }
+ { \str_if_eq:VnTF \familytype { sf }
+ { \__xpg_use_or_warn:c { #1@font@sf } }
+ { \__xpg_use_or_warn:c { #1@font@rm } }
+ }
+}
+
+\cs_set_protected:Npn \xpg_select_default_fontfamily:n #1
+ {
+ \tl_set:Ne \l_tmpa_tl { \familydefault }
+ \tl_set:Ne \l_tmpb_tl { \sfdefault }
+ \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
+ { \tl_set:Nn \familytype {sf} }
+ { \tl_set_eq:NN \l_tmpb_tl \ttdefault
+ \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
+ { \tl_set:Nn \familytype {tt} }
+ { \tl_set:Nn \familytype {rm} }
+ }
+ \xpg_select_fontfamily:n{#1}
+ }
+
+\cs_new_nopar:Nn \xpg_set_normalfont:n
+{
+ \cs_set_eq:cc { rmfamily } { #1@font@rm }
+ \cs_set_eq:cc { sffamily } { #1@font@sf }
+ \cs_set_eq:cc { ttfamily } { #1@font@tt }
+ \cs_set_nopar:Npn \normalfont
+ { \xpg_select_default_fontfamily:n {#1}
+ \fontseries{\seriesdefault}\selectfont
+ \fontshape{\shapedefault}
+ \hook_use:n { normalfont }
+ \selectfont
+ }
+ \cs_set_nopar:Npn \reset@font {\protect\normalfont}
+}
+
+\cs_gset_eq:cc { @@fterindentfalse } { @afterindentfalse }
+\cs_new_nopar:Nn \__xpg_french_indent:
+{
+ \cs_set_eq:cc { @afterindentfalse } { @afterindenttrue }
\@afterindenttrue
}
-\def\nofrench@indent{
- \let\@afterindentfalse\@@fterindentfalse
+\cs_new_nopar:Nn \__xpg_no_french_indent:
+{
+ \cs_set_eq:cc { @afterindentfalse } { @@fterindentfalse }
\@afterindentfalse
}
@@ -5839,10 +5838,10 @@ to track the issues and follow progress.
\cs_new:Nn \__xpg_select_background_language:n
{
- \str_if_eq:eeTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript}}{latin}
+ \str_if_eq:eeTF { \prop_item:Nn{\l_xpg_langsetup_prop}{#1/lcscript} } { latin }
{}
- {\xpg@set@normalfont{#1}}
- \csuse{#1@globalnumbers}
+ { \xpg_set_normalfont:n{#1} }
+ \use:c{#1@globalnumbers}
}
\cs_generate_variant:Nn \__xpg_select_background_language:n {e}
% Declare secondary language #2 with language options #1
@@ -5853,7 +5852,7 @@ to track the issues and follow progress.
\__xpg_load_lang_definition:ee {#1} {#2}
% define environment and command if not alias
\str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#2/target}} {#2} {
- \use:c{\prop_item:Ne{\g_xpg_langsetup_prop}
+ \use:c{\prop_item:Ne{\l_xpg_langsetup_prop}
{#2/DefineCommandsCmd}}
{#2}
}
@@ -5866,28 +5865,13 @@ to track the issues and follow progress.
\cs_new:Nn \__xpg_set_otherlanguage:nn
{
\__xpg_register_language:nn{#1}{#2}
- % If a variant is set, store it.
- \gdef\otherlanguagevariant{}
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@other@langvariant}
-
- \csgdef{#2@gvar}{\otherlanguagevariant}
- \prop_get:NeNT \g_xpg_langsetup_prop {#2/babelname} \l_tmpa_tl
- { \xdef\otherlanguagebabelname{\l_tmpa_tl} }
- \cs_gset_eq:cc{#2@gbabelname}{otherlanguagebabelname}
}
\cs_generate_variant:Nn \__xpg_set_otherlanguage:nn { ee }
-
-% Store main language variant for external packages
-\define@key{xpg@other@langvariant}{variant}{
- \gdef\otherlanguagevariant{#1}
-}
-
\NewDocumentCommand \setotherlanguages { m }
- {
+{
\clist_map_function:eN { #1 } \setotherlanguage
- }
+}
\cs_set:Nn \xpg_common_language:
{% FIXME is this really needed???
@@ -5910,7 +5894,8 @@ to track the issues and follow progress.
% for specific (esp. tag-based) aliases
% where \text<alias> would cause clashes
% (e.g., \textit)
-\newcommand\textlang[3][]{
+\NewDocumentCommand \textlang { O{} m +m }
+{
\__xpg_textlanguage:een {#1} {#2} {#3}
}
@@ -5919,45 +5904,20 @@ to track the issues and follow progress.
% inside case changing commands (e.g. \MakeUppercase)
\tl_put_right:Nn \l_text_case_exclude_arg_tl { \textlang }
-% Alias to {<lang>}, but more suitable
-% for specific (esp. tag-based) aliases
-% where {<alias>} would cause clashes
-% (e.g., \fi)
-\DeclareEnvironmentCopy { lang } { otherlanguage }
-
% wrapper for foreignlanguage and otherlanguage*
-\newcommand*\polyglossia@setforeignlanguage[2][]{
- \select@@language[#1]{#2}
+\cs_new_nopar:Nn \xpg_set_foreign_language:nn
+{
+ \xpg_select_language:nn { #1 } { #2 }
\__xpg_register_language:nn{#1}{#2}
- % Store babelname of current language (for external packages such as biblatex)
- \tl_if_blank:nTF {#1}{
- \ifcsundef{#2@gbabelname}{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }{
- \edef\babelname{\csuse{#2@gbabelname}}
- }
- }{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }
- % Store BCP-47 id of current language
- \__xpg_store_bcp_info:nn {#1}{#2}
-}
-
-% Expandable lowercasing. We use this to assure keyval
-% options are lowercased (also when used in \MakeUppercase
-% contexts e.g. in headings)
-% Macro adapted from tudscr.sty
-\newcommand*\xpg@str@lowercase[2]{
- \protected@edef#1{
- \lowercase{\def\noexpand#1{#2}}
- }#1
}
% lowercase options before passing to setkeys
-\cs_new:Nn \__xpg_set_keys:nn
+\NewDocumentCommand \SetGlossOptions { m m }
{
- \xpg@str@lowercase{\xpg@tmp@opts}{#2}
- \exp_args:Nne \setkeys{#1}{\xpg@tmp@opts}
+ % \text_lowercase:n fully expands
+ % (as opposed to \str_lowercase:n)
+ \use:c { xpg_#1_default_options_tl }
+ \exp_args:Ne \keys_set:ne{ polyglossia / gloss / #1 }{ \text_lowercase:n {#2} }
}
% joint code of \foreignlanguage, otherlanguage*
@@ -5967,54 +5927,30 @@ to track the issues and follow progress.
\cs_new:Nn \xpg_otherlanguage:nn
{
\xpg_error_if_lang_not_loaded:n{#2}
- \__xpg_set_keys:nn{#2}{#1}
- \polyglossia@setforeignlanguage[#1]{#2}
+ \SetGlossOptions{#2}{#1}
+ \xpg_set_foreign_language:nn { #1 } { #2 }
% Hook for external packages such as biblatex
\polyglossia@language@switched
% buggy restoration heure
- \csuse{inlineextras@#2}
+ \use:c{inlineextras@#2}
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
\cs_if_exist_use:c{inlineextras@bbl@\babelname}
}
\DeclareDocumentCommand { \foreignlanguage } { O{} m +m }
- {
+{
\__xpg_foreignlanguage:eeen {#1} {#2} {\xpg_alias_base_lang:n{#2}} {#3}
- }
+}
% prevent case changing of language name in \foreignlanguage
\tl_put_right:Nn \l_text_case_exclude_arg_tl { \foreignlanguage }
-% Direct access to polyglossia@setforeignlanguage
+% Direct access to \xpg_set_foreign_language:nn
% used in captions
-\newcommand{\setforeignlanguage}[2][]
+\NewDocumentCommand \setforeignlanguage { O{} m }
{
- \polyglossia@setforeignlanguage[#1]{#2}
-}
-
-% Stack to store matrix languages
-\seq_new:N \__xpg_current_matrixlang_stack
-
-% Store embedding language when an embedded language is switched to
-\cs_new_nopar:Nn \__xpg_store_matrixlang:
-{
- \seq_gput_left:Nn \__xpg_current_matrixlang_stack \languagename
-}
-
-% When an embedded language is closed, reset to the embedding language
-% and remove stored matrix language from stack
-\cs_new_nopar:Nn \__xpg_reset_to_matrixlang:
-{
- % if stack is empty, use main language
- \seq_gpop_left:NNTF \__xpg_current_matrixlang_stack \l_tmpa_tl
- { \cs_set_eq:NN \__xpg_current_matrixlang \l_tmpa_tl }
- { \cs_set_eq:NN \__xpg_current_matrixlang \mainlanguagename }
- % Reset the language's/script's font families if the embedding script is latin
- \str_if_eq:eeT{\prop_item:Ne{\g_xpg_langsetup_prop}{\__xpg_current_matrixlang/lcscript}}{latin}
- {\resetfontlatin}
- % In case a \<lang>font is defined, re-activate that
- \exp_args:Ne \xpg@set@normalfont{\__xpg_current_matrixlang}
+ \xpg_set_foreign_language:nn { #1 } { #2 }
}
% internal wrapper for foreign language
@@ -6028,12 +5964,10 @@ to track the issues and follow progress.
{
\msg_show:nnn { polyglossia } { languagenotloaded } {#2}
}{
- \__xpg_store_matrixlang:
\group_begin:
\xpg_otherlanguage:nn{ \xpg_alias_add_to_option_i:nn{#2}{#1} }{ #3 }
\__xpg_lang_set_text_direction:nn{#3}{#4}
\group_end:
- \__xpg_reset_to_matrixlang:
}
}
\cs_generate_variant:Nn \__xpg_foreignlanguage:nnnn {eeen}
@@ -6042,11 +5976,9 @@ to track the issues and follow progress.
% otherlanguage* is the environment equivalent of \foreignlanguage
\DeclareDocumentEnvironment { otherlanguage* } { O{} m }
{
- \__xpg_store_matrixlang:
\__xpg_otherlanguage:eee { #1 } { #2 } { \xpg_alias_base_lang:n { #2 } }
}{
- \egroup% \group_end: does not work here!
- \__xpg_reset_to_matrixlang:
+ \c_group_end_token% \group_end: does not work here!
}
% internal wrapper
@@ -6061,7 +5993,7 @@ to track the issues and follow progress.
}{
\xpg_otherlanguage:nn{ \xpg_alias_add_to_option_i:nn{#2}{#1} }{ #3 }
\__xpg_lang_set_text_direction:nn{#3}%
- \bgroup% \group_begin: does not work here!
+ \c_group_begin_token% \group_begin: does not work here!
}
}
\cs_generate_variant:Nn \__xpg_otherlanguage:nnn { eee }
@@ -6077,9 +6009,6 @@ to track the issues and follow progress.
}
\cs_generate_variant:Nn \__xpg_textlanguage:nnn {een}
-% Track whether we are in an inline lang (\text...) switch
-\bool_new:N \l__xpg_inline_lang_bool
-
% use by \text<lang> and \textlang. Equivalent to \foreignlanguage,
% except that dates are localized.
% #1: option
@@ -6093,41 +6022,43 @@ to track the issues and follow progress.
\msg_show:nnn { polyglossia } { languagenotloaded } {#2}
}
{
- \__xpg_store_matrixlang:
\group_begin:
- \bool_set_true:N \l__xpg_inline_lang_bool
\xpg_otherlanguage:nn{#1}{#3}
- \csuse{date#3}
+ \use:c{date#3}
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
\cs_if_exist_use:c{date@bbl@\babelname}
\__xpg_lang_set_text_direction:nn{#3}{#4}
\group_end:
- \__xpg_reset_to_matrixlang:
}
}
\cs_generate_variant:Nn \__xpg_textlanguage:nnnn {nnen}
% Define language-specific hyphenation exceptions
-\newcommand\pghyphenation[3][]{
- \bgroup
- \xpg_error_if_lang_not_loaded:n{#2}
- \setkeys{#2}{#1}
- \select@@language[#1]{#2}
+\NewDocumentCommand \pghyphenation {O{} m m}
+{
+ \c_group_begin_token
+ \xpg_error_if_lang_not_loaded:n { #2 }
+ \SetGlossOptions{#2}{#1}
+ \xpg_select_language:nn { #1 } { #2 }
\hyphenation{#3}
- \egroup
+ \c_group_end_token
}
% Hook that other package authors can use
% (for instance biblatex):
% Do not rename!
-\newcommand*{\xpg@hook@setlanguage}{}
+\cs_set_nopar:Npn \xpg@hook@setlanguage {}
-\def\xpg@pop@language@i#1#2{
- \xpg@set@language@aux[#1]{#2}
+\cs_set_nopar:Nn \__xpg_pop_language:nn
+{
+ \xpg_set_language_aux:nn { #1 } { #2 }
\xpg@hook@setlanguage
- \let\emp@langname\@undefined}
+% FIXME This seems to be a very old relict.
+% The macro is nowhere used. Probably remove.
+% \let\emp@langname\@undefined
+}
\DeclareDocumentCommand \selectlanguage {s O{} m}
{
@@ -6146,131 +6077,124 @@ to track the issues and follow progress.
\cs_new:Nn \__xpg_select_language:nnn
{
% Register the language options
- \__xpg_set_language_options:nnn {#3} {#2} {@xpg@set@langvariant}
+ \__xpg_set_language_options:nn {#3} {#2}
\IfBooleanTF { #1 } % The starred variant does not write to the aux
{
- \xpg@set@language@nonaux[#2]{#3}
+ \xpg_set_language_nonaux:nn { #2 } { #3 }
}{
- \cs_set_nopar:Npe \xpg@pop@language { \exp_not:N \xpg@pop@language@i {#2} {#3} }
- \group_insert_after:N \xpg@pop@language
- \xpg@set@language@aux[#2]{#3}
+ \cs_set_nopar:Ne \xpg_pop_language: { \exp_not:N \__xpg_pop_language:nn { #2 } { #3 } }
+ \group_insert_after:N \xpg_pop_language:
+ \xpg_set_language_aux:nn { #2 } { #3 }
}
- \__xpg_register_language:nn{#2}{#3}
+ \__xpg_register_language:nn { #2 } { #3 }
}
\cs_generate_variant:Nn \__xpg_select_language:nnn { nee, nne }
-
% set lang option #2 for lang #1
-\cs_new:Nn \__xpg_set_language_options:nnn
+\cs_new:Nn \__xpg_set_language_options:nn
{
- \tl_if_blank:nF {#2}
+ \cs_if_exist:cT { xpg_#1_default_options_prop }
{
- % If the optional argument sets a value for the key “variant”, copy it to xpg@langvariant
- \clist_map_inline:nn { #2 } {
- \xpg@parsevariantkeyvalue##1=#3:#1\relax
- }%
- \__xpg_set_keys:nn{#1}{#2}
+ \prop_concat:ccc { l_xpg_curropt_prop } { l_xpg_curropt_prop }
+ { xpg_#1_default_options_prop }
}
+ \xpg__keyval_parser:eeN { #2 } { #1 } \l_xpg_curropt_prop
+ \SetGlossOptions{#1}{#2}
}
% Initialize default language options, so that
% \iflanguageoption has the info it needs also
% for default settings
-\newcommand*\xpg@initialize@gloss@options[2]{
- \__xpg_set_language_options:nnn {#1} {#2} {@xpg@set@langvariant}
-}
+\NewDocumentCommand \InitializeGlossOptions { m m }
+{
+ \tl_new:c { xpg_#1_default_options_tl }
+ \prop_new:c { xpg_#1_default_options_prop }
+ \keys_precompile:nec { polyglossia / gloss / #1 }
+ { \text_lowercase:n { #2, \xpg__tmp_default_options_tl } }
+ { xpg_#1_default_options_tl }
+ \xpg__keyval_parser:enc { #2, \xpg__tmp_default_options_tl } { #1 }
+ { xpg_#1_default_options_prop }
+ \prop_concat:ccc { l_xpg_curropt_prop } { l_xpg_curropt_prop }
+ { xpg_#1_default_options_prop }
+ \use:c { xpg_#1_default_options_tl }
+ \__xpg_set_language_options:nn {#1} {#2}
+}
+\tl_new:N \xpg__tmp_default_options_tl
+\cs_generate_variant:Nn \keys_precompile:nnN { nec }
% Record synonymous keyvals such as variant=us and variant=american
-% Syntax: \xpg@set@alias@values{<lang>}{<key>}{<val>}{<alias vals, comma-separated>}
-\newcommand*\xpg@set@alias@values[4]{%
- \prop_if_exist:cF { xpg@alias@keyvals@#1@#3 }
- { \prop_new:c {xpg@alias@keyvals@#1@#3} }
- \prop_put:cnn { xpg@alias@keyvals@#1@#3 }
- {#2}{#4}
- \prop_if_exist:cF { xpg@alias@keyvals@#1@#4 }
- { \prop_new:c {xpg@alias@keyvals@#1@#4} }
- \prop_put:cnn { xpg@alias@keyvals@#1@#4 }
- {#2}{#3}
-}
-
-% Patch xkeyval to record default values of keys
-\pretocmd{\XKV@define@default}{%
- \csgdef{xpg@default@opt@\XKV@header #1}{#2}
-}{}{\xpg@warning{Patching xkeyval failed!}}
-
-% Helper to get and register option keyvals
-\def\xpg@parsevariantkeyvalue#1=#2@#3:#4\relax{
- \def\@tmpa{#1}
- \def\@tmpb{variant}
- % variant values are stored in specific macros
- % (\xpg@main@langvariant, \xpg@other@langvariant
- % and \xpg@set@langvariant)
- \ifx\@tmpa\@tmpb\setkeys{#3}{#1=#2}\fi
- \tl_if_empty:nTF{#2}
- {
- \ifcsdef{xpg@default@opt@KV@#4@#1}
- {\xpg@store@opt@keyval#1:\csuse{xpg@default@opt@KV@#4@#1}=:#4\relax}
- {}%
- }
- { \xpg@store@opt@keyval#1:#2:#4\relax }
-}%
-
-% Store option keys and values
-% This strips trailing '=' from values.
-\def\xpg@store@opt@keyval#1:#2=:#3\relax{
- \prop_if_exist:cF { xpg@current@options@#3 }
- { \prop_new:c {xpg@current@options@#3} }
- \prop_put:cnn { xpg@current@options@#3 }
- {#1}{#2}
+% Syntax: \SetLanguageAliasValues{<lang>}{<key>}{<alias vals, comma-separated>}
+\int_new:N \l_xpg_alias_keyvals_int
+\int_set:Nn \l_xpg_alias_keyvals_int { 2 }
+\NewDocumentCommand \SetLanguageAliasValues { m m m }
+{
+ \clist_map_inline:nn { #3 }
+ {
+ \int_const:cn { c_xpg_alias_keyvals_#1_#2_##1_int } { \l_xpg_alias_keyvals_int }
+ }
+ \int_incr:N \l_xpg_alias_keyvals_int
}
+\cs_new:Npn \xpg__keyval_parser:nnN #1 #2 #3 % #1 = key-vals, #2 = language, #3 = prop
+ {
+ \keyval_parse:nnn
+ { \xpg__keyval_parser_default:nnn { #2 } { #3 } }
+ { \xpg__keyval_parser_nondefault:nnnn { #2 } { #3 } }
+ { #1 }
+ }
+\cs_generate_variant:Nn \xpg__keyval_parser:nnN { eeN, enc }
+
+\cs_new:Npn \xpg__keyval_parser_default:nnn #1 #2 #3 % #1 = lang, #2 = prop, #3 = key
+ {
+ \str_set:Nn \l_tempa_str { #1 / #3 }
+ \str_concat:NNN \l_tempa_str \c__keys_default_root_str \l_tempa_str
+ \prop_put:Nne #2 { #1 / #3 } { \use:c { \l_tempa_str } }
+ }
+
+\cs_new:Npn \xpg__keyval_parser_nondefault:nnnn #1 #2 #3 #4 % #1 = lang, #2 = prop, #3 = key, #4 = value
+ {
+ \prop_put:Nnn #2 { #1 / #3 } { #4 }
+ }
\prg_set_conditional:Npnn \__xpg_check_option_value:NNN #1#2#3 { p , T , F , TF }
-{
- \prop_get:cnNTF {xpg@current@options@#1} {#2} \l_tmpa_tl
- {
- \str_if_eq:eeTF{\l_tmpa_tl}{#3}
- {\prg_return_true:}
+ {
+ \bool_lazy_or:nnTF
+ {
+ \str_if_eq_p:ee { \prop_item:Nn \l_xpg_curropt_prop { #1 / #2 } } { #3 }
+ } {
+ \int_compare_p:nNn
{
- \prop_get:cnNTF {xpg@alias@keyvals@#1@#3} {#2} \l_tmpb_tl
- {
- \clist_set:Ne{\l_tmpa_clist}{\l_tmpb_tl}
- \providetoggle{xpgvalfound}
- \togglefalse{xpgvalfound}
- \clist_map_inline:Nn \l_tmpa_clist {
- \str_if_eq:eeT{##1}{\l_tmpa_tl}
- { \toggletrue{xpgvalfound} }
- }
- \iftoggle{xpgvalfound}{\prg_return_true:}{\prg_return_false:}
- }
- {
- \prg_return_false:
- }
- }
- }
- {
- \prg_return_false:
- }
+ \cs_if_exist_use:cF { c_xpg_alias_keyvals_#1_#2_#3_int } { 0 }
+ } = {
+ \cs_if_exist_use:cF { c_xpg_alias_keyvals_#1_#2_\prop_item:Nn \l_xpg_curropt_prop { #1 / #2 }_int } { 1 }
+ }
+ } { \prg_return_true: } { \prg_return_false: }
+ }
+
+\prg_set_conditional:Npnn \xpg_if_main_language:n #1 { T, F, TF }
+{
+ \str_if_eq:VnTF \xpg_main_language_tl { #1 }
+ { \prg_return_true: }
+ { \prg_return_false: }
}
+\cs_set_eq:NN \IfMainLanguageTF \xpg_if_main_language:nTF
+
+\cs_set_eq:NN \IfMainLanguageT \xpg_if_main_language:nT
+
+\cs_set_eq:NN \IfMainLanguageF \xpg_if_main_language:nF
+
% Test if option value is set
\DeclareDocumentCommand \iflanguageoption { m m m m m }
{
\__xpg_check_option_value:NNNTF{#1}{#2}{#3}{#4}{#5}
}
-
-% Append any variant to csv list of variants
-\define@key{xpg@langvariant}{variant}{
- \clist_if_in:NeF \xpg@vloaded {#1}{
- \clist_gput_right:Ne \xpg@vloaded {#1}
- }
-}
-
% Test if language is loaded
\DeclareDocumentCommand \iflanguageloaded { m m m }
{
- \AddToHook{begindocument/end}{
+ \hook_gput_code:nnn {begindocument/end} {.}
+ {
\clist_if_in:NeTF \xpg@loaded{#1}{#2}{#3}
}
}
@@ -6278,7 +6202,8 @@ to track the issues and follow progress.
% Same for babellanguage is loaded
\DeclareDocumentCommand \ifbabellanguageloaded { m m m }
{
- \AddToHook{begindocument/end}{
+ \hook_gput_code:nnn {begindocument/end} {.}
+ {
\clist_if_in:NeTF \xpg@bloaded{#1}{#2}{#3}
}
}
@@ -6286,7 +6211,8 @@ to track the issues and follow progress.
% Same for languageid
\DeclareDocumentCommand \iflanguageidloaded { m m m m }
{
- \AddToHook{begindocument/end}{
+ \hook_gput_code:nnn {begindocument/end} {.}
+ {
\str_case:nnTF {#1}
{
{bcp-47} { \clist_if_in:NeTF \xpg@bcp@loaded{#2}{#3}{#4} }
@@ -6294,7 +6220,7 @@ to track the issues and follow progress.
}
{}
{
- \xpg@error{Invalid~ \string\iflanguageidloaded\space argument:~ #1}
+ \xpg_ill_arg_msg:nn { #1 } { \iflanguageidloaded }
}
}%
}
@@ -6324,53 +6250,46 @@ to track the issues and follow progress.
}
-\newcommand*{\xpg@set@language@nonaux}[2][]{
- \@select@language[#1]{#2}
+\cs_new_nopar:Nn \xpg_set_language_nonaux:nn
+{
+ \__xpg_start_language:nn { #1 } { #2 }
}
-\newcommand*{\xpg@set@language@aux}[2][]{
- % Store babelname of current language (for external packages such as biblatex)
- \tl_if_blank:nTF {#1}{
- \ifcsundef{#2@gbabelname}{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }{
- \edef\babelname{\csuse{#2@gbabelname}}
- }
- }{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }
- % Store BCP-47 id of current language
- \__xpg_store_bcp_info:nn {#1}{#2}
- \@select@language[#1]{#2}
+\cs_new_nopar:Nn \xpg_set_language_aux:nn
+{
+ \__xpg_start_language:nn { #1 } { #2 }
% Write to the aux
- \xpg@set@language@only@aux[#1]{#2}
+ \xpg_set_language_only_aux:nn { #1 } { #2 }
}
-\newcommand*{\xpg@set@language@only@aux}[2][]{
+\cs_new_nopar:Nn \xpg_set_language_only_aux:nn
+{
% Write to the aux (toc files)
\if@filesw
\addtocontents{toc}{\selectlanguage*[#1]{#2}}
\fi
}
-\AtBeginDocument{
+\hook_gput_code:nnn {begindocument} {.}
+{
\if@filesw
- \immediate\write\@mainaux
- {\ProvideDocumentCommand\selectlanguage{sO{}m}{}}
+ \immediate\write\@mainaux
+ {\ProvideDocumentCommand\selectlanguage{sO{}m}{}}
\fi
}
% Since captions might float to other language regions,
% we need to change the language here (#542)
-\AddToHook{cmd/caption/before}{
+\hook_gput_code:nnn {cmd/caption/before} {.}
+{
\ifhmode\unskip\fi
\addtocontents{lof}{\protect\setforeignlanguage{\languagename}}
\addtocontents{lot}{\protect\setforeignlanguage{\languagename}}
}
% check if language is defined
-\prg_set_conditional:Npnn \__xpg_check_if_exist_l@:n #1 { F, TF }
+\prg_set_conditional:Npnn \__xpg_pattern_check_if_exists:n #1 { F, TF }
{
\bool_lazy_and:nnTF
{ \cs_if_exist_p:c { l@#1 } }
@@ -6379,82 +6298,125 @@ to track the issues and follow progress.
{ \prg_return_false: }
}
-\def\polyglossia@luatex@load@lang#1{
+\cs_new_nopar:Nn \__xpg_luatex_load_lang:n
+{
% if \l@#1 is not properly defined, call lua function newloader(#1),
% and assign the returned number to \l@#1
- \__xpg_check_if_exist_l@:nF {#1}
+ \__xpg_pattern_check_if_exists:nF {#1}
{
\directlua { token.set_char('l@#1', polyglossia.newloader'#1') }
}
}
-% This check is also used by biblatex, so don't
-% rename silently.
-\newcommand\xpg@ifdefined[3]{
+% check if language is defined
+\prg_set_conditional:Npnn \xpg_if_language_defined:n #1 { T, F, TF }
+{
% With luatex, we first need to define \l@#1.
\sys_if_engine_luatex:T
{
- \polyglossia@luatex@load@lang{#1}
+ \__xpg_luatex_load_lang:n {#1}
}
- \__xpg_check_if_exist_l@:nTF{#1}{#2}{#3}
+ \__xpg_pattern_check_if_exists:nTF{#1}
+ { \prg_return_true: }
+ { \prg_return_false: }
}
+% Aliases for gloss files
+\cs_gset_eq:cc { IfLanguageDefinedTF } { xpg_if_language_defined:nTF }
+\cs_gset_eq:cc { IfLanguageDefinedT } { xpg_if_language_defined:nT }
+\cs_gset_eq:cc { IfLanguageDefinedF } { xpg_if_language_defined:nF }
+
+% Check if patterns for language #1 is defined. If not, try
+% the comma-separated list of fallbacks in #2
+\NewDocumentCommand \TryPatternWithFallback { m m }
+{
+ \xpg_if_language_defined:nF { #1 }
+ {
+ \clist_clear_new:N \l_xpg_lang_patterns
+ \clist_set:Ne \l_xpg_lang_patterns { #2 }
+ \bool_set_false:N \l_tmpa_bool
+ \clist_map_inline:Nn \l_xpg_lang_patterns
+ {
+ \xpg_if_language_defined:nT { ##1 }
+ {
+ \cs_gset_eq:cc { l@#1 } { l@##1 }
+ \bool_set_true:N \l_tmpa_bool
+ \clist_map_break:
+ }
+ }
+ \bool_if:NF \l_tmpa_bool
+ {
+ \xpg_warning_msg:n
+ {No~ hyphenation~ patterns~ for~ #1~ found \iow_newline:
+ Falling~ back~ to~ the~ default~ patterns~ (=~English)!}
+ \exp_args:Nc \adddialect {l@#1} 0
+ }
+ }
+}
+
+% This old term is used by biblatex, so don't drop!
+\cs_gset_eq:cc { xpg@ifdefined } { xpg_if_language_defined:nTF }
+
% Set \bbl@hyphendata@\the\language, which is (lua)babel's
% hyphenation pattern hook
% FIXME Clarifiy why/when this is needed.
-\newcommand*\xpg@set@bbl@hyphendata[1]{
+\cs_new:Nn \xpg_set_bbl_hyphendata:n
+{
\sys_if_engine_luatex:T
{
- \ifcsdef{bbl@hyphendata@#1}{}{
- \global\@namedef{bbl@hyphendata@\the\language}{}
+ \cs_if_exist:cF {bbl@hyphendata@#1}
+ {
+ \cs_gset:cpn {bbl@hyphendata@\the\language} {}
}
}
}
% Set hyphenation patterns for a given language. This does the right
% thing both for XeTeX and LuaTeX
-\newcommand*\xpg@set@hyphenation@patterns[1]{
- \sys_if_engine_luatex:T { \polyglossia@luatex@load@lang{#1} }
+\cs_new:Nn \xpg_set_hyphenation_patterns:n
+{
+ \sys_if_engine_luatex:T { \__xpg_luatex_load_lang:n {#1} }
\language=\csname l@#1\endcsname
}
-\newcommand*\@select@language[2][]{
+\cs_new:Nn \__xpg_start_language:nn
+{
% hook for compatibility with biblatex
- \select@language{#2}
- \xpg@set@bbl@hyphendata{\the\language}
+ \select@language { #2 }
+ \xpg_set_bbl_hyphendata:n {\the\language}
\xpg_initial_setup:
- \select@@language[#1]{#2}%
+ \xpg_select_language:nn { #1 } { #2 }
% Hook for external packages such as biblatex
- \polyglossia@language@switched%
- \__xpg_lang_set_par_direction:n{#2}
- \csuse{captions#2}%
- \csuse{date#2}%
+ \polyglossia@language@switched
+ \__xpg_lang_set_par_direction:n {#2}
+ \use:c {captions#2}
+ \use:c {date#2}
% These are hooks for external packages which want to access variants
% via babelname (such as biblatex)
- \cs_if_exist_use:c{captions@bbl@\babelname}
- \cs_if_exist_use:c{date@bbl@\babelname}
- \__xpg_local_marks:n{#2}
- \csuse{init@extras@#2}%
+ \cs_if_exist_use:c {captions@bbl@\babelname}
+ \cs_if_exist_use:c {date@bbl@\babelname}
+ \__xpg_local_marks:n {#2}
+ \use:c {init@extras@#2}
\__xpg_indent_first:n { #2 }
- \csuse{blockextras@#2}%
+ \cs_if_exist_use:c {blockextras@#2}
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
- \cs_if_exist_use:c{blockextras@bbl@\babelname}
- }
+ \cs_if_exist_use:c {blockextras@bbl@\babelname}
+}
% hook for compatibility with biblatex
% (probably no longer used due to the
% more general hook that follows, but
% we keep it for backwards comp.)
-\def\select@language#1{}
+\cs_set:Npn \select@language #1 {}
% Hook for external packages such as biblatex
% do not rename!
-\def\polyglossia@language@switched{}
+\cs_new:Npn \polyglossia@language@switched {}
-% remove all custumization for language #1
+% remove all customization for language #1
\cs_new:Npn \noextrascurrent #1
-{%
+{
\cs_if_exist_use:c{noextras@#1}%
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
@@ -6462,160 +6424,105 @@ to track the issues and follow progress.
}
% Common code for `\select@language' and `\foreignlanguage'.
-\newcommand{\select@@language}[2][]{%
+\cs_new:Nn \xpg_select_language:nn
+{
% disable the extras and number settings of the previous language
\cs_if_exist:cT{languagename}
{
\noextrascurrent{\languagename}
\cs_if_exist_use:c{no\languagename @numbers}
\sys_if_engine_xetex:T{
- \__xpg_if_LR_str:eTF{\prop_item:Ne{\g_xpg_langsetup_prop}{\languagename/direction}}
+ \__xpg_if_LR_str:eTF{\prop_item:Ne{\l_xpg_langsetup_prop}{\languagename/direction}}
{
- \__xpg_if_LR_str:eF{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/direction}}
+ \__xpg_if_LR_str:eF{\prop_item:Nn{\l_xpg_langsetup_prop}{#2/direction}}
{\setnonlatin} % LTR -> RTL
}
{
- \__xpg_if_LR_str:eT{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/direction}}
+ \__xpg_if_LR_str:eT{\prop_item:Nn{\l_xpg_langsetup_prop}{#2/direction}}
{\setlatin} % RTL -> LTR
}
}
}
- \polyglossia@set@language@name[#1]{#2}
- % Set the language's/script's font families
- \str_if_eq:eeT{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/lcscript}} {latin}
- {
- \resetfontlatin
- }
- \bool_if:NF \l__xpg_inline_lang_bool
- { % This for non-inline font switches
- % in case a \<lang>font is defined
- \xpg@set@normalfont{#2}
- }
- \xpg@select@fontfamily{#2}
+ \xpg_set_language_name:n { #2 }
+ \xpg_set_normalfont:n { #2 }
+ \xpg_select_fontfamily:n { #2 }
\__xpg_use_or_warn:c{#2@language}
\cs_if_exist_use:c{#2@numbers}
- \use@localhyphenmins[#1]{#2}
+ \__xpg_use_localhyphenmins:nn { #1 } { #2 }
\__xpg_french_spacing:n { #2 }
}
-\let\xpg@pop@language\relax
+\cs_undefine:N \xpg_pop_language:
-%
-% Keep track of the active (nested) languages and options
-%
-\clist_new:N \l_xpg_lang_stack
-
-\cs_new:Nn \__xpg_stack_language:nn
-{
- \clist_gpush:Nn \l_xpg_lang_stack {#1:#2}
-}
+\DeclareDocumentEnvironment { otherlanguage } { O{} m }
+ {
+ \selectlanguage[#1]{#2}
+ } { }
-\cs_generate_variant:Nn \__xpg_stack_language:nn {nx}
+% Alias to {<lang>}, but more suitable
+% for specific (esp. tag-based) aliases
+% where {<alias>} would cause clashes
+% (e.g., \fi)
+\DeclareEnvironmentCopy { lang } { otherlanguage }
-\cs_new:Nn \__xpg_unstack_language:n
+\NewDocumentCommand \setlocalhyphenmins { m m m }
{
- \clist_gpop:NNTF \l_xpg_lang_stack \l_tmpa_tl {
- % Stored format = options:language => split:
- \seq_set_split:Nne \l_tmpa_seq {:} \l_tmpa_tl
- \seq_get_left:NN \l_tmpa_seq \l_tmpb_tl
- \seq_get_right:NN \l_tmpa_seq \l_tmpc_tl
- % Execute passed command with language and maybe options
- % and re-set stored language's keys
- \tl_if_empty:NTF \l_tmpb_tl {\cs_if_exist_use:c{#1}{\l_tmpc_tl}}
- {\__xpg_set_keys:nn{\l_tmpc_tl}{\l_tmpb_tl}
- \cs_if_exist_use:c{#1}[\l_tmpb_tl]{\l_tmpc_tl}
- }
- }
- {}
-}
-
-\DeclareDocumentEnvironment { otherlanguage } { O{} m }
- {
- % Get real current (pre-switch) options (incl. defaults)
- \clist_clear_new:N \l_xpg_current_options
- \prop_if_exist:cF { xpg@current@options@\languagename }
- { \prop_new:c {xpg@current@options@\languagename} }
- \prop_map_inline:cn {xpg@current@options@\languagename}
+ \xpg_if_language_defined:nTF{#1}
+ {
+ \cs_if_eq:ccTF { l@#1 } { l@nohyphenation }
{
- \clist_put_right:Nn \l_xpg_current_options {##1=##2}
+ \xpg_warning_msg:n {\string\setlocalhyphenmin\space~ useless~ for~ unhyphenated~ language~ #1}
+ }{
+ \providehyphenmins{#1}{#2#3}
}
- % Store current (pre-switch) options and language on stack
- \__xpg_stack_language:nx{\clist_use:Nn \l_xpg_current_options {,}}{\languagename}
- \selectlanguage[#1]{#2}
- }
- {
- % restore previous language in aux file and remove closed one from stack
- \__xpg_unstack_language:n{xpg@set@language@only@aux}
- }
-
-\newcommand{\setlocalhyphenmins}[3]{
- \xpg@ifdefined{#1}{
- \expandafter\ifx\csname l@#1\endcsname\l@nohyphenation
- \xpg@warning{\string\setlocalhyphenmin\space~ useless~ for~ unhyphenated~ language~ #1}
- \else
- \providehyphenmins{#1}{#2#3}
- \fi
}{
- \xpg@warning{\string\setlocalhyphenmin\space~ useless~ for~ unknown~ language~ #1}
+ \xpg_warning_msg:n {\string\setlocalhyphenmin\space~ useless~ for~ unknown~ language~ #1}
}
}
% \setlanghyphenmins[options]{lang}{l}{r}
-\newcommand*\setlanghyphenmins[4][]{%
+\NewDocumentCommand \setlanghyphenmins { O{} m m m }
+{
% Check for real language name and options
- \edef\xpg@tmp@opts{\xpg_alias_add_to_option_i:nn{#2}{#1}}
- \edef\xpg@tmp@lang{\xpg_alias_base_lang:n{#2}}
- \bgroup
- \xpg_error_if_lang_not_loaded:n{\xpg@tmp@lang}
- \__xpg_set_keys:nn{\xpg@tmp@lang}{\xpg@tmp@opts}
+ \tl_set:Nx \l_tmp_opts_tl { \xpg_alias_add_to_option_i:nn{#2}{#1} }
+ \tl_set:Nx \l_tmp_lang_tl { \xpg_alias_base_lang:n{#2} }
+ \c_group_begin_token
+ \xpg_error_if_lang_not_loaded:n{\l_tmp_lang_tl}
+ \SetGlossOptions{\l_tmp_lang_tl}{ \l_tmp_opts_tl }
% Store bcp47.tag@hypenmins
- \tl_if_blank:nTF {\xpg@tmp@opts}{%
- \ifcsundef{\csname xpg@tmp@lang\endcsname @g.bcp47.tag}{
- \csedef{tmp@bcp47.tag}{\prop_item:Ne{\g_xpg_langsetup_prop}{ \xpg@tmp@lang / bcp47 }}
- }{
- \csedef{tmp@bcp47.tag}{\csuse{#2@g.bcp47.tag}}
- }
- }{
- \csedef{tmp@bcp47.tag}{\prop_item:Ne{\g_xpg_langsetup_prop}{ \xpg@tmp@lang / bcp47 }}
- }
- \csgdef{\csname tmp@bcp47.tag\endcsname @hyphenmins}{{#3}{#4}}
- \egroup
+ \cs_set_nopar:cpe {tmp@bcp47.tag} { \prop_item:Ne{\l_xpg_langsetup_prop}{ \l_tmp_lang_tl / bcp47 } }
+ \cs_gset:cpn {\csname tmp@bcp47.tag\endcsname @hyphenmins} {{#3}{#4}}
+ \c_group_end_token
}
-% \use@localhypenmins[options]{lang}
-\newcommand*\use@localhyphenmins[2][]{
- \bgroup
- \xpg_error_if_lang_not_loaded:n{#2}
- \__xpg_set_keys:nn{#2}{#1}
+% \__xpg_use_localhyphenmins:nn {options}{lang}
+\cs_new_nopar:Nn \__xpg_use_localhyphenmins:nn
+{
+ \c_group_begin_token
+ \xpg_error_if_lang_not_loaded:n {#2}
+ \SetGlossOptions {#2} {#1}
% Use bcp47.tag@hypenmins
- \tl_if_blank:nTF {#1}{
- \ifcsundef{#2@g.bcp47.tag}{
- \csxdef{tmp@bcp47.tag}{\prop_item:Nn{\g_xpg_langsetup_prop}{ #2 / bcp47 }}
- }{
- \csxdef{tmp@bcp47.tag}{\csuse{#2@g.bcp47.tag}}
- }
- }{
- \csxdef{tmp@bcp47.tag}{\prop_item:Nn{\g_xpg_langsetup_prop}{ #2 / bcp47 }}
- }
- \egroup
- \ifcsundef{\csname tmp@bcp47.tag\endcsname @hyphenmins}{
- \ifcsundef{#2hyphenmins}{}
+ \cs_gset_nopar:cpe {tmp@bcp47.tag} { \prop_item:Nn{\l_xpg_langsetup_prop}{ #2 / bcp47 } }
+ \c_group_end_token
+ \cs_if_exist:cTF {\csname tmp@bcp47.tag\endcsname @hyphenmins}
+ {
+ \tl_set:Ne \l_tmpa_tl { \use:c{\csname tmp@bcp47.tag\endcsname @hyphenmins} }
+ \expandafter \set@hyphenmins \l_tmpa_tl
+ }{
+ \cs_if_exist:cT{#2hyphenmins}
{
\expandafter\expandafter\expandafter\set@hyphenmins\csname #2hyphenmins\endcsname\relax
}
- }{
- \edef\tmpa{\csuse{\csname tmp@bcp47.tag\endcsname @hyphenmins}}
- \expandafter\expandafter\expandafter\set@hyphenmins\tmpa\relax
}
- \sys_if_engine_luatex:T{
+ \sys_if_engine_luatex:T
+ {
% Set \totalhyphenmin if specified
- \prop_get:NeNTF \g_xpg_langsetup_prop {#2/totalhyphenmin} \l_tmpa_tl
+ \prop_get:NeNT \l_xpg_langsetup_prop {#2/totalhyphenmin} \l_tmpb_tl
{
- \xpg@info{totalhyphenmin: '\l_tmpa_tl'}
- \expandafter\hyphenationmin \l_tmpa_tl
+ \xpg_info_msg:n {totalhyphenmin: '\l_tmpb_tl'}
+ \expandafter\hyphenationmin \l_tmpb_tl
}
- {}
}
}
@@ -6627,23 +6534,26 @@ to track the issues and follow progress.
\DeclareDocumentEnvironment { hyphenrules } { O{} m }
{
% Check for real language name and options
- \edef\xpg@tmp@opts{\xpg_alias_add_to_option_i:nn{#2}{#1}}
- \edef\xpg@tmp@lang{\xpg_alias_base_lang:n{#2}}
+ \tl_set:Nx \l_tmp_opts_tl { \xpg_alias_add_to_option_i:nn{#2}{#1} }
+ \tl_set:Nx \l_tmp_lang_tl { \xpg_alias_base_lang:n{#2} }
% Register the language options
- \__xpg_set_language_options:nnn {\xpg@tmp@lang} {\xpg@tmp@opts} {@xpg@set@langvariant}
+ \__xpg_set_language_options:nn { \l_tmp_lang_tl } { \l_tmp_opts_tl }
% Now switch patterns
- \__xpg_use_or_warn:c{\use:c{xpg@tmp@lang}@language}
+ \__xpg_use_or_warn:c{\use:c{l_tmp_lang_tl}@language}
% And activate hyphenmins
- \use@localhyphenmins[\xpg@tmp@opts]{\xpg@tmp@lang}
+ \__xpg_use_localhyphenmins:nn { \l_tmp_opts_tl } { \l_tmp_lang_tl }
}
{ }
-\AddToHook{begindocument/before}{
- \IfPackageLoadedTF{bidi}{
- \providecommand*{\aemph}[1]{$\overline{\hboxR{#1}}$}
+\hook_gput_code:nnn {begindocument/before} {.}
+{
+ \IfPackageLoadedTF{bidi}
+ {
+ \ProvideDocumentCommand \aemph { m } { $\overline{\hboxR{#1}}$ }
}{}
- \IfPackageLoadedTF{luabidi}{
- \providecommand*{\aemph}[1]{$\overline{\hbox{\RL{#1}}}$}
+ \IfPackageLoadedTF{luabidi}
+ {
+ \ProvideDocumentCommand \aemph { m } { $\overline{\hbox{\RL{#1}}}$ }
}{}
}
@@ -6677,7 +6587,8 @@ to track the issues and follow progress.
.value_required:n = true,
}
-\keys_set:nn { polyglossia } {
+\keys_set:nn { polyglossia }
+{
localmarks = false,
verbose = true,
babelshorthands = false,
@@ -6694,23 +6605,35 @@ to track the issues and follow progress.
\sys_if_engine_luatex:T{
\str_if_eq:eeF{\g_xpg_luatex_renderer_str}{none}
{
- \xpg@info{Setting~ LuaTeX~ font~ renderer~ to~ \g_xpg_luatex_renderer_str}
+ \xpg_info_msg:n{Setting~ LuaTeX~ font~ renderer~ to~ \g_xpg_luatex_renderer_str}
\exp_args:Ne \defaultfontfeatures{Renderer=\g_xpg_luatex_renderer_str}
}
}
-\bool_if:nF \g_xpg_verbose_bool {
- \gdef\@latex@info#1{\relax} % no latex info
- \gdef\@font@info#1{\relax} % no latex font info
- \gdef\@font@warning#1{\relax} % no latex font warnings
- \gdef\zf@PackageInfo#1{\relax} % no fontspec info
- \gdef\xpg@info#1{\relax} % no polyglossia info
+\bool_if:nF \g_xpg_verbose_bool
+{
+ \cs_gset_nopar:Npn \@latex@info #1 { \relax } % no latex info
+ \cs_gset_nopar:Npn \@font@info #1 { \relax } % no latex font info
+ \cs_gset_nopar:Npn \@font@warning #1 { \relax } % no latex font warnings
+ \msg_redirect_module:nnn { fontspec } { info } { none } % no fontspec info
+ \msg_redirect_module:nnn { polyglossia } { info } { none } % no polyglossia info
}
\bool_if:nT \g_xpg_localmarks_bool {
\__xpg_enable_local_marks:
}
+% common code to initiate babelshordhands in glosses
+\cs_new:Npn \InitializeBabelShorthands
+{
+ \cs_if_exist:cF {initiate@active@char}
+ {
+ \file_input:n {babelsh.def}
+ \initiate@active@char{"}
+ \shorthandoff{"}
+ }
+}
+
% Control shorthand (de-)activation
% This checks that the shorthand char is only deactivated
% if we have activated it ourselves and hence keeps
@@ -6738,21 +6661,22 @@ to track the issues and follow progress.
% Inherit shorthands in other languages
\NewDocumentCommand \inheritbabelshorthands { m m }
{
- \AddToHook{begindocument/before}{
+ \hook_gput_code:nnn {begindocument/before} {.}
+ {
% Load the involved languages if necessary
% Error if they do not exist
\tl_set:Nn \l__xpg_tmpa_lang_tl { \xpg_alias_base_lang:n{#1} }
\clist_if_in:NeF \xpg@loaded {\l__xpg_tmpa_lang_tl}{
\file_if_exist:nTF{gloss-\l__xpg_tmpa_lang_tl .ldf}
{ \setotherlanguage{#1} }
- { \xpg@error{ Source~ language~ #1,~ used~ in~
+ { \xpg_error_msg:n { Source~ language~ #1,~ used~ in~
\string\inheritbabelshorthands,~ does~ not~ exist } }
}
\tl_set:Nn \l__xpg_tmpb_lang_tl { \xpg_alias_base_lang:n{#2} }
\clist_if_in:NeF \xpg@loaded {\l__xpg_tmpb_lang_tl}{
\file_if_exist:nTF{gloss-\l__xpg_tmpb_lang_tl .ldf}
{ \setotherlanguage{#2} }
- { \xpg@error{ Target~ language~ #2,~ used~ in~
+ { \xpg_error_msg:n { Target~ language~ #2,~ used~ in~
\string\inheritbabelshorthands,~ does~ not~ exist } }
}
% Test whether the requested shorthands exist
@@ -6764,7 +6688,7 @@ to track the issues and follow progress.
{ \bool_set_true:N \l__xpg_no_shorthands_bool }
\bool_if:nT { \l__xpg_no_shorthands_bool }
{
- \xpg@error{ No~ babel~ shorthands~ exist~ for~ language~ #1 }
+ \xpg_error_msg:n { No~ babel~ shorthands~ exist~ for~ language~ #1 }
}
% If so, apply:
\bool_if:nF { \l__xpg_no_shorthands_bool }
@@ -6789,7 +6713,7 @@ to track the issues and follow progress.
\iflanguageloaded{\l__xpg_tmpa_lang_tl}{
\use:c{\l__xpg_tmpa_lang_tl @shorthands}
}{
- \xpg@error{ Language~ #1,~ requested~ in~
+ \xpg_error_msg:n { Language~ #1,~ requested~ in~
\string\startbabelshorthands,~ is~ not~ loaded }
}
}
@@ -7090,7 +7014,7 @@ to track the issues and follow progress.
\ifnum#1<5000
\Hebrewnumeral{#1}%
\else
- \ifnum#1<6000 % current millenium, print without thousands
+ \ifnum#1<6000 % current millennium, print without thousands
\@tempcnta=#1\relax
\if@xpg@hebrew@fullyear\else\advance\@tempcnta by -5000\fi
\Hebrewnumeral{\@tempcnta}%
@@ -7419,7 +7343,7 @@ l3calc. Please update expl3!
\@ifundefined{@Remainder}{\input{cal-util.def}}{}
%% The following functions are straightforward implementation
-%% of Reingold & Dershowitz, Calendrical Calculations, The Millenium Edition
+%% of Reingold & Dershowitz, Calendrical Calculations, The Millennium Edition
%%
\def\@FixedFromHijri#1#2#3#4{% year,month,day,counter
@@ -7494,82 +7418,15 @@ Shawwāl\or Dhū ’l-Qaʿda\or Dhū ’l-Ḥijja\fi}
% \end{macrocode}
% \iffalse
%</hijrical.sty>
-%<*polyglossia-french.lua>
+%<*polyglossia-cjk-spacing.lua>
% \fi
% \clearpage
%
-% \subsection{polyglossia-french.lua}
+% \subsection{polyglossia-cjk-spacing.lua}
% \begin{macrocode}
--
--- polyglossia-punct.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-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)
- set_left_space(lang, '‽', 0.5) -- U+203D (interrobang)
-
- 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
-% \end{macrocode}
-% \iffalse
-%</polyglossia-french.lua>
-%<*polyglossia-korean.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-korean.lua}
-% \begin{macrocode}
---
--- polyglossia-korean.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- polyglossia-cjk-spacing.lua
+-- part of polyglossia v2.2 -- 2024/07/15
--
local glyph_id = node.id"glyph"
@@ -7577,13 +7434,17 @@ local hbox_id = node.id"hlist"
local vbox_id = node.id"vlist"
local glue_id = node.id"glue"
local penalty_id = node.id"penalty"
-local disc_id = node.id"disc"
+local whatsit_id = node.id"whatsit"
+local math_id = node.id"math"
--
--- attr_korean: variant = plain (0), classic (1), modern (2)
+-- attr_cjk: variant = plain: 0, JP/classic: 1, KR/modern: 2, SC: 3, TC: 4
+--
+local attr_cjk = luatexbase.attributes["xpg@attr@cjkspacing"]
+--
+-- attr_josa: ONLY For Korean. DO NOT declare \newattribute for other langs
--
-local attr_korean = luatexbase.attributes["xpg@attr@korean"]
-local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
+local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
--
-- characters after which linebreak is not allowed
@@ -7632,9 +7493,9 @@ local nobr_after = {
-- characters before which linebreak is not allowed
-- (currently, not much differences among the followings)
-- 1: normal chars
--- 2: hangul jamo vowels and trailing consonants
+-- 2: hangul jamo vowels and trailing consonants plus combinings
-- 3: kana small letters
--- 0: dashes (supress visible spacing)
+-- 0: dashes (suppress visible spacing after this char)
--
local nobr_before = setmetatable({
[0x21] = 1, -- ! EXCLAMATION MARK
@@ -7645,7 +7506,7 @@ local nobr_before = setmetatable({
[0x2D] = 0, -- - HYPHEN-MINUS
[0x2E] = 1, -- . FULL STOP
[0x2F] = 0, -- / SOLIDUS
- [0x3A] = 0, -- : COLON
+ [0x3A] = 1, -- : COLON
[0x3B] = 1, -- ; SEMICOLON
[0x3E] = 1, -- > GREATER-THAN SIGN
[0x3F] = 1, -- ? QUESTION MARK
@@ -7657,11 +7518,11 @@ local nobr_before = setmetatable({
[0xBB] = 1, -- » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
[0x2013] = 0, -- – EN DASH
[0x2014] = 0, -- — EM DASH
- [0x2015] = 1, -- ― HORIZONTAL BAR
+ [0x2015] = 0, -- ― HORIZONTAL BAR
[0x2019] = 1, -- ’ RIGHT SINGLE QUOTATION MARK
[0x201D] = 1, -- ” RIGHT DOUBLE QUOTATION MARK
- [0x2025] = 1, -- ‥ TWO DOT LEADER
- [0x2026] = 1, -- … HORIZONTAL ELLIPSIS
+ [0x2025] = 0, -- ‥ TWO DOT LEADER
+ [0x2026] = 0, -- … HORIZONTAL ELLIPSIS
[0x232A] = 1, -- 〉 RIGHT-POINTING ANGLE BRACKET
[0x3001] = 1, -- 、 IDEOGRAPHIC COMMA
[0x3002] = 1, -- 。 IDEOGRAPHIC FULL STOP
@@ -7693,10 +7554,10 @@ local nobr_before = setmetatable({
[0x308E] = 3, -- ゎ HIRAGANA LETTER SMALL WA
[0x3095] = 3, -- ゕ HIRAGANA LETTER SMALL KA
[0x3096] = 3, -- ゖ HIRAGANA LETTER SMALL KE
- [0x3099] = 1, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309A] = 1, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
- [0x309B] = 1, -- ゛ KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309C] = 1, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ [0x3099] = 2, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
+ [0x309A] = 2, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ [0x309B] = 2, -- ゛ KATAKANA-HIRAGANA VOICED SOUND MARK
+ [0x309C] = 2, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
[0x309D] = 1, -- ゝ HIRAGANA ITERATION MARK
[0x309E] = 1, -- ゞ HIRAGANA VOICED ITERATION MARK
[0x30A0] = 1, -- ゠ KATAKANA-HIRAGANA DOUBLE HYPHEN
@@ -7716,9 +7577,9 @@ local nobr_before = setmetatable({
[0x30FC] = 1, -- ー KATAKANA-HIRAGANA PROLONGED SOUND MARK
[0x30FD] = 1, -- ヽ KATAKANA ITERATION MARK
[0x30FE] = 1, -- ヾ KATAKANA VOICED ITERATION MARK
- [0xFE30] = 1, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
- [0xFE31] = 1, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
- [0xFE32] = 1, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
+ [0xFE30] = 0, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
+ [0xFE31] = 0, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
+ [0xFE32] = 0, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
[0xFE36] = 1, -- ︶ PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
[0xFE38] = 1, -- ︸ PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
[0xFE3A] = 1, -- ︺ PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET
@@ -7745,18 +7606,18 @@ local nobr_before = setmetatable({
[0xFF63] = 1, -- 」 HALFWIDTH RIGHT CORNER BRACKET
[0xFF64] = 1, -- 、 HALFWIDTH IDEOGRAPHIC COMMA
[0xFF65] = 1, -- ・ HALFWIDTH KATAKANA MIDDLE DOT
- [0xFF9E] = 1, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
- [0xFF9F] = 1, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
+ [0xFF9E] = 2, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
+ [0xFF9F] = 2, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
}, { __index = function(_,c)
if c >= 0x1160 and c <= 0x11FF then return 2 end
if c >= 0xD7B0 and c <= 0xD7FF then return 2 end
- if c >= 0x302A and c <= 0x302F then return 1 end
+ if c >= 0x302A and c <= 0x302F then return 2 end -- tone marks
if c >= 0x31F0 and c <= 0x31FF then return 3 end
if c >= 0xFF67 and c <= 0xFF70 then return 3 end
- if c >= 0xFE00 and c <= 0xFE0F then return 1 end
+ if c >= 0xFE00 and c <= 0xFE0F then return 2 end -- variation selectors
if c >= 0xFE10 and c <= 0xFE19 and not (c == 0xFE17) then return 1 end
if c >= 0xFE50 and c <= 0xFE58 then return 1 end
- if c >= 0xE0100 and c <= 0xE01EF then return 1 end
+ if c >= 0xE0100 and c <= 0xE01EF then return 2 end -- variation selecters
end
})
@@ -7774,6 +7635,7 @@ local function is_cjk (c)
or c >= 0xFF00 and c <= 0xFFEF
or c >= 0x1F100 and c <= 0x1F2FF
or c >= 0x20000 and c <= 0x2FA1F
+ or c >= 0x30000 and c <= 0x323AF
or nobr_after[c] and c > 0x2014
or nobr_before[c] and c > 0x2014
end
@@ -7813,8 +7675,28 @@ local charclass = setmetatable({
}, { __index = function() return 0 end })
--
+-- get character class
+-- var : variant = plain, JP/classic, KR/modern, SC, TC
+-- c : codepoint
+--
+local function get_charclass (var, c)
+ if var < 3 then
+ return charclass[c]
+ elseif var == 3 then
+ -- SC : these are left aligned
+ return (c == 0xFF01 or c == 0xFF1F) and 4 -- FULLWIDTH EXCLAMATION/QUESTION MARK
+ or (c == 0xFF1A or c == 0xFF1B) and 2 -- FULLWIDTH COLON/SEMICOLON
+ or charclass[c]
+ end
+ -- TC : these are center aligned
+ return (c == 0x3001 or c == 0xFF0C) and 3 -- IDEOGRAPHIC/FULLWIDTH COMMA
+ or (c == 0x3002 or c == 0xFF0E) and 3 -- IDEOGRAPHIC/FULLWIDTH FULL STOP -- 5 ?
+ or charclass[c]
+end
+
+--
-- table for spacing between char classes
--- 1 stands for 0.5*fontsize when variant=classic
+-- 1 stands for 0.5*fontsize when variant = JP/classic or SC or TC
--
local intercharclass = { [0] =
{ [0] = nil, {1,1}, nil, {.5,.5} },
@@ -7846,7 +7728,7 @@ end
--
-- return 0.5*fontsize of given fontid
--- space: true if variant=modern; then 0.5*interword_space
+-- space: true if variant=KR/modern; then 0.5*interword_space
--
local function get_font_size (fid, space)
local size = font.getparameters(fid)
@@ -7860,7 +7742,7 @@ end
--
-- charclass 1 thru 4 will be packed in \hbox to 0.5em{\hss? curr \hss?}
--- when variant=classic/modern
+-- when variant ~= plain
--
local function glyph_to_box (head, curr, class)
local g, h = curr
@@ -7889,7 +7771,7 @@ end
--
-- insert spacing defined as charclass[a][b] between a and b
-- f: fontid
--- var: variant = plain, classic, modern
+-- var: variant = plain, JP/classic, KR/modern, SC, TC
-- cc: charclass of current char
-- nc: charclass of next char
-- nobr: linebreak is not allowed
@@ -7908,12 +7790,16 @@ end
--
-- insert inter-character spacing in other normal cases
--- f: fontid
--- var: variant = plain, classic, modern
--- x: true between cjk and non-cjk (a little more spacing)
+-- f: fontid
+-- var: variant = plain, JP/classic, KR/modern, SC, TC
+-- nobr: no linebreak
+-- x: true between cjk and non-cjk (a little more spacing)
--
-local function insert_penalty_glue (head, curr, f, var, x)
- if var ~= 1 then
+local function insert_penalty_glue (head, curr, f, var, nobr, x)
+ if nobr then
+ local penalty = get_new_penalty(10000)
+ head, curr = node.insert_after(head, curr, penalty)
+ elseif var == 0 or var == 2 then
local penalty = get_new_penalty(50)
head, curr = node.insert_after(head, curr, penalty)
end
@@ -7929,53 +7815,64 @@ end
--
-- main process for linebreak and inter-character spacing
--- lb: true if pre_linebreak_filter
--
-local function korean_break (head, lb)
+local function cjk_break (head)
local curr = head
while curr do
- if curr.id == glyph_id then
- local var = node.has_attribute(curr, attr_korean)
+ if attr_cjk and (curr.id == glyph_id or curr.id == math_id and curr.subtype == 1) then
+ local var = node.has_attribute(curr, attr_cjk)
if var then
- local c, f = curr.char or 0, curr.font or 0
- local cc, cjkc = charclass[c], is_cjk(c)
+ local c, f = curr.char or 0, curr.font
+ local cc, cjkc = get_charclass(var, c), is_cjk(c)
-- compress cjk punctuations when charclass is 1 thru 4
if var > 0 and cc > 0 and cc < 5 then
head, curr = glyph_to_box(head, curr, cc)
end
- local next = curr.next
- if next and next.id == glyph_id then
+ local next = node.getnext(curr)
+ while next and next.id == whatsit_id do -- skip whatsit nodes
+ curr, next = next, node.getnext(next)
+ end
+
+ if next and (next.id == glyph_id or next.id == math_id and next.subtype == 0) then
local n = next.char or 0
- local nc = charclass[n]
+ f = f or next.font or 0 -- in case of curr == math_off
+
+ -- skip combining. or dash+dash case to suppress stretching
+ if nobr_before[n] == 2 or (nobr_before[c] == 0 and nobr_before[n] == 0) then
+ goto skip_combining
+ end
+
+ local nc = get_charclass(var, n)
local nobr = nobr_before[n] or nobr_after[c]
-- insert spacing as of intercharclass
if var > 0 and intercharclass[cc][nc] then
head, curr = insert_cjk_penalty_glue(head, curr, f, var, cc, nc, nobr)
- -- or insert spacing when linebreak is allowed
- elseif not nobr then
+ else
local cjkn = is_cjk(n)
-- if curr or next is cjk char
if cjkc or cjkn then
- -- if between cjk and non-cjk
- if var > 0 and not (cjkc and cjkn) and nobr_before[c] ~= 0 then
- head, curr = insert_penalty_glue(head, curr, f, var, true)
+ -- plain variant / cjk+cjk / nobr cjk+noncjk / after dash
+ -- : insert a 0pt glue
+ if var == 0 or (cjkc and cjkn) or nobr or nobr_before[c] == 0 then
+ head, curr = insert_penalty_glue(head, curr, f, var, nobr)
- -- or under pre_linebreak_filter
- elseif lb then
- head, curr = insert_penalty_glue(head, curr, f, var)
+ -- other cases: insert a small glue
+ else
+ head, curr = insert_penalty_glue(head, curr, f, var, nobr, true)
end
end
end
end
end
end
- curr = curr.next
+ ::skip_combining::
+ curr = node.getnext(curr)
end
return head
end
@@ -7989,7 +7886,7 @@ end
local function reorder_tm (head)
local curr, tone = node.slide(head)
while curr do
- if curr.id == glyph_id and node.has_attribute(curr, attr_korean) then
+ if curr.id == glyph_id and node.has_attribute(curr, attr_cjk) then
local f = font.getfont(curr.font) or font.fonts[curr.font]
if f and f.hb then -- harfbuzz do the right thing
tone = nil
@@ -8005,7 +7902,7 @@ local function reorder_tm (head)
end
end
end
- curr = curr.prev
+ curr = node.getprev(curr)
end
return head
end
@@ -8092,7 +7989,7 @@ local function get_prev_char (p)
local pc = get_prev_char(node.slide(p.head))
if pc then return pc end
end
- p = p.prev
+ p = node.getprev(p)
end
end
@@ -8107,10 +8004,10 @@ local function auto_josa (head)
if josa then
local cc = curr.char or 0
if josa == 0 then
- josa = josa_code[get_prev_char(curr.prev) or 0x30]
+ josa = josa_code[get_prev_char(node.getprev(curr)) or 0x30]
end
if cc == 0xC774 then
- local n = curr.next
+ local n = node.getnext(curr)
if n and n.char and n.char >= 0xAC00 and n.char <= 0xD7A3 then
else
cc = 0xAC00
@@ -8129,7 +8026,7 @@ local function auto_josa (head)
node.unset_attribute(curr, attr_josa)
end
end
- curr = curr.next
+ curr = node.getnext(curr)
end
for _,v in ipairs(tofree) do node.free(v) end
return head
@@ -8140,45 +8037,86 @@ end
-- As char value of glyphs can be changed by opentype GSUB process,
-- we have to occupy the first position among callback functions.
--
-local prepend_to_callback
-if luatexbase.base_add_to_callback then
- prepend_to_callback = function(name, func, desc)
- luatexbase.add_to_callback(name, func, desc, 1)
+luatexbase.add_to_callback( "pre_shaping_filter",
+function(head)
+ if attr_josa then head = auto_josa(head) end
+ head = cjk_break(head)
+ if attr_josa then head = reorder_tm(head) end
+ return head
+end,
+"polyglossia.lang_cjk_spacing")
+
+-- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
+% \end{macrocode}
+% \iffalse
+%</polyglossia-cjk-spacing.lua>
+%<*polyglossia-french.lua>
+% \fi
+% \clearpage
+%
+% \subsection{polyglossia-french.lua}
+% \begin{macrocode}
+--
+-- polyglossia-punct.lua
+-- part of polyglossia v2.2 -- 2024/07/15
+--
+
+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
-else
- prepend_to_callback = function(name, func, desc)
- local t = { {func, desc} }
- for _,v in ipairs(luatexbase.callback_descriptions(name)) do
- table.insert(t, {luatexbase.remove_from_callback(name, v)})
- end
- for _,v in ipairs(t) do
- luatexbase.add_to_callback(name, v[1], v[2])
- 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)
+ set_left_space(lang, '‽', 0.5) -- U+203D (interrobang)
+
+ 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
-prepend_to_callback ("pre_linebreak_filter",
- function(head)
- head = auto_josa(head)
- head = korean_break(head, true)
- head = reorder_tm(head)
- return head
- end,
- "polyglossia.lang_korean")
-
-prepend_to_callback ("hpack_filter",
- function(head)
- head = auto_josa(head)
- head = korean_break(head)
- head = reorder_tm(head)
- return head
- end,
- "polyglossia.lang_korean")
+local function deactivate_french_punct()
+ polyglossia.deactivate_punct()
+end
--- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
+polyglossia.activate_french_punct = activate_french_punct
+polyglossia.deactivate_french_punct = deactivate_french_punct
% \end{macrocode}
% \iffalse
-%</polyglossia-korean.lua>
+%</polyglossia-french.lua>
%<*polyglossia-latin.lua>
% \fi
% \clearpage
@@ -8187,7 +8125,7 @@ prepend_to_callback ("hpack_filter",
% \begin{macrocode}
--
-- polyglossia-latin.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia-punct')
@@ -8242,14 +8180,13 @@ polyglossia.deactivate_latin_punct = deactivate_latin_punct
% \begin{macrocode}
--
-- polyglossia-punct.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
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 declare_callback_rule = luatexbase.declare_callback_rule
local new_attribute = luatexbase.new_attribute
local node = node
@@ -8573,13 +8510,16 @@ local function activate(lang)
-- 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
+add_to_callback("pre_linebreak_filter",process,"polyglossia-punct.process")
+add_to_callback("hpack_filter",process,"polyglossia-punct.process")
+declare_callback_rule("pre_linebreak_filter",
+ "polyglossia-punct.process", "before", "luaotfload.node_processor")
+declare_callback_rule("hpack_filter",
+ "polyglossia-punct.process", "before", "luaotfload.node_processor")
+
+
local function deactivate()
tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset"
-- Though it would make compilation slightly faster, it is not possible to
@@ -8610,7 +8550,7 @@ polyglossia.clear_spaced_characters = clear_spaced_characters
% \begin{macrocode}
--
-- polyglossia-sanskrit.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia-punct')
@@ -8660,31 +8600,29 @@ polyglossia.deactivate_sanskrit_punct = deactivate_sanskrit_punct
% \begin{macrocode}
--
-- polyglossia-tibt.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia') -- just in case...
local add_to_callback = luatexbase.add_to_callback
local remove_from_callback = luatexbase.remove_from_callback
+local declare_callback_rule = luatexbase.declare_callback_rule
local priority_in_callback = luatexbase.priority_in_callback
local next, type = next, type
-
-local nodes, fonts, node = nodes, fonts, node
-
-local nodecodes = nodes.nodecodes --- <= preloaded node.types()
+local node = node
local insert_node_before = node.insert_before
local insert_node_after = node.insert_after
-local remove_node = nodes.remove
+local remove_node = node.remove
local copy_node = node.copy
local has_attribute = node.has_attribute
local end_of_math = node.end_of_math
if not end_of_math then -- luatex < .76
local traverse_nodes = node.traverse_id
- local math_code = nodecodes.math
+ local math_code = node.id('math_char')
local end_of_math = function (n)
for n in traverse_nodes(math_code, n.next) do
return n
@@ -8692,10 +8630,10 @@ if not end_of_math then -- luatex < .76
end
end
--- node types as of April 2013
-local glyph_code = nodecodes.glyph
-local penalty_code = nodecodes.penalty
-local kern_code = nodecodes.kern
+-- node types as of April 2024
+local glyph_code = node.id('glyph')
+local penalty_code = node.id('penalty')
+local kern_code = node.id('kern')
-- we make a new node, so that we can copy it later on
local penalty_node = node.new(penalty_code)
@@ -8726,7 +8664,6 @@ local function process(head)
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
@@ -8739,15 +8676,13 @@ end
local callback_name = "pre_linebreak_filter"
local function activate()
- if not priority_in_callback (callback_name, "polyglossia-tibt.process") then
- add_to_callback(callback_name, process, "polyglossia-tibt.process", 1)
- end
+ add_to_callback(callback_name, process, "polyglossia-tibt.process")
+ declare_callback_rule(callback_name,
+ "polyglossia-tibt.process", "before", "luaotfload.node_processor")
end
local function desactivate()
- if priority_in_callback (callback_name, "polyglossia-tibt.process") then
- remove_from_callback(callback_name, "polyglossia-tibt.process")
- end
+ remove_from_callback(callback_name, "polyglossia-tibt.process")
end
polyglossia.activate_tibt_eol = activate
@@ -8763,7 +8698,7 @@ polyglossia.desactivate_tibt_eol = desactivate
% \begin{macrocode}
--
-- polyglossia.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
local module_name = "polyglossia"
@@ -8839,7 +8774,7 @@ local function newloader(langentry)
end
-- language info will be written into the .log file
- local s = { "Language data for " .. langentry }
+ local s = { }
for k, v in pairs(langdata) do
if type(v) == 'table' then -- for 'synonyms'
s[#s+1] = k .. "\t" .. table.concat(v,',')
@@ -8847,7 +8782,10 @@ local function newloader(langentry)
s[#s+1] = k .. "\t" .. tostring(v)
end
end
- log_info(table.concat(s,"\n"))
+ local a = {}
+ for _,n in pairs(s) do table.insert(a, n) end
+ table.sort(a)
+ log_info("Language data for " .. langentry .. "\n" .. table.concat(a,"\n"))
--
-- LaTeX's \newlanguage increases language register (count19),
@@ -8857,7 +8795,7 @@ local function newloader(langentry)
-- this possible situation, our newloader() function will
-- unfortunately overwrite the language \lang@xyz.
--
- -- Threfore here we will compare LaTeX's \newlanguage number with
+ -- Therefore here we will compare LaTeX's \newlanguage number with
-- LuaTeX's lang.new() id and select the bigger one for our new
-- language object. Also we will update LaTeX's language register
-- by this new id, so that another possible \newlanguage should not
@@ -8872,7 +8810,7 @@ local function newloader(langentry)
local newlangid = math.max(langcnt, langid)
-- set language register for possible \newlanguage
tex.setcount('global', lang_register, newlangid)
- -- get new lang object if needeed
+ -- get new lang object if needed
if langid ~= newlangid then
langobject = lang.new(newlangid)
end
@@ -9716,7 +9654,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%% This is an algorithm from Reingold & Dershowitz,
-%% Calendrical Calculations, The Millenium Edition
+%% Calendrical Calculations, The Millennium Edition
%%
\def\@FixedFromGregorian#1#2#3#4{%
\setcounter{tmpA}{(#1-1)*365}%
@@ -10069,36 +10007,36 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \end{macrocode}
% \iffalse
%</xgreek-fixes.def>
-%<*gloss-acadien.ldf>
+%<*gloss-acadian.ldf>
% \fi
% \clearpage
%
-% \subsection{gloss-acadien.ldf}
+% \subsection{gloss-acadian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for Canadian (Acadian) French]
% We provide this as a babel alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
-%</gloss-acadien.ldf>
+%</gloss-acadian.ldf>
%<*gloss-aeb.ldf>
% \fi
% \clearpage
%
% \subsection{gloss-aeb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-aeb.ldf}[polyglossia: module for aeb (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -10109,13 +10047,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-af.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-af.ldf}[polyglossia: module for af (Afrikaans)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{afrikaans}
+\InheritGlossFile{afrikaans}
% \end{macrocode}
% \iffalse
@@ -10126,13 +10064,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-afb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-afb.ldf}[polyglossia: module for afb (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -10143,7 +10081,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-afrikaans.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-afrikaans.ldf}[polyglossia: module for Afrikaans]
@@ -10161,22 +10099,21 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{afrikaans}{af}
-\define@boolkey{afrikaans}[afrikaans@]{babelshorthands}[true]{}
-
+\DeclareKeys[polyglossia/gloss/afrikaans]
+ {
+ babelshorthands.if = afrikaans@babelshorthands,
+ babelshorthands.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{afrikaans}{babelshorthands=false}
+\InitializeGlossOptions{afrikaans}{babelshorthands=false}
\ifsystem@babelshorthands
- \setkeys{afrikaans}{babelshorthands=true}
+ \SetGlossOptions{afrikaans}{babelshorthands=true}
\else
- \setkeys{afrikaans}{babelshorthands=false}
+ \SetGlossOptions{afrikaans}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\afrikaans@shorthands{%
\xpg@activate@shorthands%
@@ -10248,7 +10185,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-albanian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-albanian.ldf}[polyglossia: module for Albanian]
@@ -10305,13 +10242,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-am.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-am.ldf}[polyglossia: module for am (Amharic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{amharic}
+\InheritGlossFile{amharic}
% \end{macrocode}
% \iffalse
@@ -10322,13 +10259,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-american.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-american.ldf}[polyglossia: module for American English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -10339,7 +10276,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-amharic.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-amharic.ldf}[polyglossia: module for Amharic]
\PolyglossiaSetup{amharic}{
@@ -10559,13 +10496,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-apd.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-apd.ldf}[polyglossia: module for apd (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -10576,13 +10513,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-IQ.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-IQ.ldf}[polyglossia: module for ar-IQ (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar,bcp47-region=IQ}%
@@ -10595,13 +10532,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-JO.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-JO.ldf}[polyglossia: module for ar-JO (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-JO,bcp47-language=ar,bcp47-region=JO}%
@@ -10614,13 +10551,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-LB.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-LB.ldf}[polyglossia: module for ar-LB (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-LB,bcp47-language=ar,bcp47-region=LB}%
@@ -10633,13 +10570,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-MR.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-MR.ldf}[polyglossia: module for ar-MR (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}%
@@ -10652,13 +10589,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-PS.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-PS.ldf}[polyglossia: module for ar-PS (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-PS,bcp47-language=ar,bcp47-region=PS}%
@@ -10671,13 +10608,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-SY.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-SY.ldf}[polyglossia: module for ar-SY (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-SY,bcp47-language=ar,bcp47-region=SY}%
@@ -10690,13 +10627,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar-YE.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-YE.ldf}[polyglossia: module for ar-YE (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar,bcp47-region=YE}%
@@ -10709,13 +10646,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ar.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar.ldf}[polyglossia: module for ar (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -10726,7 +10663,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-arabic.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-arabic.ldf}[polyglossia: module for Arabic]
\RequireBidi
@@ -10766,104 +10703,112 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*[locale=default]{arabic}{apd}
\setlanguagealias*[locale=mashriq]{arabic}{ar-PS}
-\define@boolkey{arabic}[arabic@]{abjadalph}[true]{}
-
\newif\ifeastern@numerals
-\define@choicekey*+{arabic}{numerals}[\xpg@val\xpg@nr]{mashriq,maghrib,eastern,western}[mashriq]{%
- \ifcase\xpg@nr\relax
- % mashriq:
- \eastern@numeralstrue%
- \or
- % maghrib:
- \eastern@numeralsfalse
- \or
- % eastern:
- \eastern@numeralstrue%
- \or
- % western:
- \eastern@numeralsfalse
- \fi
- \xpg@info{Option: Arabic, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Arabic numerals option `#1'}}
-
-%this is needed for \abjad in arabicnumbers.sty
-\define@boolkey{arabic}[arabic@]{abjadjimnotail}[true]{%
- \ifarabic@abjadjimnotail
- \abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi}
-
-\define@choicekey*+{arabic}{locale}[\xpg@val\xpg@nr]{default,mashriq,libya,algeria,tunisia,morocco,mauritania}[default]{%
- \ifcase\xpg@nr\relax
- % default:
- \eastern@numeralstrue%
- \SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar}%
- \xpg@info{Option: arabic, locale=default}%
- \or
- % mashriq:
- \eastern@numeralstrue%
- \SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar}%
- \xpg@info{Option: arabic, locale=mashriq}%
- \or
- % libya:
- \eastern@numeralstrue%
- \SetLanguageKeys{arabic}{bcp47=ayl,bcp47-language=ar,bcp47-region=LY}%
- \xpg@info{Option: arabic, locale=libya}%
- \or
- % algeria:
- \eastern@numeralsfalse%
- \SetLanguageKeys{arabic}{bcp47=arq,bcp47-language=ar,bcp47-region=DZ,bcp47-extension-u=nu-latn}%
- \xpg@info{Option: arabic, locale=algeria}%
- \or
- % tunisia:
- \eastern@numeralsfalse%
- \SetLanguageKeys{arabic}{bcp47=aeb,bcp47-language=ar,bcp47-region=TN,bcp47-extension-u=nu-latn}%
- \xpg@info{Option: arabic, locale=tunisia}%
- \or
- % morocco:
- \eastern@numeralsfalse%
- \SetLanguageKeys{arabic}{bcp47=ary,bcp47-language=ar,bcp47-region=MA,bcp47-extension-u=nu-latn}%
- \xpg@info{Option: arabic, locale=morocco}%
- \or
- % mauritania:
- \eastern@numeralstrue%
- \SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}%
- \xpg@info{Option: arabic, locale=mauritania}%
- \fi
- \gdef\@@arabic@month{\@arabic@month{#1}}
- }{\xpg@warning{Unknown Arabic locale `#1'}}
-
\newif\if@hijrical
-\define@choicekey*+{arabic}{calendar}[\xpg@val\xpg@nr]{gregorian,hijri,islamic}[gregorian]{%
- \ifcase\xpg@nr\relax
- % gregorian:
- \@hijricalfalse
- \or
- % hijri:
- \@hijricaltrue
- \or
- % islamic:
- \@hijricaltrue
- \fi
- \xpg@info{Option: Arabic, calendar=\xpg@val}%
-}{\xpg@warning{Unknown Arabic calendar option `#1'}}
-
-
-\define@key{arabic}{hijricorrection}[0]{%
- \gdef\arabic@hijri@correction{#1}}%
-
\newif\ifarabic@customsep\arabic@customsepfalse
-\def\xpg@sepmark{}
-\define@key{arabic}{sectionsep}[.]{%
- \arabic@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
+
+\DeclareKeys[polyglossia/gloss/arabic]
+ {
+ hijricorrection.code = \gdef\arabic@hijri@correction{#1},
+ hijricorrection.default:n = 0,
+ sectionsep.code = \gdef\xpg@sepmark{#1}\arabic@customseptrue,
+ sectionsep.default:n = .,
+ abjadalph.if = arabic@abjadalph,
+ abjadalph.default:n = true,
+ abjadjimnotail.if = abjad@jim@notail,
+ abjadjimnotail.default:n = true,
+ numerals.choice:,
+ numerals / mashriq.code =
+ {%
+ \eastern@numeralstrue
+ },
+ numerals / maghrib.code =
+ {%
+ \eastern@numeralsfalse
+ },
+ numerals / eastern.code =
+ {%
+ \eastern@numeralstrue
+ },
+ numerals / western.code =
+ {%
+ \eastern@numeralsfalse
+ },
+ numerals.default:n = mashriq,
+ numerals/unknown.code = \xpg@warning{Unknown Arabic numerals option `#1'},
+ locale.choice:,
+ locale / default.code =
+ {%
+ \eastern@numeralstrue
+ \def\abjad@one{ا}%
+ \SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / mashriq.code =
+ {%
+ \eastern@numeralstrue
+ \def\abjad@one{ا}%
+ \SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / libya.code =
+ {%
+ \eastern@numeralstrue
+ \def\abjad@one{ا}%
+ \SetLanguageKeys{arabic}{bcp47=ayl,bcp47-language=ar,bcp47-region=LY}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / algeria.code =
+ {%
+ \eastern@numeralsfalse
+ \def\abjad@one{أ}%
+ \SetLanguageKeys{arabic}{bcp47=arq,bcp47-language=ar,bcp47-region=DZ,bcp47-extension-u=nu-latn}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / tunisia.code =
+ {%
+ \eastern@numeralsfalse
+ \def\abjad@one{أ}%
+ \SetLanguageKeys{arabic}{bcp47=aeb,bcp47-language=ar,bcp47-region=TN,bcp47-extension-u=nu-latn}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / morocco.code =
+ {%
+ \eastern@numeralsfalse
+ \def\abjad@one{أ}%
+ \SetLanguageKeys{arabic}{bcp47=ary,bcp47-language=ar,bcp47-region=MA,bcp47-extension-u=nu-latn}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / mauritania.code =
+ {%
+ \eastern@numeralstrue
+ \def\abjad@one{ا}%
+ \SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale.default:n = default,
+ locale/unknown.code = \xpg@warning{Unknown Arabic locale `#1'},
+ calendar.choice:,
+ calendar / gregorian.code =
+ {%
+ \@hijricalfalse
+ },
+ calendar / hijri.code =
+ {%
+ \@hijricaltrue
+ },
+ calendar / islamic.code =
+ {%
+ \@hijricaltrue
+ },
+ calendar.default:n = gregorian,
+ calendar/unknown.code = \xpg@warning{Unknown Arabic calendar option `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{arabic}{locale=default,calendar=gregorian,numerals=mashriq,hijricorrection=0,abjadjimnotail=false}
+\InitializeGlossOptions{arabic}{locale=default,calendar=gregorian,numerals=mashriq,hijricorrection=0,abjadjimnotail=false}
% Register alias options
-\xpg@set@alias@values{arabic}{calendar}{islamic}{hijri}
+\SetLanguageAliasValues{arabic}{calendar}{islamic,hijri}
\def\arabicgregmonth@default#1{\ifcase#1%
% Egypt, Sudan, Yemen and Golf states
@@ -10883,9 +10828,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\arabicgregmonth@mauritania#1{\ifcase#1%
\or يناير\or فبراير\or مارس\or إبريل\or مايو\or يونيو\or يوليو\or أغشت\or شتمبر\or أكتوبر\or نوفمبر\or دجمبر\fi}
-\def\@arabic@month#1{\ifcsdef{arabicgregmonth@#1}{\expandafter\csname arabicgregmonth@#1\endcsname}%
-{\xpg@warning{Option `locale=#1' is not defined for Arabic: using `default' instead}%
-\arabicgregmonth@default}}
+\def\@arabic@month#1{%
+ \@ifundefined{arabicgregmonth@#1}%
+ {\xpg@warning{Option `locale=#1' is not defined for Arabic: using `default' instead}%
+ \arabicgregmonth@default}%
+ {\expandafter\csname arabicgregmonth@#1\endcsname}%
+}
%\Hijritoday is now locale-aware and will format the date with this macro:
\DefineFormatHijriDate{arabic}{\@ensure@RTL{\arabicnumber{\value{Hijriday}}%
@@ -10917,18 +10865,18 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\datearabic{%
\def\today{%
- \if@hijrical%
+ \if@hijrical
\Hijritoday[\arabic@hijri@correction]%
\else%
- \if@RTL%
+ \if@RTL
\arabicnumber\day\space\@@arabic@month{\month}%
\space\arabicnumber\year%
\else% in LR environment we format the gregorian date within \textenglish
- \ifcsdef{english@loaded}{\textenglish{\today}}%else US format
- {\normalfontlatin\ifcase\month\or January\or February\or March\or April\or May\or June\or%
- July\or August\or September\or October\or November\or December\fi%
+ \iflanguageloaded{english}{\textenglish{\today}}%else US format
+ {\normalfontlatin\ifcase\month\or January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or December\fi
\space\number\day,\space\number\year}%
- \fi%
+ \fi
\fi}}
% Use \providecommand here as the ldf file might
@@ -10954,10 +10902,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\or ح\or ط\or ي\or ك\or ل\or م\or ن%
\or س\or ع\or ف\or ص\or ق\or ر\or ش%
\or ت\or ث\or خ\or ذ\or ض\or ظ\or غ%
- \else\xpg@ill@value{#1}{arabic@abjad@alph}\fi%
+ \else\xpg@ill@value{#1}{arabic@abjad@alph}\fi
}
-
\def\abjadmaghribi#1{%
\ifnum#1>1999\xpg@ill@value{#1}{abjad}%
\else
@@ -10980,111 +10927,111 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%maghribi س -> ص ص -> ض ش -> س ض -> ظ ظ -> غ غ -> ش
\def\abj@maghribi@num@ii#1{%
- \ifcase#1\or ي\or ك\or ل\or م\or ن%
+ \ifcase#1\abjad@zero\or ي\or ك\or ل\or م\or ن%
\or ص\or ع\or ف\or ض\fi
- \ifnum#1=\z@\abjad@zero\fi\abj@num@i}
+ \abj@num@i}
\def\abj@maghribi@num@iii#1{%
\ifcase#1\or ق\or ر\or س\or ت\or ث%
\or خ\or ذ\or ظ\or غ\fi
- \ifnum#1=\z@\fi\abj@maghribi@num@ii}
+ \abj@maghribi@num@ii}
\def\abj@maghribi@num@iv#1{%
\ifcase#1\or ش\fi
- \ifnum#1=\z@\fi\abj@maghribi@num@iii}
+ \abj@maghribi@num@iii}
\def\arabic@numbers{%
\ifarabic@abjadalph
- \let\@alph\abjadalph%
- \let\@Alph\abjadalph%
+ \let\@alph\abjadalph
+ \let\@Alph\abjadalph
\else
- \let\@alph\abjad%
- \let\@Alph\abjad%
+ \let\@alph\abjad
+ \let\@Alph\abjad
\fi
}
\def\noarabic@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
+ \let\@alph\latin@alph
+ \let\@Alph\latin@Alph
}
% Store original definition
\let\xpg@save@arabic\@arabic
\def\arabic@globalnumbers{%
- \let\@arabic\arabicnumber%
+ \let\@arabic\arabicnumber
\renewcommand\thefootnote{\localnumeral*{footnote}}%
\renewcommand\theequation{\localnumeral*{equation}}%
}
\def\noarabic@globalnumbers{%
- \let\@arabic\xpg@save@arabic%
+ \let\@arabic\xpg@save@arabic
}
\def\arabic@xetex@capsformat{%
- \let\xpg@save@sepmark\@SepMark%
+ \let\xpg@save@sepmark\@SepMark
\SepMark{\xpg@sepmark}
}
\def\noarabic@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi
}
\def\arabic@luatex@capsformat{%
%
% change chapter and part headings
\ifarabic@customsep
- \ifcsdef{chapter}{%
- \let\xpg@save@thesection\thesection%
+ \ifcsname chapter\endcsname
+ \let\xpg@save@thesection\thesection
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
- \let\xpg@save@theequation\theequation%
+ \let\xpg@save@theequation\theequation
\renewcommand*\theequation{%
\ifnum \c@chapter>\z@ \thechapter\xpg@sepmark\fi\@arabic\c@equation}
- \let\xpg@save@thefigure\thefigure%
+ \let\xpg@save@thefigure\thefigure
\renewcommand*\thefigure{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@figure}
- \let\xpg@save@thetable\thetable%
+ \let\xpg@save@thetable\thetable
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
- \let\xpg@save@thesubsection\thesubsection%
+ \fi
+ \let\xpg@save@thesubsection\thesubsection
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
- \let\xpg@save@thesubsubsection\thesubsubsection%
+ \let\xpg@save@thesubsubsection\thesubsubsection
\renewcommand\thesubsubsection{\thesubsection\xpg@sepmark\@arabic\c@subsubsection}
- \let\xpg@save@theparagraph\theparagraph%
+ \let\xpg@save@theparagraph\theparagraph
\renewcommand\theparagraph
{\thesubsubsection\xpg@sepmark\@arabic\c@paragraph}
- \let\xpg@save@thesubparagraph\thesubparagraph%
+ \let\xpg@save@thesubparagraph\thesubparagraph
\renewcommand\thesubparagraph{\theparagraph\xpg@sepmark\@arabic\c@subparagraph}
- \fi% (end \ifarabic@customsep)
+ \fi % (end \ifarabic@customsep)
}
\def\noarabic@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
- \let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
- \let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
- \let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
- \let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
- \let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
- \let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
- \let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
- \let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \ifcsname xpg@save@thesection\endcsname
+ \let\thesection\xpg@save@thesection
+ \fi
+ \ifcsname xpg@save@theequation\endcsname
+ \let\theequation\xpg@save@theequation
+ \fi
+ \ifcsname xpg@save@thefigure\endcsname
+ \let\thefigure\xpg@save@thefigure
+ \fi
+ \ifcsname xpg@save@thetable\endcsname
+ \let\thetable\xpg@save@thetable
+ \fi
+ \ifcsname xpg@save@thesubsection\endcsname
+ \let\thesubsection\xpg@save@thesubsection
+ \ifcsname xpg@save@thesubsubsection\endcsname
+ \let\thesubsubsection\xpg@save@thesubsubsection
+ \fi
+ \fi
+ \ifcsname xpg@save@theparagraph\endcsname
+ \let\theparagraph\xpg@save@theparagraph
+ \fi
+ \ifcsname xpg@save@thesubparagraph\endcsname
+ \let\thesubparagraph\xpg@save@thesubparagraph
+ \fi
}
\def\blockextras@arabic{%
@@ -11096,7 +11043,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi
\fi
}
-%
+
\def\noextras@arabic{%
\ifarabic@customsep
\ifxetex
@@ -11116,7 +11063,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-armenian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-armenian.ldf}[polyglossia: module for Armenian]
@@ -11139,43 +11086,49 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@eastern@armenian
\@eastern@armenianfalse
-\define@choicekey*+{armenian}{variant}[\xpg@val\xpg@nr]{western,eastern}[western]{%
- \ifcase\xpg@nr\relax
- % western:
- \@eastern@armenianfalse%
- \or
- % eastern:
- \@eastern@armeniantrue%
- \fi
- \xpg@info{Option: Armenian, variant=\xpg@val}%
-}{\xpg@warning{Unknown Armenian variant `#1'}}
\newif\if@armenian@numerals
\@armenian@numeralsfalse
-\define@key{armenian}{numerals}[armenian]{%
- \ifstrequal{#1}{arabic}{%
- \@armenian@numeralsfalse%
- \SetLanguageKeys{armenian}{bcp47-extension-u=nu-latn}%
- }{%
- \@armenian@numeralstrue%
- \SetLanguageKeys{armenian}{bcp47-extension-u={}}%
- }%
-}
-\define@boolkey{armenian}[armenian@]{capitalyiwn}[true]{%
- \ifarmenian@capitalyiwn
- % MakeUppercase capitalizes the ligature of letters ech and yiwn (U+0587)
- % to capital ech and yiwn (also the output if Armenian is not selected at all)
- \SetLanguageKeys{armenian}{bcp47-casing=hy-x-yiwn,bcp47-extension-x=yiwn}
- \else
- % Capitalize ech and yiwn ligature to capital ech and vew,
- % following Armenian spelling reform
- \SetLanguageKeys{armenian}{bcp47-casing=hy,bcp47-extension-x={}}
- \fi
-}
+\DeclareKeys[polyglossia/gloss/armenian]
+ {
+ variant.choice:,
+ variant / western.code =
+ {%
+ \@eastern@armenianfalse
+ },
+ variant / eastern.code =
+ {%
+ \@eastern@armeniantrue
+ },
+ variant.default:n = western,
+ variant/unknown.code = \xpg@warning{Unknown Armenian variant `#1'},
+ numerals.choice:,
+ numerals / armenian.code =
+ {%
+ \@armenian@numeralstrue
+ \SetLanguageKeys{armenian}{bcp47-extension-u={}}%
+ },
+ numerals / arabic.code =
+ {%
+ \@armenian@numeralsfalse
+ \SetLanguageKeys{armenian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = armenian,
+ capitalyiwn.choice:,
+ capitalyiwn / true.code =
+ {%
+ \SetLanguageKeys{armenian}{bcp47-casing=hy-x-yiwn,bcp47-extension-x=yiwn}%
+ },
+ capitalyiwn / false.code =
+ {%
+ \SetLanguageKeys{armenian}{bcp47-casing=hy,bcp47-extension-x={}}%
+ },
+ capitalyiwn.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{armenian}{numerals=armenian,variant=western}
+\InitializeGlossOptions{armenian}{numerals=armenian,variant=western}
% Taken from ArmTeX. Audit!
\def\captionsarmenian{%
@@ -11324,13 +11277,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-arq.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-arq.ldf}[polyglossia: module for arq (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -11341,13 +11294,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ary.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ary.ldf}[polyglossia: module for ary (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -11358,13 +11311,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-arz.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-arz.ldf}[polyglossia: module for arz (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -11375,13 +11328,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ast.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ast.ldf}[polyglossia: module for ast (Asturian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{asturian}
+\InheritGlossFile{asturian}
% \end{macrocode}
% \iffalse
@@ -11392,7 +11345,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-asturian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translated by Xuacu <xuacusk8 at gmail dot com>
% Contributed by Kevin Godby <godbyk at gmail dot com>
@@ -11452,13 +11405,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-australian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-australian.ldf}[polyglossia: module for Australian English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -11469,13 +11422,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-austrian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-austrian.ldf}[polyglossia: module for Austrian German (old spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -11486,13 +11439,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ayl.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ayl.ldf}[polyglossia: module for ayl (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
% \end{macrocode}
% \iffalse
@@ -11503,13 +11456,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bahasa.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bahasa.ldf}[polyglossia: module for Bahasa Indonesia]
% We provide this as a babel alias
-\xpg@load@master@language{malay}
+\InheritGlossFile{malay}
% \end{macrocode}
% \iffalse
@@ -11520,14 +11473,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bahasai.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bahasai.ldf}[polyglossia: module for Bahasa Indonesia]
% We only provide this gloss for babel compatibility. Since bahasai is
% a malay variety, we use 'malay' with variant 'indonesian' now.
-\xpg@load@master@language{malay}
+\InheritGlossFile{malay}
% \end{macrocode}
% \iffalse
@@ -11538,14 +11491,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bahasam.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bahasam.ldf}[polyglossia: module for Bahasa Melayu]
% We only provide this gloss for babel compatibility. Since bahasam is
% a malay variety, we use 'malay' with variant 'malaysian' now.
-\xpg@load@master@language{malay}
+\InheritGlossFile{malay}
% \end{macrocode}
% \iffalse
@@ -11556,7 +11509,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-basque.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-basque.ldf}[polyglossia: module for Basque]
\PolyglossiaSetup{basque}{
@@ -11614,13 +11567,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-be-tarask.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-be-tarask.ldf}[polyglossia: module for be-tarask (Belarusian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{belarusian}
+\InheritGlossFile{belarusian}
% \end{macrocode}
% \iffalse
@@ -11631,13 +11584,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-be.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-be.ldf}[polyglossia: module for be (Belarusian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{belarusian}
+\InheritGlossFile{belarusian}
% \end{macrocode}
% \iffalse
@@ -11648,7 +11601,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-belarusian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-belarusian.ldf}[polyglossia: module for Belarusian]
@@ -11676,63 +11629,68 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*{belarusian}{be}
\def\belarusian@spelling{modern}
-\define@choicekey*+{belarusian}{spelling}[\xpg@val\xpg@nr]{modern,classic,tarask}[modern]{%
- \ifcase\xpg@nr\relax
- % modern:
- \def\belarusian@spelling{modern}%
- \SetLanguageKeys{belarusian}{bcp47=be,bcp47-variant=1959acad}%
- \or
- % classic:
- \def\belarusian@spelling{tarask}%
- \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
- \or
- % tarask:
- \def\belarusian@spelling{tarask}%
- \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
- \fi
-}{\xpg@warning{Unknown Belarusian spelling `#1'}}
-
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{belarusian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \fi
- \xpg@info{Option: Belarusian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Belarusian numerals value `#1'}}
-\define@boolkey{belarusian}[belarusian@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/belarusian]
+ {
+ babelshorthands.if = belarusian@babelshorthands,
+ babelshorthands.default:n = true,
+ spelling.choice:,
+ spelling / modern.code =
+ {%
+ \def\belarusian@spelling{modern}%
+ \SetLanguageKeys{belarusian}{bcp47=be,bcp47-variant=1959acad}%
+ },
+ spelling / classic.code =
+ {%
+ \def\belarusian@spelling{tarask}%
+ \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
+ },
+ spelling / tarask.code =
+ {%
+ \def\belarusian@spelling{tarask}%
+ \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
+ },
+ spelling.default:n = modern,
+ spelling/unknown.code = \xpg@warning{Unknown Belarusian spelling `#1'},
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Belarusian numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{belarusian}{babelshorthands=false,numerals=arabic,spelling=modern}
+\InitializeGlossOptions{belarusian}{babelshorthands=false,numerals=arabic,spelling=modern}
% Register alias options
-\xpg@set@alias@values{belarusian}{spelling}{classic}{tarask}
+\SetLanguageAliasValues{belarusian}{spelling}{classic,tarask}
\ifsystem@babelshorthands
- \setkeys{belarusian}{babelshorthands=true}
+ \SetGlossOptions{belarusian}{babelshorthands=true}
\else
- \setkeys{belarusian}{babelshorthands=false}
+ \SetGlossOptions{belarusian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\belarusian@shorthands{%
\xpg@activate@shorthands%
@@ -11976,7 +11934,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bengali.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translations provided by সাজেদুর রহিম জোয়ারদার <toshazed@gmail.com>
% TODO implement Bengali calendar
@@ -12005,30 +11963,36 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\ifbengali@devanagari@numerals
\newif\ifbengali@bengali@numerals
-\define@choicekey*+{bengali}{numerals}[\xpg@val\xpg@nr]{Devanagari,Bengali,Western}[Devanagari]{%
- \ifcase\xpg@nr\relax
- % Devanagari:
- \bengali@bengali@numeralsfalse%
- \bengali@devanagari@numeralstrue%
- \or
- % Bengali:
- \bengali@bengali@numeralstrue%
- \bengali@devanagari@numeralsfalse%
- \or
- % Western:
- \bengali@bengali@numeralsfalse%
- \bengali@devanagari@numeralsfalse%
- \fi
- \xpg@info{Option: Bengali, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Bengali numeral `#1'}}
\def\extras@bengali{}
\def\noextras@bengali{}
-\define@boolkey{bengali}[bengali@]{changecounternumbering}[true]{}
+\DeclareKeys[polyglossia/gloss/bengali]
+ {
+ changecounternumbering.if = bengali@changecounternumbering,
+ changecounternumbering.default:n = true,
+ numerals.choice:,
+ numerals / devanagari.code =
+ {%
+ \bengali@bengali@numeralsfalse
+ \bengali@devanagari@numeralstrue
+ },
+ numerals / bengali.code =
+ {%
+ \bengali@bengali@numeralstrue
+ \bengali@devanagari@numeralsfalse
+ },
+ numerals / western.code =
+ {%
+ \bengali@bengali@numeralsfalse
+ \bengali@devanagari@numeralsfalse
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Bengali numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{bengali}{changecounternumbering=false,numerals=Devanagari}
+\InitializeGlossOptions{bengali}{changecounternumbering=false,numerals=Devanagari}
\def\captionsbengali{%
\def\refname{তথ্যসূত্রসমূহ}%
@@ -12117,13 +12081,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bg.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bg.ldf}[polyglossia: module for bg (Bulgarian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{bulgarian}
+\InheritGlossFile{bulgarian}
% \end{macrocode}
% \iffalse
@@ -12134,13 +12098,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bn.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bn.ldf}[polyglossia: module for bn (Bengali)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{bengali}
+\InheritGlossFile{bengali}
% \end{macrocode}
% \iffalse
@@ -12151,13 +12115,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bo.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bo.ldf}[polyglossia: module for bo (Tibetan)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{tibetan}
+\InheritGlossFile{tibetan}
% \end{macrocode}
% \iffalse
@@ -12168,7 +12132,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bosnian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bosnian.ldf}[polyglossia: module for Bosnian]
@@ -12232,13 +12196,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-br.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-br.ldf}[polyglossia: module for br (Breton)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{breton}
+\InheritGlossFile{breton}
% \end{macrocode}
% \iffalse
@@ -12249,7 +12213,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-brazil.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-brazil.ldf}[polyglossia: module for Brazilian Portuguese]
@@ -12257,7 +12221,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% 'brazil' was selected in accordance with babel.
% Since brazil is a variety of portuguese, we use 'portuguese' now.
-\xpg@load@master@language{portuguese}
+\InheritGlossFile{portuguese}
% \end{macrocode}
% \iffalse
@@ -12268,7 +12232,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-breton.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-breton.ldf}[polyglossia: module for Breton]
\PolyglossiaSetup{breton}{
@@ -12376,13 +12340,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-british.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-british.ldf}[polyglossia: module for British English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -12393,13 +12357,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bs.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bs.ldf}[polyglossia: module for bs (Bosnian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{bosnian}
+\InheritGlossFile{bosnian}
% \end{macrocode}
% \iffalse
@@ -12410,7 +12374,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-bulgarian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bulgarian.ldf}[polyglossia: module for Bulgarian]
\PolyglossiaSetup{bulgarian}{
@@ -12473,15 +12437,15 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\figurename{Фигура}%
\def\tablename{Таблица}%
%\def\thepart{}%
- %\def\partname{}%
+ \def\partname{Част}%
\def\pagename{Стр.}%
\def\seename{вж.}%
\def\alsoname{вж.\ също и}%
\def\enclname{Приложения}%
\def\ccname{копия}%
- %\def\headtoname{}%
- \def\proofname{Proof}%
- \def\glossaryname{Glossary}%
+ \def\headtoname{За}%
+ \def\proofname{Доказателство}%
+ \def\glossaryname{Притурка}%
}
\def\datebulgarian{%
@@ -12512,13 +12476,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ca.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ca.ldf}[polyglossia: module for ca (Catalan)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{catalan}
+\InheritGlossFile{catalan}
% \end{macrocode}
% \iffalse
@@ -12529,13 +12493,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-canadian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-canadian.ldf}[polyglossia: module for Canadian English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -12546,13 +12510,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-canadien.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-canadien.ldf}[polyglossia: module for Canadian French]
% We provide this as a babel alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
@@ -12563,7 +12527,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-catalan.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-catalan.ldf}[polyglossia: module for Catalan]
\PolyglossiaSetup{catalan}{
@@ -12581,21 +12545,21 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{catalan}{ca}
-\define@boolkey{catalan}[catalan@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/catalan]
+ {
+ babelshorthands.if = catalan@babelshorthands,
+ babelshorthands.default:n = true,
+ }
\ifsystem@babelshorthands
- \setkeys{catalan}{babelshorthands=true}
+ \SetGlossOptions{catalan}{babelshorthands=true}
\else
- \setkeys{catalan}{babelshorthands=false}
+ \SetGlossOptions{catalan}{babelshorthands=false}
\fi
% Register default options
-\xpg@initialize@gloss@options{catalan}{babelshorthands=false}
+\InitializeGlossOptions{catalan}{babelshorthands=false}
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
%%% adapted from Babel's catalan.ldf
\newdimen\leftllkern \newdimen\rightllkern \newdimen\raiselldim
@@ -12732,7 +12696,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-chinese.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-chinese.ldf}[polyglossia: module for Chinese]
@@ -12756,51 +12720,60 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*[variant=simplified]{chinese}{zh-CN}
\setlanguagealias*[variant=traditional]{chinese}{zh-TW}
-\providebool{chinese@traditional}
+\@ifundefined{ifchinese@traditional}%
+ {\newif\ifchinese@traditional}{}
-\def\chinese@variant{chinese}
-
-\newif\ifchinese@numerals
-\define@key{chinese}{numerals}[arabic]{%
- \ifstrequal{#1}{chinese}%
- {\chinese@numeralstrue%
- \SetLanguageKeys{chinese}{bcp47-extension-u=nu-hant}%
- }{\chinese@numeralsfalse%
- \SetLanguageKeys{chinese}{bcp47-extension-u=nu-latn}%
- }%
-}
+\@ifundefined{ifchinese@numerals}%
+ {\newif\ifchinese@numerals}{}
+\def\chinese@variant{chinese}
-\define@choicekey*+{chinese}{variant}[\xpg@val\xpg@nr]{cn,simplified,tw,traditional}[cn]{%
- \ifcase\xpg@nr\relax
- % cn:
- \chinese@traditionalfalse
- \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
- \xpg@info{Option: Chinese, variant=simplified}%
- \or
- % simplified:
- \chinese@traditionalfalse
- \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
- \xpg@info{Option: Chinese, variant=simplified}%
- \or
- % tw:
- \chinese@traditionaltrue
- \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
- \xpg@info{Option: Chinese, variant=traditional}%
- \or
- % traditional:
- \chinese@traditionaltrue
- \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
- \xpg@info{Option: Chinese, variant=traditional}%
- \fi
-}{\xpg@warning{Unknown Chinese variant `#1'}}
+\DeclareKeys[polyglossia/gloss/chinese]
+ {
+ variant.choice:,
+ variant / cn.code =
+ {%
+ \chinese@traditionalfalse
+ \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
+ },
+ variant / simplified.code =
+ {%
+ \chinese@traditionalfalse
+ \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
+ },
+ variant / tw.code =
+ {%
+ \chinese@traditionaltrue
+ \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
+ },
+ variant / traditional.code =
+ {%
+ \chinese@traditionaltrue
+ \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
+ },
+ variant.default:n = cn,
+ variant/unknown.code = \xpg@warning{Unknown Chinese variant `#1'},
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \chinese@numeralsfalse
+ \SetLanguageKeys{chinese}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / chinese.code =
+ {%
+ \chinese@numeralstrue
+ \SetLanguageKeys{chinese}{bcp47-extension-u=nu-hant}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Chinese numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{chinese}{variant=cn,numerals=arabic}
-%\xpg@initialize@gloss@options{chinese}{variant=tw,numerals=arabic}
+\InitializeGlossOptions{chinese}{variant=cn,numerals=arabic}
+%\InitializeGlossOptions{chinese}{variant=tw,numerals=arabic}
% Register alias options
-\xpg@set@alias@values{chinese}{variant}{cn}{simplified}
-\xpg@set@alias@values{chinese}{variant}{tw}{traditional}
+\SetLanguageAliasValues{chinese}{variant}{cn,simplified}
+\SetLanguageAliasValues{chinese}{variant}{tw,traditional}
\def\chinese@capsformat{%
@@ -12852,7 +12825,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\enclname{附件}%
\def\ccname{抄送}%
\def\headtoname{收件人}%
- \def\\glossaryname{詞彙表}%
+ \def\glossaryname{詞彙表}%
}
\def\captions@chinese@simplified{%
\def\contentsname{目录}%
@@ -12875,7 +12848,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\enclname{附件}%
\def\ccname{抄送}%
\def\headtoname{收件人}%
- \def\\glossaryname{词汇表}%
+ \def\glossaryname{词汇表}%
}
\newcount\c@TempJNum%
@@ -13023,13 +12996,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ckb-Arab.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ckb-Arab.ldf}[polyglossia: module for ckb-Arab (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -13040,13 +13013,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ckb-Latn.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ckb-Latn.ldf}[polyglossia: module for ckb-Latn (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -13057,30 +13030,47 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ckb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ckb.ldf}[polyglossia: module for ckb (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
%</gloss-ckb.ldf>
+%<*gloss-classiclatin.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-classiclatin.ldf}
+% \begin{macrocode}
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
+%
+\ProvidesFile{gloss-classiclatin.ldf}[polyglossia: module for classic Latin]
+
+% We provide this as a babel alias
+
+\InheritGlossFile{latin}
+
+% \end{macrocode}
+% \iffalse
+%</gloss-classiclatin.ldf>
%<*gloss-cop.ldf>
% \fi
% \clearpage
%
% \subsection{gloss-cop.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-cop.ldf}[polyglossia: module for cop (Coptic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{coptic}
+\InheritGlossFile{coptic}
% \end{macrocode}
% \iffalse
@@ -13091,7 +13081,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-coptic.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-coptic.ldf}[polyglossia: module for Coptic]
\PolyglossiaSetup{coptic}{
@@ -13147,7 +13137,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-croatian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-croatian.ldf}[polyglossia: module for Croatian]
\PolyglossiaSetup{croatian}{
@@ -13169,40 +13159,40 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\RequirePackage{luavlna}
\fi
-\define@boolkey{croatian}[croatian@]{babelshorthands}[true]{}
-
-\define@boolkey{croatian}[croatian@]{disabledigraphs}[true]{}
-
-% Alias kept for backwards compatibility. Please do not remove
-\define@boolkey{croatian}[croatian@]{disableligatures}[true]{%
- \xpg@warning{The option disableligatures is deprected.\MessageBreak
- Please use disabledigraphs instead}%
- \ifcroatian@disableligatures
- \croatian@disabledigraphstrue
- \else
- \croatian@disabledigraphsfalse
- \fi
-}
-
-\define@boolkey{croatian}[croatian@]{splithyphens}[true]{}
-
-\define@boolkey{croatian}[croatian@]{localalph}[true]{}
+\DeclareKeys[polyglossia/gloss/croatian]
+ {
+ babelshorthands.if = croatian@babelshorthands,
+ babelshorthands.default:n = true,
+ disabledigraphs.if = croatian@disabledigraphs,
+ disabledigraphs.default:n = true,
+ splithyphens.if = croatian@splithyphens,
+ splithyphens.default:n = true,
+ localalph.if = croatian@localalph,
+ localalph.default:n = true,
+ disableligatures.choices:nn = { true, false }
+ {%
+ \xpg@warning{The option disableligatures is deprecated.\MessageBreak
+ Please use disabledigraphs instead}%
+ \ifcase\UseName{l_keys_choice_int}\or
+ \croatian@disabledigraphstrue
+ \or
+ \croatian@disabledigraphsfalse
+ \fi
+ },
+ disableligatures.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{croatian}{babelshorthands=false,disabledigraphs=false,
+\InitializeGlossOptions{croatian}{babelshorthands=false,disabledigraphs=false,
splithyphens=true,localalph=true}
\ifsystem@babelshorthands
- \setkeys{croatian}{babelshorthands=true}
+ \SetGlossOptions{croatian}{babelshorthands=true}
\else
- \setkeys{croatian}{babelshorthands=false}
+ \SetGlossOptions{croatian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\let\xpg@hyphen@char-
\def\croatian@@splhyphen#1{%
@@ -13423,13 +13413,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-cy.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-cy.ldf}[polyglossia: module for cy (Welsh)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{welsh}
+\InheritGlossFile{welsh}
% \end{macrocode}
% \iffalse
@@ -13440,13 +13430,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-cz.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-cz.ldf}[polyglossia: module for cz (Czech)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{czech}
+\InheritGlossFile{czech}
% \end{macrocode}
% \iffalse
@@ -13457,7 +13447,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-czech.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-czech.ldf}[polyglossia: module for Czech]
@@ -13480,26 +13470,26 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\RequirePackage{luavlna}
\fi
-\define@boolkey{czech}[czech@]{babelshorthands}[true]{}
-
-\define@boolkey{czech}[czech@]{splithyphens}[true]{}
-
-\define@boolkey{czech}[czech@]{vlna}[true]{}
+\DeclareKeys[polyglossia/gloss/czech]
+ {
+ babelshorthands.if = czech@babelshorthands,
+ babelshorthands.default:n = true,
+ splithyphens.if = czech@splithyphens,
+ splithyphens.default:n = true,
+ vlna.if = czech@vlna,
+ vlna.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{czech}{babelshorthands=false,splithyphens=true,vlna=true}
+\InitializeGlossOptions{czech}{babelshorthands=false,splithyphens=true,vlna=true}
\ifsystem@babelshorthands
- \setkeys{czech}{babelshorthands=true}
+ \SetGlossOptions{czech}{babelshorthands=true}
\else
- \setkeys{czech}{babelshorthands=false}
+ \SetGlossOptions{czech}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\czech@@splithyphen#1{%
\def\czech@sh@tmp{%
@@ -13716,13 +13706,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-da.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-da.ldf}[polyglossia: module for da (Danish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{danish}
+\InheritGlossFile{danish}
% \end{macrocode}
% \iffalse
@@ -13733,7 +13723,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-danish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-danish.ldf}[polyglossia: module for Danish]
\PolyglossiaSetup{danish}{
@@ -13790,13 +13780,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-AT-1901.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-1901.ldf}[polyglossia: module for de-AT-1901 (Austrian German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13807,13 +13797,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-AT-1996.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-1996.ldf}[polyglossia: module for de-AT-1996 (Austrian German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13824,13 +13814,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-AT.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT.ldf}[polyglossia: module for de-AT (Austrian German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13841,13 +13831,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-CH-1901.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-1901.ldf}[polyglossia: module for de-CH-1901 (Swiss German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13858,13 +13848,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-CH-1996.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-1996.ldf}[polyglossia: module for de-CH-1996 (Swiss German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13875,13 +13865,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-CH.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH.ldf}[polyglossia: module for de-CH (Swiss German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13892,13 +13882,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-DE-1901.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-1901.ldf}[polyglossia: module for de-DE-1901 (Germany's German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13909,13 +13899,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-DE-1996.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-1996.ldf}[polyglossia: module for de-DE-1996 (Germany's German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13926,13 +13916,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-DE.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE.ldf}[polyglossia: module for de-DE (Germany's German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13943,13 +13933,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-AT-1901.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-1901-Latf.ldf}[polyglossia: module for de-AT-1901-Latf (Austrian German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13960,13 +13950,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-AT-1996.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-1996-Latf.ldf}[polyglossia: module for de-AT-1996-Latf (Austrian German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13977,13 +13967,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-AT.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-Latf.ldf}[polyglossia: module for de-AT-Latf (Austrian German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -13994,13 +13984,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-CH-1901.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-1901-Latf.ldf}[polyglossia: module for de-CH-1901-Latf (Swiss German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14011,13 +14001,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-CH-1996.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-1996-Latf.ldf}[polyglossia: module for de-CH-1996-Latf (Swiss German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14028,13 +14018,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-CH.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-Latf.ldf}[polyglossia: module for de-CH-Latf (Swiss German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14045,13 +14035,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-DE-1901.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-1901-Latf.ldf}[polyglossia: module for de-DE-1901-Latf (Germany's German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14062,13 +14052,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-DE-1996.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-1996-Latf.ldf}[polyglossia: module for de-DE-1996-Latf (Germany's German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14079,13 +14069,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf-DE.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-Latf.ldf}[polyglossia: module for de-DE-Latf (Germany's German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14096,13 +14086,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de-Latf.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-Latf.ldf}[polyglossia: module for de-Latf (German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14113,13 +14103,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-de.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de.ldf}[polyglossia: module for de (German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -14130,7 +14120,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-divehi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-divehi.ldf}[polyglossia: module for Divehi]
@@ -14185,13 +14175,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-dsb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-dsb.ldf}[polyglossia: module for dsb (Sorbian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
% \end{macrocode}
% \iffalse
@@ -14202,7 +14192,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-dutch.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-dutch.ldf}[polyglossia: module for Dutch]
\PolyglossiaSetup{dutch}{
@@ -14219,24 +14209,24 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{dutch}{nl}
-\define@boolkey{dutch}[dutch@]{babelshorthands}[true]{}
-
-\define@boolkey{dutch}[dutch@]{tremahyphenation}[true]{}
+\DeclareKeys[polyglossia/gloss/dutch]
+ {
+ babelshorthands.if = dutch@babelshorthands,
+ babelshorthands.default:n = true,
+ tremahyphenation.if = dutch@tremahyphenation,
+ tremahyphenation.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{dutch}{babelshorthands=false,tremahyphenation=true}
+\InitializeGlossOptions{dutch}{babelshorthands=false,tremahyphenation=true}
\ifsystem@babelshorthands
- \setkeys{dutch}{babelshorthands=true}
+ \SetGlossOptions{dutch}{babelshorthands=true}
\else
- \setkeys{dutch}{babelshorthands=false}
+ \SetGlossOptions{dutch}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\xpg@trema#1{\allowhyphens\discretionary{-}{#1}{\"{#1}}\allowhyphens}
@@ -14412,30 +14402,47 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-dv.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-dv.ldf}[polyglossia: module for dv (Divehi)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{divehi}
+\InheritGlossFile{divehi}
% \end{macrocode}
% \iffalse
%</gloss-dv.ldf>
+%<*gloss-ecclesiasticlatin.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-ecclesiasticlatin.ldf}
+% \begin{macrocode}
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
+%
+\ProvidesFile{gloss-ecclesiasticlatin.ldf}[polyglossia: module for ecclesiastic Latin]
+
+% We provide this as a babel alias
+
+\InheritGlossFile{latin}
+
+% \end{macrocode}
+% \iffalse
+%</gloss-ecclesiasticlatin.ldf>
%<*gloss-el-monoton.ldf>
% \fi
% \clearpage
%
% \subsection{gloss-el-monoton.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-el-monoton.ldf}[polyglossia: module for el-monoton (Greek)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
% \end{macrocode}
% \iffalse
@@ -14446,13 +14453,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-el-polyton.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-el-polyton.ldf}[polyglossia: module for el-polyton (Greek)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
% \end{macrocode}
% \iffalse
@@ -14463,13 +14470,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-el.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-el.ldf}[polyglossia: module for el (Greek)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
% \end{macrocode}
% \iffalse
@@ -14480,13 +14487,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-en-AU.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en-AU.ldf}[polyglossia: module for en-AU (Australian English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -14497,13 +14504,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-en-CA.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
-\ProvidesFile{gloss-en-CA.ldf}[polyglossia: module for en-CA (Canadan English)]
+\ProvidesFile{gloss-en-CA.ldf}[polyglossia: module for en-CA (Canadian English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -14514,13 +14521,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-en-GB.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en-GB.ldf}[polyglossia: module for en-GB (British English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -14531,13 +14538,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-en-NZ.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en-NZ.ldf}[polyglossia: module for en-NZ (Newzealand English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -14548,13 +14555,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-en-US.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en-US.ldf}[polyglossia: module for en-US (American English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -14565,13 +14572,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-en.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en.ldf}[polyglossia: module for en (English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -14582,7 +14589,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-english.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-english.ldf}[polyglossia: module for English]
@@ -14614,9 +14621,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias[variant=canadian]{english}{canadian}
\setlanguagealias[variant=newzealand]{english}{newzealand}
-\providebool{british@hyphen}
-\providebool{english@ordinalmonthday}
-\providebool{british@dateformat}
+\@ifundefined{ifbritish@hyphen}%
+ {\newif\ifbritish@hyphen}{}
+\@ifundefined{ifenglish@ordinalmonthday}%
+ {\newif\ifenglish@ordinalmonthday}{}
+\@ifundefined{ifbritish@dateformat}%
+ {\newif\ifbritish@dateformat}{}
% US English (\l@english) is default
% Initialize its settings
@@ -14625,49 +14635,46 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\english@ordinalmonthdayfalse
\british@dateformatfalse
-% Option ordinalmonthday
-\define@boolkey{english}[english@]{ordinalmonthday}[true]{}
-
-\define@choicekey*+{english}{variant}[\xpg@val\xpg@nr]{uk,british,us,american,usmax,australian,newzealand,canadian}[us]{%
- \ifcase\xpg@nr\relax
+\DeclareKeys[polyglossia/gloss/english]
+ {
+ ordinalmonthday.if = english@ordinalmonthday,
+ ordinalmonthday.default:n = true,
+ variant.choices:nn = { uk, british, us, american, usmax, australian, newzealand, canadian }
+ {%
+ \ifcase\UseName{l_keys_choice_int}\or
% uk:
\british@hyphentrue
\british@dateformattrue
\english@ordinalmonthdaytrue
\SetLanguageKeys{english}{babelname=british,bcp47=en-GB,bcp47-language=en,bcp47-region=GB}%
- \xpg@info{Option: English, variant=british}%
\or
% british:
\british@hyphentrue
\british@dateformattrue
\english@ordinalmonthdaytrue
\SetLanguageKeys{english}{babelname=british,bcp47=en-GB,bcp47-language=en,bcp47-region=GB}%
- \xpg@info{Option: english variant=british}%
\or
% us:
\british@hyphenfalse
\british@dateformatfalse
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=american,bcp47=en-US,bcp47-language=en,bcp47-region=US}%
- \xpg@info{Option: English, variant=american}%
\or
% american:
\british@hyphenfalse
\british@dateformatfalse
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=american,bcp47=en-US,bcp47-language=en,bcp47-region=US}%
- \xpg@info{Option: English, variant=american}%
\or
% usmax:
\british@hyphenfalse
\british@dateformatfalse
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=american,bcp47=en-US,bcp47-language=en,bcp47-region=US}%
- \xpg@info{Option: english variant=american (with additional patterns)}%
- \xpg@ifdefined{usenglishmax}{}%
+ \IfLanguageDefinedF{usenglishmax}%
{\xpg@warning{No hyphenation patterns were loaded for "US English Max"\MessageBreak
I will use the standard patterns for US English instead}%
- \adddialect\l@usenglishmax\l@english\relax%
+ \adddialect\l@usenglishmax\l@english
}%
\def\english@variant{usenglishmax}%
\or
@@ -14678,8 +14685,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\british@dateformattrue
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=australian,bcp47=en-AU,bcp47-language=en,bcp47-region=AU}%
- \xpg@info{Option: English, variant=australian}%
- \adddialect\l@australian\l@english%
+ \adddialect\l@australian\l@english
\or
% newzealand:
% These use the british hyphenation patterns
@@ -14688,8 +14694,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\british@dateformattrue
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=newzealand,bcp47=en-NZ,bcp47-language=en,bcp47-region=NZ}%
- \xpg@info{Option: English, variant=newzealand}%
- \adddialect\l@newzealand\l@english%
+ \adddialect\l@newzealand\l@english
\or
% canadian:
% This is currently equivalent to usenglish (as in babel)
@@ -14697,45 +14702,35 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\british@dateformatfalse
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=canadian,bcp47=en-CA,bcp47-language=en,bcp47-region=CA}%
- \xpg@info{Option: English, variant=american}%
- \adddialect\l@canadian\l@english%
+ \adddialect\l@canadian\l@english
\fi
\ifbritish@hyphen
- \xpg@ifdefined{ukenglish}{}%
+ \IfLanguageDefinedF{ukenglish}%
{\xpg@warning{No hyphenation patterns were loaded for British English\MessageBreak
I will use the patterns for US English instead}%
- \adddialect\l@ukenglish\l@english\relax%
+ \adddialect\l@ukenglish\l@english
}%
\def\english@variant{ukenglish}%
\fi
-}{\xpg@warning{Unknown English variant `#1'}}
+ },
+ variant.default:n = us,
+ variant/unknown.code = \xpg@warning{Unknown English variant `#1'},
+ }
% Register default options
-\xpg@initialize@gloss@options{english}{variant=us,ordinalmonthday=false}
+\InitializeGlossOptions{english}{variant=us,ordinalmonthday=false}
% Register alias options
-\xpg@set@alias@values{english}{variant}{us}{american}
-\xpg@set@alias@values{english}{variant}{uk}{british}
+\SetLanguageAliasValues{english}{variant}{us,american}
+\SetLanguageAliasValues{english}{variant}{uk,british}
\ifxetex
% Check if \l@english is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{english}{}{%
- \def\do##1{%
- \xpg@ifdefined{#1}%
- {\csletcs{l@english}{l@#1}\listbreak}%
- {%
- \xpg@warning{No hyphenation patterns for English found"\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@english0
- }%
- }%
- \docsvlist{british, american, usenglishmax, australian, newzealand}
- \xpg@ifdefined{english}{}{}
- }%
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{english}{british, american, usenglishmax, australian, newzealand}
\fi
\def\english@language{%
- \polyglossia@setup@language@patterns{\english@variant}%
+ \SetupPolyglossiaLangPatterns{\english@variant}%
}%
\def\captionsenglish{%
@@ -14793,13 +14788,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-eo.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-eo.ldf}[polyglossia: module for eo (Esperanto)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{esperanto}
+\InheritGlossFile{esperanto}
% \end{macrocode}
% \iffalse
@@ -14810,13 +14805,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-es-ES.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-es-ES.ldf}[polyglossia: module for es-ES (Spain's Spanish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{spanish}
+\InheritGlossFile{spanish}
% \end{macrocode}
% \iffalse
@@ -14827,13 +14822,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-es-MX.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-es-MX.ldf}[polyglossia: module for es-MX (Mexican Spanish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{spanish}
+\InheritGlossFile{spanish}
% \end{macrocode}
% \iffalse
@@ -14844,13 +14839,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-es.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-es.ldf}[polyglossia: module for es (Spanish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{spanish}
+\InheritGlossFile{spanish}
% \end{macrocode}
% \iffalse
@@ -14861,7 +14856,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-esperanto.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-esperanto.ldf}[polyglossia: module for Esperanto]
\PolyglossiaSetup{esperanto}{
@@ -14892,10 +14887,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\figurename{Figuro}%
\def\tablename{Tabelo}%
%\def\thepart{}%
- %\def\partname{}%
+ \def\partname{Parto}%
\def\pagename{Paĝo}%
\def\seename{vidu}%
- \def\alsoname{Parto}%
+ \def\alsoname{vidu ankaŭ}%
\def\enclname{Aldono(j)}%
\def\ccname{Kopie al}%
\def\headtoname{Al}%
@@ -14941,7 +14936,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-estonian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-estonian.ldf}[polyglossia: module for Estonian]
\PolyglossiaSetup{estonian}{
@@ -14981,7 +14976,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\ccname{Koopia(d)}%
%\def\headtoname{}%
\def\proofname{Korrektuur}%
- \def\glossaryname{Glossary}% <-- need translation
+ \def\glossaryname{Sõnastik}%
}
\def\dateestonian{%
\def\today{\number\day.\space\ifcase\month\or
@@ -14998,13 +14993,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-et.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-et.ldf}[polyglossia: module for et (Estonian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{estonian}
+\InheritGlossFile{estonian}
% \end{macrocode}
% \iffalse
@@ -15015,13 +15010,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-eu.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-eu.ldf}[polyglossia: module for eu (Basque)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{basque}
+\InheritGlossFile{basque}
% \end{macrocode}
% \iffalse
@@ -15032,13 +15027,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fa.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fa.ldf}[polyglossia: module for fa (Persian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{persian}
+\InheritGlossFile{persian}
% \end{macrocode}
% \iffalse
@@ -15049,14 +15044,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-farsi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-farsi.ldf}[polyglossia: module for Farsi]
% We only provide this gloss for babel compatibility.
% The proper English language name is Persian.
-\xpg@load@master@language{persian}
+\InheritGlossFile{persian}
% \end{macrocode}
% \iffalse
@@ -15067,13 +15062,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fi.ldf}[polyglossia: module for fi (Finnish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{finnish}
+\InheritGlossFile{finnish}
% \end{macrocode}
% \iffalse
@@ -15084,7 +15079,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-finnish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-finnish.ldf}[polyglossia: module for Finnish]
\PolyglossiaSetup{finnish}{
@@ -15102,51 +15097,54 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{finnish}{fi}
-\define@boolkey{finnish}[finnish@]{babelshorthands}[true]{}
-
\newif\if@finnish@schoolhyphens
\newif\if@finnish@babelhyphens
-\define@choicekey*+{finnish}{hyphens}[\xpg@val\xpg@nr]{default,school,babel}[default]{%
- \ifcase\xpg@nr\relax
- % default:
- \@finnish@schoolhyphensfalse
- \@finnish@babelhyphensfalse
- \or
- % school:
- \@finnish@schoolhyphenstrue
- \@finnish@babelhyphensfalse
- \or
- % babel:
- \@finnish@schoolhyphensfalse
- \@finnish@babelhyphenstrue
- \fi
- \xpg@info{Option: Finnish, hyphens=\xpg@val}%
-}{\xpg@warning{Unknown Finnish hyphens `#1'}}
-
-% backwards compatibility
-\define@boolkey{finnish}[finnish@]{schoolhyphens}[true]{%
- \iffinnish@schoolhyphens
- \@finnish@schoolhyphenstrue
- \@finnish@babelhyphensfalse
- \else
- \@finnish@schoolhyphensfalse
- \fi
-}
+
+\DeclareKeys[polyglossia/gloss/finnish]
+ {
+ babelshorthands.if = finnish@babelshorthands,
+ babelshorthands.default:n = true,
+ hyphens.choice:,
+ hyphens / default.code =
+ {%
+ \@finnish@schoolhyphensfalse
+ \@finnish@babelhyphensfalse
+ },
+ hyphens / school.code =
+ {%
+ \@finnish@schoolhyphenstrue
+ \@finnish@babelhyphensfalse
+ },
+ hyphens / babel.code =
+ {%
+ \@finnish@schoolhyphensfalse
+ \@finnish@babelhyphenstrue
+ },
+ hyphens.default:n = default,
+ hyphens/unknown.code = \xpg@warning{Unknown Finnish hyphens `#1'},
+ schoolhyphens.choice:,
+ schoolhyphens / true.code =
+ {%
+ \@finnish@schoolhyphenstrue
+ \@finnish@babelhyphensfalse
+ },
+ schoolhyphens / false.code =
+ {%
+ \@finnish@schoolhyphensfalse
+ },
+ schoolhyphens.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{finnish}{babelshorthands=false,hyphens=default}
+\InitializeGlossOptions{finnish}{babelshorthands=false,hyphens=default}
\ifsystem@babelshorthands
- \setkeys{finnish}{babelshorthands=true}
+ \SetGlossOptions{finnish}{babelshorthands=true}
\else
- \setkeys{finnish}{babelshorthands=false}
+ \SetGlossOptions{finnish}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\finnish@shorthands{%
\xpg@activate@shorthands%
@@ -15191,15 +15189,15 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\finnish@language{%
\if@finnish@schoolhyphens
- \xpg@ifdefined{schoolfinnish}{%
- \polyglossia@setup@language@patterns{schoolfinnish}%
+ \IfLanguageDefinedTF{schoolfinnish}{%
+ \SetupPolyglossiaLangPatterns{schoolfinnish}%
}{%
\xpg@warning{Finnish 'School' hyphenation patterns (schoolfinnish) not available.\MessageBreak
I will use the standard patterns for Finnish instead}%
- \polyglossia@setup@language@patterns{finnish}%
+ \SetupPolyglossiaLangPatterns{finnish}%
}%
\else
- \polyglossia@setup@language@patterns{finnish}%
+ \SetupPolyglossiaLangPatterns{finnish}%
\fi
}
@@ -15253,13 +15251,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fr-CA-u-sd-canb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr-CA-u-sd-canb.ldf}[polyglossia: module for fr-CA-u-sd-canb (Canadian French, Acadian subvariety)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
@@ -15270,13 +15268,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fr-CA.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr-CA.ldf}[polyglossia: module for fr-CA (Canadian French)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
@@ -15287,13 +15285,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fr-CH.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr-CH.ldf}[polyglossia: module for fr-CH (Swiss French)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
@@ -15304,13 +15302,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fr-FR.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr-FR.ldf}[polyglossia: module for fr-FR (France's French)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
@@ -15321,13 +15319,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fr.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr.ldf}[polyglossia: module for fr (French)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
% \end{macrocode}
% \iffalse
@@ -15338,7 +15336,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-french.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-french.ldf}[polyglossia: module for French]
@@ -15368,43 +15366,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias[variant=canadian]{french}{canadien}
\def\french@variant{french}
-\define@choicekey*+{french}{variant}[\xpg@val\xpg@nr]{french,canadian,acadian,swiss}[french]{%
- \ifcase\xpg@nr\relax
- % french:
- \def\french@variant{french}%
- \SetLanguageKeys{french}{babelname=french,bcp47=fr-FR,bcp47-language=fr,bcp47-region=FR}%
- \french@thincolonspacefalse
- \or
- % canadian:
- \def\french@variant{canadien}%
- \SetLanguageKeys{french}{babelname=canadien,bcp47=fr-CA,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-caqc}%
- \xpg@ifdefined{canadien}{}%
- {\xpg@warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
- I will use the standard patterns for French instead}%
- \adddialect\l@canadien\l@french\relax}%
- \french@thincolonspacefalse
- \or
- % acadian:
- \def\french@variant{acadian}%
- \SetLanguageKeys{french}{babelname=acadian,bcp47=fr-CA-u-sd-canb,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-canb}%
- \xpg@ifdefined{acadian}{}%
- {\xpg@warning{No hyphenation patterns were loaded for "French (Canada, Acadian)"\MessageBreak
- I will use the standard patterns for French instead}%
- \adddialect\l@acadian\l@french\relax}%
- \french@thincolonspacefalse
- \or
- % swiss:
- \def\french@variant{swissfrench}%
- \SetLanguageKeys{french}{babelname=french,bcp47=fr-CH,bcp47-language=fr,bcp47-region=CH}%
- \adddialect\l@swissfrench\l@french\relax%
- \french@thincolonspacetrue
- \fi
- \xpg@info{Option: French, variant=\xpg@val}%
-}{\xpg@warning{Unknown French variant `#1'}}
-
\def\french@language{%
- \polyglossia@setup@language@patterns{\french@variant}%
+ \SetupPolyglossiaLangPatterns{\french@variant}%
}%
\ifluatex
@@ -15424,91 +15388,103 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% Save original footnote definition
% Do this at the end of the preamble to catch other
% packages' footnote changes (#391)
-\AtEndPreamble{%
+\AddToHook{begindocument/before}{%
\let\xpg@orig@makefntext\@makefntext
}
-\define@boolkey{french}[french@]{frenchfootnote}[true]{}
-
-\define@boolkey{french}[french@]{autospacing}[true]{}
-\french@autospacingtrue
-
-\define@boolkey{french}[french@]{frenchpart}[true]{}
-\french@frenchparttrue
-
-\newif\iffrench@autospaceguillemets
-\define@boolkey{french}[french@]{autospaceguillemets}[true]{}
-\french@autospaceguillemetstrue
-
-\newif\iffrench@thincolonspace
-\define@boolkey{french}[french@]{thincolonspace}[true]{}
-\french@thincolonspacefalse
-
-% Backwards compatibility
-\define@boolkey{french}[french@]{automaticspacesaroundguillemets}[true]{%
- \iffrench@automaticspacesaroundguillemets
- \setkeys{french}{autospaceguillemets=true}%
- \else
- \setkeys{french}{autospaceguillemets=false}%
- \fi
-}
-
% name is for compatibility with babel
\let\french@ttfamilyORI\ttfamily
\DeclareRobustCommand\french@ttfamilyFB{\nofrench@punctuation\french@ttfamilyORI}
-% Allow to switch on autospacing in ttfamily context
-\define@boolkey{french}[french@]{autospacetypewriter}[true]{}
-\french@autospacetypewriterfalse
-
-% This is how babel-french has it
-\define@boolkey{french}[french@]{OriginalTypewriter}[true]{%
- \iffrench@OriginalTypewriter
- \setkeys{french}{autospacetypewriter=false}%
- \else
- \setkeys{french}{autospacetypewriter=true}%
- \fi
-}
-
% Configuration of item labels
\def\french@itemi{\textemdash}
\def\french@itemii{\textemdash}
\def\french@itemiii{\textemdash}
\def\french@itemiv{\textemdash}
-\define@key{french}{itemlabels}[\textemdash]{%
- \def\french@itemi{#1}
- \def\french@itemii{#1}
- \def\french@itemiii{#1}
- \def\french@itemiv{#1}
-}
-
-\define@key{french}{itemlabeli}[\textemdash]{%
- \def\french@itemi{#1}
-}
-
-\define@key{french}{itemlabelii}[\textemdash]{%
- \def\french@itemii{#1}
-}
-
-\define@key{french}{itemlabeliii}[\textemdash]{%
- \def\french@itemiii{#1}
-}
-
-\define@key{french}{itemlabeliv}[\textemdash]{%
- \def\french@itemiv{#1}
-}
+\newif\iffrench@autospacetypewriter
+\french@autospacetypewriterfalse
+\newif\iffrench@autospacing
+\french@autospacingtrue
+\newif\iffrench@frenchpart
+\french@frenchparttrue
+\newif\iffrench@autospaceguillemets
+\french@autospaceguillemetstrue
-\define@boolkey{french}[french@]{frenchitemlabels}[true]{}
+\DeclareKeys[polyglossia/gloss/french]
+ {
+ variant.choice:,
+ variant / french.code =
+ {%
+ \def\french@variant{french}%
+ \SetLanguageKeys{french}{babelname=french,bcp47=fr-FR,bcp47-language=fr,bcp47-region=FR}%
+ \french@thincolonspacefalse
+ },
+ variant / canadian.code =
+ {%
+ \def\french@variant{canadien}%
+ \SetLanguageKeys{french}{babelname=canadien,bcp47=fr-CA,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-caqc}%
+ \IfLanguageDefinedF{canadien}%
+ {\xpg@warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
+ I will use the standard patterns for French instead}%
+ \adddialect\l@canadien\l@french\relax}%
+ \french@thincolonspacefalse
+ },
+ variant / acadian.code =
+ {%
+ \def\french@variant{acadian}%
+ \SetLanguageKeys{french}{babelname=acadian,bcp47=fr-CA-u-sd-canb,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-canb}%
+ \IfLanguageDefinedF{acadian}%
+ {\xpg@warning{No hyphenation patterns were loaded for "French (Canada, Acadian)"\MessageBreak
+ I will use the standard patterns for French instead}%
+ \adddialect\l@acadian\l@french\relax}%
+ \french@thincolonspacefalse
+ },
+ variant / swiss.code =
+ {%
+ \def\french@variant{swissfrench}%
+ \SetLanguageKeys{french}{babelname=french,bcp47=fr-CH,bcp47-language=fr,bcp47-region=CH}%
+ \adddialect\l@swissfrench\l@french\relax%
+ \french@thincolonspacetrue
+ },
+ variant.default:n = french,
+ variant/unknown.code = \xpg@warning{Unknown French variant `#1'},
+ frenchfootnote.if = french@frenchfootnote,
+ frenchfootnote.default:n = true,
+ autospacing.if = french@autospacing,
+ autospacing.default:n = true,
+ frenchpart.if = french@frenchpart,
+ frenchpart.default:n = true,
+ autospaceguillemets.if = french@autospaceguillemets,
+ autospaceguillemets.default:n = true,
+ thincolonspace.if = french@thincolonspace,
+ thincolonspace.default:n = true,
+ automaticspacesaroundguillemets.meta:n = {autospaceguillemets=#1},
+ autospacetypewriter.if = french@autospacetypewriter,
+ autospacetypewriter.default:n = true,
+ originaltypewriter.meta:n = {autospacetypewriter=#1},
+ itemlabeli.store = \french@itemi,
+ itemlabelii.store = \french@itemii,
+ itemlabeliii.store = \french@itemiii,
+ itemlabeliv.store = \french@itemiv,
+ frenchitemlabels.if = french@frenchitemlabels,
+ frenchitemlabels.default:n = true,
+ itemlabels.code =
+ \def\french@itemi{#1}%
+ \def\french@itemii{#1}%
+ \def\french@itemiii{#1}%
+ \def\french@itemiv{#1},
+ itemlabels.default:n = \textemdash
+ }
% Register default options
-\xpg@initialize@gloss@options{french}{variant=french,autospacing=true,thincolonspace=false,
+\InitializeGlossOptions{french}{variant=french,autospacing=true,thincolonspace=false,
autospaceguillemets=true,autospacetypewriter=false,
frenchfootnote=false,frenchitemlabels=false,
itemlabels=\textemdash,itemlabeli=\textemdash,itemlabelii=\textemdash,
itemlabeliii=\textemdash,itemlabeliv=\textemdash}
% Register alias options
-\xpg@set@alias@values{french}{variant}{canadian}{acadian}
+\SetLanguageAliasValues{french}{variant}{canadian,acadian}
\def\french@fontsetup{%
@@ -15679,100 +15655,100 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\french@capsformat{%
% Change part heading
% With titlesec
- \ifcsdef{titleformat}{%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\xpg@french@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for French}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
+ \@ifundefined{titleformat}{%
+ % With KOMA
+ \@ifundefined{sectionformat}{%
+ % With memoir
+ \@ifundefined{@memptsize}{% (not \ifdefined\@memptsize)
+ % With standard classes
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\xpg@french@part\nobreakspace\partname}%
+ {}%
+ {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for French}}}%
+ }% (end \ifdefined \@part)
+ }{% Hyperref
+ \let\xpg@save@part@format\NR@part%
+ \patchcmd{\NR@part}%
{\partname\nobreakspace\thepart}%
{\xpg@french@part\nobreakspace\partname}%
{}%
{\xpg@warning{Failed to patch part for French}}%
- }{}%
- }%
- }{% (not \ifdefined\titleformat)
- % With KOMA
- \ifcsdef{sectionformat}{%
- \ifcsdef{partformat}{%
- \let\xpg@save@part@format\partformat%
- \renewcommand{\partformat}{\xpg@french@part~\partname}%
- }{}%
- }{% (not \ifdefined\sectionformat)
- % With memoir
- \ifcsdef{@memptsize}{%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
- {\partnamefont\xpg@french@part\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for French}}%
- }{% not hyperref
- \ifcsdef{@part}{%
+ }% (end \ifdefined\NR@part)
+ }{%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
\let\xpg@save@part@format\@part%
\patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
{\partnamefont\xpg@french@part\partnamenum\printpartname}%
{}%
{\xpg@warning{Failed to patch part for French}}%
- }{}%
- }%
- }{% (not \ifdefined\@memptsize)
- % With standard classes
- \ifcsdef{NR@part}{% Hyperref
+ }%
+ }{% Hyperref (nameref)
\let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
+ \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
+ {\partnamefont\xpg@french@part\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for French}}%
+ }%
+ }% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\sectionformat)
+ \@ifundefined{partformat}{}{%
+ \let\xpg@save@part@format\partformat%
+ \renewcommand{\partformat}{\xpg@french@part~\partname}%
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
{\partname\nobreakspace\thepart}%
{\xpg@french@part\nobreakspace\partname}%
{}%
{\xpg@warning{Failed to patch part for French}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\xpg@french@part\nobreakspace\partname}%
- {}%
- {\ifcsdef{part}{\xpg@warning{Failed to patch part for French}}{}}%
- }{}% (end \ifdefined \NR@part)
- }% (end \ifdefined\@part)
- }% (end \ifdefined\@memptsize)
- }% (end \ifdefined\sectionformat)
+ }%
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part%
+ \patchcmd{\NR@part}%
+ {\partname\nobreakspace\thepart}%
+ {\xpg@french@part\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for French}}%
+ }%
}% (end \ifdefined\titleformat)
}
\def\nofrench@capsformat{%
% Reset chapter and part heading
- \ifcsdef{titleformat}{%
- % With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format%
- }{%
- \let\@part\xpg@save@part@format%
- }%
- }{}%
- }{% (not \ifdefined\titleformat)
- \ifcsdef{sectionformat}{%
- % With KOMA
- \ifcsdef{xpg@save@part@format}{%
- \let\partformat\xpg@save@part@format
- }{}%
- }{%
+ \@ifundefined{titleformat}{%
+ \@ifundefined{sectionformat}{%
% With memoir and standard classes
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format%
- }{%
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
\let\@part\xpg@save@part@format%
+ }{%
+ \let\NR@part\xpg@save@part@format%
}%
- }{}%
+ }%
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@part@format}{}{%
+ \let\partformat\xpg@save@part@format
+ }%
}% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ % With titlesec
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
+ \let\@part\xpg@save@part@format%
+ }{%
+ \let\NR@part\xpg@save@part@format%
+ }%
+ }%
}% (end \ifdefined\titleformat)
}
@@ -15783,7 +15759,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\if@xpg@french@footnote@set%
\else%
\iffrench@frenchfootnote%
- \ifdefstring{\xpg@main@language}{french}{%
+ \IfMainLanguageTF{french}{%
\ifx\@makefntext\undefined\else%
\long\def\french@makefntext##1{%
\parindent1em \noindent\quad%
@@ -15807,7 +15783,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\if@xpg@french@itemlabels@set%
\else%
\iffrench@frenchitemlabels
- \ifdefstring{\xpg@main@language}{french}{%
+ \IfMainLanguageTF{french}{%
\renewcommand{\labelitemi}{\french@itemi}%
\renewcommand{\labelitemii}{\french@itemii}%
\renewcommand{\labelitemiii}{\french@itemiii}%
@@ -15882,13 +15858,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-friulan.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-friulan.ldf}[polyglossia: module for Friulian]
% We only provide this gloss for babel compatibility.
-\xpg@load@master@language{friulian}
+\InheritGlossFile{friulian}
% \end{macrocode}
% \iffalse
@@ -15899,7 +15875,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-friulian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-friulian.ldf}[polyglossia: module for Friulian]
@@ -15953,7 +15929,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
Lui\or Avost\or Setembar\or Otobar\or Novembar\or Dicembar%
\fi\space dal\space\number\year}}
-\AtEndPreamble{% the user or the class might define different values
+\AddToHook{begindocument/before}{% the user or the class might define different values
\edef\xpgfu@savedvalues{%
\clubpenalty=\the\clubpenalty\space
\@clubpenalty=\the\@clubpenalty\space
@@ -15985,13 +15961,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-fur.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fur.ldf}[polyglossia: module for fur (Friulian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{friulian}
+\InheritGlossFile{friulian}
% \end{macrocode}
% \iffalse
@@ -16002,13 +15978,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ga.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ga.ldf}[polyglossia: module for ga (Gaelic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{gaelic}
+\InheritGlossFile{gaelic}
% \end{macrocode}
% \iffalse
@@ -16019,7 +15995,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-gaelic.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-gaelic.ldf}[polyglossia: module for Gaelic]
@@ -16043,23 +16019,28 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias[variant=scottish]{gaelic}{scottish}
\def\gaelic@variant{irish}
-\define@choicekey*+{gaelic}{variant}[\xpg@val\xpg@nr]{irish,scottish}[irish]{%
- \ifcase\xpg@nr\relax
- % irish:
- \gdef\gaelic@variant{irish}%
- \SetLanguageKeys{gaelic}{language=Irish,langtag=IRI,babelname=irish,bcp47=ga,bcp47-language=ga}%
- \xpg@fontsetup@latin{gaelic}%
- \or
- % scottish:
- \gdef\gaelic@variant{scottish}%
- \SetLanguageKeys{gaelic}{language=Gaelic,langtag=GAE,babelname=scottish,bcp47=gd,bcp47-language=gd}%
- \xpg@fontsetup@latin{gaelic}%
- \fi
- \xpg@info{Option: gaelic, variant=\xpg@val}%
-}{\xpg@warning{Unknown gaelic variant `#1'}}
+
+\DeclareKeys[polyglossia/gloss/gaelic]
+ {
+ variant.choice:,
+ variant / irish.code =
+ {%
+ \gdef\gaelic@variant{irish}%
+ \SetLanguageKeys{gaelic}{language=Irish,langtag=IRI,babelname=irish,bcp47=ga,bcp47-language=ga}%
+ \SetupLatinPolyglossiaFont{gaelic}%
+ },
+ variant / scottish.code =
+ {%
+ \gdef\gaelic@variant{scottish}%
+ \SetLanguageKeys{gaelic}{language=Gaelic,langtag=GAE,babelname=scottish,bcp47=gd,bcp47-language=gd}%
+ \SetupLatinPolyglossiaFont{gaelic}%
+ },
+ variant.default:n = irish,
+ variant/unknown.code = \xpg@warning{Unknown gaelic variant `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{gaelic}{variant=irish}
+\InitializeGlossOptions{gaelic}{variant=irish}
\def\captionsgaelic@irish{%
\def\refname{Tagairtí}%
@@ -16149,7 +16130,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-galician.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-galician.ldf}[polyglossia: module for Galician]
\PolyglossiaSetup{galician}{
@@ -16206,13 +16187,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-gd.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-gd.ldf}[polyglossia: module for gd (Gaelic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{gaelic}
+\InheritGlossFile{gaelic}
% \end{macrocode}
% \iffalse
@@ -16223,7 +16204,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-georgian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-georgian.ldf}[polyglossia: module for Georgian]
@@ -16243,34 +16224,37 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*{georgian}{ka}
\newif\ifgeorgian@numerals
-\define@key{georgian}{numerals}[arabic]{%
- \ifstrequal{#1}{georgian}%
- {\georgian@numeralstrue%
- \SetLanguageKeys{georgian}{bcp47-extension-u=nu-geor}%
- }%
- {\georgian@numeralsfalse%
- \SetLanguageKeys{georgian}{bcp47-extension-u=nu-latn}%
- }%
-}
-
-\define@boolkey{georgian}[georgian@]{babelshorthands}[true]{}
-\define@boolkey{georgian}[georgian@]{oldmonthnames}[true]{}
+\DeclareKeys[polyglossia/gloss/georgian]
+ {
+ babelshorthands.if = georgian@babelshorthands,
+ babelshorthands.default:n = true,
+ oldmonthnames.if = georgian@oldmonthnames,
+ oldmonthnames.default:n = true,
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \georgian@numeralsfalse
+ \SetLanguageKeys{georgian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / georgian.code =
+ {%
+ \georgian@numeralstrue
+ \SetLanguageKeys{georgian}{bcp47-extension-u=nu-geor}%
+ },
+ numerals.default:n = arabic
+ }
% Register default options
-\xpg@initialize@gloss@options{georgian}{babelshorthands=false,oldmonthnames=false,numerals=arabic}
+\InitializeGlossOptions{georgian}{babelshorthands=false,oldmonthnames=false,numerals=arabic}
\ifsystem@babelshorthands
- \setkeys{georgian}{babelshorthands=true}
+ \SetGlossOptions{georgian}{babelshorthands=true}
\else
- \setkeys{georgian}{babelshorthands=false}
+ \SetGlossOptions{georgian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\georgian@shorthands{%
\xpg@activate@shorthands%
@@ -16471,7 +16455,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-german.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-german.ldf}[polyglossia: module for German]
@@ -16520,51 +16504,11 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@german@oldspelling
\@german@oldspellingfalse
-\define@choicekey*+{german}{spelling}[\xpg@val\xpg@nr]{new,old,1901,1996}[new]{%
- \ifcase\xpg@nr\relax
- % new:
- \@german@oldspellingfalse
- \or
- % old:
- \@german@oldspellingtrue
- \or
- % 1901:
- \@german@oldspellingtrue
- \or
- % 1996:
- \@german@oldspellingfalse
- \fi
- \german@set@babelname%
- \xpg@info{Option: German, spelling=\xpg@val}%
-}{\xpg@warning{Unknown German spelling `#1'}}
\newif\if@austrian@locale
\@austrian@localefalse
\newif\if@swiss@locale
\@swiss@localefalse
-\define@choicekey*+{german}{variant}[\xpg@val\xpg@nr]{german,austrian,swiss}[german]{%
- \ifcase\xpg@nr\relax
- % german:
- \@swiss@localefalse%
- \@austrian@localefalse%
- \or
- % austrian:
- \@austrian@localetrue%
- \@swiss@localefalse%
- \or
- % swiss:
- \@swiss@localetrue%
- \@austrian@localefalse%
- \xpg@ifdefined{swissgerman}{}%
- {%
- \xpg@warning{No hyphenation patterns were loaded for "Swiss German (Old Spelling)"\MessageBreak
- I will use the standard patterns for German (old spelling) instead}%
- \adddialect\l@swissgerman\l@german\relax%
- }%
- \fi
- \german@set@babelname%
- \xpg@info{Option: German, variant=\xpg@val}%
-}{\xpg@warning{Unknown German variant `#1'}}
\def\german@set@babelname{%
\if@german@oldspelling
@@ -16613,58 +16557,110 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\newif\if@german@blackletter
-\define@choicekey*+{german}{script}[\xpg@val\xpg@nr]{latin,blackletter,fraktur}[latin]{%
- \ifcase\xpg@nr\relax
- % latin:
- \@german@blackletterfalse%
- \or
- % blackletter:
- \@german@blacklettertrue%
- \or
- % fraktur:
- \@german@blacklettertrue%
- \fi
- \german@set@babelname%
- \xpg@info{Option: German, script=\xpg@val}%
-}{\xpg@warning{Unknown German script `#1'}}
-
-\define@boolkey{german}[german@]{capitaleszett}[true]{%
- \ifgerman@capitaleszett
- % MakeUppercase capitalizes the eszett (U+00DF) with U+1E9E
- \SetLanguageKeys{german}{bcp47-casing=de-x-eszett,bcp47-extension-x=eszett}
- \else
- % Capitalize eszett as <SS>
- \SetLanguageKeys{german}{bcp47-casing=de,bcp47-extension-x={}}
- \fi
-}
-
-
-% Option defunc'ed, as both XeTeX and LuaTeX meanwhile
-% use the experimental German hyphenation patterns by default.
-\define@boolkey{german}[german@]{latesthyphen}[true]{}
-\define@boolkey{german}[german@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/german]
+ {
+ babelshorthands.if = german@babelshorthands,
+ babelshorthands.default:n = true,
+ latesthyphen.if = german@latesthyphen,
+ latesthyphen.default:n = true,
+ capitaleszett.choice:,
+ capitaleszett / true.code =
+ {% MakeUppercase capitalizes the eszett (U+00DF) with U+1E9E
+ \SetLanguageKeys{german}{bcp47-casing=de-x-eszett,bcp47-extension-x=eszett}%
+ },
+ capitaleszett / false.code =
+ {% Capitalize eszett as <SS>
+ \SetLanguageKeys{german}{bcp47-casing=de,bcp47-extension-x={}}%
+ },
+ capitaleszett.default:n = true,
+ script.choice:,
+ script / latin.code =
+ {%
+ \@german@blackletterfalse
+ \german@set@babelname
+ },
+ script / blackletter.code =
+ {%
+ \@german@blacklettertrue
+ \german@set@babelname
+ },
+ script / fraktur.code =
+ {%
+ \@german@blacklettertrue
+ \german@set@babelname
+ },
+ script.default:n = latin,
+ script/unknown.code = \xpg@warning{Unknown German script `#1'},
+ spelling.choice:,
+ spelling / new.code =
+ {%
+ \@german@oldspellingfalse
+ \german@set@babelname
+ },
+ spelling / old.code =
+ {%
+ \@german@oldspellingtrue
+ \german@set@babelname
+ },
+ spelling / 1901.code =
+ {%
+ \@german@oldspellingtrue
+ \german@set@babelname
+ },
+ spelling / 1996.code =
+ {%
+ \@german@oldspellingfalse
+ \german@set@babelname
+ },
+ spelling.default:n = new,
+ spelling/unknown.code = \xpg@warning{Unknown German spelling `#1'},
+ variant.choice:,
+ variant / german.code =
+ {%
+ \@swiss@localefalse
+ \@austrian@localefalse
+ \german@set@babelname
+ },
+ variant / austrian.code =
+ {%
+ \@austrian@localetrue
+ \@swiss@localefalse
+ \german@set@babelname
+ },
+ variant / swiss.code =
+ {%
+ \@swiss@localetrue
+ \@austrian@localefalse
+ \IfLanguageDefinedF{swissgerman}
+ {%
+ \xpg@warning{No hyphenation patterns were loaded for "Swiss German (Old Spelling)"\MessageBreak
+ I will use the standard patterns for German (old spelling) instead}%
+ \adddialect\l@swissgerman\l@german\relax
+ }%
+ \german@set@babelname
+ },
+ variant.default:n = german,
+ variant/unknown.code = \xpg@warning{Unknown German variant `#1'}
+ }
+
-\setkeys{german}{spelling,script,variant}
+\SetGlossOptions{german}{spelling,script,variant}
% Register default options
-\xpg@initialize@gloss@options{german}{variant=german,spelling=new,script=latin,babelshorthands=false}
+\InitializeGlossOptions{german}{variant=german,spelling=new,script=latin,babelshorthands=false}
% Register alias options
-\xpg@set@alias@values{german}{spelling}{new}{1996}
-\xpg@set@alias@values{german}{spelling}{old}{1901}
-\xpg@set@alias@values{german}{script}{blackletter}{fraktur}
+\SetLanguageAliasValues{german}{spelling}{new,1996}
+\SetLanguageAliasValues{german}{spelling}{old,1901}
+\SetLanguageAliasValues{german}{script}{blackletter,fraktur}
\ifsystem@babelshorthands
- \setkeys{german}{babelshorthands=true}
+ \SetGlossOptions{german}{babelshorthands=true}
\else
- \setkeys{german}{babelshorthands=false}
+ \SetGlossOptions{german}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\german@shorthands{%
\xpg@activate@shorthands%
@@ -16786,15 +16782,15 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\german@language{%
\if@german@oldspelling
\if@swiss@locale
- \polyglossia@setup@language@patterns{swissgerman}%
+ \SetupPolyglossiaLangPatterns{swissgerman}%
\else
- \polyglossia@setup@language@patterns{german}%
+ \SetupPolyglossiaLangPatterns{german}%
\fi
\if@austrian@locale
\adddialect\l@austrian\l@german%
\fi
\else
- \polyglossia@setup@language@patterns{ngerman}%
+ \SetupPolyglossiaLangPatterns{ngerman}%
\if@austrian@locale
\adddialect\l@naustrian\l@ngerman%
\fi
@@ -16825,13 +16821,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-germanb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-germanb.ldf}[polyglossia: module for German (old spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -16842,13 +16838,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-gl.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-gl.ldf}[polyglossia: module for gl (Galician)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{galician}
+\InheritGlossFile{galician}
% \end{macrocode}
% \iffalse
@@ -16859,13 +16855,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-grc.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-grc.ldf}[polyglossia: module for grc (Greek)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
% \end{macrocode}
% \iffalse
@@ -16876,7 +16872,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-greek.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-greek.ldf}[polyglossia: module for Greek]
@@ -16900,7 +16896,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*[variant=ancient]{greek}{grc}
-\setlanguagealias*[varant=polytonic]{greek}{el-polyton}
+\setlanguagealias*[variant=polytonic]{greek}{el-polyton}
\setlanguagealias*[variant=monotonic]{greek}{el-monoton}
\setlanguagealias*{greek}{el}
@@ -16920,44 +16916,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@greek@ancient\@greek@ancientfalse
\newif\if@greek@poly\@greek@polyfalse
-\define@choicekey*+{greek}{variant}[\xpg@val\xpg@nr]{monotonic,mono,polytonic,poly,ancient,ancientgreek}[monotonic]{%
- \xpg@ifdefined{greek}{}{%
- \xpg@nopatterns{greek}%
- \adddialect\l@greek\l@nohyphenation
- }%
- \ifcase\xpg@nr\relax
- % monotonic:
- \@greek@polyfalse
- \@greek@ancientfalse
- \or
- % mono:
- \@greek@polyfalse
- \@greek@ancientfalse
- \or
- % polytonic:
- \@greek@polytrue
- \@greek@ancientfalse
- \or
- % poly:
- \@greek@polytrue
- \@greek@ancientfalse
- \or
- % ancient:
- \@greek@polyfalse
- \@greek@ancienttrue
- \or
- % ancientgreek:
- \@greek@polyfalse
- \@greek@ancienttrue
- \fi
- \greek@set@langdata
- \xpg@info{Option: Greek, variant=\xpg@val}%
-}{\xpg@warning{Unknown Greek variant `#1'}}
-
-
\def\greek@set@langdata{%
\if@greek@ancient
- \xpg@ifdefined{ancientgreek}{}%
+ \IfLanguageDefinedF{ancientgreek}%
{\xpg@warning{No hyphenation patterns were loaded for Ancient Greek\MessageBreak
I will use the patterns loaded for \string\l@greek\space instead}%
\adddialect\l@ancientgreek\l@greek\relax}%
@@ -16967,7 +16928,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\SetLanguageKeys{greek}{babelname=greek,bcp47=grc,bcp47-language=grc,bcp47-variant={}}%
\else
\if@greek@poly
- \xpg@ifdefined{polygreek}{}%
+ \IfLanguageDefinedF{polygreek}%
{\xpg@warning{No hyphenation patterns were loaded for Polytonic Greek\MessageBreak
I will use the patterns loaded for \string\l@greek\space instead}%
\adddialect\l@polygreek\l@greek\relax}%
@@ -16976,7 +16937,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\dategreek{\datepolygreek}%
\SetLanguageKeys{greek}{babelname=polutonikogreek,bcp47=el-polyton,bcp47-language=el,bcp47-variant=polyton}%
\else% monotonic greek
- \xpg@ifdefined{monogreek}{}%
+ \IfLanguageDefinedF{monogreek}%
{\xpg@warning{No hyphenation patterns were loaded for Monotonic Greek\MessageBreak
I will use the patterns loaded for \string\l@greek\space instead}%
\adddialect\l@monogreek\l@greek\relax}%
@@ -16990,42 +16951,85 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\greek@language{%
- \polyglossia@setup@language@patterns{\greek@variant}%
+ \SetupPolyglossiaLangPatterns{\greek@variant}%
}
\newif\if@greek@numerals
-\define@choicekey*+{greek}{numerals}[\xpg@val\xpg@nr]{greek,arabic}[greek]{%
- \ifcase\xpg@nr\relax
- % greek:
- \@greek@numeralstrue%
- \SetLanguageKeys{greek}{bcp47-extension-u=nu-grek}%
- \or
- % arabic:
- \@greek@numeralsfalse%
- \SetLanguageKeys{greek}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Greek, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Greek numerals value `#1'}}
-
-\define@boolkey{greek}[greek@]{capitaliota}[true]{%
- \ifgreek@capitaliota
- % \MakeUppercase converts the ypogegrammeni (subscript muted iota) to capital iota
- \SetLanguageKeys{greek}{bcp47-casing=el-x-iota,bcp47-extension-x=iota}
- \else
- % \MakeUppercase retains the subscript versions (default)
- \SetLanguageKeys{greek}{bcp47-casing=el,bcp47-extension-x={}}
- \fi
-}
-
-\define@boolkey{greek}{attic}[true]{\xpg@warning{Greek option `attic' is no longer required.}}
+\DeclareKeys[polyglossia/gloss/greek]
+ {
+ variant.choices:nn = { monotonic, mono,polytonic, poly,ancient, ancientgreek }
+ {%
+ \CheckHyphenationPatterns{greek}%
+ \ifcase\UseName{l_keys_choice_int}\or
+ % monotonic:
+ \@greek@polyfalse
+ \@greek@ancientfalse
+ \or
+ % mono:
+ \@greek@polyfalse
+ \@greek@ancientfalse
+ \or
+ % polytonic:
+ \@greek@polytrue
+ \@greek@ancientfalse
+ \or
+ % poly:
+ \@greek@polytrue
+ \@greek@ancientfalse
+ \or
+ % ancient:
+ \@greek@polyfalse
+ \@greek@ancienttrue
+ \or
+ % ancientgreek:
+ \@greek@polyfalse
+ \@greek@ancienttrue
+ \fi
+ \greek@set@langdata
+ },
+ variant.default:n = monotonic,
+ variant/unknown.code = \xpg@warning{Unknown Greek variant `#1'},
+ numerals.choice:,
+ numerals / greek.code =
+ {%
+ \@greek@numeralstrue
+ \SetLanguageKeys{greek}{bcp47-extension-u=nu-grek}%
+ },
+ numerals / arabic.code =
+ {%
+ \@greek@numeralsfalse
+ \SetLanguageKeys{greek}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = greek,
+ numerals/unknown.code = \xpg@warning{Unknown Greek numerals value `#1'},
+ capitaliota.choice:,
+ capitaliota / true.code =
+ {%
+ \@greek@capitaliotatrue
+ % \MakeUppercase converts the ypogegrammeni (subscript muted iota) to capital iota
+ \SetLanguageKeys{greek}{bcp47-casing=el-x-iota,bcp47-extension-x=iota}%
+ },
+ capitaliota / false.code =
+ {%
+ \@greek@capitaliotafalse
+ % \MakeUppercase retains the subscript versions (default)
+ \SetLanguageKeys{greek}{bcp47-casing=el,bcp47-extension-x={}}%
+ },
+ capitaliota.default:n = true,
+ attic.choices:nn = { true, false }
+ {%
+ \xpg@warning{Greek option `attic' is no longer required.}
+ },
+ capitaliota.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{greek}{variant=monotonic,numerals=greek}
+\InitializeGlossOptions{greek}{variant=monotonic,numerals=greek}
% Register alias options
-\xpg@set@alias@values{greek}{variant}{monotonic}{mono}
-\xpg@set@alias@values{greek}{variant}{polytonic}{poly}
+\SetLanguageAliasValues{greek}{variant}{monotonic,mono}
+\SetLanguageAliasValues{greek}{variant}{polytonic,poly}
\def\monogreekcaptions{%
\def\refname{Αναφορές}%
@@ -17344,13 +17348,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-he.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-he.ldf}[polyglossia: module for he (Hebrew)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{hebrew}
+\InheritGlossFile{hebrew}
% \end{macrocode}
% \iffalse
@@ -17361,7 +17365,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hebrew.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hebrew.ldf}[polyglossia: module for Hebrew]
@@ -17387,41 +17391,48 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{hebrew}{he}
-% hebrewcal options
-\define@key{hebrew}{marcheshvan}[true]{\setkeys{hebrewcal}{marcheshvan=#1}}
-\define@key{hebrew}{transliteration}[alt]{\setkeys{hebrewcal}{transliteration=#1}}
-\define@key{hebrew}{fullyear}[true]{\setkeys{hebrewcal}{fullyear=#1}}
-
\newif\if@calendar@hebrew
-\define@choicekey*+{hebrew}{calendar}[\xpg@val\xpg@nr]{hebrew,gregorian}[gregorian]{%
- \ifcase\xpg@nr\relax
- % hebrew:
- \@calendar@hebrewtrue
- \or
- % gregorian:
- \@calendar@hebrewfalse
- \fi
- \xpg@info{Option: Hebrew, calendar=\xpg@val}%
-}{\xpg@warning{Unknown Hebrew calendar `#1'}}
-
\newif\if@hebrew@numerals
-\define@choicekey*+{hebrew}{numerals}[\xpg@val\xpg@nr]{hebrew,arabic}[arabic]{%
- \ifcase\xpg@nr\relax
- % hebrew:
- \@hebrew@numeralstrue
- \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-hebr}%
- \or
- % arabic:
- \@hebrew@numeralsfalse
- \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Hebrew, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Hebrew numerals value `#1'}}
-\setkeys{hebrew}{numerals}
+\DeclareKeys[polyglossia/gloss/hebrew]
+ {
+ marcheshvan.code = \setkeys{hebrewcal}{marcheshvan=#1},
+ marcheshvan.default:n = true,
+ transliteration.code = \setkeys{hebrewcal}{transliteration=#1},
+ transliteration.default:n = alt,
+ fullyear.code = \setkeys{hebrewcal}{fullyear=#1},
+ fullyear.default:n = true,
+ calendar.choice:,
+ calendar / hebrew.code =
+ {%
+ \@calendar@hebrewtrue
+ },
+ calendar / gregorian.code =
+ {%
+ \@calendar@hebrewfalse
+ },
+ calendar.default:n = gregorian,
+ calendar/unknown.code = \xpg@warning{Unknown Hebrew calendar `#1'},
+ numerals.choice:,
+ numerals / hebrew.code =
+ {%
+ \@hebrew@numeralstrue
+ \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-hebr}%
+ },
+ numerals / arabic.code =
+ {%
+ \@hebrew@numeralsfalse
+ \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Hebrew numerals value `#1'}
+ }
+
+
+\SetGlossOptions{hebrew}{numerals}
% Register default options
-\xpg@initialize@gloss@options{hebrew}{numerals=arabic,calendar=gregorian,marcheshvan=false,fullyear=false}
+\InitializeGlossOptions{hebrew}{numerals=arabic,calendar=gregorian,marcheshvan=false,fullyear=false}
\def\captionshebrew{%
\def\prefacename{מבוא}%
@@ -17535,13 +17546,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hi.ldf}[polyglossia: module for hi (Hindi)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{hindi}
+\InheritGlossFile{hindi}
% \end{macrocode}
% \iffalse
@@ -17552,7 +17563,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hindi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% UTF-8 strings kindly provided by Zdenĕk Wagner, 10-03-2008
% with corrections and additional contributions by Anshuman Pandey
@@ -17579,8 +17590,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\ifx\l@hindi\@undefined%
\ifx\l@sanskrit\@undefined%
- \xpg@nopatterns{Hindi}%
- \adddialect\l@hindi\l@nohyphenation%
+ \XPGNoPatternsFallback{hindi}%
\else
\xpg@warning{No hyphenation patterns were loaded for Hindi\MessageBreak
I will use the patterns for Sanskrit instead}
@@ -17589,26 +17599,31 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi
\def\hindi@language{%
- \polyglossia@setup@language@patterns{hindi}%
+ \SetupPolyglossiaLangPatterns{hindi}%
}
\newif\ifhindi@devanagari@numerals
\hindi@devanagari@numeralstrue
-\define@choicekey*+{hindi}{numerals}[\xpg@val\xpg@nr]{Devanagari,Western}[Devanagari]{%
- \ifcase\xpg@nr\relax
- % Devanagari:
- \hindi@devanagari@numeralstrue%
- \SetLanguageKeys{hindi}{bcp47-extension-u=nu-deva}%
- \or
- % Western:
- \hindi@devanagari@numeralsfalse%
- \SetLanguageKeys{hindi}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Hindi, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Hindi numeral `#1'}}
+
+\DeclareKeys[polyglossia/gloss/hindi]
+ {
+ numerals.choice:,
+ numerals / devanagari.code =
+ {%
+ \hindi@devanagari@numeralstrue
+ \SetLanguageKeys{hindi}{bcp47-extension-u=nu-deva}%
+ },
+ numerals / western.code =
+ {%
+ \hindi@devanagari@numeralsfalse
+ \SetLanguageKeys{hindi}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Hindi numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{hindi}{numerals=devanagari}
+\InitializeGlossOptions{hindi}{numerals=devanagari}
\newcommand{\hindinumerals}[2]{\hindinumber{#2}}
@@ -17628,6 +17643,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\contentsname{विषय सूची}%
\def\enclname{}%
\def\figurename{चित्र}% रेखाचित्र
+ \def\glossaryname{शब्दार्थ सूची}%
\def\headpagename{पृष्ठ}%
\def\headtoname{}%
\def\indexname{सूची}%
@@ -17639,6 +17655,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\pagename{पृष्ठ}%
\def\partname{खण्ड}%
\def\prefacename{प्रस्तावना}% प्राक्कथन
+ \def\proofname{प्रमाण}%
\def\refname{हवाले}%
\def\tablename{तालिका}%
\def\seename{देखिए}%
@@ -17671,13 +17688,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hr.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hr.ldf}[polyglossia: module for hr (Croatian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{croatian}
+\InheritGlossFile{croatian}
% \end{macrocode}
% \iffalse
@@ -17688,13 +17705,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hsb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hsb.ldf}[polyglossia: module for hsb (Higher Sorbian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
% \end{macrocode}
% \iffalse
@@ -17705,13 +17722,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hu.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hu.ldf}[polyglossia: module for hu (Hungarian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{hungarian}
+\InheritGlossFile{hungarian}
% \end{macrocode}
% \iffalse
@@ -17722,7 +17739,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hungarian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hungarian.ldf}[polyglossia: module for Hungarian]
@@ -17749,53 +17766,61 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@hungarian@swapcaptions
\newif\if@hungarian@swapheadings
\newif\if@hungarian@swapheaders
-\define@choicekey*+{hungarian}{swapstrings}[\xpg@val\xpg@nr]{all,captions,headings,headers,hheaders,none}[all]{%
- \ifcase\xpg@nr\relax
- % all:
- \@hungarian@swapcaptionstrue%
- \@hungarian@swapheadingstrue%
- \@hungarian@swapheaderstrue%
- \or
- % captions:
- \@hungarian@swapcaptionstrue%
- \@hungarian@swapheadingsfalse%
- \@hungarian@swapheadersfalse%
- \or
- % headings:
- \@hungarian@swapcaptionsfalse%
- \@hungarian@swapheadingstrue%
- \@hungarian@swapheadersfalse%
- \or
- % headers:
- \@hungarian@swapcaptionsfalse%
- \@hungarian@swapheadingsfalse%
- \@hungarian@swapheaderstrue%
- \or
- % hheaders:
- \@hungarian@swapcaptionsfalse%
- \@hungarian@swapheadingstrue%
- \@hungarian@swapheaderstrue%
- \or
- % none:
- \@hungarian@swapcaptionsfalse%
- \@hungarian@swapheadingsfalse%
- \@hungarian@swapheadersfalse%
- \fi
- \xpg@info{Option: Hungarian, swapstrings=\xpg@val}%
-}{\xpg@warning{Unknown Hungarian swapstrings value `#1'}}
-% Force punctuation: 1) after section type counters; 2) after @chapapp in the running head
-\define@boolkey{hungarian}[hungarian@]{forceheadingpunctuation}[true]{}
+\DeclareKeys[polyglossia/gloss/hungarian]
+ {
+ forceheadingpunctuation.if = hungarian@forceheadingpunctuation,
+ forceheadingpunctuation.default:n = true,
+ swapstrings.choice:,
+ swapstrings / all.code =
+ {%
+ \@hungarian@swapcaptionstrue
+ \@hungarian@swapheadingstrue
+ \@hungarian@swapheaderstrue
+ },
+ swapstrings / captions.code =
+ {%
+ \@hungarian@swapcaptionstrue
+ \@hungarian@swapheadingsfalse
+ \@hungarian@swapheadersfalse
+ },
+ swapstrings / headings.code =
+ {%
+ \@hungarian@swapcaptionsfalse
+ \@hungarian@swapheadingstrue
+ \@hungarian@swapheadersfalse
+ },
+ swapstrings / headers.code =
+ {%
+ \@hungarian@swapcaptionsfalse
+ \@hungarian@swapheadingsfalse
+ \@hungarian@swapheaderstrue
+ },
+ swapstrings / hheaders.code =
+ {%
+ \@hungarian@swapcaptionsfalse
+ \@hungarian@swapheadingstrue
+ \@hungarian@swapheaderstrue
+ },
+ swapstrings / none.code =
+ {%
+ \@hungarian@swapcaptionsfalse
+ \@hungarian@swapheadingsfalse
+ \@hungarian@swapheadersfalse
+ },
+ swapstrings.default:n = all,
+ swapstrings/unknown.code = \xpg@warning{Unknown Hungarian swapstrings value `#1'}
+ }
% Register default options
% forceheadinpunctuatin is recommended, but the default value is false for compatibility reasons
-\xpg@initialize@gloss@options{hungarian}{swapstrings=all,
+\InitializeGlossOptions{hungarian}{swapstrings=all,
forceheadingpunctuation=false}
\def\hungarian@language{%
- \polyglossia@setup@language@patterns{hungarian}%
- \xpg@ifdefined{hungarian}{\adddialect\l@magyar\l@hungarian}{}%
+ \SetupPolyglossiaLangPatterns{hungarian}%
+ \IfLanguageDefinedT{hungarian}{\adddialect\l@magyar\l@hungarian}%
}%
\def\captionshungarian{%
@@ -17867,120 +17892,104 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% change chapter and part headings
\if@hungarian@swapheadings
% With titlesec
- \ifcsdef{titleformat}{%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }{}%
- }
- \ifcsdef{chapter}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
- {\thechapter.\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }{}%
- }{% (not \ifdefined\titleformat)
+ \@ifundefined{titleformat}{%
% With KOMA
- \ifcsdef{sectionformat}{%
- \ifcsdef{partformat}{%
- \let\xpg@save@part@format\partformat%
- \renewcommand{\partformat}{\thepart.~\partname}%
- }{}%
- \ifcsdef{chapterformat}{%
- \let\xpg@save@chap@format\chapterformat%
- \renewcommand{\chapterformat}{\mbox{\thechapter\autodot%
- \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
- }{}%
- }{% (not \ifdefined\sectionformat)
- % With memoir
- \ifcsdef{@memptsize}{%
- \ifcsdef{@makechapterhead}{%
- \let\xpg@save@chap@format\@makechapterhead%
- \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
- {\printchapternum.\chapternamenum\printchaptername}%
- {}%
- {\xpg@warning{Failed to patch chapter for Hungarian}}%
- }{}%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
- {\printpartnum.\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
- {\printpartnum.\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }{}%
- }%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{sectionformat}{%
+ % Memoir?
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{@makechapterhead}{%
+ \@ifundefined{@makechapterhead}{}{%
\let\xpg@save@chap@format\@makechapterhead%
\patchcmd{\@makechapterhead}%
{\@chapapp\space \thechapter}%
{\thechapter.\space \@chapapp}%
{}%
{\xpg@warning{Failed to patch chapter for Hungarian}}%
- }{}%
- \ifcsdef{NR@part}{% Hyperref (nameref)
+ }%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\thepart.\nobreakspace\partname}%
+ {}%
+ {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Hungarian}}}%
+ }% (end \ifdefined\@part)
+ }{% Hyperref (nameref)
\let\xpg@save@part@format\NR@part%
\patchcmd{\NR@part}%
{\partname\nobreakspace\thepart}%
{\thepart.\nobreakspace\partname}%
{}%
{\xpg@warning{Failed to patch part for Hungarian}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\ifcsdef{part}{\xpg@warning{Failed to patch part for Hungarian}}{}}%
- }{}% (end \ifdefined\@part)
}% (end not hyperref)
- }% (end \ifdefined\@memptsize)
- }% (end \ifdefined\sectionformat)
+ }{% with memoir (\ifdefined\@memptsize)
+ \@ifundefined{@makechapterhead}{}{%
+ \let\xpg@save@chap@format\@makechapterhead%
+ \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
+ {\printchapternum.\chapternamenum\printchaptername}%
+ {}%
+ {\xpg@warning{Failed to patch chapter for Hungarian}}%
+ }%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
+ {\printpartnum.\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Hungarian}}%
+ }%
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part%
+ \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
+ {\printpartnum.\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Hungarian}}%
+ }%
+ }% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\sectionformat)
+ \@ifundefined{partformat}{}{%
+ \let\xpg@save@part@format\partformat%
+ \renewcommand{\partformat}{\thepart.~\partname}%
+ }%
+ \@ifundefined{chapterformat}{}{%
+ \let\xpg@save@chap@format\chapterformat%
+ \renewcommand{\chapterformat}{\mbox{\thechapter\autodot%
+ \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\thepart.\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Hungarian}}%
+ }%
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part%
+ \patchcmd{\NR@part}%
+ {\partname\nobreakspace\thepart}%
+ {\thepart.\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Hungarian}}%
+ }%
+ \@ifundefined{chapter}{}{%
+ \titleformat\chapter[display]%
+ {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
+ {\thechapter.\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
+ }%
}% (end \ifdefined\titleformat)
\fi% (end \if@hungarian@swapheadings)
%
% Change running headers
\if@hungarian@swapheaders
- \ifcsdef{chapterformat}{%
- % With KOMA
- \let\xpg@save@chaptermark@format\chaptermarkformat%
- \renewcommand*\chaptermarkformat{%
- \thechapter\autodot\ \IfChapterUsesPrefixLine{\chapapp\@hungarian@forced@dot\enskip}{}}
- }{% (not \ifdefined\chapterformat)
- \ifcsdef{@memptsize}{%
- % With memoir
- \let\xpg@save@chaptermark@format\chaptermark%
- \renewcommand*\chaptermark[1]{%
- \markboth{\memUChead{%
- \ifnum \c@secnumdepth >\m@ne
- \ifbool{@mainmatter}{%
- \thechapter.\ \@chapapp\@hungarian@forced@dot\ %
- }{}%
- \fi
- ##1}}{}}%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{chapterformat}{%
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermark}{}{%
\ifpatchable{\chaptermark}%
{\@chapapp\ \thechapter.}%
{\let\xpg@save@chaptermark@format\chaptermark%
@@ -17990,8 +17999,24 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{}%
{\xpg@warning{Failed to patch chaptermark for Hungarian}}}%
{}%
- }{}% (end \ifdefined\chaptermark)
+ }% (end \ifdefined\chaptermark)
+ }{% (\ifdefined\@memptsize)
+ % With memoir
+ \let\xpg@save@chaptermark@format\chaptermark%
+ \renewcommand*\chaptermark[1]{%
+ \markboth{\memUChead{%
+ \ifnum \c@secnumdepth >\m@ne
+ \ifbool{@mainmatter}{%
+ \thechapter.\ \@chapapp\@hungarian@forced@dot\ %
+ }{}%
+ \fi
+ ##1}}{}}%
}% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\chapterformat)
+ % With KOMA
+ \let\xpg@save@chaptermark@format\chaptermarkformat%
+ \renewcommand*\chaptermarkformat{%
+ \thechapter\autodot\ \IfChapterUsesPrefixLine{\chapapp\@hungarian@forced@dot\enskip}{}}
}% (end \ifdefined\chapterformat)
\fi% (end \if@hungarian@swapheaders)
}
@@ -18003,58 +18028,58 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\fnum@figure\xpg@save@fnum@figure%
%
% Reset chapter and part heading
- \ifcsdef{titleformat}{%
+ \@ifundefined{titleformat}{%
+ \@ifundefined{sectionformat}{%
+ % With memoir and standard classes
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
+ \let\@part\xpg@save@part@format%
+ }{%
+ \let\NR@part\xpg@save@part@format%
+ }%
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\@makechapterhead\xpg@save@chap@format
+ }%
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@part@format}{}{%
+ \let\partformat\xpg@save@part@format
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\chapterformat\xpg@save@chap@format
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
% With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format%
- }{%
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
\let\@part\xpg@save@part@format%
+ }{%
+ \let\NR@part\xpg@save@part@format%
}%
- }{}%
- \ifcsdef{chapter}{%
+ }%
+ \@ifundefined{chapter}{}{%
\titleformat\chapter[display]%
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
{\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }{}%
- }{% (not \ifdefined\titleformat)
- \ifcsdef{sectionformat}{%
- % With KOMA
- \ifcsdef{xpg@save@part@format}{%
- \let\partformat\xpg@save@part@format
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\chapterformat\xpg@save@chap@format
- }{}%
- }{%
- % With memoir and standard classes
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format%
- }{%
- \let\@part\xpg@save@part@format%
- }%
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\@makechapterhead\xpg@save@chap@format
- }{}%
- }% (end \ifdefined\sectionformat)
+ }%
}% (end \ifdefined\titleformat)
%
% Reset headers
- \ifcsdef{chaptermarkformat}{%
- % With KOMA
- \ifcsdef{xpg@save@chaptermark@format}{%
- \let\chaptermarkformat\xpg@save@chaptermark@format%
- }{}%
- }{%
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermarkformat}{%
+ \@ifundefined{chaptermark}{}{%
% With memoir and standard classes
- \ifcsdef{xpg@save@chaptermark@format}{%
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
\let\chaptermark\xpg@save@chaptermark@format%
- }{}%
- }{}% (end \ifdefined\chaptermark)
- }% (end \ifdefined\chapterformat)
+ }%
+ }% (end \ifdefined\chaptermark)
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
+ \let\chaptermarkformat\xpg@save@chaptermark@format%
+ }%
+ }% (end \ifdefined\chaptermarkformat)
}
% Hungarian needs 1) trailing dots in chapter headings; 2) trailing dot in section, subsection, etc, counters
\def\@hungarian@forced@dot{}
@@ -18121,13 +18146,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-hy.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hy.ldf}[polyglossia: module for hy (Armenian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{armenian}
+\InheritGlossFile{armenian}
% \end{macrocode}
% \iffalse
@@ -18138,13 +18163,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ia.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ia.ldf}[polyglossia: module for ia (Interlingua)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{interlingua}
+\InheritGlossFile{interlingua}
% \end{macrocode}
% \iffalse
@@ -18155,7 +18180,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-icelandic.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-icelandic.ldf}[polyglossia: module for Icelandic]
\PolyglossiaSetup{icelandic}{
@@ -18213,13 +18238,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-id.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-id.ldf}[polyglossia: module for id (Malay)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{malay}
+\InheritGlossFile{malay}
% \end{macrocode}
% \iffalse
@@ -18230,7 +18255,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-interlingua.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-interlingua.ldf}[polyglossia: module for Interlingua]
\PolyglossiaSetup{interlingua}{
@@ -18288,14 +18313,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-irish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-irish.ldf}[polyglossia: module for Irish]
% We only provide this gloss for babel compatibility. Since irish is
% a gaelic variety, we use 'gaelic' with variant 'irish' now.
-\xpg@load@master@language{gaelic}
+\InheritGlossFile{gaelic}
% \end{macrocode}
% \iffalse
@@ -18306,13 +18331,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-is.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-is.ldf}[polyglossia: module for is (Icelandic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{icelandic}
+\InheritGlossFile{icelandic}
% \end{macrocode}
% \iffalse
@@ -18323,13 +18348,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-it.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-it.ldf}[polyglossia: module for it (Italian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{italian}
+\InheritGlossFile{italian}
% \end{macrocode}
% \iffalse
@@ -18341,7 +18366,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \subsection{gloss-italian.ldf}
% \begin{macrocode}
% !TEX encoding = UTF-8 Unicode
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-italian.ldf}[polyglossia: module for Italian]
\PolyglossiaSetup{italian}{
@@ -18360,24 +18385,22 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{italian}{it}
-
-%%% CHANGES START %%% by Enrico Gregorio
-\define@boolkey{italian}[italian@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/italian]
+ {
+ babelshorthands.if = italian@babelshorthands,
+ babelshorthands.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{italian}{babelshorthands=false}
+\InitializeGlossOptions{italian}{babelshorthands=false}
\ifsystem@babelshorthands
- \setkeys{italian}{babelshorthands=true}
+ \SetGlossOptions{italian}{babelshorthands=true}
\else
- \setkeys{italian}{babelshorthands=false}
+ \SetGlossOptions{italian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\italian@shorthands{%
\xpg@activate@shorthands%
@@ -18457,7 +18480,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%%% CHANGES START %%% by Enrico Gregorio
\let\xpgit@savedvalues\empty
-\AtEndPreamble{% the user or the class might define different values
+\AddToHook{begindocument/before}{% the user or the class might define different values
\edef\xpgit@savedvalues{%
\clubpenalty=\the\clubpenalty\space
\@clubpenalty=\the\@clubpenalty\space
@@ -18493,13 +18516,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ja.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ja.ldf}[polyglossia: module for ja (Japanese)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{japanese}
+\InheritGlossFile{japanese}
% \end{macrocode}
% \iffalse
@@ -18510,7 +18533,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-japanese.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-japanese.ldf}[polyglossia: module for Japanese]
@@ -18749,13 +18772,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ka.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ka.ldf}[polyglossia: module for ka (Georgian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{georgian}
+\InheritGlossFile{georgian}
% \end{macrocode}
% \iffalse
@@ -18767,7 +18790,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \subsection{gloss-kannada.ldf}
% \begin{macrocode}
%% gloss-kannada.ldf
-%% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+%% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%%
%% Copyright 2011 Aravinda VK <hallimanearavind AT gmail.com>,
%% Shankar Prasad <prasad.mvs AT gmail.com>,
@@ -18821,12 +18844,20 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\tmp@western{Western}
\newif\ifkannada@numerals
\kannada@numeralstrue
-
-\define@key{kannada}{numerals}[Kannada]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@western
- \kannada@numeralsfalse
- \fi}
+
+\DeclareKeys[polyglossia/gloss/kannada]
+ {
+ numerals.choice:,
+ numerals / kannada.code =
+ {%
+ \kannada@numeralstrue
+ },
+ numerals / western.code =
+ {%
+ \kannada@numeralsfalse
+ },
+ numerals.default:n = kannada
+ }
\def\captionskannada{%
@@ -18890,7 +18921,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-khmer.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-khmer.ldf}[polyglossia: module for Khmer]
\PolyglossiaSetup{khmer}{
@@ -18911,18 +18942,24 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@khmer@numerals
\def\tmp@khmer{khmer}
-\define@key{khmer}{numerals}[arabic]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@khmer%
- \@khmer@numeralstrue%
- \SetLanguageKeys{khmer}{bcp47-extension-u=nu-khmr}%
- \else%
- \@khmer@numeralsfalse%
- \SetLanguageKeys{khmer}{bcp47-extension-u=nu-latn}%
- \fi%
-}
-\setkeys{khmer}{numerals}
+\DeclareKeys[polyglossia/gloss/khmer]
+ {
+ numerals.choice:,
+ numerals / khmer.code =
+ {%
+ \@khmer@numeralstrue
+ \SetLanguageKeys{khmer}{bcp47-extension-u=nu-khmr}%
+ },
+ numerals / arabic.code =
+ {%
+ \@khmer@numeralsfalse
+ \SetLanguageKeys{khmer}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = arabic
+ }
+
+\SetGlossOptions{khmer}{numerals}
\def\captionskhmer{%
\def\prefacename{អារម្ភកថា}%
@@ -19073,13 +19110,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-km.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-km.ldf}[polyglossia: module for km (Khmer)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{khmer}
+\InheritGlossFile{khmer}
% \end{macrocode}
% \iffalse
@@ -19090,13 +19127,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-kmr-Arab.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kmr-Arab.ldf}[polyglossia: module for kmr-Arab (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -19107,13 +19144,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-kmr-Latn.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kmr-Latn.ldf}[polyglossia: module for kmr-Latn (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -19124,13 +19161,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-kmr.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kmr.ldf}[polyglossia: module for kmr (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -19141,13 +19178,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-kn.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kn.ldf}[polyglossia: module for kn (Kannada)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kannada}
+\InheritGlossFile{kannada}
% \end{macrocode}
% \iffalse
@@ -19158,13 +19195,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ko.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ko.ldf}[polyglossia: module for ko (Korean)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{korean}
+\InheritGlossFile{korean}
% \end{macrocode}
% \iffalse
@@ -19175,7 +19212,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-korean.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-korean.ldf}[polyglossia: module for Korean]
@@ -19195,40 +19232,48 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{korean}{ko}
-% variant : plain (0), classic (1), or modern (2)
-\define@choicekey{korean}{variant}[\xpg@val\xpg@nr]{plain,classic,modern}[plain]{%
- \let\xpg@korean@variant\xpg@nr
-}
-% captions : hangul (0) or hanja (1)
-\define@choicekey{korean}{captions}[\xpg@val\xpg@nr]{hangul,hanja}[hangul]{%
- \let\xpg@korean@captions\xpg@nr
-}
-% swapstrings: all (0), headings (1), headers (2), or none (3)
\newif\if@korean@swapheadings
\newif\if@korean@swapheaders
-\define@choicekey*+{korean}{swapstrings}[\xpg@val\xpg@nr]{all,headings,headers,none}[all]{%
- \ifcase\xpg@nr\relax
- % all:
- \@korean@swapheadingstrue%
- \@korean@swapheaderstrue%
- \or
- % headings:
- \@korean@swapheadingstrue%
- \@korean@swapheadersfalse%
- \or
- % headers:
- \@korean@swapheadingsfalse%
- \@korean@swapheaderstrue%
- \or
- % none:
- \@korean@swapheadingsfalse%
- \@korean@swapheadersfalse%
- \fi
- \xpg@info{Option: Korean, swapstrings=\xpg@val}%
-}{\xpg@warning{Unknown Korean swapstrings value `#1'}}
+
+\DeclareKeys[polyglossia/gloss/korean]
+ {
+ variant.choices:nn = { plain, classic, modern }
+ {%
+ \edef\xpg@korean@variant{\the\numexpr\UseName{l_keys_choice_int}-1\relax}
+ },
+ variant.default:n = plain,
+ captions.choices:nn = { hangul, hanja }
+ {%
+ \edef\xpg@korean@captions{\the\numexpr\UseName{l_keys_choice_int}-1\relax}
+ },
+ captions.default:n = hangul,
+ swapstrings.choice:,
+ swapstrings / all.code =
+ {%
+ \@korean@swapheadingstrue
+ \@korean@swapheaderstrue
+ },
+ swapstrings / headings.code =
+ {%
+ \@korean@swapheadingstrue
+ \@korean@swapheadersfalse
+ },
+ swapstrings / headers.code =
+ {%
+ \@korean@swapheadingsfalse
+ \@korean@swapheaderstrue
+ },
+ swapstrings / none.code =
+ {%
+ \@korean@swapheadingsfalse
+ \@korean@swapheadersfalse
+ },
+ swapstrings.default:n = all,
+ swapstrings/unknown.code = \xpg@warning{Unknown Korean swapstrings value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{korean}{variant=plain,swapstrings=all,captions=hangul}
+\InitializeGlossOptions{korean}{variant=plain,swapstrings=all,captions=hangul}
\def\captionskorean{%
\ifcase\xpg@korean@captions\relax
@@ -19290,60 +19335,48 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% change chapter and part headings
\if@korean@swapheadings
% With titlesec
- \ifcsdef{titleformat}{%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
- {}%
- {\xpg@warning{Failed to patch part for Korean}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part
- \patchcmd{\@part}%
+ \@ifundefined{titleformat}{%
+ % With KOMA
+ \@ifundefined{sectionformat}{%
+ % With memoir
+ \@ifundefined{@memptsize}{%
+ % With standard classes
+ \@ifundefined{@makechapterhead}{}{%
+ \let\xpg@save@chap@format\@makechapterhead
+ \patchcmd{\@makechapterhead}%
+ {\@chapapp\space \thechapter}%
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \appendixname\space \thechapter
+ \else
+ \koreanTHEname\space \thechapter\space \@chapapp
+ \fi
+ }%
+ {}%
+ {\xpg@warning{Failed to patch chapter for Korean}}%
+ }%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \ifpatchable{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\let\xpg@save@part@format\@part
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {}%
+ {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Korean}}}}%
+ {}%
+ }% (end \ifdefined\@part)
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part
+ \patchcmd{\NR@part}%
{\partname\nobreakspace\thepart}%
{\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
{}%
{\xpg@warning{Failed to patch part for Korean}}%
- }{}%
- }
- \ifcsdef{chapter}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\space \thechapter
- \else
- \koreanTHEname\space \thechapter\space \@chapapp
- \fi
- }{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
- }{}%
- }{% (not \ifdefined\titleformat)
- % With KOMA
- \ifcsdef{sectionformat}{%
- \ifcsdef{partformat}{%
- \let\xpg@save@part@format\partformat
- \renewcommand*{\partformat}{\koreanTHEname~\thepart~\partname}%
- }{}%
- \ifcsdef{chapterformat}{%
- \let\xpg@save@chap@format\chapterformat
- \renewcommand*{\chapterformat}{\mbox{%
- \IfChapterUsesPrefixLine
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \chapapp\nobreakspace \thechapter\autodot
- \else
- \koreanTHEname\nobreakspace \thechapter\nobreakspace \chapapp\autodot
- \fi
- }%
- {\thechapter\autodot\enskip}%
- }}%
- }{}%
- }{% (not \ifdefined\sectionformat)
- % With memoir
- \ifcsdef{@memptsize}{%
- \ifcsdef{@makechapterhead}{%
+ }% (end not hyperref)
+ }{% (\ifdefined\@memptsize)
+ \@ifundefined{@makechapterhead}{}{%
\let\xpg@save@chap@format\@makechapterhead
\patchcmd{\@makechapterhead}%
{\printchaptername \chapternamenum \printchapternum}%
@@ -19361,19 +19394,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\ifpatchable\printchaptername\@chapapp
{\chapnamefont\koreanTHEname\chapternamenum}{}}%
\fi
- }{}%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part
- \patchcmd{\NR@part}%
- {\printpartname \partnamenum \printpartnum}%
- {\printkoreanpartthe \printpartnum\partnamenum \printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Korean}}%
- \ifdefined\printkoreanpartthe\else
- \def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}%
- \fi
- }{% not hyperref
- \ifcsdef{@part}{%
+ }%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
\let\xpg@save@part@format\@part
\patchcmd{\@part}%
{\printpartname \partnamenum \printpartnum}%
@@ -19383,84 +19406,77 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\ifdefined\printkoreanpartthe\else
\def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}%
\fi
- }{}%
- }%
- }{% (not \ifdefined\@memptsize)
- % With standard classes
- \ifcsdef{@makechapterhead}{%
- \let\xpg@save@chap@format\@makechapterhead
- \patchcmd{\@makechapterhead}%
- {\@chapapp\space \thechapter}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\space \thechapter
- \else
- \koreanTHEname\space \thechapter\space \@chapapp
- \fi
- }%
- {}%
- {\xpg@warning{Failed to patch chapter for Korean}}%
- }{}%
- \ifcsdef{NR@part}{% Hyperref (nameref)
+ }%
+ }{% Hyperref (nameref)
\let\xpg@save@part@format\NR@part
\patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {\printpartname \partnamenum \printpartnum}%
+ {\printkoreanpartthe \printpartnum\partnamenum \printpartname}%
{}%
{\xpg@warning{Failed to patch part for Korean}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \ifpatchable{\@part}%
- {\partname\nobreakspace\thepart}%
- {\let\xpg@save@part@format\@part
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
- {}%
- {\ifcsdef{part}{\xpg@warning{Failed to patch part for Korean}}{}}}%
- {}%
- }{}% (end \ifdefined\@part)
- }% (end not hyperref)
+ \ifdefined\printkoreanpartthe\else
+ \def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}%
+ \fi
+ }%
}% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\sectionformat)
+ \@ifundefined{partformat}{}{%
+ \let\xpg@save@part@format\partformat
+ \renewcommand*{\partformat}{\koreanTHEname~\thepart~\partname}%
+ }%
+ \@ifundefined{chapterformat}{}{%
+ \let\xpg@save@chap@format\chapterformat
+ \renewcommand*{\chapterformat}{\mbox{%
+ \IfChapterUsesPrefixLine
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \chapapp\nobreakspace \thechapter\autodot
+ \else
+ \koreanTHEname\nobreakspace \thechapter\nobreakspace \chapapp\autodot
+ \fi
+ }%
+ {\thechapter\autodot\enskip}%
+ }}%
+ }%
}% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Korean}}%
+ }%
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part
+ \patchcmd{\NR@part}%
+ {\partname\nobreakspace\thepart}%
+ {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Korean}}%
+ }%
+ \@ifundefined{chapter}{}{%
+ \titleformat\chapter[display]%
+ {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \appendixname\space \thechapter
+ \else
+ \koreanTHEname\space \thechapter\space \@chapapp
+ \fi
+ }{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
+ }%
}% (end \ifdefined\titleformat)
\fi % (end \if@korean@swapheadings)
%
% Change running headers
\if@korean@swapheaders
- \ifcsdef{chapterformat}{%
- % With KOMA
- \let\xpg@save@chaptermark@format\chaptermarkformat
- \renewcommand*\chaptermarkformat{%
- \IfChapterUsesPrefixLine
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \chapapp\ \thechapter\autodot
- \else
- \koreanTHEname\ \thechapter\ \chapapp\autodot
- \fi
- }%
- {\thechapter\autodot}%
- \enskip
- }%
- }{% (not \ifdefined\chapterformat)
- \ifcsdef{@memptsize}{%
- % With memoir
- \let\xpg@save@chaptermark@format\chaptermark
- \patchcmd{\chaptermark}%
- {\@chapapp\ \@nameuse{thechapter}}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\ \@nameuse{thechapter}%
- \else
- \koreanTHEname\ \@nameuse{thechapter}\ \@chapapp
- \fi
- }%
- {}%
- {\xpg@warning{Failed to patch chaptermark for Korean}}%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{chapterformat}{%
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermark}{}{%
\ifpatchable{\chaptermark}%
{\@chapapp\ \thechapter}%
{\let\xpg@save@chaptermark@format\chaptermark
@@ -19476,65 +19492,94 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{}%
{\xpg@warning{Failed to patch chaptermark for Korean}}}%
{}%
- }{}% (end \ifdefined\chaptermark)
+ }% (end \ifdefined\chaptermark)
+ }{% (\ifdefined\@memptsize)
+ % With memoir
+ \let\xpg@save@chaptermark@format\chaptermark
+ \patchcmd{\chaptermark}%
+ {\@chapapp\ \@nameuse{thechapter}}%
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \appendixname\ \@nameuse{thechapter}%
+ \else
+ \koreanTHEname\ \@nameuse{thechapter}\ \@chapapp
+ \fi
+ }%
+ {}%
+ {\xpg@warning{Failed to patch chaptermark for Korean}}%
}% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\chapterformat)
+ % With KOMA
+ \let\xpg@save@chaptermark@format\chaptermarkformat
+ \renewcommand*\chaptermarkformat{%
+ \IfChapterUsesPrefixLine
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \chapapp\ \thechapter\autodot
+ \else
+ \koreanTHEname\ \thechapter\ \chapapp\autodot
+ \fi
+ }%
+ {\thechapter\autodot}%
+ \enskip
+ }%
}% (end \ifdefined\chapterformat)
\fi % (end \if@korean@swapheaders)
}
\def\nokorean@headingsformat{%
% Reset chapter and part heading
- \ifcsdef{titleformat}{%
+ \@ifundefined{titleformat}{%
+ \@ifundefined{sectionformat}{%
+ % With memoir and standard classes
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
+ \let\@part\xpg@save@part@format
+ }{%
+ \let\NR@part\xpg@save@part@format
+ }%
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\@makechapterhead\xpg@save@chap@format
+ }%
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@part@format}{}{%
+ \let\partformat\xpg@save@part@format
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\chapterformat\xpg@save@chap@format
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
% With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format
- }{%
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
\let\@part\xpg@save@part@format
+ }{%
+ \let\NR@part\xpg@save@part@format
}%
- }{}%
- \ifcsdef{chapter}{%
+ }%
+ \@ifundefined{chapter}{}{%
\titleformat\chapter[display]%
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
{\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
- }{}%
- }{% (not \ifdefined\titleformat)
- \ifcsdef{sectionformat}{%
- % With KOMA
- \ifcsdef{xpg@save@part@format}{%
- \let\partformat\xpg@save@part@format
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\chapterformat\xpg@save@chap@format
- }{}%
- }{%
- % With memoir and standard classes
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format
- }{%
- \let\@part\xpg@save@part@format
- }%
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\@makechapterhead\xpg@save@chap@format
- }{}%
- }% (end \ifdefined\sectionformat)
+ }%
}% (end \ifdefined\titleformat)
%
% Reset headers
- \ifcsdef{chaptermarkformat}{%
- % With KOMA
- \ifcsdef{xpg@save@chaptermark@format}{%
- \let\chaptermarkformat\xpg@save@chaptermark@format
- }{}%
- }{%
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermarkformat}{%
+ \@ifundefined{chaptermark}{}{%
% With memoir and standard classes
- \ifcsdef{xpg@save@chaptermark@format}{%
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
\let\chaptermark\xpg@save@chaptermark@format
- }{}%
- }{}% (end \ifdefined\chaptermark)
+ }%
+ }% (end \ifdefined\chaptermark)
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
+ \let\chaptermarkformat\xpg@save@chaptermark@format
+ }%
}% (end \ifdefined\chapterformat)
}
@@ -19598,13 +19643,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\XeTeXinterchartokenstate\z@
\XeTeXlinebreakpenalty\z@
\XeTeXlinebreakskip\z@skip
- \XeTeXlinebreaklocale "en"
+ \XeTeXlinebreaklocale ""
\noextras@korean@common
}
\else % luatex
- \def\inlineextras@korean{\xpg@attr@korean\xpg@korean@variant\relax}
+ \def\inlineextras@korean{\xpg@attr@cjkspacing\xpg@korean@variant\relax}
\def\noextras@korean{%
- \unsetattribute\xpg@attr@korean
+ \unsetattribute\xpg@attr@cjkspacing
\noextras@korean@common
}
\fi
@@ -19624,7 +19669,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\newattribute\newluatexattribute
\let\unsetattribute\unsetluatexattribute
\fi
-\newattribute\xpg@attr@korean
+\newattribute\xpg@attr@cjkspacing
\newattribute\xpg@attr@autojosa
% user commands for Josa
% Josa : particles in Korean grammar that immediately follow a noun or pronoun.
@@ -19645,7 +19690,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\protected\def\로{\으 로}
\def\xpg@reset@josa {\global\let\xpg@josa@zwang\z@}\xpg@reset@josa
% load lua file for korean
-\directlua{ require "polyglossia-korean" }
+\directlua{ require "polyglossia-cjk-spacing" }
% \end{macrocode}
% \iffalse
%</gloss-korean.ldf>
@@ -19655,13 +19700,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ku-Arab.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ku-Arab.ldf}[polyglossia: module for ku-Arab (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -19672,13 +19717,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ku-Latn.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ku-Latn.ldf}[polyglossia: module for ku-Latn (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -19689,13 +19734,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ku.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ku.ldf}[polyglossia: module for ku (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -19706,7 +19751,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-kurdish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Created on September 1, 2019
% Last updated on May 17, 2020
@@ -19749,36 +19794,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@kurdish@kurmanji
\def\kurdish@variant{sorani}
-\define@choicekey*+{kurdish}{variant}[\xpg@val\xpg@nr]{sorani,kurmanji}[sorani]{%
- \ifcase\xpg@nr\relax
- % sorani:
- \def\kurdish@variant{sorani}%
- \@kurdish@kurmanjifalse%
- \or
- % kurmanji:
- \def\kurdish@variant{kurmanji}%
- \@kurdish@kurmanjitrue%
- \fi
- \kurdish@set@variety%
- \xpg@info{Option: kurdish, variant=\xpg@val}%
-}{\xpg@warning{Unknown Kurdish variant `#1'}}
\newif\if@kurdish@latin
\newif\if@kurdish@arabic
-\define@choicekey*+{kurdish}{script}[\xpg@val\xpg@nr]{arabic,latin}{%
- \ifcase\xpg@nr\relax
- % arabic:
- \@kurdish@latinfalse%
- \@kurdish@arabictrue%
- \or
- % latin:
- \@kurdish@latintrue%
- \@kurdish@arabicfalse%
- \fi
- \kurdish@set@variety%
- \xpg@info{Option: kurdish, script=\xpg@val}%
-}{\xpg@warning{Unknown Kurdish script `#1'}}
-
\newif\if@western@numerals
\newif\if@force@western@numerals
@@ -19795,7 +19813,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\SetLanguageKeys{kurdish}{script=Latin,direction=LR,scripttag=latn,babelname=kurdish,bcp47=ckb-Arab,bcp47-language=ckb,bcp47-script=Arab,bcp47-casing=ckb-Arab}%
\fi
\def\kurdish@script{latin}
- \xpg@fontsetup@latin{kurdish}%
+ \SetupLatinPolyglossiaFont{kurdish}%
\else
\if@kurdish@arabic% arabic explicitly set
\if@kurdish@kurmanji
@@ -19805,61 +19823,84 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\else
\SetLanguageKeys{kurdish}{script=Arabic,direction=RL,scripttag=arab,babelname=kurdish,bcp47=ckb-Arab,bcp47-language=ckb,bcp47-script=Arab,bcp47-casing=ckb-Arab}%
\fi
- \xpg@fontsetup@nonlatin{kurdish}%
+ \SetupNonLatinPolyglossiaFont{kurdish}%
\else% sorani=arabic, kurmanji=latin
\if@kurdish@kurmanji
\@western@numeralstrue%
\SetLanguageKeys{kurdish}{script=Latin,direction=LR,scripttag=latn,babelname=kurmanji,bcp47=kmr-Latn,bcp47-language=kmr,bcp47-script=Latn,bcp47-casing=kmr-Latn}%
- \xpg@fontsetup@latin{kurdish}%
+ \SetupLatinPolyglossiaFont{kurdish}%
\def\kurdish@script{latin}
\else
\SetLanguageKeys{kurdish}{script=Arabic,direction=RL,scripttag=arab,babelname=kurdish,bcp47=ckb-Arab,bcp47-language=ckb,bcp47-script=Arab,bcp47-casing=ckb-Arab}%
- \xpg@fontsetup@nonlatin{kurdish}%
+ \SetupNonLatinPolyglossiaFont{kurdish}%
\fi
\fi
\fi
}
\newif\if@western@numerals
-\define@choicekey*+{kurdish}{numerals}[\xpg@val\xpg@nr]{eastern,western}[eastern]{%
- \ifcase\xpg@nr\relax
- % eastern:
- \@western@numeralsfalse%
- \or
- % western:
- \@western@numeralstrue%
- \@force@western@numeralstrue%
- \fi
- \xpg@info{Option: Kurdish, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Kurdish numerals option `#1'}}
\newif\ifkurdish@customsep\kurdish@customsepfalse
\def\xpg@sepmark{}
-\define@key{kurdish}{sectionsep}[.]{%
- \kurdish@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
-
-%this is needed for \abjad in arabicnumbers.sty
-\define@boolkey{kurdish}[kurdish@]{abjadjimnotail}[true]{%
- \ifkurdish@abjadjimnotail
- \abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi%
-}
-
-% NOT YET USED
-\define@key{kurdish}{locale}[default]{%
- \def\@kurdish@locale{#1}}
%TODO add option for CALENDAR
+\DeclareKeys[polyglossia/gloss/kurdish]
+ {
+ variant.choice:,
+ variant / sorani.code =
+ {%
+ \def\kurdish@variant{sorani}%
+ \@kurdish@kurmanjifalse
+ \kurdish@set@variety
+ },
+ variant / kurmanji.code =
+ {%
+ \def\kurdish@variant{kurmanji}%
+ \@kurdish@kurmanjitrue
+ \kurdish@set@variety
+ },
+ variant.default:n = sorani,
+ variant/unknown.code = \xpg@warning{Unknown Kurdish variant `#1'},
+ script.choice:,
+ script / arabic.code =
+ {%
+ \@kurdish@latinfalse
+ \@kurdish@arabictrue
+ \kurdish@set@variety
+ },
+ script / latin.code =
+ {%
+ \@kurdish@latintrue
+ \@kurdish@arabicfalse
+ \kurdish@set@variety
+ },
+ script.default:n = sorani,
+ script/unknown.code = \xpg@warning{Unknown Kurdish script `#1'},
+ numerals.choice:,
+ numerals / eastern.code =
+ {%
+ \@western@numeralsfalse
+ },
+ numerals / western.code =
+ {%
+ \@western@numeralstrue
+ \@force@western@numeralstrue
+ },
+ numerals.default:n = eastern,
+ numerals/unknown.code = \xpg@warning{Unknown Kurdish numerals value `#1'},
+ sectionsep.code = \gdef\xpg@sepmark{#1}\kurdish@customseptrue,
+ sectionsep.default:n = .,
+ abjadjimnotail.if = abjad@jim@notail,
+ abjadjimnotail.default:n = true,
+ locale.store = \@kurdish@locale
+ }
+
% Register default options
-\xpg@initialize@gloss@options{kurdish}{variant=sorani,locale=default,script=arabic,abjadjimnotail=false,numerals=eastern}
+\InitializeGlossOptions{kurdish}{variant=sorani,locale=default,script=arabic,abjadjimnotail=false,numerals=eastern}
\def\kurdish@language{%
- \polyglossia@setup@language@patterns{\kurdish@pattern}%
+ \SetupPolyglossiaLangPatterns{\kurdish@pattern}%
}%
\def\kurdishNativemonth#1{\ifcase#1%
@@ -20112,16 +20153,16 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nokurdish@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi%
}
\def\kurdish@luatex@capsformat{%
%
% change chapter and part headings
\ifkurdish@customsep
- \ifcsdef{chapter}{%
+ \ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
@@ -20133,7 +20174,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
+ \fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
@@ -20148,30 +20189,30 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nokurdish@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
+ \ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
+ \fi%
+ \ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
+ \fi%
+ \ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
+ \fi%
+ \ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
+ \fi%
+ \ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
+ \ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
+ \fi%
+ \fi%
+ \ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
+ \fi%
+ \ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \fi%
}
\def\blockextras@kurdish{%
@@ -20203,13 +20244,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-kurmanji.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kurmanji.ldf}[polyglossia: module for Kurmanji Kurdish]
% We provide this gloss for babel compatibility.
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
% \end{macrocode}
% \iffalse
@@ -20220,13 +20261,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-la-x-classic.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-la-xclassic.ldf}[polyglossia: module for la-xclassic (Latin)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latin}
+\InheritGlossFile{latin}
% \end{macrocode}
% \iffalse
@@ -20237,13 +20278,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-la-x-ecclesia.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-la-xecclesiastic.ldf}[polyglossia: module for la-xecclesiastic (Latin)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latin}
+\InheritGlossFile{latin}
% \end{macrocode}
% \iffalse
@@ -20254,13 +20295,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-la-x-medieval.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-la-xmedieval.ldf}[polyglossia: module for la-xmedieval (Latin)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latin}
+\InheritGlossFile{latin}
% \end{macrocode}
% \iffalse
@@ -20271,13 +20312,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-la.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-la.ldf}[polyglossia: module for la (Latin)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latin}
+\InheritGlossFile{latin}
% \end{macrocode}
% \iffalse
@@ -20288,7 +20329,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lao.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lao.ldf}[polyglossia: module for Lao]
@@ -20312,14 +20353,23 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@lao@numerals
\def\tmp@lao{lao}
-\define@key{lao}{numerals}[arabic]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@lao\@lao@numeralstrue\else
- \@lao@numeralsfalse\fi
-}
+
+\DeclareKeys[polyglossia/gloss/lao]
+ {
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \@lao@numeralsfalse
+ },
+ numerals / lao.code =
+ {%
+ \@lao@numeralstrue
+ },
+ numerals.default:n = arabic
+ }
% Register default options
-\xpg@initialize@gloss@options{lao}{numerals=arabic}
+\InitializeGlossOptions{lao}{numerals=arabic}
% Translations provided by Brian Wilson <bountonw at gmail.com>
\def\captionslao{%
@@ -20399,7 +20449,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-latex.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-latex.ldf}[polyglossia: module for default language]
@@ -20449,7 +20499,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-latin.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-latin.ldf}[polyglossia: module for Latin]
@@ -20484,6 +20534,9 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\bool_new:N \l_polyglossia_latin_use_v_bool
\bool_new:N \l_polyglossia_latin_use_ligatures_bool
\bool_new:N \l_polyglossia_latin_capitalize_month_bool
+\bool_new:N \l_polyglossia_latin_babelshorthands_bool
+\bool_new:N \l_polyglossia_latin_prosodic_shorthands_bool
+\bool_new:N \l_polyglossia_latin_ecclesiastic_footnotes_bool
\cs_new:Npn \polyglossia_latin_classical_character_codes:
{
@@ -20519,11 +20572,11 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\cs_new:Npn \polyglossia_latin_use_modern_patterns:
{
- \xpg@ifdefined {latin}
+ \IfLanguageDefinedTF {latin}
{
\def \latin@language
{
- \polyglossia@setup@language@patterns {latin}
+ \SetupPolyglossiaLangPatterns {latin}
\str_case:Vn \l_polyglossia_latin_variant_str
{
{classic} { \adddialect \l@classiclatin \l@latin }
@@ -20547,11 +20600,11 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\cs_new:Npn \polyglossia_latin_set_patterns:n #1
% #1 may be "classiclatin" or "liturgicallatin"
{
- \xpg@ifdefined {#1}
+ \IfLanguageDefinedTF {#1}
{
\def \latin@language
{
- \polyglossia@setup@language@patterns {#1}
+ \SetupPolyglossiaLangPatterns {#1}
\str_case:Vn \l_polyglossia_latin_variant_str
{
{classic} {
@@ -20767,7 +20820,8 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% Save original footnote definition
% Do this at the end of the preamble to catch other
% packages' footnote changes (#391)
-\AtEndPreamble{%
+\hook_gput_code:nnn { begindocument / before } {.}
+{
\cs_if_exist:NT \@makefntext
{
\cs_set_eq:NN \polyglossia_latin_original_footnote:n \@makefntext
@@ -20791,40 +20845,27 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\cs_new:Npn \polyglossia_latin_apply_footnote_option:
{
- \str_if_eq:VnTF \xpg@main@language {latin}
+ \IfMainLanguageTF {latin}
{
\cs_if_exist:NT \@makefntext
{
- \iflatin@ecclesiasticfootnotes
+ \bool_if:NTF \l_polyglossia_latin_ecclesiastic_footnotes_bool
+ {
\let \@makefntext \polyglossia_latin_variant_footnote:n
- \else
+ }
+ {
\let \@makefntext \polyglossia_latin_original_footnote:n
- \fi
+ }
}
}
{
- \iflatin@ecclesiasticfootnotes
- \msg_warning:nn {polyglossia} {latin / ineffective footnote option}
- \fi
- }
- }
-
-\define@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: }
+ \bool_if:NT \l_polyglossia_latin_ecclesiastic_footnotes_bool
+ {
+ \msg_warning:nn {polyglossia} {latin / ineffective footnote option}
+ }
}
}
-
%%%%% Language variants: classic, medieval, modern, and ecclesiastic
\str_new:N \l_polyglossia_latin_variant_str
@@ -20887,58 +20928,6 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\polyglossia_latin_use_modern_patterns:
}
-\define@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@boolkey{latin}[latin@]{usej}[true]
- {
- \iflatin@usej
- \bool_set_true:N \l_polyglossia_latin_use_j_bool
- \else
- \bool_set_false:N \l_polyglossia_latin_use_j_bool
- \fi
- }
-
-\define@boolkey{latin}[latin@]{capitalizemonth}[true]
- {
- \iflatin@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}
@@ -20951,23 +20940,6 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
The~Latin~hyphenation~variant~"#1"~is~undefined~\msg_line_context:.
}
-\define@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
@@ -21039,30 +21011,89 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
}
-
-%%%%% Latin shorthands
-
-\define@boolkey{latin}[latin@]{babelshorthands}[true]
- {
- }
-
-\define@boolkey{latin}[latin@]{prosodicshorthands}[true]
+\DeclareKeys[polyglossia/gloss/latin]
{
+ babelshorthands.bool_set:N = \l_polyglossia_latin_babelshorthands_bool,
+ babelshorthands.default:n = true,
+ prosodicshorthands.bool_set:N = \l_polyglossia_latin_prosodic_shorthands_bool,
+ prosodicshorthands.default:n = true,
+ usej.bool_set:N = \l_polyglossia_latin_use_j_bool,
+ capitalizemonth.bool_set:N = \l_polyglossia_latin_capitalize_month_bool,
+ hyphenation.code =
+ \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}
+ },
+ variant.code =
+ \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}
+ },
+ ecclesiasticfootnotes.choices:nn = { true, false }
+ {
+ \ifcase\UseName{l_keys_choice_int}\or
+ \bool_set_true:N \l_polyglossia_latin_ecclesiastic_footnotes_bool
+ \else
+ \bool_set_false:N \l_polyglossia_latin_ecclesiastic_footnotes_bool
+ \fi
+ \xpg_if_in_preamble:TF
+ {
+ % 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: }
+ }
+ {
+ % within the document
+ \polyglossia_latin_apply_footnote_option:
+ }
+ },
+ ecclesiasticfootnotes.default:n = true
}
% Register default options
-\xpg@initialize@gloss@options{latin}{variant=modern,hyphenation=modern,babelshorthands=false,
+\InitializeGlossOptions{latin}{variant=modern,hyphenation=modern,babelshorthands=false,
prosodicshorthands=false,ecclesiasticfootnotes=false,
usej=false,capitalizemonth=true}
\ifsystem@babelshorthands
- \setkeys{latin}{babelshorthands=true}
+ \SetGlossOptions{latin}{babelshorthands=true}
\else
- \setkeys{latin}{babelshorthands=false}
+ \SetGlossOptions{latin}{babelshorthands=false}
\fi
\ExplSyntaxOff % babelsh.def does not support expl3 syntax
-\ifcsundef{initiate@active@char}{\input{babelsh.def}}{}
+\@ifundefined{initiate@active@char}{\input{babelsh.def}}{}
\ExplSyntaxOn
\initiate@active@char {"}
@@ -21094,13 +21125,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\AtBeginDocument
{
- \str_if_eq:VnTF \xpg@main@language {latin}
+ \IfMainLanguageTF {latin}
{
- \iflatin@prosodicshorthands
- \else
+ \bool_if:NF \l_polyglossia_latin_prosodic_shorthands_bool
+ {
\shorthandoff {=}
\shorthandoff* {^}
- \fi
+ }
}
{
% The following command should not be called if the main language
@@ -21462,7 +21493,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let \xpgla@savedvalues \empty
-\AtEndPreamble
+\hook_gput_code:nnn { begindocument / before } {.}
{
\edef \xpgla@savedvalues
{
@@ -21475,12 +21506,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def \noextras@latin
{
- \iflatin@babelshorthands
+ \bool_if:NT \l_polyglossia_latin_babelshorthands_bool
+ {
\polyglossia_latin_no_shorthands:
- \fi
- \iflatin@prosodicshorthands
+ }
+ \bool_if:NT \l_polyglossia_latin_prosodic_shorthands_bool
+ {
\polyglossia_latin_no_prosodic_shorthands:
- \fi
+ }
\xpgla@savedvalues
\polyglossia_latin_no_punctuation_spacing:
\polyglossia_latin_modern_character_codes:
@@ -21496,16 +21529,20 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{
\polyglossia_latin_punctuation_spacing:
}
- \iflatin@babelshorthands
+ \bool_if:NTF \l_polyglossia_latin_babelshorthands_bool
+ {
\polyglossia_latin_shorthands:
- \else
+ }
+ {
\polyglossia_latin_no_shorthands:
- \fi
- \iflatin@prosodicshorthands
+ }
+ \bool_if:NTF \l_polyglossia_latin_prosodic_shorthands_bool
+ {
\polyglossia_latin_prosodic_shorthands:
- \else
+ }
+ {
\polyglossia_latin_no_prosodic_shorthands:
- \fi
+ }
}
\def \blockextras@latin
@@ -21558,64 +21595,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \end{macrocode}
% \iffalse
%</gloss-latin.ldf>
-%<*gloss-latinclassic.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-latinclassic.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-latinclassic.ldf}[polyglossia: module for classic Latin]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-latinclassic.ldf>
-%<*gloss-latinecclesiastic.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-latinecclesiastic.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-latinecclesiastic.ldf}[polyglossia: module for ecclesiastic Latin]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-latinecclesiastic.ldf>
-%<*gloss-latinmedieval.ldf>
-% \fi
-% \clearpage
-%
-% \subsection{gloss-latinmedieval.ldf}
-% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-latinmedieval.ldf}[polyglossia: module for medieval Latin]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{latin}
-
-% \end{macrocode}
-% \iffalse
-%</gloss-latinmedieval.ldf>
%<*gloss-latvian.ldf>
% \fi
% \clearpage
%
% \subsection{gloss-latvian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-latvian.ldf}[polyglossia: module for Latvian]
\PolyglossiaSetup{latvian}{
@@ -21642,12 +21628,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\contentsname{Saturs}%
\def\listfigurename{Attēlu saraksts}%
\def\listtablename{Tabulu saraksts}%
- \def\indexname{Index}%
+ \def\indexname{Priekšmetu rādītājs}%
\def\figurename{Att.}%
\def\tablename{Tabula}%
\def\partname{Daļa}%
- \def\enclname{encl}%
- \def\ccname{cc}%
+ \def\enclname{Pielikumā}%
+ \def\ccname{Kopija(s)}%
\def\headtoname{To}%
\def\pagename{lpp.}%
\def\seename{sk.}%
@@ -21673,7 +21659,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lithuanian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translated by Paulius Sladkevičius <komsas@gmail.com>
@@ -21755,13 +21741,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lo.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lo.ldf}[polyglossia: module for lo (Lao)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{lao}
+\InheritGlossFile{lao}
% \end{macrocode}
% \iffalse
@@ -21772,13 +21758,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lowersorbian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lowersorbian.ldf}[polyglossia: module for Lower Sorbian]
% We provide this as a babel alias
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
% \end{macrocode}
% \iffalse
@@ -21789,14 +21775,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lsorbian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lsorbian.ldf}[polyglossia: module for Lower Sorbian]
% We only provide this gloss for babel compatibility. Since lsorbian is
% a sorbian variety, we use 'sorbian' with variant 'lower' now.
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
% \end{macrocode}
% \iffalse
@@ -21807,13 +21793,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lt.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lt.ldf}[polyglossia: module for lt (Lithuanian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{lithuanian}
+\InheritGlossFile{lithuanian}
% \end{macrocode}
% \iffalse
@@ -21824,13 +21810,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-lv.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lv.ldf}[polyglossia: module for lv (Latvian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latvian}
+\InheritGlossFile{latvian}
% \end{macrocode}
% \iffalse
@@ -21841,7 +21827,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-macedonian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-macedonian.ldf}[polyglossia: module for Macedonian]
\PolyglossiaSetup{macedonian}{
@@ -21940,13 +21926,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-magyar.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-magyar.ldf}[polyglossia: module for Hungarian (Magyar)]
% We only provide this gloss for babel compatibility.
-\xpg@load@master@language{hungarian}
+\InheritGlossFile{hungarian}
% \end{macrocode}
% \iffalse
@@ -21957,7 +21943,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-malay.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-malay.ldf}[polyglossia: module for Malay]
@@ -21985,65 +21971,44 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% Backwards compat. alias
\setlanguagealias[variant=malaysian]{malay}{bahasam}
-\providebool{malay@melayu}
+\@ifundefined{ifmalay@melayu}%
+ {\newif\ifmalay@melayu}{}
\malay@melayufalse
\def\malay@variant{malay}
-\define@choicekey*+{malay}{variant}[\xpg@val\xpg@nr]{indonesian,malaysian}[malaysian]{%
- \ifcase\xpg@nr\relax
- % indonesian:
- \def\malay@variant{indonesian}%
- \malay@melayufalse
- \or
- % malaysian:
- \def\malay@variant{malay}%
- \malay@melayutrue
- \fi
- \ifmalay@melayu
- \SetLanguageKeys{malay}{language=Malay,langtag=MLY,babelname=bahasam,bcp47=zsm,bcp47-language=zsm}%
- \xpg@fontsetup@latin{malay}%
- % Check if \l@malay is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{malay}{}{%
- \def\do##1{%
- \xpg@ifdefined{##1}%
- {\csletcs{l@malay}{l@##1}\listbreak}%
- {}%
- }%
- \docsvlist{melayu,bahasam,bahasai,indonesian,indon,bahasa}
- \xpg@ifdefined{malay}{}{%
- \xpg@warning{No hyphenation patterns for Malay (Malaysian) found\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@malay0%
- }%
- }%
- \else
- \SetLanguageKeys{malay}{language=Indonesian,langtag=IND,babelname=bahasa,bcp47=id,bcp47-language=id}%
- \xpg@fontsetup@latin{malay}%
- % Check if \l@indonesian is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{indonesian}{}{%
- \def\do##1{%
- \xpg@ifdefined{##1}%
- {\csletcs{l@indonesian}{l@##1}\listbreak}%
- {}%
- }%
- \docsvlist{indon,bahasai,bahasam,malay,melayu,bahasa}
- \xpg@ifdefined{indonesian}{}{%
- \xpg@warning{No hyphenation patterns for Malay (Indonesian) found\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@indonesian0
- }%
- }%
- \fi
- \xpg@info{Option: malay, variant=\xpg@val}%
-}{\xpg@warning{Unknown malay variant `#1'}}
+
+\DeclareKeys[polyglossia/gloss/malay]
+ {
+ variant.choice:,
+ variant / indonesian.code =
+ {%
+ \def\malay@variant{indonesian}%
+ \malay@melayufalse
+ \SetLanguageKeys{malay}{language=Indonesian,langtag=IND,babelname=bahasa,bcp47=id,bcp47-language=id}%
+ \SetupLatinPolyglossiaFont{malay}%
+ % Check if \l@indonesian is defined. If not, try to set it to some variety
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{indonesian}{indon,bahasai,bahasam,malay,melayu,bahasa}%
+ },
+ variant / malaysian.code =
+ {%
+ \def\malay@variant{malay}%
+ \malay@melayutrue
+ \SetLanguageKeys{malay}{language=Malay,langtag=MLY,babelname=bahasam,bcp47=zsm,bcp47-language=zsm}%
+ \SetupLatinPolyglossiaFont{malay}%
+ % Check if \l@malay is defined. If not, try to set it to some variety
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{malay}{melayu,bahasam,bahasai,indonesian,indon,bahasa}%
+ },
+ variant.default:n = malaysian,
+ variant/unknown.code = \xpg@warning{Unknown malay variant `#1'},
+ }
% Register default options
-\xpg@initialize@gloss@options{malay}{variant=malaysian}
+\InitializeGlossOptions{malay}{variant=malaysian}
\def\malay@language{%
- \polyglossia@setup@language@patterns{\malay@variant}%
+ \SetupPolyglossiaLangPatterns{\malay@variant}%
}%
@@ -22156,7 +22121,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-malayalam.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-malayalam.ldf}[polyglossia: module for Malayalam]
@@ -22226,7 +22191,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-marathi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translations provided by Abhijit Navale <abhi_navale@live.in>
% Ordinals (1-100) added by Niranjan Tambe <niranjanvikastambe@gmail.com> on 14th December, 2019
@@ -22256,21 +22221,25 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\ifmarathi@devanagari@numerals
\marathi@devanagari@numeralstrue
-\define@choicekey*+{marathi}{numerals}[\xpg@val\xpg@nr]{Western,Devanagari}[Devanagari]{%
- \ifcase\xpg@nr\relax
- % Western:
- \marathi@devanagari@numeralsfalse%
- \SetLanguageKeys{marathi}{bcp47-extension-u=nu-latn}%
- \or
- % Devanagari:
- \marathi@devanagari@numeralstrue%
- \SetLanguageKeys{marathi}{bcp47-extension-u=nu-deva}%
- \fi
- \xpg@info{Option: Marathi, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Marathi numerals value `#1'}}
+\DeclareKeys[polyglossia/gloss/marathi]
+ {
+ numerals.choice:,
+ numerals / western.code =
+ {%
+ \marathi@devanagari@numeralsfalse
+ \SetLanguageKeys{marathi}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / devanagari.code =
+ {%
+ \marathi@devanagari@numeralstrue
+ \SetLanguageKeys{marathi}{bcp47-extension-u=nu-deva}%
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Marathi numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{marathi}{numerals=Devanagari}
+\InitializeGlossOptions{marathi}{numerals=Devanagari}
\newcommand{\marathinumerals}[2]{\marathinumber{#2}}
@@ -22370,19 +22339,36 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \end{macrocode}
% \iffalse
%</gloss-marathi.ldf>
+%<*gloss-medievallatin.ldf>
+% \fi
+% \clearpage
+%
+% \subsection{gloss-medievallatin.ldf}
+% \begin{macrocode}
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
+%
+\ProvidesFile{gloss-medievallatin.ldf}[polyglossia: module for medieval Latin]
+
+% We provide this as a babel alias
+
+\InheritGlossFile{latin}
+
+% \end{macrocode}
+% \iffalse
+%</gloss-medievallatin.ldf>
%<*gloss-mk.ldf>
% \fi
% \clearpage
%
% \subsection{gloss-mk.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-mk.ldf}[polyglossia: module for mk (Macedonian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{macedonian}
+\InheritGlossFile{macedonian}
% \end{macrocode}
% \iffalse
@@ -22393,13 +22379,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ml.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ml.ldf}[polyglossia: module for ml (Malayalam)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{malayalam}
+\InheritGlossFile{malayalam}
% \end{macrocode}
% \iffalse
@@ -22410,13 +22396,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-mn.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-mn.ldf}[polyglossia: module for mn (Mongolian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{mongolian}
+\InheritGlossFile{mongolian}
% \end{macrocode}
% \iffalse
@@ -22427,7 +22413,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-mongolian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-mongolian.ldf}[polyglossia: module for Mongolian]
@@ -22459,43 +22445,46 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{mongolian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \fi
- \xpg@info{Option: Mongolian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Mongolian numerals value `#1'}}
-\define@boolkey{mongolian}[mongolian@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/mongolian]
+ {
+ babelshorthands.if = mongolian@babelshorthands,
+ babelshorthands.default:n = true,
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Mongolian numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{mongolian}{babelshorthands=false,numerals=arabic}
+\InitializeGlossOptions{mongolian}{babelshorthands=false,numerals=arabic}
\ifsystem@babelshorthands
- \setkeys{mongolian}{babelshorthands=true}
+ \SetGlossOptions{mongolian}{babelshorthands=true}
\else
- \setkeys{mongolian}{babelshorthands=false}
+ \SetGlossOptions{mongolian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\mongolian@shorthands{%
\xpg@activate@shorthands%
@@ -22548,7 +22537,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\bibname{Номзүй}%
\def\chaptername{Бүлэг}%
\def\appendixname{Хавсралт}%
- \ifcsundef{thechapter}%
+ \@ifundefined{thechapter}%
{\def\contentsname{Агуулга}}%
{\def\contentsname{Гарчиг}}%
\def\listfigurename{Зургийн жагсаалт}%
@@ -22666,13 +22655,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-mr.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-mr.ldf}[polyglossia: module for mr (Marathi)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{marathi}
+\InheritGlossFile{marathi}
% \end{macrocode}
% \iffalse
@@ -22683,13 +22672,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-naustrian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-naustrian.ldf}[polyglossia: module for Austrian German (current spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -22700,13 +22689,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-nb.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-nb.ldf}[polyglossia: module for nb (Norwegian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{norwegian}
+\InheritGlossFile{norwegian}
% \end{macrocode}
% \iffalse
@@ -22717,13 +22706,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-newzealand.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-newzealand.ldf}[polyglossia: module for Newzealand English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
% \end{macrocode}
% \iffalse
@@ -22734,13 +22723,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ngerman.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ngerman.ldf}[polyglossia: module for German (current spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -22751,7 +22740,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-nko.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-nko.ldf}[Polyglossia: module for N’Ko]
\PolyglossiaSetup{nko}{%
@@ -22849,14 +22838,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-norsk.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-norsk.ldf}[polyglossia: module for Norwegian (Bokmal)]
% We only provide this gloss for babel compatibility. Since norsk is
% actually norwegian bokmal, we use 'norwegian' with variant 'bokmal' now.
-\xpg@load@master@language{norwegian}
+\InheritGlossFile{norwegian}
% \end{macrocode}
% \iffalse
@@ -22867,7 +22856,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-norwegian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-norwegian.ldf}[polyglossia: module for Norwegian]
\PolyglossiaSetup{norwegian}{
@@ -22889,28 +22878,32 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias[variant=nynorsk]{norwegian}{nynorsk}
\def\norwegian@variant{nynorsk}
-\define@choicekey*+{norwegian}{variant}[\xpg@val\xpg@nr]{nynorsk,bokmal}[nynorsk]{%
- \ifcase\xpg@nr\relax
- % nynorsk:
- \def\norwegian@variant{nynorsk}%
- \SetLanguageKeys{norwegian}{langtag=NYN,babelname=nynorsk,bcp47=nn,bcp47-language=nn}%
- \xpg@fontsetup@latin{norwegian}%
- \or
- % bokmal:
- \def\norwegian@variant{norsk}%
- \SetLanguageKeys{norwegian}{langtag=NOR,babelname=norsk,bcp47=nb,bcp47-language=nb}%
- \xpg@fontsetup@latin{norwegian}%
- \fi
- \xpg@info{Option: norwegian, variant=\xpg@val}%
-}{\xpg@warning{Unknown norwegian variant `#1'}}
+\DeclareKeys[polyglossia/gloss/norwegian]
+ {
+ variant.choice:,
+ variant / nynorsk.code =
+ {%
+ \def\norwegian@variant{nynorsk}%
+ \SetLanguageKeys{norwegian}{langtag=NYN,babelname=nynorsk,bcp47=nn,bcp47-language=nn}%
+ \SetupLatinPolyglossiaFont{norwegian}%
+ },
+ variant / bokmal.code =
+ {%
+ \def\norwegian@variant{norsk}%
+ \SetLanguageKeys{norwegian}{langtag=NOR,babelname=norsk,bcp47=nb,bcp47-language=nb}%
+ \SetupLatinPolyglossiaFont{norwegian}%
+ },
+ variant.default:n = nynorsk,
+ variant/unknown.code = \xpg@warning{Unknown norwegian variant `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{norwegian}{variant=nynorsk}
+\InitializeGlossOptions{norwegian}{variant=nynorsk}
\def\norwegian@language{%
- \polyglossia@setup@language@patterns{\norwegian@variant}%
+ \SetupPolyglossiaLangPatterns{\norwegian@variant}%
}%
\def\captionsnorwegian@nynorsk{%
@@ -22994,13 +22987,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-nswissgerman.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-nswissgerman.ldf}[polyglossia: module for Swiss German (current spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -23011,14 +23004,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-nynorsk.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-nynorsk.ldf}[polyglossia: module for Norwegian (Nynorsk)]
% We only provide this gloss for babel compatibility. Since nynorsk is
% a norwegian variety, we use 'norwegian' with variant 'nynorsk' now.
-\xpg@load@master@language{norwegian}
+\InheritGlossFile{norwegian}
% \end{macrocode}
% \iffalse
@@ -23029,7 +23022,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-occitan.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
%%
%% This is file `gloss-occitan.ldf',
@@ -23065,19 +23058,19 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{occitan}{oc}
-\define@boolkey{occitan}[occitan@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/occitan]
+ {
+ babelshorthands.if = occitan@babelshorthands,
+ babelshorthands.default:n = true
+ }
\ifsystem@babelshorthands
- \setkeys{occitan}{babelshorthands=true}
+ \SetGlossOptions{occitan}{babelshorthands=true}
\else
- \setkeys{occitan}{babelshorthands=false}
+ \SetGlossOptions{occitan}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\occitan@shorthands{%
\xpg@activate@shorthands%
@@ -23169,7 +23162,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\today{\occitanday\space \occitanmonth\space de~\number\year}%
}
\let\xpgoc@savedvalues\empty
-\AtEndPreamble{% the user or the class might define different values
+\AddToHook{begindocument/before}{% the user or the class might define different values
\edef\xpgoc@savedvalues{%
\clubpenalty=\the\clubpenalty\space
\@clubpenalty=\the\@clubpenalty\space
@@ -23210,7 +23203,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-odia.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translations provided by ଅଶୋକ ଦାସ୍ <das@pas.rochester.edu> and ଅଭିଷେକ ଜେନା <avisekjena@gmail.com>
% TODO implement Odia calendar
@@ -23242,32 +23235,37 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\ifodia@devanagari@numerals
\newif\ifodia@odia@numerals
-\define@choicekey*+{odia}{numerals}[\xpg@val\xpg@nr]{Devanagari,Odia,Western}[Devanagari]{%
- \ifcase\xpg@nr\relax
- % Devanagari:
- \odia@odia@numeralsfalse%
- \odia@devanagari@numeralstrue%
- \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-deva}%
- \or
- % Odia:
- \odia@odia@numeralstrue%
- \odia@devanagari@numeralsfalse%
- \or
- % Western:
- \odia@odia@numeralsfalse%
- \odia@devanagari@numeralsfalse%
- \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Odia, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Odia numeral `#1'}}
-
\def\extras@odia{}
\def\noextras@odia{}
-\define@boolkey{odia}[odia@]{changecounternumbering}[true]{}
+\DeclareKeys[polyglossia/gloss/odia]
+ {
+ changecounternumbering.if = odia@changecounternumbering,
+ changecounternumbering.default:n = true,
+ numerals.choice:,
+ numerals / devanagari.code =
+ {%
+ \odia@odia@numeralsfalse
+ \odia@devanagari@numeralstrue
+ \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-deva}%
+ },
+ numerals / odia.code =
+ {%
+ \odia@odia@numeralstrue
+ \odia@devanagari@numeralsfalse
+ },
+ numerals / western.code =
+ {%
+ \odia@odia@numeralsfalse
+ \odia@devanagari@numeralsfalse
+ \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Odia numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{odia}{changecounternumbering=false,numerals=Devanagari}
+\InitializeGlossOptions{odia}{changecounternumbering=false,numerals=Devanagari}
\def\captionsodia{%
\def\refname{ସନ୍ଦର୍ଭ}%
@@ -23370,13 +23368,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-or.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-odia.ldf}[polyglossia: module for or (Odia)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{odia}
+\InheritGlossFile{odia}
% \end{macrocode}
% \iffalse
@@ -23387,13 +23385,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-pa.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-pa.ldf}[polyglossia: module for pa (Punjabi)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{punjabi}
+\InheritGlossFile{punjabi}
% \end{macrocode}
% \iffalse
@@ -23404,7 +23402,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-persian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-persian.ldf}[polyglossia: module for Persian]
@@ -23433,42 +23431,36 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias{persian}{farsi}
\newif\if@western@numerals
-\define@choicekey*+{persian}{numerals}[\xpg@val\xpg@nr]{eastern,western}[eastern]{%
- \ifcase\xpg@nr\relax
- % eastern:
- \@western@numeralsfalse%
- \SetLanguageKeys{persian}{bcp47-extension-u=nu-arab}%
- \or
- % western:
- \@western@numeralstrue%
- \SetLanguageKeys{persian}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Persian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Persian numerals option `#1'}}
-
\newif\ifpersian@customsep\persian@customsepfalse
\def\xpg@sepmark{}
-\define@key{persian}{sectionsep}[.]{%
- \persian@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
-
-%this is needed for \abjad in arabicnumbers.sty
-\define@boolkey{persian}[persian@]{abjadjimnotail}[true]{%
- \ifpersian@abjadjimnotail
- \abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi}
-
-% NOT YET USED
-\define@key{persian}{locale}[default]{%
- \def\@persian@locale{#1}}
%TODO add option for CALENDAR
+\DeclareKeys[polyglossia/gloss/persian]
+ {
+ sectionsep.code = \gdef\xpg@sepmark{#1}\persian@customseptrue,
+ sectionsep.default:n = .,
+ abjadjimnotail.if = abjad@jim@notail,
+ abjadjimnotail.default:n = true,
+ locale.store = \@persian@locale,
+ locale.default:n = default,
+ numerals.choice:,
+ numerals / eastern.code =
+ {%
+ \@western@numeralsfalse
+ \SetLanguageKeys{persian}{bcp47-extension-u=nu-arab}%
+ },
+ numerals / western.code =
+ {%
+ \@western@numeralstrue
+ \SetLanguageKeys{persian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = eastern,
+ numerals/unknown.code = \xpg@warning{Unknown Persian numerals option `#1'}
+ }
+
% Register default options
-\xpg@initialize@gloss@options{persian}{locale=default,numerals=eastern,abjadjimnotail=false}
+\InitializeGlossOptions{persian}{locale=default,numerals=eastern,abjadjimnotail=false}
\def\farsigregmonth#1{\ifcase#1%
\or ژانویه\or فوریه\or مارس\or آوریل\or مه\or ژوئن\or ژوئیه\or اوت\or سپتامبر\or اکتبر\or نوامبر\or دسامبر\fi}
@@ -23553,16 +23545,16 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nopersian@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi%
}
\def\persian@luatex@capsformat{%
%
% change chapter and part headings
\ifpersian@customsep
- \ifcsdef{chapter}{%
+ \ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
@@ -23574,7 +23566,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
+ \fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
@@ -23589,30 +23581,30 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nopersian@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
+ \ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
+ \fi%
+ \ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
+ \fi%
+ \ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
+ \fi%
+ \ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
+ \fi%
+ \ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
+ \ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
+ \fi%
+ \fi%
+ \ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
+ \fi%
+ \ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \fi%
}
\def\blockextras@persian{%
@@ -23645,7 +23637,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% \subsection{gloss-piedmontese.ldf}
% \begin{macrocode}
% !TEX encoding = UTF-8 Unicode
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-piedmontese.ldf}[2013/02/12 v1.0 polyglossia: module for Piedmontese]
\makeatletter
@@ -23663,19 +23655,19 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{piedmontese}{pms}
-\define@boolkey{piedmontese}[piedmontese@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/piedmontese]
+ {
+ babelshorthands.if = piedmontese@babelshorthands,
+ babelshorthands.default:n = true
+ }
\ifsystem@babelshorthands
- \setkeys{piedmontese}{babelshorthands=true}
+ \SetGlossOptions{piedmontese}{babelshorthands=true}
\else
- \setkeys{piedmontese}{babelshorthands=false}
+ \SetGlossOptions{piedmontese}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\piedmontese@shorthands{%
\xpg@activate@shorthands%
@@ -23739,7 +23731,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
ëd luj\or d'agost\or dë stèmber\or d'otóber\or ëd novèmber\or dë dzèmber%
\fi\space dal\space\number\year}}
-\AtEndPreamble{%
+\AddToHook{begindocument/before}{%
\edef\xpgpms@savedvalues{%
\clubpenalty=\the\clubpenalty\space
\@clubpenalty=\the\@clubpenalty\space
@@ -23775,7 +23767,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-polish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-polish.ldf}[polyglossia: module for Polish]
@@ -23797,26 +23789,26 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\RequirePackage{luavlna}
\fi
-\define@boolkey{polish}[polish@]{babelshorthands}[true]{}
-
-\define@boolkey{polish}[polish@]{splithyphens}[true]{}
-
-\define@boolkey{polish}[polish@]{vlna}[true]{}
+\DeclareKeys[polyglossia/gloss/polish]
+ {
+ babelshorthands.if = polish@babelshorthands,
+ babelshorthands.default:n = true,
+ splithyphens.if = polish@splithyphens,
+ splithyphens.default:n = true,
+ vlna.if = polish@vlna,
+ vlna.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{polish}{babelshorthands=false,splithyphens=true,vlna=true}
+\InitializeGlossOptions{polish}{babelshorthands=false,splithyphens=true,vlna=true}
\ifsystem@babelshorthands
- \setkeys{polish}{babelshorthands=true}
+ \SetGlossOptions{polish}{babelshorthands=true}
\else
- \setkeys{polish}{babelshorthands=false}
+ \SetGlossOptions{polish}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\let\xpg@hyphen@char-
\def\polish@@splhyphen#1{%
@@ -24034,13 +24026,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-polutonikogreek.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-polutonikogreek.ldf}[polyglossia: module for polytonic Greek]
% We provide this as a babel alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
% \end{macrocode}
% \iffalse
@@ -24051,7 +24043,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-portuges.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-portuges.ldf}[polyglossia: module for Portuguese]
@@ -24060,7 +24052,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% introduced it in 8.3 filename times). Since polyglossia uses full
% English language names, we use 'portuguese' now.
-\xpg@load@master@language{portuguese}
+\InheritGlossFile{portuguese}
% \end{macrocode}
% \iffalse
@@ -24071,7 +24063,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-portuguese.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-portuguese.ldf}[polyglossia: module for Portuguese]
@@ -24101,41 +24093,42 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi
\def\portuguese@variant{portuges}
-\define@choicekey*+{portuguese}{variant}[\xpg@val\xpg@nr]{portuguese,brazilian}[portuguese]{%
- \ifcase\xpg@nr\relax
- % portuguese:
- \def\portuguese@variant{portuges}%
- \SetLanguageKeys{portuguese}{babelname=portuges,bcp47=pt-PT,bcp47-language=pt,bcp47-region=PT}%
- \or
- % brazilian:
- \def\portuguese@variant{brazil}%
- \SetLanguageKeys{portuguese}{babelname=brazil,bcp47=pt-BR,bcp47-language=pt,bcp47-region=BR}%
- % There are no specific brazil patterns
- \adddialect\l@brazil\l@portuges\relax%
- \fi
- \xpg@info{Option: portuguese, variant=\xpg@val}%
-}{\xpg@warning{Unknown portuguese variant `#1'}}
-
-\define@boolkey{portuguese}[portuguese@]{babelshorthands}[true]{}
-\define@boolkey{portuguese}[portuguese@]{splithyphens}[true]{}
+\DeclareKeys[polyglossia/gloss/portuguese]
+ {
+ babelshorthands.if = portuguese@babelshorthands,
+ babelshorthands.default:n = true,
+ splithyphens.if = portuguese@splithyphens,
+ splithyphens.default:n = true,
+ variant.choice:,
+ variant / portuguese.code =
+ {%
+ \def\portuguese@variant{portuges}%
+ \SetLanguageKeys{portuguese}{babelname=portuges,bcp47=pt-PT,bcp47-language=pt,bcp47-region=PT}%
+ },
+ variant / brazilian.code =
+ {%
+ \def\portuguese@variant{brazil}%
+ \SetLanguageKeys{portuguese}{babelname=brazil,bcp47=pt-BR,bcp47-language=pt,bcp47-region=BR}%
+ % There are no specific brazil patterns
+ \adddialect\l@brazil\l@portuges\relax
+ },
+ variant.default:n = portuguese,
+ variant/unknown.code = \xpg@warning{Unknown portuguese variant `#1'},
+ }
% Register default options
-\xpg@initialize@gloss@options{portuguese}{variant=portuguese,
+\InitializeGlossOptions{portuguese}{variant=portuguese,
babelshorthands=false,
splithyphens=true}
\ifsystem@babelshorthands
- \setkeys{portuguese}{babelshorthands=true}
+ \SetGlossOptions{portuguese}{babelshorthands=true}
\else
- \setkeys{portuguese}{babelshorthands=false}
+ \SetGlossOptions{portuguese}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\let\xpg@hyphen@char-
\def\portuguese@@splhyphen#1{%
@@ -24204,7 +24197,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\portuguese@language{%
- \polyglossia@setup@language@patterns{\portuguese@variant}%
+ \SetupPolyglossiaLangPatterns{\portuguese@variant}%
}%
\def\captionsportuguese@portuges{%
@@ -24302,7 +24295,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-punjabi.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% UTF-8 strings kindly provided by
% Arvinder Singh Kang, <17-11-2022>
@@ -24329,26 +24322,31 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\punjabi@language{%
% patterns are spelled panjabi
- \polyglossia@setup@language@patterns{panjabi}%
+ \SetupPolyglossiaLangPatterns{panjabi}%
}
\newif\ifpunjabi@gurmukhi@numerals
\punjabi@gurmukhi@numeralstrue
-\define@choicekey*+{punjabi}{numerals}[\xpg@val\xpg@nr]{Gurmukhi,Western}[Gurmukhi]{%
- \ifcase\xpg@nr\relax
- % Gurmukhi:
- \punjabi@gurmukhi@numeralstrue%
- \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-guru}%
- \or
- % Western:
- \punjabi@gurmukhi@numeralsfalse%
- \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Punjabi, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Punjabi numeral `#1'}}
+
+\DeclareKeys[polyglossia/gloss/punjabi]
+ {
+ numerals.choice:,
+ numerals / gurmukhi.code =
+ {%
+ \punjabi@gurmukhi@numeralstrue
+ \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-guru}%
+ },
+ numerals / western.code =
+ {%
+ \punjabi@gurmukhi@numeralsfalse
+ \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = gurmukhi,
+ numerals/unknown.code = \xpg@warning{Unknown Punjabi numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{punjabi}{numerals=gurmukhi}
+\InitializeGlossOptions{punjabi}{numerals=gurmukhi}
\newcommand{\punjabinumerals}[2]{\punjabinumber{#2}}
@@ -24410,7 +24408,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-romanian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-romanian.ldf}[polyglossia: module for Romanian]
@@ -24469,7 +24467,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-romansh.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-romansh.ldf}[polyglossia: module for Romansh]
\makeatletter
@@ -24527,7 +24525,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-russian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-russian.ldf}[polyglossia: module for Russian]
@@ -24556,11 +24554,6 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*[spelling=old]{russian}{ru-petr1708}
\newif\if@russian@modern
-\define@key{russian}{spelling}[modern]{%
- \ifstrequal{#1}{old}%
- {\@russian@modernfalse\SetLanguageKeys{russian}{bcp47=ru-petr1708,bcp47-variant=petr1708}}%
- {\@russian@moderntrue\SetLanguageKeys{russian}{bcp47=ru,bcp47-variant=luna1918}}%
-}
\def\captionsrussian{%
\if@russian@modern\captionsrussian@modern\else\captionsrussian@old\fi%
@@ -24572,49 +24565,68 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{russian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-latn}%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
- \fi
- \xpg@info{Option: Russian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Russian numerals value `#1'}}
-\define@boolkey{russian}[russian@]{indentfirst}[true]{%
- \ifrussian@indentfirst
- \SetLanguageKeys{russian}{indentfirst=true}%
- \else
- \SetLanguageKeys{russian}{indentfirst=false}%
- \fi%
-}
-
-\define@boolkey{russian}[russian@]{babelshorthands}[true]{}
-
-% Force punctuation after heading number
-\define@boolkey{russian}[russian@]{forceheadingpunctuation}[true]{}
-
-% Define some math functions
-\define@boolkey{russian}[russian@]{mathfunctions}[true]{}
+\DeclareKeys[polyglossia/gloss/russian]
+ {
+ babelshorthands.if = russian@babelshorthands,
+ babelshorthands.default:n = true,
+ forceheadingpunctuation.if = russian@forceheadingpunctuation,
+ forceheadingpunctuation.default:n = true,
+ mathfunctions.if = russian@mathfunctions,
+ mathfunctions.default:n = true,
+ spelling.choice:,
+ spelling / modern.code =
+ {%
+ \@russian@moderntrue
+ \SetLanguageKeys{russian}{bcp47=ru,bcp47-variant=luna1918}%
+ },
+ spelling / old.code =
+ {%
+ \@russian@modernfalse
+ \SetLanguageKeys{russian}{bcp47=ru-petr1708,bcp47-variant=petr1708}%
+ },
+ spelling.default:n = modern,
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{russian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Russian numerals value `#1'},
+ indentfirst.choice:,
+ indentfirst / true.code =
+ {%
+ \SetLanguageKeys{russian}{indentfirst=true}%
+ },
+ indentfirst / false.code =
+ {%
+ \SetLanguageKeys{russian}{indentfirst=false}%
+ },
+ indentfirst.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{russian}{babelshorthands=false,
+\InitializeGlossOptions{russian}{babelshorthands=false,
spelling=modern,
numerals=arabic,
indentfirst=true,
@@ -24623,16 +24635,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\ifsystem@babelshorthands
- \setkeys{russian}{babelshorthands=true}
+ \SetGlossOptions{russian}{babelshorthands=true}
\else
- \setkeys{russian}{babelshorthands=false}
+ \SetGlossOptions{russian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\russian@shorthands{%
\xpg@activate@shorthands%
@@ -24684,7 +24692,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\bibname{Литература}%
\def\chaptername{Глава}%
\def\appendixname{Приложение}%
- \ifcsundef{thechapter}%
+ \@ifundefined{thechapter}%
{\def\contentsname{Содержание}}%
{\def\contentsname{Оглавление}}%
\def\listfigurename{Список иллюстраций}%
@@ -24727,7 +24735,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\bibname{Библіографія}%
\def\chaptername{Глава}%
\def\appendixname{Приложеніе}%
- \ifcsundef{thechapter}%
+ \@ifundefined{thechapter}%
{\def\contentsname{Содержаніе}}%
{\def\contentsname{Оглавленіе}}%
\def\listfigurename{Списокъ иллюстрацій}%
@@ -24926,7 +24934,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-sami.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-sami.ldf}[polyglossia: module for Sami]
@@ -24956,19 +24964,19 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% % northern:
% \def\sami@variant{samin}%
% \SetLanguageKeys{sami}{language=Northern Sami,langtag=NSM}%
-% \xpg@fontsetup@latin{sami}%
+% \SetupLatinPolyglossiaFont{sami}%
% \or
% % other:
% \def\sami@variant{}%
% \SetLanguageKeys{sami}{language= Sami,langtag=}%
-% \xpg@fontsetup@latin{sami}%
+% \SetupLatinPolyglossiaFont{sami}%
% \fi
% \xpg@info{Option: sami, variant=\xpg@val}%
%}{\xpg@warning{Unknown sami variant `#1'}}
%\def\sami@language{%
-% \polyglossia@setup@language@patterns{\sami@variant}%
+% \SetupPolyglossiaLangPatterns{\sami@variant}%
%}%
\def\captionssami@northern{%
@@ -25030,14 +25038,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-samin.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-samin.ldf}[polyglossia: module for Northern Sami]
% We only provide this gloss for babel compatibility. Since samin is
% a sami variety, we use 'sami' with variant 'northern' now.
-\xpg@load@master@language{sami}
+\InheritGlossFile{sami}
% \end{macrocode}
% \iffalse
@@ -25048,7 +25056,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-sanskrit.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-sanskrit.ldf}[polyglossia: module for Sanskrit]
@@ -25077,56 +25085,55 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*[script=gujarati]{sanskrit}{sa-Gujr}
\setlanguagealias*[script=latin]{sanskrit}{sa-Latn}
-\define@key{sanskrit}{Script}[devanagari]{%
- \ifcsdef{fontsetup@sanskrit@#1}%
- {\csname fontsetup@sanskrit@#1\endcsname}%
- {\xpg@error{`#1' is not a valid script for Sanskrit}%
- }%
-}
-
-\define@key{sanskrit}{script}[devanagari]{\setkeys{sanskrit}{Script=#1}}
-
\def\fontsetup@sanskrit@devanagari{%
\SetLanguageKeys{sanskrit}{scripttag=deva,script=Devanagari,bcp47=sa-Deva,bcp47-language=sa,bcp47-script=Deva,bcp47-casing=sa-Deva}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@gujarati{%
\SetLanguageKeys{sanskrit}{scripttag=gujr,script=Gujarati,bcp47=sa-Gujr,bcp47-language=sa,bcp47-script=Gujr,bcp47-casing=sa-Gujr}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@malayalam{%
\SetLanguageKeys{sanskrit}{scripttag=mlym,script=Malayalam,bcp47=sa-Mlym,bcp47-language=sa,bcp47-script=Mlym,bcp47-casing=sa-Mlym}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@bengali{%
\SetLanguageKeys{sanskrit}{scripttag=beng,script=Bengali,bcp47=sa-Beng,bcp47-language=sa,bcp47-script=Beng,bcp47-casing=sa-Beng}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@kannada{%
\SetLanguageKeys{sanskrit}{scripttag=knda,script=Kannada,bcp47=sa-Knda,bcp47-language=sa,bcp47-script=Knda,bcp47-casing=sa-Knda}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@telugu{%
\SetLanguageKeys{sanskrit}{scripttag=telu,script=Telugu,bcp47=sa-Relu,bcp47-language=sa,bcp47-script=Relu,bcp47-casing=sa-Relu}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@latin{%
\SetLanguageKeys{sanskrit}{scripttag=latn,script=Latin,bcp47=sa-Latn,bcp47-language=sa,bcp47-script=Latn,bcp47-casing=sa-Latn}
- \xpg@fontsetup@latin{sanskrit}}
+ \SetupLatinPolyglossiaFont{sanskrit}}
\newif\ifsanskrit@devanagari@numerals
\sanskrit@devanagari@numeralstrue
-\define@choicekey*+{sanskrit}{numerals}[\xpg@val\xpg@nr]{devanagari,western}[devanagari]{%
- \ifcase\xpg@nr\relax
- % devanagari:
- \sanskrit@devanagari@numeralstrue%
- \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-deva}%
- \or
- % western:
- \sanskrit@devanagari@numeralsfalse%
- \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Sanskrit, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Sanskrit numeral `#1'}}
+\DeclareKeys[polyglossia/gloss/sanskrit]
+ {
+ script.code = \@ifundefined{fontsetup@sanskrit@#1}%
+ {\xpg@error{`#1' is not a valid script for Sanskrit}}%
+ {\csname fontsetup@sanskrit@#1\endcsname},
+ script.default:n = devanagari,
+ numerals.choice:,
+ numerals / devanagari.code =
+ {%
+ \sanskrit@devanagari@numeralstrue
+ \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-deva}%
+ },
+ numerals / western.code =
+ {%
+ \sanskrit@devanagari@numeralsfalse
+ \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Sanskrit numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{sanskrit}{script=devanagari,numerals=devanagari}
+\InitializeGlossOptions{sanskrit}{script=devanagari,numerals=devanagari}
% Use \providecommand here as the ldf file might
% be reloaded via BCP.
@@ -25207,14 +25214,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-scottish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-scottish.ldf}[polyglossia: module for Scottish Gaelic]
% We only provide this gloss for babel compatibility. Since scottish is
% a gaelic variety, we use 'gaelic' with variant 'scottish' now.
-\xpg@load@master@language{gaelic}
+\InheritGlossFile{gaelic}
% \end{macrocode}
% \iffalse
@@ -25225,7 +25232,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-serbian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-serbian.ldf}[polyglossia: module for Serbian]
%TODO split into gloss-serbiancyr.ldf and gloss-serbianlat.ldf
@@ -25266,67 +25273,10 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi
\newif\if@serbian@cyr
-\define@choicekey*+{serbian}{Script}[\xpg@val\xpg@nr]{cyrillic,latin}[cyrillic]{%
- \ifcase\xpg@nr\relax
- % cyrillic:
- \@serbian@cyrtrue
- \xpg@fontsetup@nonlatin{serbian}%
- \or
- % latin:
- \@serbian@cyrfalse
- \xpg@fontsetup@latin{serbian}%
- %TODO \def\serbian@language{\language=\l@serbianlat}%
- % or should we use Croatian patterns as a fallback for the time being???
- \fi
- \serbian@set@languagekeys%
- \xpg@info{Option: Serbian, script=\xpg@val}%
-}{\xpg@warning{Unknown Serbian script `#1'}}
-
-\define@key{serbian}{script}[cyrillic]{\setkeys{serbian}{Script=#1}}
-
\newif\if@serbian@ijekavian
-\define@choicekey*+{serbian}{variant}[\xpg@val\xpg@nr]{ekavian,ijekavian}[ekavian]{%
- \ifcase\xpg@nr\relax
- % ekavian:
- \@serbian@ijekavianfalse%
- \or
- % ijekavian:
- \@serbian@ijekaviantrue%
- \fi
- \serbian@set@languagekeys%
- \xpg@info{Option: Serbian, variant=\xpg@val}%
-}{\xpg@warning{Unknown Serbian variant `#1'}}
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{serbian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-latn}%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
- \fi
- \xpg@info{Option: Serbian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Serbian numerals value `#1'}}
-
-\define@boolkey{serbian}[serbian@]{splithyphens}[true]{}
-
-\define@boolkey{serbian}[serbian@]{datei}[true]{}
\def\serbian@set@languagekeys{%
\if@serbian@cyr
@@ -25344,10 +25294,75 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\fi%
}
-\setkeys{serbian}{Script,numerals}
+\DeclareKeys[polyglossia/gloss/serbian]
+ {
+ splithyphens.if = serbian@splithyphens,
+ splithyphens.default:n = true,
+ datei.if = serbian@datei,
+ datei.default:n = true,
+ variant.choice:,
+ variant / ekavian.code =
+ {%
+ \@serbian@ijekavianfalse
+ \serbian@set@languagekeys
+ },
+ variant / ijekavian.code =
+ {%
+ \@serbian@ijekaviantrue
+ \serbian@set@languagekeys
+ },
+ variant.default:n = ekavian,
+ variant/unknown.code = \xpg@warning{Unknown Serbian variant `#1'},
+ script.choice:,
+ script / cyrillic.code =
+ {%
+ \@serbian@cyrtrue
+ \SetupNonLatinPolyglossiaFont{serbian}%
+ \serbian@set@languagekeys
+ },
+ script / latin.code =
+ {%
+ \@serbian@cyrfalse
+ \SetupLatinPolyglossiaFont{serbian}%
+ %TODO \def\serbian@language{\language=\l@serbianlat}%
+ % or should we use Croatian patterns as a fallback for the time being???
+ \serbian@set@languagekeys
+ },
+ script.default:n = cyrillic,
+ script/unknown.code = \xpg@warning{Unknown Serbian script `#1'},
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{serbian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Serbian numerals value `#1'}
+ }
+
+\SetGlossOptions{serbian}{script,numerals}
% Register default options
-\xpg@initialize@gloss@options{serbian}{script=cyrillic,numerals=arabic,splithyphens=true}
+\InitializeGlossOptions{serbian}{script=cyrillic,numerals=arabic,splithyphens=true}
\def\captionsserbian{%
\if@serbian@cyr\captionsserbian@cyr\else\captionsserbian@lat\fi
@@ -25648,13 +25663,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-serbianc.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-serbianc.ldf}[polyglossia: module for Serbian (cyrillic)]
% We provide this as a babel alias
-\xpg@load@master@language{serbian}
+\InheritGlossFile{serbian}
% \end{macrocode}
% \iffalse
@@ -25665,7 +25680,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-slovak.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-slovak.ldf}[polyglossia: module for Slovak]
@@ -25686,26 +25701,26 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\RequirePackage{luavlna}
\fi
-\define@boolkey{slovak}[slovak@]{babelshorthands}[true]{}
-
-\define@boolkey{slovak}[slovak@]{splithyphens}[true]{}
-
-\define@boolkey{slovak}[slovak@]{vlna}[true]{}
+\DeclareKeys[polyglossia/gloss/slovak]
+ {
+ babelshorthands.if = slovak@babelshorthands,
+ babelshorthands.default:n = true,
+ splithyphens.if = slovak@splithyphens,
+ splithyphens.default:n = true,
+ vlna.if = slovak@vlna,
+ vlna.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{slovak}{babelshorthands=false,splithyphens=true,vlna=true}
+\InitializeGlossOptions{slovak}{babelshorthands=false,splithyphens=true,vlna=true}
\ifsystem@babelshorthands
- \setkeys{slovak}{babelshorthands=true}
+ \SetGlossOptions{slovak}{babelshorthands=true}
\else
- \setkeys{slovak}{babelshorthands=false}
+ \SetGlossOptions{slovak}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\let\xpg@hyphen@char-
\def\slovak@@splhyphen#1{%
@@ -25881,7 +25896,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\def\contentsname{Obsah}%
\def\listfigurename{Zoznam obrázkov}%
\def\listtablename{Zoznam tabuliek}%
- \def\indexname{Index}%
+ \def\indexname{Register}%
\def\figurename{Obrázok}%
\def\tablename{Tabuľka}%
%\def\thepart{}%
@@ -25932,13 +25947,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-slovene.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-slovene.ldf}[polyglossia: module for Slovenian]
% We provide this as a babel alias
-\xpg@load@master@language{slovenian}
+\InheritGlossFile{slovenian}
% \end{macrocode}
% \iffalse
@@ -25949,7 +25964,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-slovenian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-slovenian.ldf}[polyglossia: module for Slovenian]
@@ -25970,10 +25985,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% Babel aliases
\setlanguagealias{slovenian}{slovene}
-\define@boolkey{slovenian}[slovenian@]{localalph}[true]{}
+\DeclareKeys[polyglossia/gloss/slovenian]
+ {
+ localalph.if = slovenian@localalph,
+ localalph.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{slovenian}{localalph=false}
+\InitializeGlossOptions{slovenian}{localalph=false}
\def\captionsslovenian{%
@@ -26041,7 +26060,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-sorbian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-sorbian.ldf}[polyglossia: module for Sorbian]
@@ -26069,60 +26088,40 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias[variant=upper]{sorbian}{uppersorbian}
\def\sorbian@variant{usorbian}
-\define@choicekey*+{sorbian}{variant}[\xpg@val\xpg@nr]{upper,lower}[upper]{%
- \ifcase\xpg@nr\relax
- % upper:
- \def\sorbian@variant{usorbian}%
- \SetLanguageKeys{sorbian}{language=Upper Sorbian,langtag=USB,babelname=uppersorbian,bcp47=hsb,bcp47-language=hsb}%
- \xpg@fontsetup@latin{sorbian}%
- % Check if \l@usorbian is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{usorbian}{}{%
- \def\do##1{%
- \xpg@ifdefined{##1}%
- {\csletcs{l@usorbian}{l@##1}\listbreak}%
- {}%
- }%
- \docsvlist{uppersorbian}
- \xpg@ifdefined{usorbian}{}{%
- \xpg@warning{No hyphenation patterns for Upper Sorbian found\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@usorbian0%
- }
- }%
- \or
- % lower:
- \def\sorbian@variant{lsorbian}%
- \SetLanguageKeys{sorbian}{language=Lower Sorbian,langtag=LSB,babelname=lowersorbian,bcp47=dsb,bcp47-language=dsb}%
- \xpg@fontsetup@latin{sorbian}%
- % Check if \l@lsorbian is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{lsorbian}{}{%
- \def\do##1{%
- \xpg@ifdefined{##1}%
- {\csletcs{l@lsorbian}{l@##1}\listbreak}%
- {}%
- }%
- \docsvlist{lowersorbian,Lsorbian,usorbian,uppersorbian}
- \xpg@ifdefined{lsorbian}{}{%
- \xpg@warning{No hyphenation patterns for Lower Sorbian found\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@lsorbian0%
- }
- }%
- \fi
- \xpg@info{Option: sorbian, variant=\xpg@val}%
-}{\xpg@warning{Unknown sorbian variant `#1'}}
-
-\define@boolkey{sorbian}[sorbian@]{olddate}[true]{}
+\DeclareKeys[polyglossia/gloss/sorbian]
+ {
+ olddate.if = sorbian@olddate,
+ olddate.default:n = true,
+ variant.choice:,
+ variant / upper.code =
+ {%
+ \def\sorbian@variant{usorbian}%
+ \SetLanguageKeys{sorbian}{language=Upper Sorbian,langtag=USB,babelname=uppersorbian,bcp47=hsb,bcp47-language=hsb}%
+ \SetupLatinPolyglossiaFont{sorbian}%
+ % Check if \l@usorbian is defined. If not, try to set it to some variety
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{usorbian}{uppersorbian}%
+ },
+ variant / lower.code =
+ {%
+ \def\sorbian@variant{lsorbian}%
+ \SetLanguageKeys{sorbian}{language=Lower Sorbian,langtag=LSB,babelname=lowersorbian,bcp47=dsb,bcp47-language=dsb}%
+ \SetupLatinPolyglossiaFont{sorbian}%
+ % Check if \l@lsorbian is defined. If not, try to set it to some variety
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{lsorbian}{lowersorbian,Lsorbian,usorbian,uppersorbian}%
+ },
+ variant.default:n = upper,
+ variant/unknown.code = \xpg@warning{Unknown sorbian variant `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{sorbian}{variant=upper,olddate=false}
+\InitializeGlossOptions{sorbian}{variant=upper,olddate=false}
\def\sorbian@language{%
- \polyglossia@setup@language@patterns{\sorbian@variant}%
+ \SetupPolyglossiaLangPatterns{\sorbian@variant}%
}%
@@ -26232,7 +26231,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-spanish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-spanish.ldf}[polyglossia: module for Spanish]
@@ -26261,52 +26260,58 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@spanish@mexico
\@spanish@mexicofalse
-\define@choicekey*+{spanish}{variant}[\xpg@val\xpg@nr]{spanish,mexican}[spanish]{%
- \ifcase\xpg@nr\relax
- % spanish:
- \@spanish@mexicofalse%
- \SetLanguageKeys{spanish}{babelname=spanish,bcp47=es-ES,bcp47-region=ES}%
- \or
- % mexican:
- \@spanish@mexicotrue%
- \SetLanguageKeys{spanish}{babelname=spanishmx,bcp47=es-MX,bcp47-region=MX}%
- \fi
- \xpg@info{Option: spanish, variant=\xpg@val}%
-}{\xpg@warning{Unknown spanish variant `#1'}}
% Localized math operators à la babel
\newif\ifspanish@accentedoperators
\newif\ifspanish@spacedoperators
\newif\ifspanish@locoperators
-\define@choicekey*+{spanish}{spanishoperators}[\xpg@val\xpg@nr]{all,accented,spaced,none}[all]{%
- \ifcase\xpg@nr\relax
- % all:
- \spanish@locoperatorstrue%
- \spanish@accentedoperatorstrue%
- \spanish@spacedoperatorstrue%
- \or
- % accented:
- \spanish@locoperatorsfalse%
- \spanish@accentedoperatorstrue%
- \spanish@spacedoperatorsfalse%
- \or
- % spaced:
- \spanish@locoperatorsfalse%
- \spanish@accentedoperatorsfalse%
- \spanish@spacedoperatorstrue%
- \or
- % none:
- \spanish@locoperatorsfalse%
- \spanish@accentedoperatorsfalse%
- \spanish@spacedoperatorsfalse%
- \fi
- \xpg@info{Option: Spanish, spanishoperators=\xpg@val}%
-}{\xpg@warning{Unknown spanishoperators value `#1'}}
-
+\DeclareKeys[polyglossia/gloss/spanish]
+ {
+ variant.choice:,
+ variant / spanish.code =
+ {%
+ \@spanish@mexicofalse
+ \SetLanguageKeys{spanish}{babelname=spanish,bcp47=es-ES,bcp47-region=ES}%
+ },
+ variant / mexican.code =
+ {%
+ \@spanish@mexicotrue
+ \SetLanguageKeys{spanish}{babelname=spanishmx,bcp47=es-MX,bcp47-region=MX}%
+ },
+ variant.default:n = spanish,
+ variant/unknown.code = \xpg@warning{Unknown spanish variant `#1'},
+ spanishoperators.choice:,
+ spanishoperators / all.code =
+ {%
+ \spanish@locoperatorstrue
+ \spanish@accentedoperatorstrue
+ \spanish@spacedoperatorstrue
+ },
+ spanishoperators / accented.code =
+ {%
+ \spanish@locoperatorsfalse
+ \spanish@accentedoperatorstrue
+ \spanish@spacedoperatorsfalse
+ },
+ spanishoperators / spaced.code =
+ {%
+ \spanish@locoperatorsfalse
+ \spanish@accentedoperatorsfalse
+ \spanish@spacedoperatorstrue
+ },
+ spanishoperators / none.code =
+ {%
+ \spanish@locoperatorsfalse
+ \spanish@accentedoperatorsfalse
+ \spanish@spacedoperatorsfalse
+ },
+ spanishoperators.default:n = all,
+ spanishoperators/unknown.code = \xpg@warning{Unknown spanishoperators value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{spanish}{variant=spanish,spanishoperators=none}
+\InitializeGlossOptions{spanish}{variant=spanish,spanishoperators=none}
\let\xpg@save@lim\lim
\let\xpg@save@limsup\limsup
@@ -26472,13 +26477,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-spanishmx.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-spanishmx.ldf}[polyglossia: module for Mexican Spanish]
% We provide this as a babel alias
-\xpg@load@master@language{spanish}
+\InheritGlossFile{spanish}
% \end{macrocode}
% \iffalse
@@ -26489,7 +26494,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-swedish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-swedish.ldf}[polyglossia: module for Swedish]
@@ -26554,13 +26559,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-swissgerman.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-swissgerman.ldf}[polyglossia: module for Swiss German (old spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
% \end{macrocode}
% \iffalse
@@ -26571,7 +26576,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-syriac.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-syriac.ldf}[polyglossia: module for Syriac]
@@ -26595,34 +26600,37 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{syriac}{syr}
-\def\syriacnumber#1{\@syriacnumber{#1}}%
+\def\syriacnumber#1{\@syriacnumber{#1}}
\newif\if@eastern@numerals
-\define@choicekey*+{syriac}{numerals}[\xpg@val\xpg@nr]{eastern,western,abjad}[eastern]{%
- \ifcase\xpg@nr\relax
- % eastern:
- \@eastern@numeralstrue
- \SetLanguageKeys{syriac}{bcp47-extension-u=nu-syrc}%
- \or
- % western:
- \@eastern@numeralsfalse
- \SetLanguageKeys{syriac}{bcp47-extension-u=nu-latn}%
- \or
- % abjad:
- \let\syriacnumber\abjadsyriac%
- \fi
- \xpg@info{Option: Syriac, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Syriac numerals option `#1'}}
-
\newif\ifsyriac@customsep\syriac@customsepfalse
\def\xpg@sepmark{}
-\define@key{syriac}{sectionsep}[.]{%
- \syriac@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
+
+\DeclareKeys[polyglossia/gloss/syriac]
+ {
+ sectionsep.code = \gdef\xpg@sepmark{#1}\syriac@customseptrue,
+ sectionsep.default:n = .,
+ numerals.choice:,
+ numerals / eastern.code =
+ {%
+ \@eastern@numeralstrue
+ \SetLanguageKeys{syriac}{bcp47-extension-u=nu-syrc}%
+ },
+ numerals / western.code =
+ {%
+ \@eastern@numeralsfalse
+ \SetLanguageKeys{syriac}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / abjad.code =
+ {%
+ \let\syriacnumber\abjadsyriac
+ },
+ numerals.default:n = eastern,
+ numerals/unknown.code = \xpg@warning{Unknown Syriac numerals option `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{syriac}{numerals=western}
+\InitializeGlossOptions{syriac}{numerals=western}
%\define@key{polyglossia}{syriaclocale}[default]{%
% \def\@syriac@locale{#1}}
@@ -26709,13 +26717,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\IfCharIsAvailableTF{0661}%
{\@ensure@LTR{\protect\arabicdigits{\number#1}}}%
{\@ensure@LTR{\arabicdigits{\number#1}}
- \ifcsdef{arabicfont}%
- {\@ensure@LTR{\protect\arabicdigits{\number#1}}%
- \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
- I am using \string\arabicfont instead}}%
+ \@ifundefined{arabicfont}%
{\number#1%%% <---changed from \RL{\protect\reset@font\protect\number#1}%
\xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
since \string\arabicfont is not defined, we'll use Western numerals instead}}%
+ {\@ensure@LTR{\protect\arabicdigits{\number#1}}%
+ \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
+ I am using \string\arabicfont instead}}%
}%
\else
%%\RL{\protect\reset@font\number#1}%
@@ -26753,16 +26761,16 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nosyriac@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi%
}
\def\syriac@luatex@capsformat{%
%
% change chapter and part headings
\ifsyriac@customsep
- \ifcsdef{chapter}{%
+ \ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
@@ -26774,7 +26782,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
+ \fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
@@ -26789,30 +26797,30 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nosyriac@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
+ \ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
+ \fi%
+ \ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
+ \fi%
+ \ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
+ \fi%
+ \ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
+ \fi%
+ \ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
+ \ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
+ \fi%
+ \fi%
+ \ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
+ \fi%
+ \ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \fi%
}
\def\blockextras@syriac{%
@@ -26844,7 +26852,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-tamil.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-tamil.ldf}[polyglossia: module for Tamil]
@@ -26914,7 +26922,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-telugu.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-telugu.ldf}[polyglossia: module for Telugu]
@@ -26987,7 +26995,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-thai.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-thai.ldf}[polyglossia: module for Thai]
%% This is partly based on thai-latex for Babel:
@@ -27018,19 +27026,25 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@thai@numerals
\def\tmp@thai{thai}
-\define@key{thai}{numerals}[arabic]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@thai
- \@thai@numeralstrue%
- \SetLanguageKeys{thai}{bcp47-extension-u=nu-thai}%
- \else
- \@thai@numeralsfalse%
- \SetLanguageKeys{thai}{bcp47-extension-u=nu-latn}%
- \fi
-}
+
+\DeclareKeys[polyglossia/gloss/thai]
+ {
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \@thai@numeralsfalse
+ \SetLanguageKeys{thai}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / thai.code =
+ {%
+ \@thai@numeralstrue
+ \SetLanguageKeys{thai}{bcp47-extension-u=nu-thai}%
+ },
+ numerals.default:n = arabic,
+ }
% Register default options
-\xpg@initialize@gloss@options{thai}{numerals=arabic}
+\InitializeGlossOptions{thai}{numerals=arabic}
\def\captionsthai{%
\def\refname{หนังสืออ้างอิง}%
@@ -27145,7 +27159,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-tibetan.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-tibetan.ldf}[polyglossia: module for Tibetan]
%% Copyright 2013 Elie Roux
@@ -27171,20 +27185,18 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*{tibetan}{bo}
\newif\if@tibetan@numerals
-\def\tmp@tibetan{tibetan}
-\define@key{tibetan}{numerals}[tibetan]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@tibetan
- \@tibetan@numeralstrue%
- \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-tibt}%
- \else
- \@tibetan@numeralsfalse%
- \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-latn}%
- \fi%
-}
+\DeclareKeys[polyglossia/gloss/tibetan]
+ {
+ numerals.choice:,
+ numerals/tibetan.code = \@tibetan@numeralstrue
+ \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-tibt},
+ numerals/arabic.code = \@tibetan@numeralsfalse
+ \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-latn},
+ numerals.default:n = tibetan
+ }
\ifluatex
- \newluatexattribute\xpg@tibteol %
+ \newattribute\xpg@tibteol %
\directlua{polyglossia.load_tibt_eol()}%
\fi
@@ -27209,7 +27221,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
% Register default options
-\xpg@initialize@gloss@options{tibetan}{numerals=tibetan}
+\InitializeGlossOptions{tibetan}{numerals=tibetan}
% some are known, but very few
% a few come from "Standardizing Tibetan Terms of Information Technology"
@@ -27371,7 +27383,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-turkish.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-turkish.ldf}[polyglossia: module for Turkish]
\RequirePackage{hijrical}
@@ -27489,7 +27501,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-turkmen.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-turkmen.ldf}[polyglossia: module for Turkmen]
%% Translations provided by Nazar Annagurban <nazartm at gmail dot com>
@@ -27547,12 +27559,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ug.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ug.ldf}[polyglossia: module for ug (Uyghur)]
% BCP 47 tag for Uyghur
-\xpg@load@master@language{uyghur}
+\InheritGlossFile{uyghur}
% \end{macrocode}
% \iffalse
@@ -27563,7 +27575,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-ukrainian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ukrainian.ldf}[polyglossia: module for Ukrainian]
% Strings taken from Babel
@@ -27591,51 +27603,52 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{ukrainian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-latn}%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
- \fi
- \xpg@info{Option: Ukrainian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Ukrainian numerals value `#1'}}
-
-% Define some math functions
-\define@boolkey{ukrainian}[ukrainian@]{mathfunctions}[true]{}
+\DeclareKeys[polyglossia/gloss/ukrainian]
+ {
+ babelshorthands.if = ukrainian@babelshorthands,
+ babelshorthands.default:n = true,
+ mathfunctions.if = ukrainian@mathfunctions,
+ mathfunctions.default:n = true,
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Ukrainian numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{ukrainian}{numerals=arabic,mathfunctions=true}
-
-\define@boolkey{ukrainian}[ukrainian@]{babelshorthands}[true]{}
+\InitializeGlossOptions{ukrainian}{numerals=arabic,mathfunctions=true}
\ifsystem@babelshorthands
- \setkeys{ukrainian}{babelshorthands=true}
+ \SetGlossOptions{ukrainian}{babelshorthands=true}
\else
- \setkeys{ukrainian}{babelshorthands=false}
+ \SetGlossOptions{ukrainian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\ukrainian@shorthands{%
\xpg@activate@shorthands%
@@ -27862,13 +27875,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-uppersorbian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-uppersorbian.ldf}[polyglossia: module for Upper Sorbian]
% We provide this as a babel alias
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
% \end{macrocode}
% \iffalse
@@ -27879,7 +27892,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-urdu.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
%%% Adapted from a file contributed by Kamal Abdali
\ProvidesFile{gloss-urdu.ldf}[polyglossia: module for Urdu]
@@ -27906,52 +27919,46 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setlanguagealias*{urdu}{ur}
\newif\if@western@numerals
-\define@choicekey*+{urdu}{numerals}[\xpg@val\xpg@nr]{eastern,western}[eastern]{%
- \ifcase\xpg@nr\relax
- % eastern:
- \@western@numeralsfalse%
- \SetLanguageKeys{urdu}{bcp47-extension-u=nu-arab}%
- \or
- % western:
- \@western@numeralstrue%
- \SetLanguageKeys{urdu}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Urdu, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Urdu numerals option `#1'}}
-
\newif\ifurdu@customsep\urdu@customsepfalse
\def\xpg@sepmark{}
-\define@key{urdu}{sectionsep}[.]{%
- \urdu@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
-
-%this is needed for \abjad in arabicnumbers.sty
-\define@boolkey{urdu}[urdu@]{abjadjimnotail}[true]{%
- \ifurdu@abjadjimnotail
- \abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi%
-}
-
\newif\if@hijrical
-\define@choicekey*+{urdu}{calendar}[\xpg@val\xpg@nr]{gregorian,hijri}[gregorian]{%
- \ifcase\xpg@nr\relax
- % gregorian:
- \@hijricalfalse
- \or
- % hijri:
- \@hijricaltrue
- \fi
- \xpg@info{Option: Urdu, calendar=\xpg@val}%
-}{\xpg@warning{Unknown Urdu calendar option `#1'}}
-\define@key{urdu}{hijricorrection}[0]{%
- \gdef\urdu@hijri@correction{#1}}%
+\DeclareKeys[polyglossia/gloss/urdu]
+ {
+ abjadjimnotail.if = abjad@jim@notail,
+ abjadjimnotail.default:n = true,
+ sectionsep.code = \gdef\xpg@sepmark{#1}\urdu@customseptrue,
+ sectionsep.default:n = .,
+ hijricorrection.code = \gdef\urdu@hijri@correction{#1},
+ hijricorrection.default:n = 0,
+ calendar.choice:,
+ calendar / gregorian.code =
+ {%
+ \@hijricalfalse
+ },
+ calendar / hijri.code =
+ {%
+ \@hijricaltrue
+ },
+ calendar.default:n = gregorian,
+ calendar/unknown.code = \xpg@warning{Unknown Urdu calendar option `#1'},
+ numerals.choice:,
+ numerals / eastern.code =
+ {%
+ \@western@numeralsfalse
+ \SetLanguageKeys{urdu}{bcp47-extension-u=nu-arab}%
+ },
+ numerals / western.code =
+ {%
+ \@western@numeralstrue
+ \SetLanguageKeys{urdu}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = eastern,
+ numerals/unknown.code = \xpg@warning{Unknown Urdu numerals option `#1'}
+ }
% This should set the defaults
-\setkeys{urdu}{calendar,numerals,hijricorrection}
+\SetGlossOptions{urdu}{calendar,numerals,hijricorrection}
\def\urdugregmonth#1{\ifcase#1%
\or جنوری\or فروری\or مارچ\or اپریل\or مئی\or جون\or جولائی\or اگست\or ستمبر\or اکتوبر\or نومبر\or دسمبر\fi}
@@ -28038,16 +28045,16 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nourdu@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi%
}
\def\urdu@luatex@capsformat{%
%
% change chapter and part headings
\ifurdu@customsep
- \ifcsdef{chapter}{%
+ \ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
@@ -28059,7 +28066,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
+ \fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
@@ -28074,30 +28081,30 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
}
\def\nourdu@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
+ \ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
+ \fi%
+ \ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
+ \fi%
+ \ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
+ \fi%
+ \ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
+ \fi%
+ \ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
+ \ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
+ \fi%
+ \fi%
+ \ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
+ \fi%
+ \ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \fi%
}
\def\blockextras@urdu{%
@@ -28129,14 +28136,14 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-usorbian.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-usorbian.ldf}[polyglossia: module for Upper Sorbian]
% We only provide this gloss for babel compatibility. Since usorbian is
% a sorbian variety, we use 'sorbian' with variant 'upper' now.
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
% \end{macrocode}
% \iffalse
@@ -28147,7 +28154,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-uyghur.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-uyghur.ldf}[polyglossia: module for Uyghur]
%% Translations provided by Osman Tursun (Github Account: neouyghur)
@@ -28171,62 +28178,72 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\newif\if@uyghur@swapcaptions
\newif\if@uyghur@swapheadings
\newif\if@uyghur@swapheaders
-\define@choicekey*+{uyghur}{swapstrings}[\xpg@val\xpg@nr]{all,captions,headings,headers,hheaders,none}[all]{%
- \ifcase\xpg@nr\relax
- % all:
- \@uyghur@swapcaptionstrue%
- \@uyghur@swapheadingstrue%
- \@uyghur@swapheaderstrue%
- \or
- % captions:
- \@uyghur@swapcaptionstrue%
- \@uyghur@swapheadingsfalse%
- \@uyghur@swapheadersfalse%
- \or
- % headings:
- \@uyghur@swapcaptionsfalse%
- \@uyghur@swapheadingstrue%
- \@uyghur@swapheadersfalse%
- \or
- % headers:
- \@uyghur@swapcaptionsfalse%
- \@uyghur@swapheadingsfalse%
- \@uyghur@swapheaderstrue%
- \or
- % hheaders:
- \@uyghur@swapcaptionsfalse%
- \@uyghur@swapheadingstrue%
- \@uyghur@swapheaderstrue%
- \or
- % none:
- \@uyghur@swapcaptionsfalse%
- \@uyghur@swapheadingsfalse%
- \@uyghur@swapheadersfalse%
- \fi
- \xpg@info{Option: Uyghur, swapstrings=\xpg@val}%
-}{\xpg@warning{Unknown Uyghur swapstrings value `#1'}}
-
\newif\if@uyghur@ordchapter
\newif\if@uyghur@romchapter
-\define@choicekey*+{uyghur}{chapterformat}[\xpg@val\xpg@nr]{ordinal,roman,arabic}[ordinal]{%
- \ifcase\xpg@nr\relax
- % ordinal:
- \@uyghur@ordchaptertrue%
- \@uyghur@romchapterfalse%
- \or
- % roman:
- \@uyghur@ordchapterfalse%
- \@uyghur@romchaptertrue%
- \or
- % arabic:
- \@uyghur@ordchapterfalse%
- \@uyghur@romchapterfalse%
- \fi
- \xpg@info{Option: Uyghur, chapterformat=\xpg@val}%
-}{\xpg@warning{Unknown Uyghur chapterformat value `#1'}}
+
+\DeclareKeys[polyglossia/gloss/uyghur]
+ {
+ chapterformat.choice:,
+ chapterformat / ordinal.code =
+ {%
+ \@uyghur@ordchaptertrue
+ \@uyghur@romchapterfalse
+ },
+ chapterformat / roman.code =
+ {%
+ \@uyghur@ordchapterfalse
+ \@uyghur@romchaptertrue
+ },
+ chapterformat / arabic.code =
+ {%
+ \@uyghur@ordchapterfalse
+ \@uyghur@romchapterfalse
+ },
+ chapterformat.default:n = ordinal,
+ chapterformat/unknown.code = \xpg@warning{Unknown Uyghur chapterformat value `#1'},
+ swapstrings.choice:,
+ swapstrings / all.code =
+ {%
+ \@uyghur@swapcaptionstrue
+ \@uyghur@swapheadingstrue
+ \@uyghur@swapheaderstrue
+ },
+ swapstrings / captions.code =
+ {%
+ \@uyghur@swapcaptionstrue
+ \@uyghur@swapheadingsfalse
+ \@uyghur@swapheadersfalse
+ },
+ swapstrings / headings.code =
+ {%
+ \@uyghur@swapcaptionsfalse
+ \@uyghur@swapheadingstrue
+ \@uyghur@swapheadersfalse
+ },
+ swapstrings / headers.code =
+ {%
+ \@uyghur@swapcaptionsfalse
+ \@uyghur@swapheadingsfalse
+ \@uyghur@swapheaderstrue
+ },
+ swapstrings / hheaders.code =
+ {%
+ \@uyghur@swapcaptionsfalse
+ \@uyghur@swapheadingstrue
+ \@uyghur@swapheaderstrue
+ },
+ swapstrings / none.code =
+ {%
+ \@uyghur@swapcaptionsfalse
+ \@uyghur@swapheadingsfalse
+ \@uyghur@swapheadersfalse
+ },
+ swapstrings.default:n = all,
+ swapstrings/unknown.code = \xpg@warning{Unknown Uyghur swapstrings value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{uyghur}{swapstrings=all,chapterformat=ordinal}
+\InitializeGlossOptions{uyghur}{swapstrings=all,chapterformat=ordinal}
\def\captionsuyghur{%
@@ -28274,120 +28291,104 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% change chapter and part headings
\if@uyghur@swapheadings
% With titlesec
- \ifcsdef{titleformat}{%
- \ifcsdef{H@old@part}{% Hyperref
- \let\xpg@save@part@format\H@old@part%
- \patchcmd{\H@old@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }{}%
- }
- \ifcsdef{chapter}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
- {\the@uyghur@chapter\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }{}%
- }{% (not \ifdefined\titleformat)
+ \@ifundefined{titleformat}{%
% With KOMA
- \ifcsdef{sectionformat}{%
- \ifcsdef{partformat}{%
- \let\xpg@save@part@format\partformat%
- \renewcommand{\partformat}{\the@uyghur@part~\partname}%
- }{}%
- \ifcsdef{chapterformat}{%
- \let\xpg@save@chap@format\chapterformat%
- \renewcommand{\chapterformat}{\mbox{\the@uyghur@chapter%
- \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
- }{}%
- }{% (not \ifdefined\sectionformat)
+ \@ifundefined{sectionformat}{%
% With memoir
- \ifcsdef{@memptsize}{%
- \ifcsdef{@makechapterhead}{%
- \let\xpg@save@chap@format\@makechapterhead%
- \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
- {\chapnumfont\the@uyghur@chapter\chapternamenum\printchaptername}%
- {}%
- {\xpg@warning{Failed to patch chapter for Uyghur}}%
- }{}%
- \ifcsdef{H@old@part}{% Hyperref
- \let\xpg@save@part@format\H@old@part%
- \patchcmd{\H@old@part}{\printpartname \partnamenum \printpartnum}%
- {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
- {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }{}%
- }%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{@makechapterhead}{%
+ \@ifundefined{@makechapterhead}{}{%
\let\xpg@save@chap@format\@makechapterhead%
\patchcmd{\@makechapterhead}%
{\@chapapp\space \thechapter}%
{\the@uyghur@chapter\space \@chapapp}%
{}%
{\xpg@warning{Failed to patch chapter for Uyghur}}%
- }{}%
- \ifcsdef{H@old@part}{% Hyperref
+ }%
+ \@ifundefined{H@old@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\the@uyghur@part\nobreakspace\partname}%
+ {}%
+ {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Uyghur}}}%
+ }% (end \ifdefined\@part)
+ }{% Hyperref
\let\xpg@save@part@format\H@old@part%
\patchcmd{\H@old@part}%
{\partname\nobreakspace\thepart}%
{\the@uyghur@part\nobreakspace\partname}%
{}%
{\xpg@warning{Failed to patch part for Uyghur}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\ifcsdef{part}{\xpg@warning{Failed to patch part for Uyghur}}{}}%
- }{}% (end \ifdefined\@part)
}% (end not hyperref)
- }% (end \ifdefined\@memptsize)
- }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\@memptsize)
+ \@ifundefined{@makechapterhead}{}{%
+ \let\xpg@save@chap@format\@makechapterhead%
+ \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
+ {\chapnumfont\the@uyghur@chapter\chapternamenum\printchaptername}%
+ {}%
+ {\xpg@warning{Failed to patch chapter for Uyghur}}%
+ }%
+ \@ifundefined{H@old@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
+ {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Uyghur}}%
+ }%
+ }{% Hyperref
+ \let\xpg@save@part@format\H@old@part%
+ \patchcmd{\H@old@part}{\printpartname \partnamenum \printpartnum}%
+ {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Uyghur}}%
+ }%
+ }% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\sectionformat)
+ \@ifundefined{partformat}{}{%
+ \let\xpg@save@part@format\partformat%
+ \renewcommand{\partformat}{\the@uyghur@part~\partname}%
+ }%
+ \@ifundefined{chapterformat}{}{%
+ \let\xpg@save@chap@format\chapterformat%
+ \renewcommand{\chapterformat}{\mbox{\the@uyghur@chapter%
+ \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ \@ifundefined{H@old@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\the@uyghur@part\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Uyghur}}%
+ }%
+ }{% Hyperref
+ \let\xpg@save@part@format\H@old@part%
+ \patchcmd{\H@old@part}%
+ {\partname\nobreakspace\thepart}%
+ {\the@uyghur@part\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Uyghur}}%
+ }%
+ \@ifundefined{chapter}{}{%
+ \titleformat\chapter[display]%
+ {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
+ {\the@uyghur@chapter\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
+ }%
}% (end \ifdefined\titleformat)
\fi% (end \if@uyghur@swapheadings)
%
% Change running headers
\if@uyghur@swapheaders
- \ifcsdef{chapterformat}{%
- % With KOMA
- \let\xpg@save@chaptermark@format\chaptermarkformat%
- \renewcommand*\chaptermarkformat{%
- \the@uyghur@chapter\ \IfChapterUsesPrefixLine{\chapapp\enskip}{}}
- }{% (not \ifdefined\chapterformat)
- \ifcsdef{@memptsize}{%
- % With memoir
- \let\xpg@save@chaptermark@format\chaptermark%
- \renewcommand*\chaptermark[1]{%
- \markboth{\memUChead{%
- \ifnum \c@secnumdepth >\m@ne
- \ifbool{@mainmatter}{%
- \the@uyghur@chapter\ \@chapapp\ %
- }{}%
- \fi
- ##1}}{}}%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{chapterformat}{%
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermark}{}{%
\ifpatchable{\chaptermark}%
{\@chapapp\ \thechapter.}%
{\let\xpg@save@chaptermark@format\chaptermark%
@@ -28397,21 +28398,38 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
{}%
{\xpg@warning{Failed to patch chaptermark for Uyghur}}}%
{}%
- }{}% (end \ifdefined\sectionmark)
- \ifcsdef{sectionmark}{%
- \ifpatchable{\sectionmark}%
- {\thesection.}%
- {\let\xpg@save@sectionmark@format\sectionmark%
- \patchcmd{\sectionmark}%
- {\thesection.}%
- {\thesection}%
- {}%
- {\xpg@warning{Failed to patch sectionmark for Uyghur}}}%
- {}%
- }{}% (end \ifdefined\chaptermark)
+ }% (end \ifdefined\sectionmark)
+ \@ifundefined{sectionmark}{}{%
+ \ifpatchable{\sectionmark}%
+ {\thesection.}%
+ {\let\xpg@save@sectionmark@format\sectionmark%
+ \patchcmd{\sectionmark}%
+ {\thesection.}%
+ {\thesection}%
+ {}%
+ {\xpg@warning{Failed to patch sectionmark for Uyghur}}%
+ }%
+ {}%
+ }% (end \ifdefined\chaptermark)
+ }{% (\ifdefined\@memptsize)
+ % With memoir
+ \let\xpg@save@chaptermark@format\chaptermark%
+ \renewcommand*\chaptermark[1]{%
+ \markboth{\memUChead{%
+ \ifnum \c@secnumdepth >\m@ne
+ \ifbool{@mainmatter}{%
+ \the@uyghur@chapter\ \@chapapp\ %
+ }{}%
+ \fi
+ ##1}}{}}%
}% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\chapterformat)
+ % With KOMA
+ \let\xpg@save@chaptermark@format\chaptermarkformat%
+ \renewcommand*\chaptermarkformat{%
+ \the@uyghur@chapter\ \IfChapterUsesPrefixLine{\chapapp\enskip}{}}
}% (end \ifdefined\chapterformat)
- \fi% (end \if@uyghur@swapheaders)
+ \fi% (end \if@uyghur@swapheaders)
}
\def\nouyghur@capsformat{%
@@ -28421,62 +28439,62 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\fnum@figure\xpg@save@fnum@figure%
%
% Reset chapter and part heading
- \ifcsdef{titleformat}{%
+ \@ifundefined{titleformat}{%
+ \@ifundefined{sectionformat}{%
+ % With memoir and standard classes
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{H@old@part}{%
+ \let\@part\xpg@save@part@format%
+ }{%
+ \let\H@old@part\xpg@save@part@format%
+ }%
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\@makechapterhead\xpg@save@chap@format
+ }%
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@part@format}{}{%
+ \let\partformat\xpg@save@part@format
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\chapterformat\xpg@save@chap@format
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
% With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{H@old@part}{%
- \let\H@old@part\xpg@save@part@format%
- }{%
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{H@old@part}{%
\let\@part\xpg@save@part@format%
+ }{%
+ \let\H@old@part\xpg@save@part@format%
}%
- }{}%
- \ifcsdef{chapter}{%
+ }%
+ \@ifundefined{chapter}{}{%
\titleformat\chapter[display]%
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
{\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }{}%
- }{% (not \ifdefined\titleformat)
- \ifcsdef{sectionformat}{%
- % With KOMA
- \ifcsdef{xpg@save@part@format}{%
- \let\partformat\xpg@save@part@format
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\chapterformat\xpg@save@chap@format
- }{}%
- }{%
- % With memoir and standard classes
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{H@old@part}{%
- \let\H@old@part\xpg@save@part@format%
- }{%
- \let\@part\xpg@save@part@format%
- }%
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\@makechapterhead\xpg@save@chap@format
- }{}%
- }% (end \ifdefined\sectionformat)
+ }%
}% (end \ifdefined\titleformat)
%
% Reset headers
- \ifcsdef{chaptermarkformat}{%
- % With KOMA
- \ifcsdef{xpg@save@chaptermark@format}{%
- \let\chaptermarkformat\xpg@save@chaptermark@format%
- }{}%
- }{%
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermarkformat}{%
+ \@ifundefined{chaptermark}{}{%
% With memoir and standard classes
- \ifcsdef{xpg@save@chaptermark@format}{%
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
\let\chaptermark\xpg@save@chaptermark@format%
- }{}%
- }{}% (end \ifdefined\chaptermark)
- \ifcsdef{sectionmark}{%
- \ifcsdef{xpg@save@sectionmark@format}{%
+ }%
+ }% (end \ifdefined\chaptermark)
+ \@ifundefined{sectionmark}{}{%
+ \@ifundefined{xpg@save@sectionmark@format}{}{%
\let\sectionmark\xpg@save@sectionmark@format%
- }{}%
- }{}% (end \ifdefined\sectionmark)
+ }%
+ }% (end \ifdefined\sectionmark)
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
+ \let\chaptermarkformat\xpg@save@chaptermark@format%
+ }%
}% (end \ifdefined\chapterformat)
}
@@ -28512,22 +28530,22 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\let\the@uyghur@chapter\thechapter
\def\uyghur@chapterformat{%
- \ifcsdef{part}{%
+ \@ifundefined{part}{}{%
\if@uyghur@ordchapter%
\renewcommand{\the@uyghur@part}{\uyghurord{part}}%
\fi%
\if@uyghur@romchapter%
\renewcommand{\the@uyghur@part}{\Roman{part}}%
\fi%
- }{}%
- \ifcsdef{chapter}{%
+ }%
+ \@ifundefined{chapter}{}{%
\if@uyghur@ordchapter%
\renewcommand{\the@uyghur@chapter}{\uyghurord{chapter}}%
\fi%
\if@uyghur@romchapter%
\renewcommand{\the@uyghur@chapter}{\Roman{chapter}}%
\fi%
- }{}%
+ }%
}
\def\uyghur@numbers{%
@@ -28588,7 +28606,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-vietnamese.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-vietnamese.ldf}[polyglossia: module for Vietnamese]
%% Strings contributed by Daniel Owens < dhowens . pmbx . net >
@@ -28647,7 +28665,7 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-welsh.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-welsh.ldf}[polyglossia: module for Welsh]
@@ -28664,21 +28682,26 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
% BCP-47 compliant aliases
\setlanguagealias*{welsh}{cy}
-\providebool{welsh@formaldate}
+\@ifundefined{ifwelsh@formaldate}%
+ {\newif\ifwelsh@formaldate}{}
-\define@choicekey*+{welsh}{date}[\xpg@val\xpg@nr]{long,short}[short]{%
- \ifcase\xpg@nr\relax
- % long:
- \welsh@formaldatetrue
- \or
- % accented:
- \welsh@formaldatefalse
- \fi
- \xpg@info{Option: Welsh, date=\xpg@val}%
-}{\xpg@warning{Unknown date value `#1'}}
+\DeclareKeys[polyglossia/gloss/welsh]
+ {
+ date.choice:,
+ date / long.code =
+ {%
+ \welsh@formaldatetrue
+ },
+ date / short.code =
+ {%
+ \welsh@formaldatefalse
+ },
+ date.default:n = short,
+ date/unknown.code = \xpg@warning{Unknown date value `#1'},
+ }
% Register default options
-\xpg@initialize@gloss@options{welsh}{date=short}
+\InitializeGlossOptions{welsh}{date=short}
\def\captionswelsh{%
\def\refname{Cyfeiriadau}%
@@ -28747,13 +28770,13 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-zh-CN.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-zh-CN.ldf}[polyglossia: module for zh-CN (Chinese)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{chinese}
+\InheritGlossFile{chinese}
% \end{macrocode}
% \iffalse
@@ -28764,268 +28787,26 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
%
% \subsection{gloss-zh-TW.ldf}
% \begin{macrocode}
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-zh-TW.ldf}[polyglossia: module for zh-TW (Chinese)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{chinese}
+\InheritGlossFile{chinese}
% \end{macrocode}
% \iffalse
%</gloss-zh-TW.ldf>
-%<*arabicdigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{arabicdigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "ArabicDigits"
-
-pass(Unicode)
-U+0030 <> U+0660 ;
-U+0031 <> U+0661 ;
-U+0032 <> U+0662 ;
-U+0033 <> U+0663 ;
-U+0034 <> U+0664 ;
-U+0035 <> U+0665 ;
-U+0036 <> U+0666 ;
-U+0037 <> U+0667 ;
-U+0038 <> U+0668 ;
-U+0039 <> U+0669 ;
-
-% \end{macrocode}
-% \iffalse
-%</arabicdigits.map>
-%<*bengalidigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{bengalidigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "BengaliDigits"
-
-pass(Unicode)
-U+0030 <> U+09E6 ;
-U+0031 <> U+09E7 ;
-U+0032 <> U+09E8 ;
-U+0033 <> U+09E9 ;
-U+0034 <> U+09EA ;
-U+0035 <> U+09EB ;
-U+0036 <> U+09EC ;
-U+0037 <> U+09ED ;
-U+0038 <> U+09EE ;
-U+0039 <> U+09EF ;
-
-% \end{macrocode}
-% \iffalse
-%</bengalidigits.map>
-%<*devanagaridigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{devanagaridigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "DevanagariDigits"
-
-pass(Unicode)
-U+0030 <> U+0966 ;
-U+0031 <> U+0967 ;
-U+0032 <> U+0968 ;
-U+0033 <> U+0969 ;
-U+0034 <> U+096A ;
-U+0035 <> U+096B ;
-U+0036 <> U+096C ;
-U+0037 <> U+096D ;
-U+0038 <> U+096E ;
-U+0039 <> U+096F ;
-
-% \end{macrocode}
-% \iffalse
-%</devanagaridigits.map>
-%<*farsidigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{farsidigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "FarsiDigits"
-
-pass(Unicode)
-U+0030 <> U+06F0 ;
-U+0031 <> U+06F1 ;
-U+0032 <> U+06F2 ;
-U+0033 <> U+06F3 ;
-U+0034 <> U+06F4 ;
-U+0035 <> U+06F5 ;
-U+0036 <> U+06F6 ;
-U+0037 <> U+06F7 ;
-U+0038 <> U+06F8 ;
-U+0039 <> U+06F9 ;
-
-% \end{macrocode}
-% \iffalse
-%</farsidigits.map>
-%<*gurmukhidigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{gurmukhidigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "GurmukhiDigits"
-
-pass(Unicode)
-U+0030 <> U+0A66 ;
-U+0031 <> U+0A67 ;
-U+0032 <> U+0A68 ;
-U+0033 <> U+0A69 ;
-U+0034 <> U+0A6A ;
-U+0035 <> U+0A6B ;
-U+0036 <> U+0A6C ;
-U+0037 <> U+0A6D ;
-U+0038 <> U+0A6E ;
-U+0039 <> U+0A6F ;
-
-% \end{macrocode}
-% \iffalse
-%</gurmukhidigits.map>
-%<*odiadigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{odiadigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "OdiaDigits"
-
-pass(Unicode)
-U+0030 <> U+0B66 ;
-U+0031 <> U+0B67 ;
-U+0032 <> U+0B68 ;
-U+0033 <> U+0B69 ;
-U+0034 <> U+0B6A ;
-U+0035 <> U+0B6B ;
-U+0036 <> U+0B6C ;
-U+0037 <> U+0B6D ;
-U+0038 <> U+0B6E ;
-U+0039 <> U+0B6F ;
-
-% \end{macrocode}
-% \iffalse
-%</odiadigits.map>
-%<*thaidigits.map>
-% \fi
-% \clearpage
-%
-% \subsection{thaidigits.map}
-% \begin{macrocode}
-; FC ...
-LHSName "Digits"
-RHSName "ThaiDigits"
-
-pass(Unicode)
-U+0030 <> U+0E50 ;
-U+0031 <> U+0E51 ;
-U+0032 <> U+0E52 ;
-U+0033 <> U+0E53 ;
-U+0034 <> U+0E54 ;
-U+0035 <> U+0E55 ;
-U+0036 <> U+0E56 ;
-U+0037 <> U+0E57 ;
-U+0038 <> U+0E58 ;
-U+0039 <> U+0E59 ;
-
-% \end{macrocode}
-% \iffalse
-%</thaidigits.map>
-%<*polyglossia-french.lua>
-% \fi
-% \clearpage
-%
-% \subsection{polyglossia-french.lua}
-% \begin{macrocode}
---
--- polyglossia-punct.lua
--- part of polyglossia v2.1 -- 2024/03/07
---
-
-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)
- set_left_space(lang, '‽', 0.5) -- U+203D (interrobang)
-
- 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
-% \end{macrocode}
-% \iffalse
-%</polyglossia-french.lua>
-%<*polyglossia-korean.lua>
+%<*polyglossia-cjk-spacing.lua>
% \fi
% \clearpage
%
-% \subsection{polyglossia-korean.lua}
+% \subsection{polyglossia-cjk-spacing.lua}
% \begin{macrocode}
--
--- polyglossia-korean.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- polyglossia-cjk-spacing.lua
+-- part of polyglossia v2.2 -- 2024/07/15
--
local glyph_id = node.id"glyph"
@@ -29033,13 +28814,17 @@ local hbox_id = node.id"hlist"
local vbox_id = node.id"vlist"
local glue_id = node.id"glue"
local penalty_id = node.id"penalty"
-local disc_id = node.id"disc"
+local whatsit_id = node.id"whatsit"
+local math_id = node.id"math"
--
--- attr_korean: variant = plain (0), classic (1), modern (2)
+-- attr_cjk: variant = plain: 0, JP/classic: 1, KR/modern: 2, SC: 3, TC: 4
+--
+local attr_cjk = luatexbase.attributes["xpg@attr@cjkspacing"]
+--
+-- attr_josa: ONLY For Korean. DO NOT declare \newattribute for other langs
--
-local attr_korean = luatexbase.attributes["xpg@attr@korean"]
-local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
+local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
--
-- characters after which linebreak is not allowed
@@ -29088,9 +28873,9 @@ local nobr_after = {
-- characters before which linebreak is not allowed
-- (currently, not much differences among the followings)
-- 1: normal chars
--- 2: hangul jamo vowels and trailing consonants
+-- 2: hangul jamo vowels and trailing consonants plus combinings
-- 3: kana small letters
--- 0: dashes (supress visible spacing)
+-- 0: dashes (suppress visible spacing after this char)
--
local nobr_before = setmetatable({
[0x21] = 1, -- ! EXCLAMATION MARK
@@ -29101,7 +28886,7 @@ local nobr_before = setmetatable({
[0x2D] = 0, -- - HYPHEN-MINUS
[0x2E] = 1, -- . FULL STOP
[0x2F] = 0, -- / SOLIDUS
- [0x3A] = 0, -- : COLON
+ [0x3A] = 1, -- : COLON
[0x3B] = 1, -- ; SEMICOLON
[0x3E] = 1, -- > GREATER-THAN SIGN
[0x3F] = 1, -- ? QUESTION MARK
@@ -29113,11 +28898,11 @@ local nobr_before = setmetatable({
[0xBB] = 1, -- » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
[0x2013] = 0, -- – EN DASH
[0x2014] = 0, -- — EM DASH
- [0x2015] = 1, -- ― HORIZONTAL BAR
+ [0x2015] = 0, -- ― HORIZONTAL BAR
[0x2019] = 1, -- ’ RIGHT SINGLE QUOTATION MARK
[0x201D] = 1, -- ” RIGHT DOUBLE QUOTATION MARK
- [0x2025] = 1, -- ‥ TWO DOT LEADER
- [0x2026] = 1, -- … HORIZONTAL ELLIPSIS
+ [0x2025] = 0, -- ‥ TWO DOT LEADER
+ [0x2026] = 0, -- … HORIZONTAL ELLIPSIS
[0x232A] = 1, -- 〉 RIGHT-POINTING ANGLE BRACKET
[0x3001] = 1, -- 、 IDEOGRAPHIC COMMA
[0x3002] = 1, -- 。 IDEOGRAPHIC FULL STOP
@@ -29149,10 +28934,10 @@ local nobr_before = setmetatable({
[0x308E] = 3, -- ゎ HIRAGANA LETTER SMALL WA
[0x3095] = 3, -- ゕ HIRAGANA LETTER SMALL KA
[0x3096] = 3, -- ゖ HIRAGANA LETTER SMALL KE
- [0x3099] = 1, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309A] = 1, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
- [0x309B] = 1, -- ゛ KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309C] = 1, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ [0x3099] = 2, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
+ [0x309A] = 2, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ [0x309B] = 2, -- ゛ KATAKANA-HIRAGANA VOICED SOUND MARK
+ [0x309C] = 2, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
[0x309D] = 1, -- ゝ HIRAGANA ITERATION MARK
[0x309E] = 1, -- ゞ HIRAGANA VOICED ITERATION MARK
[0x30A0] = 1, -- ゠ KATAKANA-HIRAGANA DOUBLE HYPHEN
@@ -29172,9 +28957,9 @@ local nobr_before = setmetatable({
[0x30FC] = 1, -- ー KATAKANA-HIRAGANA PROLONGED SOUND MARK
[0x30FD] = 1, -- ヽ KATAKANA ITERATION MARK
[0x30FE] = 1, -- ヾ KATAKANA VOICED ITERATION MARK
- [0xFE30] = 1, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
- [0xFE31] = 1, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
- [0xFE32] = 1, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
+ [0xFE30] = 0, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
+ [0xFE31] = 0, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
+ [0xFE32] = 0, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
[0xFE36] = 1, -- ︶ PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
[0xFE38] = 1, -- ︸ PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
[0xFE3A] = 1, -- ︺ PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET
@@ -29201,18 +28986,18 @@ local nobr_before = setmetatable({
[0xFF63] = 1, -- 」 HALFWIDTH RIGHT CORNER BRACKET
[0xFF64] = 1, -- 、 HALFWIDTH IDEOGRAPHIC COMMA
[0xFF65] = 1, -- ・ HALFWIDTH KATAKANA MIDDLE DOT
- [0xFF9E] = 1, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
- [0xFF9F] = 1, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
+ [0xFF9E] = 2, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
+ [0xFF9F] = 2, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
}, { __index = function(_,c)
if c >= 0x1160 and c <= 0x11FF then return 2 end
if c >= 0xD7B0 and c <= 0xD7FF then return 2 end
- if c >= 0x302A and c <= 0x302F then return 1 end
+ if c >= 0x302A and c <= 0x302F then return 2 end -- tone marks
if c >= 0x31F0 and c <= 0x31FF then return 3 end
if c >= 0xFF67 and c <= 0xFF70 then return 3 end
- if c >= 0xFE00 and c <= 0xFE0F then return 1 end
+ if c >= 0xFE00 and c <= 0xFE0F then return 2 end -- variation selectors
if c >= 0xFE10 and c <= 0xFE19 and not (c == 0xFE17) then return 1 end
if c >= 0xFE50 and c <= 0xFE58 then return 1 end
- if c >= 0xE0100 and c <= 0xE01EF then return 1 end
+ if c >= 0xE0100 and c <= 0xE01EF then return 2 end -- variation selecters
end
})
@@ -29230,6 +29015,7 @@ local function is_cjk (c)
or c >= 0xFF00 and c <= 0xFFEF
or c >= 0x1F100 and c <= 0x1F2FF
or c >= 0x20000 and c <= 0x2FA1F
+ or c >= 0x30000 and c <= 0x323AF
or nobr_after[c] and c > 0x2014
or nobr_before[c] and c > 0x2014
end
@@ -29269,8 +29055,28 @@ local charclass = setmetatable({
}, { __index = function() return 0 end })
--
+-- get character class
+-- var : variant = plain, JP/classic, KR/modern, SC, TC
+-- c : codepoint
+--
+local function get_charclass (var, c)
+ if var < 3 then
+ return charclass[c]
+ elseif var == 3 then
+ -- SC : these are left aligned
+ return (c == 0xFF01 or c == 0xFF1F) and 4 -- FULLWIDTH EXCLAMATION/QUESTION MARK
+ or (c == 0xFF1A or c == 0xFF1B) and 2 -- FULLWIDTH COLON/SEMICOLON
+ or charclass[c]
+ end
+ -- TC : these are center aligned
+ return (c == 0x3001 or c == 0xFF0C) and 3 -- IDEOGRAPHIC/FULLWIDTH COMMA
+ or (c == 0x3002 or c == 0xFF0E) and 3 -- IDEOGRAPHIC/FULLWIDTH FULL STOP -- 5 ?
+ or charclass[c]
+end
+
+--
-- table for spacing between char classes
--- 1 stands for 0.5*fontsize when variant=classic
+-- 1 stands for 0.5*fontsize when variant = JP/classic or SC or TC
--
local intercharclass = { [0] =
{ [0] = nil, {1,1}, nil, {.5,.5} },
@@ -29302,7 +29108,7 @@ end
--
-- return 0.5*fontsize of given fontid
--- space: true if variant=modern; then 0.5*interword_space
+-- space: true if variant=KR/modern; then 0.5*interword_space
--
local function get_font_size (fid, space)
local size = font.getparameters(fid)
@@ -29316,7 +29122,7 @@ end
--
-- charclass 1 thru 4 will be packed in \hbox to 0.5em{\hss? curr \hss?}
--- when variant=classic/modern
+-- when variant ~= plain
--
local function glyph_to_box (head, curr, class)
local g, h = curr
@@ -29345,7 +29151,7 @@ end
--
-- insert spacing defined as charclass[a][b] between a and b
-- f: fontid
--- var: variant = plain, classic, modern
+-- var: variant = plain, JP/classic, KR/modern, SC, TC
-- cc: charclass of current char
-- nc: charclass of next char
-- nobr: linebreak is not allowed
@@ -29364,12 +29170,16 @@ end
--
-- insert inter-character spacing in other normal cases
--- f: fontid
--- var: variant = plain, classic, modern
--- x: true between cjk and non-cjk (a little more spacing)
+-- f: fontid
+-- var: variant = plain, JP/classic, KR/modern, SC, TC
+-- nobr: no linebreak
+-- x: true between cjk and non-cjk (a little more spacing)
--
-local function insert_penalty_glue (head, curr, f, var, x)
- if var ~= 1 then
+local function insert_penalty_glue (head, curr, f, var, nobr, x)
+ if nobr then
+ local penalty = get_new_penalty(10000)
+ head, curr = node.insert_after(head, curr, penalty)
+ elseif var == 0 or var == 2 then
local penalty = get_new_penalty(50)
head, curr = node.insert_after(head, curr, penalty)
end
@@ -29385,53 +29195,64 @@ end
--
-- main process for linebreak and inter-character spacing
--- lb: true if pre_linebreak_filter
--
-local function korean_break (head, lb)
+local function cjk_break (head)
local curr = head
while curr do
- if curr.id == glyph_id then
- local var = node.has_attribute(curr, attr_korean)
+ if attr_cjk and (curr.id == glyph_id or curr.id == math_id and curr.subtype == 1) then
+ local var = node.has_attribute(curr, attr_cjk)
if var then
- local c, f = curr.char or 0, curr.font or 0
- local cc, cjkc = charclass[c], is_cjk(c)
+ local c, f = curr.char or 0, curr.font
+ local cc, cjkc = get_charclass(var, c), is_cjk(c)
-- compress cjk punctuations when charclass is 1 thru 4
if var > 0 and cc > 0 and cc < 5 then
head, curr = glyph_to_box(head, curr, cc)
end
- local next = curr.next
- if next and next.id == glyph_id then
+ local next = node.getnext(curr)
+ while next and next.id == whatsit_id do -- skip whatsit nodes
+ curr, next = next, node.getnext(next)
+ end
+
+ if next and (next.id == glyph_id or next.id == math_id and next.subtype == 0) then
local n = next.char or 0
- local nc = charclass[n]
+ f = f or next.font or 0 -- in case of curr == math_off
+
+ -- skip combining. or dash+dash case to suppress stretching
+ if nobr_before[n] == 2 or (nobr_before[c] == 0 and nobr_before[n] == 0) then
+ goto skip_combining
+ end
+
+ local nc = get_charclass(var, n)
local nobr = nobr_before[n] or nobr_after[c]
-- insert spacing as of intercharclass
if var > 0 and intercharclass[cc][nc] then
head, curr = insert_cjk_penalty_glue(head, curr, f, var, cc, nc, nobr)
- -- or insert spacing when linebreak is allowed
- elseif not nobr then
+ else
local cjkn = is_cjk(n)
-- if curr or next is cjk char
if cjkc or cjkn then
- -- if between cjk and non-cjk
- if var > 0 and not (cjkc and cjkn) and nobr_before[c] ~= 0 then
- head, curr = insert_penalty_glue(head, curr, f, var, true)
+ -- plain variant / cjk+cjk / nobr cjk+noncjk / after dash
+ -- : insert a 0pt glue
+ if var == 0 or (cjkc and cjkn) or nobr or nobr_before[c] == 0 then
+ head, curr = insert_penalty_glue(head, curr, f, var, nobr)
- -- or under pre_linebreak_filter
- elseif lb then
- head, curr = insert_penalty_glue(head, curr, f, var)
+ -- other cases: insert a small glue
+ else
+ head, curr = insert_penalty_glue(head, curr, f, var, nobr, true)
end
end
end
end
end
end
- curr = curr.next
+ ::skip_combining::
+ curr = node.getnext(curr)
end
return head
end
@@ -29445,7 +29266,7 @@ end
local function reorder_tm (head)
local curr, tone = node.slide(head)
while curr do
- if curr.id == glyph_id and node.has_attribute(curr, attr_korean) then
+ if curr.id == glyph_id and node.has_attribute(curr, attr_cjk) then
local f = font.getfont(curr.font) or font.fonts[curr.font]
if f and f.hb then -- harfbuzz do the right thing
tone = nil
@@ -29461,7 +29282,7 @@ local function reorder_tm (head)
end
end
end
- curr = curr.prev
+ curr = node.getprev(curr)
end
return head
end
@@ -29548,7 +29369,7 @@ local function get_prev_char (p)
local pc = get_prev_char(node.slide(p.head))
if pc then return pc end
end
- p = p.prev
+ p = node.getprev(p)
end
end
@@ -29563,10 +29384,10 @@ local function auto_josa (head)
if josa then
local cc = curr.char or 0
if josa == 0 then
- josa = josa_code[get_prev_char(curr.prev) or 0x30]
+ josa = josa_code[get_prev_char(node.getprev(curr)) or 0x30]
end
if cc == 0xC774 then
- local n = curr.next
+ local n = node.getnext(curr)
if n and n.char and n.char >= 0xAC00 and n.char <= 0xD7A3 then
else
cc = 0xAC00
@@ -29585,7 +29406,7 @@ local function auto_josa (head)
node.unset_attribute(curr, attr_josa)
end
end
- curr = curr.next
+ curr = node.getnext(curr)
end
for _,v in ipairs(tofree) do node.free(v) end
return head
@@ -29596,45 +29417,86 @@ end
-- As char value of glyphs can be changed by opentype GSUB process,
-- we have to occupy the first position among callback functions.
--
-local prepend_to_callback
-if luatexbase.base_add_to_callback then
- prepend_to_callback = function(name, func, desc)
- luatexbase.add_to_callback(name, func, desc, 1)
+luatexbase.add_to_callback( "pre_shaping_filter",
+function(head)
+ if attr_josa then head = auto_josa(head) end
+ head = cjk_break(head)
+ if attr_josa then head = reorder_tm(head) end
+ return head
+end,
+"polyglossia.lang_cjk_spacing")
+
+-- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
+% \end{macrocode}
+% \iffalse
+%</polyglossia-cjk-spacing.lua>
+%<*polyglossia-french.lua>
+% \fi
+% \clearpage
+%
+% \subsection{polyglossia-french.lua}
+% \begin{macrocode}
+--
+-- polyglossia-punct.lua
+-- part of polyglossia v2.2 -- 2024/07/15
+--
+
+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
-else
- prepend_to_callback = function(name, func, desc)
- local t = { {func, desc} }
- for _,v in ipairs(luatexbase.callback_descriptions(name)) do
- table.insert(t, {luatexbase.remove_from_callback(name, v)})
- end
- for _,v in ipairs(t) do
- luatexbase.add_to_callback(name, v[1], v[2])
- 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)
+ set_left_space(lang, '‽', 0.5) -- U+203D (interrobang)
+
+ 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
-prepend_to_callback ("pre_linebreak_filter",
- function(head)
- head = auto_josa(head)
- head = korean_break(head, true)
- head = reorder_tm(head)
- return head
- end,
- "polyglossia.lang_korean")
-
-prepend_to_callback ("hpack_filter",
- function(head)
- head = auto_josa(head)
- head = korean_break(head)
- head = reorder_tm(head)
- return head
- end,
- "polyglossia.lang_korean")
+local function deactivate_french_punct()
+ polyglossia.deactivate_punct()
+end
--- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
+polyglossia.activate_french_punct = activate_french_punct
+polyglossia.deactivate_french_punct = deactivate_french_punct
% \end{macrocode}
% \iffalse
-%</polyglossia-korean.lua>
+%</polyglossia-french.lua>
%<*polyglossia-latin.lua>
% \fi
% \clearpage
@@ -29643,7 +29505,7 @@ prepend_to_callback ("hpack_filter",
% \begin{macrocode}
--
-- polyglossia-latin.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia-punct')
@@ -29698,14 +29560,13 @@ polyglossia.deactivate_latin_punct = deactivate_latin_punct
% \begin{macrocode}
--
-- polyglossia-punct.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
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 declare_callback_rule = luatexbase.declare_callback_rule
local new_attribute = luatexbase.new_attribute
local node = node
@@ -30029,13 +29890,16 @@ local function activate(lang)
-- 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
+add_to_callback("pre_linebreak_filter",process,"polyglossia-punct.process")
+add_to_callback("hpack_filter",process,"polyglossia-punct.process")
+declare_callback_rule("pre_linebreak_filter",
+ "polyglossia-punct.process", "before", "luaotfload.node_processor")
+declare_callback_rule("hpack_filter",
+ "polyglossia-punct.process", "before", "luaotfload.node_processor")
+
+
local function deactivate()
tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset"
-- Though it would make compilation slightly faster, it is not possible to
@@ -30066,7 +29930,7 @@ polyglossia.clear_spaced_characters = clear_spaced_characters
% \begin{macrocode}
--
-- polyglossia-sanskrit.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia-punct')
@@ -30116,31 +29980,29 @@ polyglossia.deactivate_sanskrit_punct = deactivate_sanskrit_punct
% \begin{macrocode}
--
-- polyglossia-tibt.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia') -- just in case...
local add_to_callback = luatexbase.add_to_callback
local remove_from_callback = luatexbase.remove_from_callback
+local declare_callback_rule = luatexbase.declare_callback_rule
local priority_in_callback = luatexbase.priority_in_callback
local next, type = next, type
-
-local nodes, fonts, node = nodes, fonts, node
-
-local nodecodes = nodes.nodecodes --- <= preloaded node.types()
+local node = node
local insert_node_before = node.insert_before
local insert_node_after = node.insert_after
-local remove_node = nodes.remove
+local remove_node = node.remove
local copy_node = node.copy
local has_attribute = node.has_attribute
local end_of_math = node.end_of_math
if not end_of_math then -- luatex < .76
local traverse_nodes = node.traverse_id
- local math_code = nodecodes.math
+ local math_code = node.id('math_char')
local end_of_math = function (n)
for n in traverse_nodes(math_code, n.next) do
return n
@@ -30148,10 +30010,10 @@ if not end_of_math then -- luatex < .76
end
end
--- node types as of April 2013
-local glyph_code = nodecodes.glyph
-local penalty_code = nodecodes.penalty
-local kern_code = nodecodes.kern
+-- node types as of April 2024
+local glyph_code = node.id('glyph')
+local penalty_code = node.id('penalty')
+local kern_code = node.id('kern')
-- we make a new node, so that we can copy it later on
local penalty_node = node.new(penalty_code)
@@ -30182,7 +30044,6 @@ local function process(head)
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
@@ -30195,15 +30056,13 @@ end
local callback_name = "pre_linebreak_filter"
local function activate()
- if not priority_in_callback (callback_name, "polyglossia-tibt.process") then
- add_to_callback(callback_name, process, "polyglossia-tibt.process", 1)
- end
+ add_to_callback(callback_name, process, "polyglossia-tibt.process")
+ declare_callback_rule(callback_name,
+ "polyglossia-tibt.process", "before", "luaotfload.node_processor")
end
local function desactivate()
- if priority_in_callback (callback_name, "polyglossia-tibt.process") then
- remove_from_callback(callback_name, "polyglossia-tibt.process")
- end
+ remove_from_callback(callback_name, "polyglossia-tibt.process")
end
polyglossia.activate_tibt_eol = activate
@@ -30219,7 +30078,7 @@ polyglossia.desactivate_tibt_eol = desactivate
% \begin{macrocode}
--
-- polyglossia.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
local module_name = "polyglossia"
@@ -30295,7 +30154,7 @@ local function newloader(langentry)
end
-- language info will be written into the .log file
- local s = { "Language data for " .. langentry }
+ local s = { }
for k, v in pairs(langdata) do
if type(v) == 'table' then -- for 'synonyms'
s[#s+1] = k .. "\t" .. table.concat(v,',')
@@ -30303,7 +30162,10 @@ local function newloader(langentry)
s[#s+1] = k .. "\t" .. tostring(v)
end
end
- log_info(table.concat(s,"\n"))
+ local a = {}
+ for _,n in pairs(s) do table.insert(a, n) end
+ table.sort(a)
+ log_info("Language data for " .. langentry .. "\n" .. table.concat(a,"\n"))
--
-- LaTeX's \newlanguage increases language register (count19),
@@ -30313,7 +30175,7 @@ local function newloader(langentry)
-- this possible situation, our newloader() function will
-- unfortunately overwrite the language \lang@xyz.
--
- -- Threfore here we will compare LaTeX's \newlanguage number with
+ -- Therefore here we will compare LaTeX's \newlanguage number with
-- LuaTeX's lang.new() id and select the bigger one for our new
-- language object. Also we will update LaTeX's language register
-- by this new id, so that another possible \newlanguage should not
@@ -30328,7 +30190,7 @@ local function newloader(langentry)
local newlangid = math.max(langcnt, langid)
-- set language register for possible \newlanguage
tex.setcount('global', lang_register, newlangid)
- -- get new lang object if needeed
+ -- get new lang object if needed
if langid ~= newlangid then
langobject = lang.new(newlangid)
end
@@ -30394,7 +30256,12 @@ polyglossia.newloader_loaded_languages = newloader_loaded_languages
\setmainfont{Linux Libertine O}
\defaultfontfeatures{Scale=MatchLowercase}
\setmonofont{Inconsolata}
-\newfontfamily\arabicfont[Script=Arabic]{Amiri}
+\newfontfamily\arabicfont[Script=Arabic]{Amiri}[%
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ Extension = .ttf,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic]
\newfontfamily\syriacfont[Script=Syriac]{Serto Jerusalem}
\newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL}
\newfontfamily\sanskritfont[Script=Devanagari]{Sanskrit 2003}
@@ -30530,7 +30397,12 @@ Quamquam sermone nativo fungi desinit, cumque nostris diebus perpauci Latine loq
\usepackage{xltxtra,url,amsmath}
\setmainfont{Linux Libertine O}
\defaultfontfeatures{Scale=MatchLowercase}
-\newfontfamily\arabicfont[Script=Arabic]{Amiri}
+\newfontfamily\arabicfont[Script=Arabic]{Amiri}[%
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ Extension = .ttf,
+ ItalicFont = *-Italic,
+ BoldItalicFont = *-BoldItalic]
\newfontfamily\arabicfonttt[Script=Arabic,Scale=.75]{DejaVu Sans Mono}
\newfontfamily\farsifont[Script=Arabic,Scale=1.1,WordSpace=2]{IranNastaliq}
\let\XeTeX\undefined
@@ -30700,7 +30572,7 @@ This is today: \today
% \typeout{* To finish the installation you have to move the following}
% \typeout{* file into a directory searched by TeX:}
% \typeout{*}
-% \typeout{* \space\space all *.sty, *.lua, *.def, *.lde and *.ldf files}
+% \typeout{* \space\space\space all *.sty, *.lua, *.def and *.ldf files}
% \typeout{*}
% \typeout{* You also need to compile the *.map files with teckit_compile}
% \typeout{* and place the resulting *.tec files under}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/arabicnumbers.sty b/Master/texmf-dist/tex/latex/polyglossia/arabicnumbers.sty
index c45aa22a654..b5c37d61db3 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/arabicnumbers.sty
+++ b/Master/texmf-dist/tex/latex/polyglossia/arabicnumbers.sty
@@ -43,24 +43,23 @@
\fi
}
\def\abjad@zero{}
-\def\abjad@three{ج\ifabjad@jim@notail\char"200D\fi}
+\def\abjad@one{ا}
+\def\abjad@three{ج\ifabjad@jim@notail\Uchar"200D\fi}
\def\abj@num@i@iso#1{%
- \ifcase#1\or ا\or ب\or\abjad@three\or د%
- \or ه\char"200D\or و\or ز\or ح\or ط\fi%
- \ifnum#1=\z@\abjad@zero\fi}
+ \ifcase#1\abjad@zero\or \abjad@one\or ب\or\abjad@three\or د%
+ \or ه\Uchar"200D\or و\or ز\or ح\or ط\fi}
\def\abj@num@i#1{%
- \ifcase#1\or ا\or ب\or\abjad@three\or د%
- \or ه\or و\or ز\or ح\or ط\fi%
- \ifnum#1=\z@\abjad@zero\fi}
+ \ifcase#1\abjad@zero\or\abjad@one\or ب\or\abjad@three\or د%
+ \or ه\or و\or ز\or ح\or ط\fi}
\def\abj@num@ii#1{%
\ifcase#1\or ي\or ك\or ل\or م\or ن%
- \or س\or ع\or ف\or ص\fi%
- \ifnum#1=\z@\fi\abj@num@i}
+ \or س\or ع\or ف\or ص\fi
+ \abj@num@i}
\def\abj@num@iii#1{%
\ifcase#1\or ق\or ر\or ش\or ت\or ث%
- \or خ\or ذ\or ض\or ظ\fi%
- \ifnum#1=\z@\fi\abj@num@ii}
+ \or خ\or ذ\or ض\or ظ\fi
+ \abj@num@ii}
\def\abj@num@iv#1{%
\ifcase#1\or غ\fi
- \ifnum#1=\z@\fi\abj@num@iii}
+ \abj@num@iii}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/cal-util.def b/Master/texmf-dist/tex/latex/polyglossia/cal-util.def
index 85576f39f71..fa6e325029e 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/cal-util.def
+++ b/Master/texmf-dist/tex/latex/polyglossia/cal-util.def
@@ -45,7 +45,7 @@
%% This is an algorithm from Reingold & Dershowitz,
-%% Calendrical Calculations, The Millenium Edition
+%% Calendrical Calculations, The Millennium Edition
%%
\def\@FixedFromGregorian#1#2#3#4{%
\setcounter{tmpA}{(#1-1)*365}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-acadien.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-acadian.ldf
index 36d3136d29b..c231e80f342 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-acadien.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-acadian.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-acadien.ldf}[polyglossia: module for Canadian (Acadian) French]
% We provide this as a babel alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-aeb.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-aeb.ldf
index 2e1a3a0719a..7029af6bf65 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-aeb.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-aeb.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-aeb.ldf}[polyglossia: module for aeb (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-af.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-af.ldf
index f47e9adcbda..baa1c8c0282 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-af.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-af.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-af.ldf}[polyglossia: module for af (Afrikaans)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{afrikaans}
+\InheritGlossFile{afrikaans}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-afb.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-afb.ldf
index 7eb4a47a7dd..41b672984bb 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-afb.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-afb.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-afb.ldf}[polyglossia: module for afb (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf
index 33d1f12831c..653d10b5dda 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-afrikaans.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-afrikaans.ldf}[polyglossia: module for Afrikaans]
@@ -16,22 +16,21 @@
% BCP-47 compliant aliases
\setlanguagealias*{afrikaans}{af}
-\define@boolkey{afrikaans}[afrikaans@]{babelshorthands}[true]{}
-
+\DeclareKeys[polyglossia/gloss/afrikaans]
+ {
+ babelshorthands.if = afrikaans@babelshorthands,
+ babelshorthands.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{afrikaans}{babelshorthands=false}
+\InitializeGlossOptions{afrikaans}{babelshorthands=false}
\ifsystem@babelshorthands
- \setkeys{afrikaans}{babelshorthands=true}
+ \SetGlossOptions{afrikaans}{babelshorthands=true}
\else
- \setkeys{afrikaans}{babelshorthands=false}
+ \SetGlossOptions{afrikaans}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\afrikaans@shorthands{%
\xpg@activate@shorthands%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-albanian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-albanian.ldf
index 06a4cd6c681..bbfbb2e7576 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-albanian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-albanian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-albanian.ldf}[polyglossia: module for Albanian]
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-am.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-am.ldf
index 649198b3789..e5a358a17e8 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-am.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-am.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-am.ldf}[polyglossia: module for am (Amharic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{amharic}
+\InheritGlossFile{amharic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-american.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-american.ldf
index f456ab17a0e..2531eb7c587 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-american.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-american.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-american.ldf}[polyglossia: module for American English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-amharic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-amharic.ldf
index 38c225672ac..aebbd10989a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-amharic.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-amharic.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-amharic.ldf}[polyglossia: module for Amharic]
\PolyglossiaSetup{amharic}{
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-apd.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-apd.ldf
index b52bfa6942c..54cb4d4b6eb 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-apd.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-apd.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-apd.ldf}[polyglossia: module for apd (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-IQ.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-IQ.ldf
index 22340aeff1c..3583fd12ccb 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-IQ.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-IQ.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-IQ.ldf}[polyglossia: module for ar-IQ (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar,bcp47-region=IQ}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-JO.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-JO.ldf
index 83fd1b49ad9..bd140fb026c 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-JO.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-JO.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-JO.ldf}[polyglossia: module for ar-JO (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-JO,bcp47-language=ar,bcp47-region=JO}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-LB.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-LB.ldf
index 69a13896196..538e6a5a90a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-LB.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-LB.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-LB.ldf}[polyglossia: module for ar-LB (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-LB,bcp47-language=ar,bcp47-region=LB}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-MR.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-MR.ldf
index 6176cfabdcb..471dad5d12b 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-MR.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-MR.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-MR.ldf}[polyglossia: module for ar-MR (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-PS.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-PS.ldf
index 821d107bbc9..8158dca6e94 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-PS.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-PS.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-PS.ldf}[polyglossia: module for ar-PS (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-PS,bcp47-language=ar,bcp47-region=PS}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-SY.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-SY.ldf
index f736606934f..b437f61e191 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-SY.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-SY.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-SY.ldf}[polyglossia: module for ar-SY (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-SY,bcp47-language=ar,bcp47-region=SY}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-YE.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-YE.ldf
index 06759e39b51..4eef25a7166 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-YE.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar-YE.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar-YE.ldf}[polyglossia: module for ar-YE (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar,bcp47-region=YE}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar.ldf
index f35c8e67727..84a751f2fc0 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ar.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ar.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ar.ldf}[polyglossia: module for ar (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf
index 3d478f02757..885fe3d02e8 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-arabic.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-arabic.ldf}[polyglossia: module for Arabic]
\RequireBidi
@@ -38,104 +38,112 @@
\setlanguagealias*[locale=default]{arabic}{apd}
\setlanguagealias*[locale=mashriq]{arabic}{ar-PS}
-\define@boolkey{arabic}[arabic@]{abjadalph}[true]{}
-
\newif\ifeastern@numerals
-\define@choicekey*+{arabic}{numerals}[\xpg@val\xpg@nr]{mashriq,maghrib,eastern,western}[mashriq]{%
- \ifcase\xpg@nr\relax
- % mashriq:
- \eastern@numeralstrue%
- \or
- % maghrib:
- \eastern@numeralsfalse
- \or
- % eastern:
- \eastern@numeralstrue%
- \or
- % western:
- \eastern@numeralsfalse
- \fi
- \xpg@info{Option: Arabic, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Arabic numerals option `#1'}}
-
-%this is needed for \abjad in arabicnumbers.sty
-\define@boolkey{arabic}[arabic@]{abjadjimnotail}[true]{%
- \ifarabic@abjadjimnotail
- \abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi}
-
-\define@choicekey*+{arabic}{locale}[\xpg@val\xpg@nr]{default,mashriq,libya,algeria,tunisia,morocco,mauritania}[default]{%
- \ifcase\xpg@nr\relax
- % default:
- \eastern@numeralstrue%
- \SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar}%
- \xpg@info{Option: arabic, locale=default}%
- \or
- % mashriq:
- \eastern@numeralstrue%
- \SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar}%
- \xpg@info{Option: arabic, locale=mashriq}%
- \or
- % libya:
- \eastern@numeralstrue%
- \SetLanguageKeys{arabic}{bcp47=ayl,bcp47-language=ar,bcp47-region=LY}%
- \xpg@info{Option: arabic, locale=libya}%
- \or
- % algeria:
- \eastern@numeralsfalse%
- \SetLanguageKeys{arabic}{bcp47=arq,bcp47-language=ar,bcp47-region=DZ,bcp47-extension-u=nu-latn}%
- \xpg@info{Option: arabic, locale=algeria}%
- \or
- % tunisia:
- \eastern@numeralsfalse%
- \SetLanguageKeys{arabic}{bcp47=aeb,bcp47-language=ar,bcp47-region=TN,bcp47-extension-u=nu-latn}%
- \xpg@info{Option: arabic, locale=tunisia}%
- \or
- % morocco:
- \eastern@numeralsfalse%
- \SetLanguageKeys{arabic}{bcp47=ary,bcp47-language=ar,bcp47-region=MA,bcp47-extension-u=nu-latn}%
- \xpg@info{Option: arabic, locale=morocco}%
- \or
- % mauritania:
- \eastern@numeralstrue%
- \SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}%
- \xpg@info{Option: arabic, locale=mauritania}%
- \fi
- \gdef\@@arabic@month{\@arabic@month{#1}}
- }{\xpg@warning{Unknown Arabic locale `#1'}}
-
\newif\if@hijrical
-\define@choicekey*+{arabic}{calendar}[\xpg@val\xpg@nr]{gregorian,hijri,islamic}[gregorian]{%
- \ifcase\xpg@nr\relax
- % gregorian:
- \@hijricalfalse
- \or
- % hijri:
- \@hijricaltrue
- \or
- % islamic:
- \@hijricaltrue
- \fi
- \xpg@info{Option: Arabic, calendar=\xpg@val}%
-}{\xpg@warning{Unknown Arabic calendar option `#1'}}
-
-
-\define@key{arabic}{hijricorrection}[0]{%
- \gdef\arabic@hijri@correction{#1}}%
-
\newif\ifarabic@customsep\arabic@customsepfalse
-\def\xpg@sepmark{}
-\define@key{arabic}{sectionsep}[.]{%
- \arabic@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
+
+\DeclareKeys[polyglossia/gloss/arabic]
+ {
+ hijricorrection.code = \gdef\arabic@hijri@correction{#1},
+ hijricorrection.default:n = 0,
+ sectionsep.code = \gdef\xpg@sepmark{#1}\arabic@customseptrue,
+ sectionsep.default:n = .,
+ abjadalph.if = arabic@abjadalph,
+ abjadalph.default:n = true,
+ abjadjimnotail.if = abjad@jim@notail,
+ abjadjimnotail.default:n = true,
+ numerals.choice:,
+ numerals / mashriq.code =
+ {%
+ \eastern@numeralstrue
+ },
+ numerals / maghrib.code =
+ {%
+ \eastern@numeralsfalse
+ },
+ numerals / eastern.code =
+ {%
+ \eastern@numeralstrue
+ },
+ numerals / western.code =
+ {%
+ \eastern@numeralsfalse
+ },
+ numerals.default:n = mashriq,
+ numerals/unknown.code = \xpg@warning{Unknown Arabic numerals option `#1'},
+ locale.choice:,
+ locale / default.code =
+ {%
+ \eastern@numeralstrue
+ \def\abjad@one{ا}%
+ \SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / mashriq.code =
+ {%
+ \eastern@numeralstrue
+ \def\abjad@one{ا}%
+ \SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / libya.code =
+ {%
+ \eastern@numeralstrue
+ \def\abjad@one{ا}%
+ \SetLanguageKeys{arabic}{bcp47=ayl,bcp47-language=ar,bcp47-region=LY}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / algeria.code =
+ {%
+ \eastern@numeralsfalse
+ \def\abjad@one{أ}%
+ \SetLanguageKeys{arabic}{bcp47=arq,bcp47-language=ar,bcp47-region=DZ,bcp47-extension-u=nu-latn}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / tunisia.code =
+ {%
+ \eastern@numeralsfalse
+ \def\abjad@one{أ}%
+ \SetLanguageKeys{arabic}{bcp47=aeb,bcp47-language=ar,bcp47-region=TN,bcp47-extension-u=nu-latn}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / morocco.code =
+ {%
+ \eastern@numeralsfalse
+ \def\abjad@one{أ}%
+ \SetLanguageKeys{arabic}{bcp47=ary,bcp47-language=ar,bcp47-region=MA,bcp47-extension-u=nu-latn}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale / mauritania.code =
+ {%
+ \eastern@numeralstrue
+ \def\abjad@one{ا}%
+ \SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}%
+ \gdef\@@arabic@month{\@arabic@month{#1}}%
+ },
+ locale.default:n = default,
+ locale/unknown.code = \xpg@warning{Unknown Arabic locale `#1'},
+ calendar.choice:,
+ calendar / gregorian.code =
+ {%
+ \@hijricalfalse
+ },
+ calendar / hijri.code =
+ {%
+ \@hijricaltrue
+ },
+ calendar / islamic.code =
+ {%
+ \@hijricaltrue
+ },
+ calendar.default:n = gregorian,
+ calendar/unknown.code = \xpg@warning{Unknown Arabic calendar option `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{arabic}{locale=default,calendar=gregorian,numerals=mashriq,hijricorrection=0,abjadjimnotail=false}
+\InitializeGlossOptions{arabic}{locale=default,calendar=gregorian,numerals=mashriq,hijricorrection=0,abjadjimnotail=false}
% Register alias options
-\xpg@set@alias@values{arabic}{calendar}{islamic}{hijri}
+\SetLanguageAliasValues{arabic}{calendar}{islamic,hijri}
\def\arabicgregmonth@default#1{\ifcase#1%
% Egypt, Sudan, Yemen and Golf states
@@ -155,9 +163,12 @@
\def\arabicgregmonth@mauritania#1{\ifcase#1%
\or يناير\or فبراير\or مارس\or إبريل\or مايو\or يونيو\or يوليو\or أغشت\or شتمبر\or أكتوبر\or نوفمبر\or دجمبر\fi}
-\def\@arabic@month#1{\ifcsdef{arabicgregmonth@#1}{\expandafter\csname arabicgregmonth@#1\endcsname}%
-{\xpg@warning{Option `locale=#1' is not defined for Arabic: using `default' instead}%
-\arabicgregmonth@default}}
+\def\@arabic@month#1{%
+ \@ifundefined{arabicgregmonth@#1}%
+ {\xpg@warning{Option `locale=#1' is not defined for Arabic: using `default' instead}%
+ \arabicgregmonth@default}%
+ {\expandafter\csname arabicgregmonth@#1\endcsname}%
+}
%\Hijritoday is now locale-aware and will format the date with this macro:
\DefineFormatHijriDate{arabic}{\@ensure@RTL{\arabicnumber{\value{Hijriday}}%
@@ -189,18 +200,18 @@
}
\def\datearabic{%
\def\today{%
- \if@hijrical%
+ \if@hijrical
\Hijritoday[\arabic@hijri@correction]%
\else%
- \if@RTL%
+ \if@RTL
\arabicnumber\day\space\@@arabic@month{\month}%
\space\arabicnumber\year%
\else% in LR environment we format the gregorian date within \textenglish
- \ifcsdef{english@loaded}{\textenglish{\today}}%else US format
- {\normalfontlatin\ifcase\month\or January\or February\or March\or April\or May\or June\or%
- July\or August\or September\or October\or November\or December\fi%
+ \iflanguageloaded{english}{\textenglish{\today}}%else US format
+ {\normalfontlatin\ifcase\month\or January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or December\fi
\space\number\day,\space\number\year}%
- \fi%
+ \fi
\fi}}
% Use \providecommand here as the ldf file might
@@ -226,10 +237,9 @@
\or ح\or ط\or ي\or ك\or ل\or م\or ن%
\or س\or ع\or ف\or ص\or ق\or ر\or ش%
\or ت\or ث\or خ\or ذ\or ض\or ظ\or غ%
- \else\xpg@ill@value{#1}{arabic@abjad@alph}\fi%
+ \else\xpg@ill@value{#1}{arabic@abjad@alph}\fi
}
-
\def\abjadmaghribi#1{%
\ifnum#1>1999\xpg@ill@value{#1}{abjad}%
\else
@@ -252,111 +262,111 @@
%maghribi س -> ص ص -> ض ش -> س ض -> ظ ظ -> غ غ -> ش
\def\abj@maghribi@num@ii#1{%
- \ifcase#1\or ي\or ك\or ل\or م\or ن%
+ \ifcase#1\abjad@zero\or ي\or ك\or ل\or م\or ن%
\or ص\or ع\or ف\or ض\fi
- \ifnum#1=\z@\abjad@zero\fi\abj@num@i}
+ \abj@num@i}
\def\abj@maghribi@num@iii#1{%
\ifcase#1\or ق\or ر\or س\or ت\or ث%
\or خ\or ذ\or ظ\or غ\fi
- \ifnum#1=\z@\fi\abj@maghribi@num@ii}
+ \abj@maghribi@num@ii}
\def\abj@maghribi@num@iv#1{%
\ifcase#1\or ش\fi
- \ifnum#1=\z@\fi\abj@maghribi@num@iii}
+ \abj@maghribi@num@iii}
\def\arabic@numbers{%
\ifarabic@abjadalph
- \let\@alph\abjadalph%
- \let\@Alph\abjadalph%
+ \let\@alph\abjadalph
+ \let\@Alph\abjadalph
\else
- \let\@alph\abjad%
- \let\@Alph\abjad%
+ \let\@alph\abjad
+ \let\@Alph\abjad
\fi
}
\def\noarabic@numbers{%
- \let\@alph\latin@alph%
- \let\@Alph\latin@Alph%
+ \let\@alph\latin@alph
+ \let\@Alph\latin@Alph
}
% Store original definition
\let\xpg@save@arabic\@arabic
\def\arabic@globalnumbers{%
- \let\@arabic\arabicnumber%
+ \let\@arabic\arabicnumber
\renewcommand\thefootnote{\localnumeral*{footnote}}%
\renewcommand\theequation{\localnumeral*{equation}}%
}
\def\noarabic@globalnumbers{%
- \let\@arabic\xpg@save@arabic%
+ \let\@arabic\xpg@save@arabic
}
\def\arabic@xetex@capsformat{%
- \let\xpg@save@sepmark\@SepMark%
+ \let\xpg@save@sepmark\@SepMark
\SepMark{\xpg@sepmark}
}
\def\noarabic@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi
}
\def\arabic@luatex@capsformat{%
%
% change chapter and part headings
\ifarabic@customsep
- \ifcsdef{chapter}{%
- \let\xpg@save@thesection\thesection%
+ \ifcsname chapter\endcsname
+ \let\xpg@save@thesection\thesection
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
- \let\xpg@save@theequation\theequation%
+ \let\xpg@save@theequation\theequation
\renewcommand*\theequation{%
\ifnum \c@chapter>\z@ \thechapter\xpg@sepmark\fi\@arabic\c@equation}
- \let\xpg@save@thefigure\thefigure%
+ \let\xpg@save@thefigure\thefigure
\renewcommand*\thefigure{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@figure}
- \let\xpg@save@thetable\thetable%
+ \let\xpg@save@thetable\thetable
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
- \let\xpg@save@thesubsection\thesubsection%
+ \fi
+ \let\xpg@save@thesubsection\thesubsection
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
- \let\xpg@save@thesubsubsection\thesubsubsection%
+ \let\xpg@save@thesubsubsection\thesubsubsection
\renewcommand\thesubsubsection{\thesubsection\xpg@sepmark\@arabic\c@subsubsection}
- \let\xpg@save@theparagraph\theparagraph%
+ \let\xpg@save@theparagraph\theparagraph
\renewcommand\theparagraph
{\thesubsubsection\xpg@sepmark\@arabic\c@paragraph}
- \let\xpg@save@thesubparagraph\thesubparagraph%
+ \let\xpg@save@thesubparagraph\thesubparagraph
\renewcommand\thesubparagraph{\theparagraph\xpg@sepmark\@arabic\c@subparagraph}
- \fi% (end \ifarabic@customsep)
+ \fi % (end \ifarabic@customsep)
}
\def\noarabic@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
- \let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
- \let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
- \let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
- \let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
- \let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
- \let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
- \let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
- \let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \ifcsname xpg@save@thesection\endcsname
+ \let\thesection\xpg@save@thesection
+ \fi
+ \ifcsname xpg@save@theequation\endcsname
+ \let\theequation\xpg@save@theequation
+ \fi
+ \ifcsname xpg@save@thefigure\endcsname
+ \let\thefigure\xpg@save@thefigure
+ \fi
+ \ifcsname xpg@save@thetable\endcsname
+ \let\thetable\xpg@save@thetable
+ \fi
+ \ifcsname xpg@save@thesubsection\endcsname
+ \let\thesubsection\xpg@save@thesubsection
+ \ifcsname xpg@save@thesubsubsection\endcsname
+ \let\thesubsubsection\xpg@save@thesubsubsection
+ \fi
+ \fi
+ \ifcsname xpg@save@theparagraph\endcsname
+ \let\theparagraph\xpg@save@theparagraph
+ \fi
+ \ifcsname xpg@save@thesubparagraph\endcsname
+ \let\thesubparagraph\xpg@save@thesubparagraph
+ \fi
}
\def\blockextras@arabic{%
@@ -368,7 +378,7 @@
\fi
\fi
}
-%
+
\def\noextras@arabic{%
\ifarabic@customsep
\ifxetex
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf
index ea904ad5e3a..0770300480f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-armenian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-armenian.ldf}[polyglossia: module for Armenian]
@@ -21,43 +21,49 @@
\newif\if@eastern@armenian
\@eastern@armenianfalse
-\define@choicekey*+{armenian}{variant}[\xpg@val\xpg@nr]{western,eastern}[western]{%
- \ifcase\xpg@nr\relax
- % western:
- \@eastern@armenianfalse%
- \or
- % eastern:
- \@eastern@armeniantrue%
- \fi
- \xpg@info{Option: Armenian, variant=\xpg@val}%
-}{\xpg@warning{Unknown Armenian variant `#1'}}
\newif\if@armenian@numerals
\@armenian@numeralsfalse
-\define@key{armenian}{numerals}[armenian]{%
- \ifstrequal{#1}{arabic}{%
- \@armenian@numeralsfalse%
- \SetLanguageKeys{armenian}{bcp47-extension-u=nu-latn}%
- }{%
- \@armenian@numeralstrue%
- \SetLanguageKeys{armenian}{bcp47-extension-u={}}%
- }%
-}
-\define@boolkey{armenian}[armenian@]{capitalyiwn}[true]{%
- \ifarmenian@capitalyiwn
- % MakeUppercase capitalizes the ligature of letters ech and yiwn (U+0587)
- % to capital ech and yiwn (also the output if Armenian is not selected at all)
- \SetLanguageKeys{armenian}{bcp47-casing=hy-x-yiwn,bcp47-extension-x=yiwn}
- \else
- % Capitalize ech and yiwn ligature to capital ech and vew,
- % following Armenian spelling reform
- \SetLanguageKeys{armenian}{bcp47-casing=hy,bcp47-extension-x={}}
- \fi
-}
+\DeclareKeys[polyglossia/gloss/armenian]
+ {
+ variant.choice:,
+ variant / western.code =
+ {%
+ \@eastern@armenianfalse
+ },
+ variant / eastern.code =
+ {%
+ \@eastern@armeniantrue
+ },
+ variant.default:n = western,
+ variant/unknown.code = \xpg@warning{Unknown Armenian variant `#1'},
+ numerals.choice:,
+ numerals / armenian.code =
+ {%
+ \@armenian@numeralstrue
+ \SetLanguageKeys{armenian}{bcp47-extension-u={}}%
+ },
+ numerals / arabic.code =
+ {%
+ \@armenian@numeralsfalse
+ \SetLanguageKeys{armenian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = armenian,
+ capitalyiwn.choice:,
+ capitalyiwn / true.code =
+ {%
+ \SetLanguageKeys{armenian}{bcp47-casing=hy-x-yiwn,bcp47-extension-x=yiwn}%
+ },
+ capitalyiwn / false.code =
+ {%
+ \SetLanguageKeys{armenian}{bcp47-casing=hy,bcp47-extension-x={}}%
+ },
+ capitalyiwn.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{armenian}{numerals=armenian,variant=western}
+\InitializeGlossOptions{armenian}{numerals=armenian,variant=western}
% Taken from ArmTeX. Audit!
\def\captionsarmenian{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-arq.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-arq.ldf
index e2ef5273c56..d71e48bd945 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-arq.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-arq.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-arq.ldf}[polyglossia: module for arq (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ary.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ary.ldf
index ad64804b5ee..c0b5debd39d 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ary.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ary.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ary.ldf}[polyglossia: module for ary (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-arz.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-arz.ldf
index 0dd998cbe5a..41e1cfd5702 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-arz.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-arz.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-arz.ldf}[polyglossia: module for arz (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ast.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ast.ldf
index e9f5095fccf..f073cdc632f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ast.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ast.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ast.ldf}[polyglossia: module for ast (Asturian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{asturian}
+\InheritGlossFile{asturian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-asturian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-asturian.ldf
index 44babd93ef5..109a560111f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-asturian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-asturian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translated by Xuacu <xuacusk8 at gmail dot com>
% Contributed by Kevin Godby <godbyk at gmail dot com>
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-australian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-australian.ldf
index c624020f9ac..d3c85168511 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-australian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-australian.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-australian.ldf}[polyglossia: module for Australian English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-austrian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-austrian.ldf
index b7ef2e504b6..b1397542781 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-austrian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-austrian.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-austrian.ldf}[polyglossia: module for Austrian German (old spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ayl.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ayl.ldf
index 815db99c2ec..a24eb19c922 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ayl.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ayl.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ayl.ldf}[polyglossia: module for ayl (Arabic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{arabic}
+\InheritGlossFile{arabic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasa.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasa.ldf
index b8a13680aa1..4395a83d2e8 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasa.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasa.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bahasa.ldf}[polyglossia: module for Bahasa Indonesia]
% We provide this as a babel alias
-\xpg@load@master@language{malay}
+\InheritGlossFile{malay}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf
index 37a604e050f..e710b619997 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasai.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bahasai.ldf}[polyglossia: module for Bahasa Indonesia]
% We only provide this gloss for babel compatibility. Since bahasai is
% a malay variety, we use 'malay' with variant 'indonesian' now.
-\xpg@load@master@language{malay}
+\InheritGlossFile{malay}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf
index f879535507c..d4c2ea9ec0c 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bahasam.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bahasam.ldf}[polyglossia: module for Bahasa Melayu]
% We only provide this gloss for babel compatibility. Since bahasam is
% a malay variety, we use 'malay' with variant 'malaysian' now.
-\xpg@load@master@language{malay}
+\InheritGlossFile{malay}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-basque.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-basque.ldf
index b4ab3525f5a..dbff903d788 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-basque.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-basque.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-basque.ldf}[polyglossia: module for Basque]
\PolyglossiaSetup{basque}{
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-be-tarask.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-be-tarask.ldf
index 02d49ffff15..975f48c0acc 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-be-tarask.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-be-tarask.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-be-tarask.ldf}[polyglossia: module for be-tarask (Belarusian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{belarusian}
+\InheritGlossFile{belarusian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-be.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-be.ldf
index efa0abbd949..666620a671c 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-be.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-be.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-be.ldf}[polyglossia: module for be (Belarusian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{belarusian}
+\InheritGlossFile{belarusian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf
index b5eb8753728..816e5900378 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-belarusian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-belarusian.ldf}[polyglossia: module for Belarusian]
@@ -26,63 +26,68 @@
\setlanguagealias*{belarusian}{be}
\def\belarusian@spelling{modern}
-\define@choicekey*+{belarusian}{spelling}[\xpg@val\xpg@nr]{modern,classic,tarask}[modern]{%
- \ifcase\xpg@nr\relax
- % modern:
- \def\belarusian@spelling{modern}%
- \SetLanguageKeys{belarusian}{bcp47=be,bcp47-variant=1959acad}%
- \or
- % classic:
- \def\belarusian@spelling{tarask}%
- \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
- \or
- % tarask:
- \def\belarusian@spelling{tarask}%
- \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
- \fi
-}{\xpg@warning{Unknown Belarusian spelling `#1'}}
-
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{belarusian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \fi
- \xpg@info{Option: Belarusian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Belarusian numerals value `#1'}}
-\define@boolkey{belarusian}[belarusian@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/belarusian]
+ {
+ babelshorthands.if = belarusian@babelshorthands,
+ babelshorthands.default:n = true,
+ spelling.choice:,
+ spelling / modern.code =
+ {%
+ \def\belarusian@spelling{modern}%
+ \SetLanguageKeys{belarusian}{bcp47=be,bcp47-variant=1959acad}%
+ },
+ spelling / classic.code =
+ {%
+ \def\belarusian@spelling{tarask}%
+ \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
+ },
+ spelling / tarask.code =
+ {%
+ \def\belarusian@spelling{tarask}%
+ \SetLanguageKeys{belarusian}{bcp47=be-tarask,bcp47-variant=tarask}%
+ },
+ spelling.default:n = modern,
+ spelling/unknown.code = \xpg@warning{Unknown Belarusian spelling `#1'},
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Belarusian numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{belarusian}{babelshorthands=false,numerals=arabic,spelling=modern}
+\InitializeGlossOptions{belarusian}{babelshorthands=false,numerals=arabic,spelling=modern}
% Register alias options
-\xpg@set@alias@values{belarusian}{spelling}{classic}{tarask}
+\SetLanguageAliasValues{belarusian}{spelling}{classic,tarask}
\ifsystem@babelshorthands
- \setkeys{belarusian}{babelshorthands=true}
+ \SetGlossOptions{belarusian}{babelshorthands=true}
\else
- \setkeys{belarusian}{babelshorthands=false}
+ \SetGlossOptions{belarusian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\belarusian@shorthands{%
\xpg@activate@shorthands%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf
index bbddce0fe8f..1831fbdf032 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bengali.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translations provided by সাজেদুর রহিম জোয়ারদার <toshazed@gmail.com>
% TODO implement Bengali calendar
@@ -27,30 +27,36 @@
\newif\ifbengali@devanagari@numerals
\newif\ifbengali@bengali@numerals
-\define@choicekey*+{bengali}{numerals}[\xpg@val\xpg@nr]{Devanagari,Bengali,Western}[Devanagari]{%
- \ifcase\xpg@nr\relax
- % Devanagari:
- \bengali@bengali@numeralsfalse%
- \bengali@devanagari@numeralstrue%
- \or
- % Bengali:
- \bengali@bengali@numeralstrue%
- \bengali@devanagari@numeralsfalse%
- \or
- % Western:
- \bengali@bengali@numeralsfalse%
- \bengali@devanagari@numeralsfalse%
- \fi
- \xpg@info{Option: Bengali, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Bengali numeral `#1'}}
\def\extras@bengali{}
\def\noextras@bengali{}
-\define@boolkey{bengali}[bengali@]{changecounternumbering}[true]{}
+\DeclareKeys[polyglossia/gloss/bengali]
+ {
+ changecounternumbering.if = bengali@changecounternumbering,
+ changecounternumbering.default:n = true,
+ numerals.choice:,
+ numerals / devanagari.code =
+ {%
+ \bengali@bengali@numeralsfalse
+ \bengali@devanagari@numeralstrue
+ },
+ numerals / bengali.code =
+ {%
+ \bengali@bengali@numeralstrue
+ \bengali@devanagari@numeralsfalse
+ },
+ numerals / western.code =
+ {%
+ \bengali@bengali@numeralsfalse
+ \bengali@devanagari@numeralsfalse
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Bengali numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{bengali}{changecounternumbering=false,numerals=Devanagari}
+\InitializeGlossOptions{bengali}{changecounternumbering=false,numerals=Devanagari}
\def\captionsbengali{%
\def\refname{তথ্যসূত্রসমূহ}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bg.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bg.ldf
index d75aff3a6e9..fe47cb79588 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bg.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bg.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bg.ldf}[polyglossia: module for bg (Bulgarian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{bulgarian}
+\InheritGlossFile{bulgarian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bn.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bn.ldf
index 2c868f96eec..c85acb7dcac 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bn.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bn.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bn.ldf}[polyglossia: module for bn (Bengali)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{bengali}
+\InheritGlossFile{bengali}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bo.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bo.ldf
index 0f590f9da3a..f569a743133 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bo.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bo.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bo.ldf}[polyglossia: module for bo (Tibetan)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{tibetan}
+\InheritGlossFile{tibetan}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bosnian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bosnian.ldf
index e94edab0a53..24b7756ae52 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bosnian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bosnian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bosnian.ldf}[polyglossia: module for Bosnian]
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-br.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-br.ldf
index 5ad3f56ef00..62436958f59 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-br.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-br.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-br.ldf}[polyglossia: module for br (Breton)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{breton}
+\InheritGlossFile{breton}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf
index f5c681c9f32..85e541ab0c3 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-brazil.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-brazil.ldf}[polyglossia: module for Brazilian Portuguese]
@@ -6,6 +6,6 @@
% 'brazil' was selected in accordance with babel.
% Since brazil is a variety of portuguese, we use 'portuguese' now.
-\xpg@load@master@language{portuguese}
+\InheritGlossFile{portuguese}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-breton.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-breton.ldf
index 3d0b34a99f9..51f048c909f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-breton.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-breton.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-breton.ldf}[polyglossia: module for Breton]
\PolyglossiaSetup{breton}{
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-british.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-british.ldf
index ccf3a39ccfd..2a9870c6370 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-british.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-british.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-british.ldf}[polyglossia: module for British English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bs.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bs.ldf
index 335992a52e5..fa0243300c8 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bs.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bs.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bs.ldf}[polyglossia: module for bs (Bosnian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{bosnian}
+\InheritGlossFile{bosnian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-bulgarian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-bulgarian.ldf
index c7976480e5b..22cb9194716 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-bulgarian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-bulgarian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-bulgarian.ldf}[polyglossia: module for Bulgarian]
\PolyglossiaSetup{bulgarian}{
@@ -61,15 +61,15 @@
\def\figurename{Фигура}%
\def\tablename{Таблица}%
%\def\thepart{}%
- %\def\partname{}%
+ \def\partname{Част}%
\def\pagename{Стр.}%
\def\seename{вж.}%
\def\alsoname{вж.\ също и}%
\def\enclname{Приложения}%
\def\ccname{копия}%
- %\def\headtoname{}%
- \def\proofname{Proof}%
- \def\glossaryname{Glossary}%
+ \def\headtoname{За}%
+ \def\proofname{Доказателство}%
+ \def\glossaryname{Притурка}%
}
\def\datebulgarian{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ca.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ca.ldf
index b8d173e11f1..9c8d87d3226 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ca.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ca.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ca.ldf}[polyglossia: module for ca (Catalan)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{catalan}
+\InheritGlossFile{catalan}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-canadian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-canadian.ldf
index 249bd57c9f1..119f086eeac 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-canadian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-canadian.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-canadian.ldf}[polyglossia: module for Canadian English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-canadien.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-canadien.ldf
index 8cfed1e4da2..e62a04726aa 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-canadien.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-canadien.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-canadien.ldf}[polyglossia: module for Canadian French]
% We provide this as a babel alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf
index 37566fd974d..1e855fabb64 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-catalan.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-catalan.ldf}[polyglossia: module for Catalan]
\PolyglossiaSetup{catalan}{
@@ -16,21 +16,21 @@
% BCP-47 compliant aliases
\setlanguagealias*{catalan}{ca}
-\define@boolkey{catalan}[catalan@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/catalan]
+ {
+ babelshorthands.if = catalan@babelshorthands,
+ babelshorthands.default:n = true,
+ }
\ifsystem@babelshorthands
- \setkeys{catalan}{babelshorthands=true}
+ \SetGlossOptions{catalan}{babelshorthands=true}
\else
- \setkeys{catalan}{babelshorthands=false}
+ \SetGlossOptions{catalan}{babelshorthands=false}
\fi
% Register default options
-\xpg@initialize@gloss@options{catalan}{babelshorthands=false}
+\InitializeGlossOptions{catalan}{babelshorthands=false}
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
%%% adapted from Babel's catalan.ldf
\newdimen\leftllkern \newdimen\rightllkern \newdimen\raiselldim
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-chinese.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-chinese.ldf
index 05621e02298..004a8e8903c 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-chinese.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-chinese.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-chinese.ldf}[polyglossia: module for Chinese]
@@ -22,51 +22,60 @@
\setlanguagealias*[variant=simplified]{chinese}{zh-CN}
\setlanguagealias*[variant=traditional]{chinese}{zh-TW}
-\providebool{chinese@traditional}
+\@ifundefined{ifchinese@traditional}%
+ {\newif\ifchinese@traditional}{}
-\def\chinese@variant{chinese}
-
-\newif\ifchinese@numerals
-\define@key{chinese}{numerals}[arabic]{%
- \ifstrequal{#1}{chinese}%
- {\chinese@numeralstrue%
- \SetLanguageKeys{chinese}{bcp47-extension-u=nu-hant}%
- }{\chinese@numeralsfalse%
- \SetLanguageKeys{chinese}{bcp47-extension-u=nu-latn}%
- }%
-}
+\@ifundefined{ifchinese@numerals}%
+ {\newif\ifchinese@numerals}{}
+\def\chinese@variant{chinese}
-\define@choicekey*+{chinese}{variant}[\xpg@val\xpg@nr]{cn,simplified,tw,traditional}[cn]{%
- \ifcase\xpg@nr\relax
- % cn:
- \chinese@traditionalfalse
- \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
- \xpg@info{Option: Chinese, variant=simplified}%
- \or
- % simplified:
- \chinese@traditionalfalse
- \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
- \xpg@info{Option: Chinese, variant=simplified}%
- \or
- % tw:
- \chinese@traditionaltrue
- \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
- \xpg@info{Option: Chinese, variant=traditional}%
- \or
- % traditional:
- \chinese@traditionaltrue
- \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
- \xpg@info{Option: Chinese, variant=traditional}%
- \fi
-}{\xpg@warning{Unknown Chinese variant `#1'}}
+\DeclareKeys[polyglossia/gloss/chinese]
+ {
+ variant.choice:,
+ variant / cn.code =
+ {%
+ \chinese@traditionalfalse
+ \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
+ },
+ variant / simplified.code =
+ {%
+ \chinese@traditionalfalse
+ \SetLanguageKeys{chinese}{language={Chinese Simplified},langtag=ZHS,bcp47=zh-CN,bcp47-language=zh,bcp47-region=CN,bcp47-script=Hans}%
+ },
+ variant / tw.code =
+ {%
+ \chinese@traditionaltrue
+ \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
+ },
+ variant / traditional.code =
+ {%
+ \chinese@traditionaltrue
+ \SetLanguageKeys{chinese}{language={Chinese Traditional},langtag=ZHT,bcp47=zh-TW,bcp47-language=zh,bcp47-region=TW,bcp47-script=Hant}%
+ },
+ variant.default:n = cn,
+ variant/unknown.code = \xpg@warning{Unknown Chinese variant `#1'},
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \chinese@numeralsfalse
+ \SetLanguageKeys{chinese}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / chinese.code =
+ {%
+ \chinese@numeralstrue
+ \SetLanguageKeys{chinese}{bcp47-extension-u=nu-hant}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Chinese numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{chinese}{variant=cn,numerals=arabic}
-%\xpg@initialize@gloss@options{chinese}{variant=tw,numerals=arabic}
+\InitializeGlossOptions{chinese}{variant=cn,numerals=arabic}
+%\InitializeGlossOptions{chinese}{variant=tw,numerals=arabic}
% Register alias options
-\xpg@set@alias@values{chinese}{variant}{cn}{simplified}
-\xpg@set@alias@values{chinese}{variant}{tw}{traditional}
+\SetLanguageAliasValues{chinese}{variant}{cn,simplified}
+\SetLanguageAliasValues{chinese}{variant}{tw,traditional}
\def\chinese@capsformat{%
@@ -118,7 +127,7 @@
\def\enclname{附件}%
\def\ccname{抄送}%
\def\headtoname{收件人}%
- \def\\glossaryname{詞彙表}%
+ \def\glossaryname{詞彙表}%
}
\def\captions@chinese@simplified{%
\def\contentsname{目录}%
@@ -141,7 +150,7 @@
\def\enclname{附件}%
\def\ccname{抄送}%
\def\headtoname{收件人}%
- \def\\glossaryname{词汇表}%
+ \def\glossaryname{词汇表}%
}
\newcount\c@TempJNum%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ckb-Arab.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ckb-Arab.ldf
index f216864f4c6..f3fb645422d 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ckb-Arab.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ckb-Arab.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ckb-Arab.ldf}[polyglossia: module for ckb-Arab (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ckb-Latn.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ckb-Latn.ldf
index 73db9067eff..93bd7dcdcf8 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ckb-Latn.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ckb-Latn.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ckb-Latn.ldf}[polyglossia: module for ckb-Latn (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ckb.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ckb.ldf
index 360d484e8c2..73d86d55a01 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ckb.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ckb.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ckb.ldf}[polyglossia: module for ckb (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-classiclatin.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-classiclatin.ldf
new file mode 100644
index 00000000000..b20a680f5bd
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-classiclatin.ldf
@@ -0,0 +1,9 @@
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
+%
+\ProvidesFile{gloss-classiclatin.ldf}[polyglossia: module for classic Latin]
+
+% We provide this as a babel alias
+
+\InheritGlossFile{latin}
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-cop.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-cop.ldf
index 2f7e8653738..3aea4d6ff28 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-cop.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-cop.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-cop.ldf}[polyglossia: module for cop (Coptic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{coptic}
+\InheritGlossFile{coptic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-coptic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-coptic.ldf
index 0cff5d46d13..4368557e1c7 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-coptic.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-coptic.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-coptic.ldf}[polyglossia: module for Coptic]
\PolyglossiaSetup{coptic}{
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf
index 15b7bc02a01..8c7d64ae5e1 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-croatian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-croatian.ldf}[polyglossia: module for Croatian]
\PolyglossiaSetup{croatian}{
@@ -20,40 +20,40 @@
\RequirePackage{luavlna}
\fi
-\define@boolkey{croatian}[croatian@]{babelshorthands}[true]{}
-
-\define@boolkey{croatian}[croatian@]{disabledigraphs}[true]{}
-
-% Alias kept for backwards compatibility. Please do not remove
-\define@boolkey{croatian}[croatian@]{disableligatures}[true]{%
- \xpg@warning{The option disableligatures is deprected.\MessageBreak
- Please use disabledigraphs instead}%
- \ifcroatian@disableligatures
- \croatian@disabledigraphstrue
- \else
- \croatian@disabledigraphsfalse
- \fi
-}
-
-\define@boolkey{croatian}[croatian@]{splithyphens}[true]{}
-
-\define@boolkey{croatian}[croatian@]{localalph}[true]{}
+\DeclareKeys[polyglossia/gloss/croatian]
+ {
+ babelshorthands.if = croatian@babelshorthands,
+ babelshorthands.default:n = true,
+ disabledigraphs.if = croatian@disabledigraphs,
+ disabledigraphs.default:n = true,
+ splithyphens.if = croatian@splithyphens,
+ splithyphens.default:n = true,
+ localalph.if = croatian@localalph,
+ localalph.default:n = true,
+ disableligatures.choices:nn = { true, false }
+ {%
+ \xpg@warning{The option disableligatures is deprecated.\MessageBreak
+ Please use disabledigraphs instead}%
+ \ifcase\UseName{l_keys_choice_int}\or
+ \croatian@disabledigraphstrue
+ \or
+ \croatian@disabledigraphsfalse
+ \fi
+ },
+ disableligatures.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{croatian}{babelshorthands=false,disabledigraphs=false,
+\InitializeGlossOptions{croatian}{babelshorthands=false,disabledigraphs=false,
splithyphens=true,localalph=true}
\ifsystem@babelshorthands
- \setkeys{croatian}{babelshorthands=true}
+ \SetGlossOptions{croatian}{babelshorthands=true}
\else
- \setkeys{croatian}{babelshorthands=false}
+ \SetGlossOptions{croatian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\let\xpg@hyphen@char-
\def\croatian@@splhyphen#1{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-cy.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-cy.ldf
index bcf199e0747..107496bca65 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-cy.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-cy.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-cy.ldf}[polyglossia: module for cy (Welsh)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{welsh}
+\InheritGlossFile{welsh}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-cz.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-cz.ldf
index d3775620eed..81cf42534e9 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-cz.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-cz.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-cz.ldf}[polyglossia: module for cz (Czech)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{czech}
+\InheritGlossFile{czech}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf
index 858f3d4ae6c..85aaf6fca69 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-czech.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-czech.ldf}[polyglossia: module for Czech]
@@ -21,26 +21,26 @@
\RequirePackage{luavlna}
\fi
-\define@boolkey{czech}[czech@]{babelshorthands}[true]{}
-
-\define@boolkey{czech}[czech@]{splithyphens}[true]{}
-
-\define@boolkey{czech}[czech@]{vlna}[true]{}
+\DeclareKeys[polyglossia/gloss/czech]
+ {
+ babelshorthands.if = czech@babelshorthands,
+ babelshorthands.default:n = true,
+ splithyphens.if = czech@splithyphens,
+ splithyphens.default:n = true,
+ vlna.if = czech@vlna,
+ vlna.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{czech}{babelshorthands=false,splithyphens=true,vlna=true}
+\InitializeGlossOptions{czech}{babelshorthands=false,splithyphens=true,vlna=true}
\ifsystem@babelshorthands
- \setkeys{czech}{babelshorthands=true}
+ \SetGlossOptions{czech}{babelshorthands=true}
\else
- \setkeys{czech}{babelshorthands=false}
+ \SetGlossOptions{czech}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\czech@@splithyphen#1{%
\def\czech@sh@tmp{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-da.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-da.ldf
index ff3dda30d0a..7a6f2e8abd1 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-da.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-da.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-da.ldf}[polyglossia: module for da (Danish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{danish}
+\InheritGlossFile{danish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf
index 6126beaeb8b..0e779b8677a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-danish.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-danish.ldf}[polyglossia: module for Danish]
\PolyglossiaSetup{danish}{
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT-1901.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT-1901.ldf
index 6ec76bdff99..ab66673e7c4 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT-1901.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT-1901.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-1901.ldf}[polyglossia: module for de-AT-1901 (Austrian German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT-1996.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT-1996.ldf
index 0354d8b16fc..38021f39d44 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT-1996.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT-1996.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-1996.ldf}[polyglossia: module for de-AT-1996 (Austrian German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT.ldf
index 5e016be933d..2c74672a940 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-AT.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT.ldf}[polyglossia: module for de-AT (Austrian German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH-1901.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH-1901.ldf
index 1df826fee1d..0c68393bc3e 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH-1901.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH-1901.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-1901.ldf}[polyglossia: module for de-CH-1901 (Swiss German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH-1996.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH-1996.ldf
index 7ccf3664967..d115b45dd71 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH-1996.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH-1996.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-1996.ldf}[polyglossia: module for de-CH-1996 (Swiss German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH.ldf
index d99f0594d75..5ca22d3cf8f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-CH.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH.ldf}[polyglossia: module for de-CH (Swiss German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE-1901.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE-1901.ldf
index 1f4a987a1b4..f1b57ec2d43 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE-1901.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE-1901.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-1901.ldf}[polyglossia: module for de-DE-1901 (Germany's German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE-1996.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE-1996.ldf
index 9114631dcf1..a51fb8fca22 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE-1996.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE-1996.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-1996.ldf}[polyglossia: module for de-DE-1996 (Germany's German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE.ldf
index 174cfc6ea0a..f88846d4d5d 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-DE.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE.ldf}[polyglossia: module for de-DE (Germany's German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT-1901.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT-1901.ldf
index 97852bb8e02..07e96769bf4 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT-1901.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT-1901.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-1901-Latf.ldf}[polyglossia: module for de-AT-1901-Latf (Austrian German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT-1996.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT-1996.ldf
index a87e11a509c..02124310792 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT-1996.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT-1996.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-1996-Latf.ldf}[polyglossia: module for de-AT-1996-Latf (Austrian German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT.ldf
index 41eb5a93b9b..a71b3cac654 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-AT.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-AT-Latf.ldf}[polyglossia: module for de-AT-Latf (Austrian German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH-1901.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH-1901.ldf
index 05d331c364b..2545c40ce48 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH-1901.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH-1901.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-1901-Latf.ldf}[polyglossia: module for de-CH-1901-Latf (Swiss German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH-1996.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH-1996.ldf
index 3e256710167..08f3d5b3da0 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH-1996.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH-1996.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-1996-Latf.ldf}[polyglossia: module for de-CH-1996-Latf (Swiss German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH.ldf
index db4d3494874..e9022148d23 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-CH.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-CH-Latf.ldf}[polyglossia: module for de-CH-Latf (Swiss German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE-1901.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE-1901.ldf
index 4b7f9f97bad..a5637e4fb1a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE-1901.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE-1901.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-1901-Latf.ldf}[polyglossia: module for de-DE-1901-Latf (Germany's German, old spelling)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE-1996.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE-1996.ldf
index a4324450320..cb6c2261296 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE-1996.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE-1996.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-1996-Latf.ldf}[polyglossia: module for de-DE-1996-Latf (Germany's German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE.ldf
index 19649f6f98b..161729c7fd1 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf-DE.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-DE-Latf.ldf}[polyglossia: module for de-DE-Latf (Germany's German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf.ldf
index 2eddf761c4d..c399b378c46 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de-Latf.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de-Latf.ldf}[polyglossia: module for de-Latf (German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-de.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-de.ldf
index 5f15ee4e843..05d3f990eea 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-de.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-de.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-de.ldf}[polyglossia: module for de (German)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf
index 10debfabfa6..a8859eac5fb 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-divehi.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-divehi.ldf}[polyglossia: module for Divehi]
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-dsb.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-dsb.ldf
index 03e4a24986b..c3f45032b9b 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-dsb.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-dsb.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-dsb.ldf}[polyglossia: module for dsb (Sorbian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf
index f679e7f039c..f2ebd6f9168 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-dutch.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-dutch.ldf}[polyglossia: module for Dutch]
\PolyglossiaSetup{dutch}{
@@ -15,24 +15,24 @@
% BCP-47 compliant aliases
\setlanguagealias*{dutch}{nl}
-\define@boolkey{dutch}[dutch@]{babelshorthands}[true]{}
-
-\define@boolkey{dutch}[dutch@]{tremahyphenation}[true]{}
+\DeclareKeys[polyglossia/gloss/dutch]
+ {
+ babelshorthands.if = dutch@babelshorthands,
+ babelshorthands.default:n = true,
+ tremahyphenation.if = dutch@tremahyphenation,
+ tremahyphenation.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{dutch}{babelshorthands=false,tremahyphenation=true}
+\InitializeGlossOptions{dutch}{babelshorthands=false,tremahyphenation=true}
\ifsystem@babelshorthands
- \setkeys{dutch}{babelshorthands=true}
+ \SetGlossOptions{dutch}{babelshorthands=true}
\else
- \setkeys{dutch}{babelshorthands=false}
+ \SetGlossOptions{dutch}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\xpg@trema#1{\allowhyphens\discretionary{-}{#1}{\"{#1}}\allowhyphens}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-dv.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-dv.ldf
index 95ba8b33b3c..e157ca05322 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-dv.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-dv.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-dv.ldf}[polyglossia: module for dv (Divehi)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{divehi}
+\InheritGlossFile{divehi}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ecclesiasticlatin.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ecclesiasticlatin.ldf
new file mode 100644
index 00000000000..51659c46528
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ecclesiasticlatin.ldf
@@ -0,0 +1,9 @@
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
+%
+\ProvidesFile{gloss-ecclesiasticlatin.ldf}[polyglossia: module for ecclesiastic Latin]
+
+% We provide this as a babel alias
+
+\InheritGlossFile{latin}
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-el-monoton.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-el-monoton.ldf
index 3b2763da549..32cfa796b91 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-el-monoton.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-el-monoton.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-el-monoton.ldf}[polyglossia: module for el-monoton (Greek)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-el-polyton.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-el-polyton.ldf
index f36384c04de..0a57420ca3f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-el-polyton.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-el-polyton.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-el-polyton.ldf}[polyglossia: module for el-polyton (Greek)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-el.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-el.ldf
index 23acc8b54cf..b9a45d3501f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-el.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-el.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-el.ldf}[polyglossia: module for el (Greek)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-en-AU.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-en-AU.ldf
index a75c84a3a61..362795a36b2 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-en-AU.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-en-AU.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en-AU.ldf}[polyglossia: module for en-AU (Australian English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-en-CA.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-en-CA.ldf
index 3253e418ab7..4c61b1afdd0 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-en-CA.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-en-CA.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
-\ProvidesFile{gloss-en-CA.ldf}[polyglossia: module for en-CA (Canadan English)]
+\ProvidesFile{gloss-en-CA.ldf}[polyglossia: module for en-CA (Canadian English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-en-GB.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-en-GB.ldf
index fb958322bf4..bf8d7eb4726 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-en-GB.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-en-GB.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en-GB.ldf}[polyglossia: module for en-GB (British English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-en-NZ.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-en-NZ.ldf
index 15db1b4a330..b9956311def 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-en-NZ.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-en-NZ.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en-NZ.ldf}[polyglossia: module for en-NZ (Newzealand English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-en-US.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-en-US.ldf
index 55e3c76b979..943933b5836 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-en-US.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-en-US.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en-US.ldf}[polyglossia: module for en-US (American English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-en.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-en.ldf
index 2fc32374054..65818e7fd70 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-en.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-en.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-en.ldf}[polyglossia: module for en (English)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf
index 87da24e5e21..c434e00c40d 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-english.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-english.ldf}[polyglossia: module for English]
@@ -30,9 +30,12 @@
\setlanguagealias[variant=canadian]{english}{canadian}
\setlanguagealias[variant=newzealand]{english}{newzealand}
-\providebool{british@hyphen}
-\providebool{english@ordinalmonthday}
-\providebool{british@dateformat}
+\@ifundefined{ifbritish@hyphen}%
+ {\newif\ifbritish@hyphen}{}
+\@ifundefined{ifenglish@ordinalmonthday}%
+ {\newif\ifenglish@ordinalmonthday}{}
+\@ifundefined{ifbritish@dateformat}%
+ {\newif\ifbritish@dateformat}{}
% US English (\l@english) is default
% Initialize its settings
@@ -41,49 +44,46 @@
\english@ordinalmonthdayfalse
\british@dateformatfalse
-% Option ordinalmonthday
-\define@boolkey{english}[english@]{ordinalmonthday}[true]{}
-
-\define@choicekey*+{english}{variant}[\xpg@val\xpg@nr]{uk,british,us,american,usmax,australian,newzealand,canadian}[us]{%
- \ifcase\xpg@nr\relax
+\DeclareKeys[polyglossia/gloss/english]
+ {
+ ordinalmonthday.if = english@ordinalmonthday,
+ ordinalmonthday.default:n = true,
+ variant.choices:nn = { uk, british, us, american, usmax, australian, newzealand, canadian }
+ {%
+ \ifcase\UseName{l_keys_choice_int}\or
% uk:
\british@hyphentrue
\british@dateformattrue
\english@ordinalmonthdaytrue
\SetLanguageKeys{english}{babelname=british,bcp47=en-GB,bcp47-language=en,bcp47-region=GB}%
- \xpg@info{Option: English, variant=british}%
\or
% british:
\british@hyphentrue
\british@dateformattrue
\english@ordinalmonthdaytrue
\SetLanguageKeys{english}{babelname=british,bcp47=en-GB,bcp47-language=en,bcp47-region=GB}%
- \xpg@info{Option: english variant=british}%
\or
% us:
\british@hyphenfalse
\british@dateformatfalse
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=american,bcp47=en-US,bcp47-language=en,bcp47-region=US}%
- \xpg@info{Option: English, variant=american}%
\or
% american:
\british@hyphenfalse
\british@dateformatfalse
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=american,bcp47=en-US,bcp47-language=en,bcp47-region=US}%
- \xpg@info{Option: English, variant=american}%
\or
% usmax:
\british@hyphenfalse
\british@dateformatfalse
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=american,bcp47=en-US,bcp47-language=en,bcp47-region=US}%
- \xpg@info{Option: english variant=american (with additional patterns)}%
- \xpg@ifdefined{usenglishmax}{}%
+ \IfLanguageDefinedF{usenglishmax}%
{\xpg@warning{No hyphenation patterns were loaded for "US English Max"\MessageBreak
I will use the standard patterns for US English instead}%
- \adddialect\l@usenglishmax\l@english\relax%
+ \adddialect\l@usenglishmax\l@english
}%
\def\english@variant{usenglishmax}%
\or
@@ -94,8 +94,7 @@
\british@dateformattrue
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=australian,bcp47=en-AU,bcp47-language=en,bcp47-region=AU}%
- \xpg@info{Option: English, variant=australian}%
- \adddialect\l@australian\l@english%
+ \adddialect\l@australian\l@english
\or
% newzealand:
% These use the british hyphenation patterns
@@ -104,8 +103,7 @@
\british@dateformattrue
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=newzealand,bcp47=en-NZ,bcp47-language=en,bcp47-region=NZ}%
- \xpg@info{Option: English, variant=newzealand}%
- \adddialect\l@newzealand\l@english%
+ \adddialect\l@newzealand\l@english
\or
% canadian:
% This is currently equivalent to usenglish (as in babel)
@@ -113,45 +111,35 @@
\british@dateformatfalse
\english@ordinalmonthdayfalse
\SetLanguageKeys{english}{babelname=canadian,bcp47=en-CA,bcp47-language=en,bcp47-region=CA}%
- \xpg@info{Option: English, variant=american}%
- \adddialect\l@canadian\l@english%
+ \adddialect\l@canadian\l@english
\fi
\ifbritish@hyphen
- \xpg@ifdefined{ukenglish}{}%
+ \IfLanguageDefinedF{ukenglish}%
{\xpg@warning{No hyphenation patterns were loaded for British English\MessageBreak
I will use the patterns for US English instead}%
- \adddialect\l@ukenglish\l@english\relax%
+ \adddialect\l@ukenglish\l@english
}%
\def\english@variant{ukenglish}%
\fi
-}{\xpg@warning{Unknown English variant `#1'}}
+ },
+ variant.default:n = us,
+ variant/unknown.code = \xpg@warning{Unknown English variant `#1'},
+ }
% Register default options
-\xpg@initialize@gloss@options{english}{variant=us,ordinalmonthday=false}
+\InitializeGlossOptions{english}{variant=us,ordinalmonthday=false}
% Register alias options
-\xpg@set@alias@values{english}{variant}{us}{american}
-\xpg@set@alias@values{english}{variant}{uk}{british}
+\SetLanguageAliasValues{english}{variant}{us,american}
+\SetLanguageAliasValues{english}{variant}{uk,british}
\ifxetex
% Check if \l@english is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{english}{}{%
- \def\do##1{%
- \xpg@ifdefined{#1}%
- {\csletcs{l@english}{l@#1}\listbreak}%
- {%
- \xpg@warning{No hyphenation patterns for English found"\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@english0
- }%
- }%
- \docsvlist{british, american, usenglishmax, australian, newzealand}
- \xpg@ifdefined{english}{}{}
- }%
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{english}{british, american, usenglishmax, australian, newzealand}
\fi
\def\english@language{%
- \polyglossia@setup@language@patterns{\english@variant}%
+ \SetupPolyglossiaLangPatterns{\english@variant}%
}%
\def\captionsenglish{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-eo.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-eo.ldf
index 6c0cb13ecdc..ee888a9a3df 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-eo.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-eo.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-eo.ldf}[polyglossia: module for eo (Esperanto)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{esperanto}
+\InheritGlossFile{esperanto}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-es-ES.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-es-ES.ldf
index 0b0555e3727..2d4927f3c40 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-es-ES.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-es-ES.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-es-ES.ldf}[polyglossia: module for es-ES (Spain's Spanish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{spanish}
+\InheritGlossFile{spanish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-es-MX.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-es-MX.ldf
index 9e459726429..656834e9f4a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-es-MX.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-es-MX.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-es-MX.ldf}[polyglossia: module for es-MX (Mexican Spanish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{spanish}
+\InheritGlossFile{spanish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-es.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-es.ldf
index fb470d36c9c..8d6968fea50 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-es.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-es.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-es.ldf}[polyglossia: module for es (Spanish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{spanish}
+\InheritGlossFile{spanish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-esperanto.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-esperanto.ldf
index bd4e63a4a40..cb6c35e5329 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-esperanto.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-esperanto.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-esperanto.ldf}[polyglossia: module for Esperanto]
\PolyglossiaSetup{esperanto}{
@@ -29,10 +29,10 @@
\def\figurename{Figuro}%
\def\tablename{Tabelo}%
%\def\thepart{}%
- %\def\partname{}%
+ \def\partname{Parto}%
\def\pagename{Paĝo}%
\def\seename{vidu}%
- \def\alsoname{Parto}%
+ \def\alsoname{vidu ankaŭ}%
\def\enclname{Aldono(j)}%
\def\ccname{Kopie al}%
\def\headtoname{Al}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-estonian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-estonian.ldf
index 5dfb90ea569..7d179e433d7 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-estonian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-estonian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-estonian.ldf}[polyglossia: module for Estonian]
\PolyglossiaSetup{estonian}{
@@ -38,7 +38,7 @@
\def\ccname{Koopia(d)}%
%\def\headtoname{}%
\def\proofname{Korrektuur}%
- \def\glossaryname{Glossary}% <-- need translation
+ \def\glossaryname{Sõnastik}%
}
\def\dateestonian{%
\def\today{\number\day.\space\ifcase\month\or
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-et.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-et.ldf
index 5ab0c3f3bae..0151ac000df 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-et.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-et.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-et.ldf}[polyglossia: module for et (Estonian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{estonian}
+\InheritGlossFile{estonian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-eu.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-eu.ldf
index 98448839b1f..39c5bdfef1c 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-eu.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-eu.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-eu.ldf}[polyglossia: module for eu (Basque)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{basque}
+\InheritGlossFile{basque}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-fa.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-fa.ldf
index 08c337bdfb0..abe7241e059 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-fa.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-fa.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fa.ldf}[polyglossia: module for fa (Persian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{persian}
+\InheritGlossFile{persian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf
index 09ae993ea43..21af458e2cf 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-farsi.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-farsi.ldf}[polyglossia: module for Farsi]
% We only provide this gloss for babel compatibility.
% The proper English language name is Persian.
-\xpg@load@master@language{persian}
+\InheritGlossFile{persian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-fi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-fi.ldf
index 3b03ab4b433..a6b932ff10b 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-fi.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-fi.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fi.ldf}[polyglossia: module for fi (Finnish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{finnish}
+\InheritGlossFile{finnish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf
index 3bd83a947d3..1d9b03c1974 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-finnish.ldf}[polyglossia: module for Finnish]
\PolyglossiaSetup{finnish}{
@@ -16,51 +16,54 @@
% BCP-47 compliant aliases
\setlanguagealias*{finnish}{fi}
-\define@boolkey{finnish}[finnish@]{babelshorthands}[true]{}
-
\newif\if@finnish@schoolhyphens
\newif\if@finnish@babelhyphens
-\define@choicekey*+{finnish}{hyphens}[\xpg@val\xpg@nr]{default,school,babel}[default]{%
- \ifcase\xpg@nr\relax
- % default:
- \@finnish@schoolhyphensfalse
- \@finnish@babelhyphensfalse
- \or
- % school:
- \@finnish@schoolhyphenstrue
- \@finnish@babelhyphensfalse
- \or
- % babel:
- \@finnish@schoolhyphensfalse
- \@finnish@babelhyphenstrue
- \fi
- \xpg@info{Option: Finnish, hyphens=\xpg@val}%
-}{\xpg@warning{Unknown Finnish hyphens `#1'}}
-
-% backwards compatibility
-\define@boolkey{finnish}[finnish@]{schoolhyphens}[true]{%
- \iffinnish@schoolhyphens
- \@finnish@schoolhyphenstrue
- \@finnish@babelhyphensfalse
- \else
- \@finnish@schoolhyphensfalse
- \fi
-}
+
+\DeclareKeys[polyglossia/gloss/finnish]
+ {
+ babelshorthands.if = finnish@babelshorthands,
+ babelshorthands.default:n = true,
+ hyphens.choice:,
+ hyphens / default.code =
+ {%
+ \@finnish@schoolhyphensfalse
+ \@finnish@babelhyphensfalse
+ },
+ hyphens / school.code =
+ {%
+ \@finnish@schoolhyphenstrue
+ \@finnish@babelhyphensfalse
+ },
+ hyphens / babel.code =
+ {%
+ \@finnish@schoolhyphensfalse
+ \@finnish@babelhyphenstrue
+ },
+ hyphens.default:n = default,
+ hyphens/unknown.code = \xpg@warning{Unknown Finnish hyphens `#1'},
+ schoolhyphens.choice:,
+ schoolhyphens / true.code =
+ {%
+ \@finnish@schoolhyphenstrue
+ \@finnish@babelhyphensfalse
+ },
+ schoolhyphens / false.code =
+ {%
+ \@finnish@schoolhyphensfalse
+ },
+ schoolhyphens.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{finnish}{babelshorthands=false,hyphens=default}
+\InitializeGlossOptions{finnish}{babelshorthands=false,hyphens=default}
\ifsystem@babelshorthands
- \setkeys{finnish}{babelshorthands=true}
+ \SetGlossOptions{finnish}{babelshorthands=true}
\else
- \setkeys{finnish}{babelshorthands=false}
+ \SetGlossOptions{finnish}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\finnish@shorthands{%
\xpg@activate@shorthands%
@@ -105,15 +108,15 @@
\def\finnish@language{%
\if@finnish@schoolhyphens
- \xpg@ifdefined{schoolfinnish}{%
- \polyglossia@setup@language@patterns{schoolfinnish}%
+ \IfLanguageDefinedTF{schoolfinnish}{%
+ \SetupPolyglossiaLangPatterns{schoolfinnish}%
}{%
\xpg@warning{Finnish 'School' hyphenation patterns (schoolfinnish) not available.\MessageBreak
I will use the standard patterns for Finnish instead}%
- \polyglossia@setup@language@patterns{finnish}%
+ \SetupPolyglossiaLangPatterns{finnish}%
}%
\else
- \polyglossia@setup@language@patterns{finnish}%
+ \SetupPolyglossiaLangPatterns{finnish}%
\fi
}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CA-u-sd-canb.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CA-u-sd-canb.ldf
index 49e1c088687..173d01f3c57 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CA-u-sd-canb.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CA-u-sd-canb.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr-CA-u-sd-canb.ldf}[polyglossia: module for fr-CA-u-sd-canb (Canadian French, Acadian subvariety)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CA.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CA.ldf
index 8c8058a00e9..c1404f6862e 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CA.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CA.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr-CA.ldf}[polyglossia: module for fr-CA (Canadian French)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CH.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CH.ldf
index b8c2126df7c..c31c4f57f8c 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CH.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-CH.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr-CH.ldf}[polyglossia: module for fr-CH (Swiss French)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-FR.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-FR.ldf
index 41f1eb0ad50..b66ad30ec8c 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-FR.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-fr-FR.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr-FR.ldf}[polyglossia: module for fr-FR (France's French)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-fr.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-fr.ldf
index 672c6de8939..46267775b17 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-fr.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-fr.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fr.ldf}[polyglossia: module for fr (French)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{french}
+\InheritGlossFile{french}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf
index 2b0c795cdeb..8beace22bbd 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-french.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-french.ldf}[polyglossia: module for French]
@@ -28,43 +28,9 @@
\setlanguagealias[variant=canadian]{french}{canadien}
\def\french@variant{french}
-\define@choicekey*+{french}{variant}[\xpg@val\xpg@nr]{french,canadian,acadian,swiss}[french]{%
- \ifcase\xpg@nr\relax
- % french:
- \def\french@variant{french}%
- \SetLanguageKeys{french}{babelname=french,bcp47=fr-FR,bcp47-language=fr,bcp47-region=FR}%
- \french@thincolonspacefalse
- \or
- % canadian:
- \def\french@variant{canadien}%
- \SetLanguageKeys{french}{babelname=canadien,bcp47=fr-CA,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-caqc}%
- \xpg@ifdefined{canadien}{}%
- {\xpg@warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
- I will use the standard patterns for French instead}%
- \adddialect\l@canadien\l@french\relax}%
- \french@thincolonspacefalse
- \or
- % acadian:
- \def\french@variant{acadian}%
- \SetLanguageKeys{french}{babelname=acadian,bcp47=fr-CA-u-sd-canb,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-canb}%
- \xpg@ifdefined{acadian}{}%
- {\xpg@warning{No hyphenation patterns were loaded for "French (Canada, Acadian)"\MessageBreak
- I will use the standard patterns for French instead}%
- \adddialect\l@acadian\l@french\relax}%
- \french@thincolonspacefalse
- \or
- % swiss:
- \def\french@variant{swissfrench}%
- \SetLanguageKeys{french}{babelname=french,bcp47=fr-CH,bcp47-language=fr,bcp47-region=CH}%
- \adddialect\l@swissfrench\l@french\relax%
- \french@thincolonspacetrue
- \fi
- \xpg@info{Option: French, variant=\xpg@val}%
-}{\xpg@warning{Unknown French variant `#1'}}
-
\def\french@language{%
- \polyglossia@setup@language@patterns{\french@variant}%
+ \SetupPolyglossiaLangPatterns{\french@variant}%
}%
\ifluatex
@@ -84,91 +50,103 @@
% Save original footnote definition
% Do this at the end of the preamble to catch other
% packages' footnote changes (#391)
-\AtEndPreamble{%
+\AddToHook{begindocument/before}{%
\let\xpg@orig@makefntext\@makefntext
}
-\define@boolkey{french}[french@]{frenchfootnote}[true]{}
-
-\define@boolkey{french}[french@]{autospacing}[true]{}
-\french@autospacingtrue
-
-\define@boolkey{french}[french@]{frenchpart}[true]{}
-\french@frenchparttrue
-
-\newif\iffrench@autospaceguillemets
-\define@boolkey{french}[french@]{autospaceguillemets}[true]{}
-\french@autospaceguillemetstrue
-
-\newif\iffrench@thincolonspace
-\define@boolkey{french}[french@]{thincolonspace}[true]{}
-\french@thincolonspacefalse
-
-% Backwards compatibility
-\define@boolkey{french}[french@]{automaticspacesaroundguillemets}[true]{%
- \iffrench@automaticspacesaroundguillemets
- \setkeys{french}{autospaceguillemets=true}%
- \else
- \setkeys{french}{autospaceguillemets=false}%
- \fi
-}
-
% name is for compatibility with babel
\let\french@ttfamilyORI\ttfamily
\DeclareRobustCommand\french@ttfamilyFB{\nofrench@punctuation\french@ttfamilyORI}
-% Allow to switch on autospacing in ttfamily context
-\define@boolkey{french}[french@]{autospacetypewriter}[true]{}
-\french@autospacetypewriterfalse
-
-% This is how babel-french has it
-\define@boolkey{french}[french@]{OriginalTypewriter}[true]{%
- \iffrench@OriginalTypewriter
- \setkeys{french}{autospacetypewriter=false}%
- \else
- \setkeys{french}{autospacetypewriter=true}%
- \fi
-}
-
% Configuration of item labels
\def\french@itemi{\textemdash}
\def\french@itemii{\textemdash}
\def\french@itemiii{\textemdash}
\def\french@itemiv{\textemdash}
-\define@key{french}{itemlabels}[\textemdash]{%
- \def\french@itemi{#1}
- \def\french@itemii{#1}
- \def\french@itemiii{#1}
- \def\french@itemiv{#1}
-}
-
-\define@key{french}{itemlabeli}[\textemdash]{%
- \def\french@itemi{#1}
-}
-
-\define@key{french}{itemlabelii}[\textemdash]{%
- \def\french@itemii{#1}
-}
-
-\define@key{french}{itemlabeliii}[\textemdash]{%
- \def\french@itemiii{#1}
-}
-
-\define@key{french}{itemlabeliv}[\textemdash]{%
- \def\french@itemiv{#1}
-}
+\newif\iffrench@autospacetypewriter
+\french@autospacetypewriterfalse
+\newif\iffrench@autospacing
+\french@autospacingtrue
+\newif\iffrench@frenchpart
+\french@frenchparttrue
+\newif\iffrench@autospaceguillemets
+\french@autospaceguillemetstrue
-\define@boolkey{french}[french@]{frenchitemlabels}[true]{}
+\DeclareKeys[polyglossia/gloss/french]
+ {
+ variant.choice:,
+ variant / french.code =
+ {%
+ \def\french@variant{french}%
+ \SetLanguageKeys{french}{babelname=french,bcp47=fr-FR,bcp47-language=fr,bcp47-region=FR}%
+ \french@thincolonspacefalse
+ },
+ variant / canadian.code =
+ {%
+ \def\french@variant{canadien}%
+ \SetLanguageKeys{french}{babelname=canadien,bcp47=fr-CA,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-caqc}%
+ \IfLanguageDefinedF{canadien}%
+ {\xpg@warning{No hyphenation patterns were loaded for "French (Canada)"\MessageBreak
+ I will use the standard patterns for French instead}%
+ \adddialect\l@canadien\l@french\relax}%
+ \french@thincolonspacefalse
+ },
+ variant / acadian.code =
+ {%
+ \def\french@variant{acadian}%
+ \SetLanguageKeys{french}{babelname=acadian,bcp47=fr-CA-u-sd-canb,bcp47-language=fr,bcp47-region=CA,bcp47-extension-u=sd-canb}%
+ \IfLanguageDefinedF{acadian}%
+ {\xpg@warning{No hyphenation patterns were loaded for "French (Canada, Acadian)"\MessageBreak
+ I will use the standard patterns for French instead}%
+ \adddialect\l@acadian\l@french\relax}%
+ \french@thincolonspacefalse
+ },
+ variant / swiss.code =
+ {%
+ \def\french@variant{swissfrench}%
+ \SetLanguageKeys{french}{babelname=french,bcp47=fr-CH,bcp47-language=fr,bcp47-region=CH}%
+ \adddialect\l@swissfrench\l@french\relax%
+ \french@thincolonspacetrue
+ },
+ variant.default:n = french,
+ variant/unknown.code = \xpg@warning{Unknown French variant `#1'},
+ frenchfootnote.if = french@frenchfootnote,
+ frenchfootnote.default:n = true,
+ autospacing.if = french@autospacing,
+ autospacing.default:n = true,
+ frenchpart.if = french@frenchpart,
+ frenchpart.default:n = true,
+ autospaceguillemets.if = french@autospaceguillemets,
+ autospaceguillemets.default:n = true,
+ thincolonspace.if = french@thincolonspace,
+ thincolonspace.default:n = true,
+ automaticspacesaroundguillemets.meta:n = {autospaceguillemets=#1},
+ autospacetypewriter.if = french@autospacetypewriter,
+ autospacetypewriter.default:n = true,
+ originaltypewriter.meta:n = {autospacetypewriter=#1},
+ itemlabeli.store = \french@itemi,
+ itemlabelii.store = \french@itemii,
+ itemlabeliii.store = \french@itemiii,
+ itemlabeliv.store = \french@itemiv,
+ frenchitemlabels.if = french@frenchitemlabels,
+ frenchitemlabels.default:n = true,
+ itemlabels.code =
+ \def\french@itemi{#1}%
+ \def\french@itemii{#1}%
+ \def\french@itemiii{#1}%
+ \def\french@itemiv{#1},
+ itemlabels.default:n = \textemdash
+ }
% Register default options
-\xpg@initialize@gloss@options{french}{variant=french,autospacing=true,thincolonspace=false,
+\InitializeGlossOptions{french}{variant=french,autospacing=true,thincolonspace=false,
autospaceguillemets=true,autospacetypewriter=false,
frenchfootnote=false,frenchitemlabels=false,
itemlabels=\textemdash,itemlabeli=\textemdash,itemlabelii=\textemdash,
itemlabeliii=\textemdash,itemlabeliv=\textemdash}
% Register alias options
-\xpg@set@alias@values{french}{variant}{canadian}{acadian}
+\SetLanguageAliasValues{french}{variant}{canadian,acadian}
\def\french@fontsetup{%
@@ -339,100 +317,100 @@
\def\french@capsformat{%
% Change part heading
% With titlesec
- \ifcsdef{titleformat}{%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\xpg@french@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for French}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
+ \@ifundefined{titleformat}{%
+ % With KOMA
+ \@ifundefined{sectionformat}{%
+ % With memoir
+ \@ifundefined{@memptsize}{% (not \ifdefined\@memptsize)
+ % With standard classes
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\xpg@french@part\nobreakspace\partname}%
+ {}%
+ {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for French}}}%
+ }% (end \ifdefined \@part)
+ }{% Hyperref
+ \let\xpg@save@part@format\NR@part%
+ \patchcmd{\NR@part}%
{\partname\nobreakspace\thepart}%
{\xpg@french@part\nobreakspace\partname}%
{}%
{\xpg@warning{Failed to patch part for French}}%
- }{}%
- }%
- }{% (not \ifdefined\titleformat)
- % With KOMA
- \ifcsdef{sectionformat}{%
- \ifcsdef{partformat}{%
- \let\xpg@save@part@format\partformat%
- \renewcommand{\partformat}{\xpg@french@part~\partname}%
- }{}%
- }{% (not \ifdefined\sectionformat)
- % With memoir
- \ifcsdef{@memptsize}{%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
- {\partnamefont\xpg@french@part\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for French}}%
- }{% not hyperref
- \ifcsdef{@part}{%
+ }% (end \ifdefined\NR@part)
+ }{%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
\let\xpg@save@part@format\@part%
\patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
{\partnamefont\xpg@french@part\partnamenum\printpartname}%
{}%
{\xpg@warning{Failed to patch part for French}}%
- }{}%
- }%
- }{% (not \ifdefined\@memptsize)
- % With standard classes
- \ifcsdef{NR@part}{% Hyperref
+ }%
+ }{% Hyperref (nameref)
\let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
+ \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
+ {\partnamefont\xpg@french@part\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for French}}%
+ }%
+ }% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\sectionformat)
+ \@ifundefined{partformat}{}{%
+ \let\xpg@save@part@format\partformat%
+ \renewcommand{\partformat}{\xpg@french@part~\partname}%
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
{\partname\nobreakspace\thepart}%
{\xpg@french@part\nobreakspace\partname}%
{}%
{\xpg@warning{Failed to patch part for French}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\xpg@french@part\nobreakspace\partname}%
- {}%
- {\ifcsdef{part}{\xpg@warning{Failed to patch part for French}}{}}%
- }{}% (end \ifdefined \NR@part)
- }% (end \ifdefined\@part)
- }% (end \ifdefined\@memptsize)
- }% (end \ifdefined\sectionformat)
+ }%
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part%
+ \patchcmd{\NR@part}%
+ {\partname\nobreakspace\thepart}%
+ {\xpg@french@part\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for French}}%
+ }%
}% (end \ifdefined\titleformat)
}
\def\nofrench@capsformat{%
% Reset chapter and part heading
- \ifcsdef{titleformat}{%
- % With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format%
- }{%
- \let\@part\xpg@save@part@format%
- }%
- }{}%
- }{% (not \ifdefined\titleformat)
- \ifcsdef{sectionformat}{%
- % With KOMA
- \ifcsdef{xpg@save@part@format}{%
- \let\partformat\xpg@save@part@format
- }{}%
- }{%
+ \@ifundefined{titleformat}{%
+ \@ifundefined{sectionformat}{%
% With memoir and standard classes
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format%
- }{%
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
\let\@part\xpg@save@part@format%
+ }{%
+ \let\NR@part\xpg@save@part@format%
}%
- }{}%
+ }%
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@part@format}{}{%
+ \let\partformat\xpg@save@part@format
+ }%
}% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ % With titlesec
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
+ \let\@part\xpg@save@part@format%
+ }{%
+ \let\NR@part\xpg@save@part@format%
+ }%
+ }%
}% (end \ifdefined\titleformat)
}
@@ -443,7 +421,7 @@
\if@xpg@french@footnote@set%
\else%
\iffrench@frenchfootnote%
- \ifdefstring{\xpg@main@language}{french}{%
+ \IfMainLanguageTF{french}{%
\ifx\@makefntext\undefined\else%
\long\def\french@makefntext##1{%
\parindent1em \noindent\quad%
@@ -467,7 +445,7 @@
\if@xpg@french@itemlabels@set%
\else%
\iffrench@frenchitemlabels
- \ifdefstring{\xpg@main@language}{french}{%
+ \IfMainLanguageTF{french}{%
\renewcommand{\labelitemi}{\french@itemi}%
\renewcommand{\labelitemii}{\french@itemii}%
\renewcommand{\labelitemiii}{\french@itemiii}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf
index 2db31a34152..7713ef99fe5 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-friulan.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-friulan.ldf}[polyglossia: module for Friulian]
% We only provide this gloss for babel compatibility.
-\xpg@load@master@language{friulian}
+\InheritGlossFile{friulian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf
index 49b69eaf9dd..ed1f24ae428 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-friulian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-friulian.ldf}[polyglossia: module for Friulian]
@@ -52,7 +52,7 @@
Lui\or Avost\or Setembar\or Otobar\or Novembar\or Dicembar%
\fi\space dal\space\number\year}}
-\AtEndPreamble{% the user or the class might define different values
+\AddToHook{begindocument/before}{% the user or the class might define different values
\edef\xpgfu@savedvalues{%
\clubpenalty=\the\clubpenalty\space
\@clubpenalty=\the\@clubpenalty\space
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-fur.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-fur.ldf
index ca0671bbe9a..2005e4d484a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-fur.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-fur.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-fur.ldf}[polyglossia: module for fur (Friulian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{friulian}
+\InheritGlossFile{friulian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ga.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ga.ldf
index 02fd9e40091..364fa8e773e 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ga.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ga.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ga.ldf}[polyglossia: module for ga (Gaelic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{gaelic}
+\InheritGlossFile{gaelic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf
index 2cbf5adbc5e..8b91897888a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-gaelic.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-gaelic.ldf}[polyglossia: module for Gaelic]
@@ -22,23 +22,28 @@
\setlanguagealias[variant=scottish]{gaelic}{scottish}
\def\gaelic@variant{irish}
-\define@choicekey*+{gaelic}{variant}[\xpg@val\xpg@nr]{irish,scottish}[irish]{%
- \ifcase\xpg@nr\relax
- % irish:
- \gdef\gaelic@variant{irish}%
- \SetLanguageKeys{gaelic}{language=Irish,langtag=IRI,babelname=irish,bcp47=ga,bcp47-language=ga}%
- \xpg@fontsetup@latin{gaelic}%
- \or
- % scottish:
- \gdef\gaelic@variant{scottish}%
- \SetLanguageKeys{gaelic}{language=Gaelic,langtag=GAE,babelname=scottish,bcp47=gd,bcp47-language=gd}%
- \xpg@fontsetup@latin{gaelic}%
- \fi
- \xpg@info{Option: gaelic, variant=\xpg@val}%
-}{\xpg@warning{Unknown gaelic variant `#1'}}
+
+\DeclareKeys[polyglossia/gloss/gaelic]
+ {
+ variant.choice:,
+ variant / irish.code =
+ {%
+ \gdef\gaelic@variant{irish}%
+ \SetLanguageKeys{gaelic}{language=Irish,langtag=IRI,babelname=irish,bcp47=ga,bcp47-language=ga}%
+ \SetupLatinPolyglossiaFont{gaelic}%
+ },
+ variant / scottish.code =
+ {%
+ \gdef\gaelic@variant{scottish}%
+ \SetLanguageKeys{gaelic}{language=Gaelic,langtag=GAE,babelname=scottish,bcp47=gd,bcp47-language=gd}%
+ \SetupLatinPolyglossiaFont{gaelic}%
+ },
+ variant.default:n = irish,
+ variant/unknown.code = \xpg@warning{Unknown gaelic variant `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{gaelic}{variant=irish}
+\InitializeGlossOptions{gaelic}{variant=irish}
\def\captionsgaelic@irish{%
\def\refname{Tagairtí}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-galician.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-galician.ldf
index 469af7e8cde..ab10957c8ea 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-galician.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-galician.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-galician.ldf}[polyglossia: module for Galician]
\PolyglossiaSetup{galician}{
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-gd.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-gd.ldf
index 94842fd4d52..bd0a4572e90 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-gd.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-gd.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-gd.ldf}[polyglossia: module for gd (Gaelic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{gaelic}
+\InheritGlossFile{gaelic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf
index e58cede44b3..be0db60a34b 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-georgian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-georgian.ldf}[polyglossia: module for Georgian]
@@ -18,34 +18,37 @@
\setlanguagealias*{georgian}{ka}
\newif\ifgeorgian@numerals
-\define@key{georgian}{numerals}[arabic]{%
- \ifstrequal{#1}{georgian}%
- {\georgian@numeralstrue%
- \SetLanguageKeys{georgian}{bcp47-extension-u=nu-geor}%
- }%
- {\georgian@numeralsfalse%
- \SetLanguageKeys{georgian}{bcp47-extension-u=nu-latn}%
- }%
-}
-
-\define@boolkey{georgian}[georgian@]{babelshorthands}[true]{}
-\define@boolkey{georgian}[georgian@]{oldmonthnames}[true]{}
+\DeclareKeys[polyglossia/gloss/georgian]
+ {
+ babelshorthands.if = georgian@babelshorthands,
+ babelshorthands.default:n = true,
+ oldmonthnames.if = georgian@oldmonthnames,
+ oldmonthnames.default:n = true,
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \georgian@numeralsfalse
+ \SetLanguageKeys{georgian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / georgian.code =
+ {%
+ \georgian@numeralstrue
+ \SetLanguageKeys{georgian}{bcp47-extension-u=nu-geor}%
+ },
+ numerals.default:n = arabic
+ }
% Register default options
-\xpg@initialize@gloss@options{georgian}{babelshorthands=false,oldmonthnames=false,numerals=arabic}
+\InitializeGlossOptions{georgian}{babelshorthands=false,oldmonthnames=false,numerals=arabic}
\ifsystem@babelshorthands
- \setkeys{georgian}{babelshorthands=true}
+ \SetGlossOptions{georgian}{babelshorthands=true}
\else
- \setkeys{georgian}{babelshorthands=false}
+ \SetGlossOptions{georgian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\georgian@shorthands{%
\xpg@activate@shorthands%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf
index 918b759eb80..f4f918f50cb 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-german.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-german.ldf}[polyglossia: module for German]
@@ -47,51 +47,11 @@
\newif\if@german@oldspelling
\@german@oldspellingfalse
-\define@choicekey*+{german}{spelling}[\xpg@val\xpg@nr]{new,old,1901,1996}[new]{%
- \ifcase\xpg@nr\relax
- % new:
- \@german@oldspellingfalse
- \or
- % old:
- \@german@oldspellingtrue
- \or
- % 1901:
- \@german@oldspellingtrue
- \or
- % 1996:
- \@german@oldspellingfalse
- \fi
- \german@set@babelname%
- \xpg@info{Option: German, spelling=\xpg@val}%
-}{\xpg@warning{Unknown German spelling `#1'}}
\newif\if@austrian@locale
\@austrian@localefalse
\newif\if@swiss@locale
\@swiss@localefalse
-\define@choicekey*+{german}{variant}[\xpg@val\xpg@nr]{german,austrian,swiss}[german]{%
- \ifcase\xpg@nr\relax
- % german:
- \@swiss@localefalse%
- \@austrian@localefalse%
- \or
- % austrian:
- \@austrian@localetrue%
- \@swiss@localefalse%
- \or
- % swiss:
- \@swiss@localetrue%
- \@austrian@localefalse%
- \xpg@ifdefined{swissgerman}{}%
- {%
- \xpg@warning{No hyphenation patterns were loaded for "Swiss German (Old Spelling)"\MessageBreak
- I will use the standard patterns for German (old spelling) instead}%
- \adddialect\l@swissgerman\l@german\relax%
- }%
- \fi
- \german@set@babelname%
- \xpg@info{Option: German, variant=\xpg@val}%
-}{\xpg@warning{Unknown German variant `#1'}}
\def\german@set@babelname{%
\if@german@oldspelling
@@ -140,58 +100,110 @@
}
\newif\if@german@blackletter
-\define@choicekey*+{german}{script}[\xpg@val\xpg@nr]{latin,blackletter,fraktur}[latin]{%
- \ifcase\xpg@nr\relax
- % latin:
- \@german@blackletterfalse%
- \or
- % blackletter:
- \@german@blacklettertrue%
- \or
- % fraktur:
- \@german@blacklettertrue%
- \fi
- \german@set@babelname%
- \xpg@info{Option: German, script=\xpg@val}%
-}{\xpg@warning{Unknown German script `#1'}}
-\define@boolkey{german}[german@]{capitaleszett}[true]{%
- \ifgerman@capitaleszett
- % MakeUppercase capitalizes the eszett (U+00DF) with U+1E9E
- \SetLanguageKeys{german}{bcp47-casing=de-x-eszett,bcp47-extension-x=eszett}
- \else
- % Capitalize eszett as <SS>
- \SetLanguageKeys{german}{bcp47-casing=de,bcp47-extension-x={}}
- \fi
-}
-
-
-% Option defunc'ed, as both XeTeX and LuaTeX meanwhile
-% use the experimental German hyphenation patterns by default.
-\define@boolkey{german}[german@]{latesthyphen}[true]{}
-
-\define@boolkey{german}[german@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/german]
+ {
+ babelshorthands.if = german@babelshorthands,
+ babelshorthands.default:n = true,
+ latesthyphen.if = german@latesthyphen,
+ latesthyphen.default:n = true,
+ capitaleszett.choice:,
+ capitaleszett / true.code =
+ {% MakeUppercase capitalizes the eszett (U+00DF) with U+1E9E
+ \SetLanguageKeys{german}{bcp47-casing=de-x-eszett,bcp47-extension-x=eszett}%
+ },
+ capitaleszett / false.code =
+ {% Capitalize eszett as <SS>
+ \SetLanguageKeys{german}{bcp47-casing=de,bcp47-extension-x={}}%
+ },
+ capitaleszett.default:n = true,
+ script.choice:,
+ script / latin.code =
+ {%
+ \@german@blackletterfalse
+ \german@set@babelname
+ },
+ script / blackletter.code =
+ {%
+ \@german@blacklettertrue
+ \german@set@babelname
+ },
+ script / fraktur.code =
+ {%
+ \@german@blacklettertrue
+ \german@set@babelname
+ },
+ script.default:n = latin,
+ script/unknown.code = \xpg@warning{Unknown German script `#1'},
+ spelling.choice:,
+ spelling / new.code =
+ {%
+ \@german@oldspellingfalse
+ \german@set@babelname
+ },
+ spelling / old.code =
+ {%
+ \@german@oldspellingtrue
+ \german@set@babelname
+ },
+ spelling / 1901.code =
+ {%
+ \@german@oldspellingtrue
+ \german@set@babelname
+ },
+ spelling / 1996.code =
+ {%
+ \@german@oldspellingfalse
+ \german@set@babelname
+ },
+ spelling.default:n = new,
+ spelling/unknown.code = \xpg@warning{Unknown German spelling `#1'},
+ variant.choice:,
+ variant / german.code =
+ {%
+ \@swiss@localefalse
+ \@austrian@localefalse
+ \german@set@babelname
+ },
+ variant / austrian.code =
+ {%
+ \@austrian@localetrue
+ \@swiss@localefalse
+ \german@set@babelname
+ },
+ variant / swiss.code =
+ {%
+ \@swiss@localetrue
+ \@austrian@localefalse
+ \IfLanguageDefinedF{swissgerman}
+ {%
+ \xpg@warning{No hyphenation patterns were loaded for "Swiss German (Old Spelling)"\MessageBreak
+ I will use the standard patterns for German (old spelling) instead}%
+ \adddialect\l@swissgerman\l@german\relax
+ }%
+ \german@set@babelname
+ },
+ variant.default:n = german,
+ variant/unknown.code = \xpg@warning{Unknown German variant `#1'}
+ }
+
-\setkeys{german}{spelling,script,variant}
+\SetGlossOptions{german}{spelling,script,variant}
% Register default options
-\xpg@initialize@gloss@options{german}{variant=german,spelling=new,script=latin,babelshorthands=false}
+\InitializeGlossOptions{german}{variant=german,spelling=new,script=latin,babelshorthands=false}
% Register alias options
-\xpg@set@alias@values{german}{spelling}{new}{1996}
-\xpg@set@alias@values{german}{spelling}{old}{1901}
-\xpg@set@alias@values{german}{script}{blackletter}{fraktur}
+\SetLanguageAliasValues{german}{spelling}{new,1996}
+\SetLanguageAliasValues{german}{spelling}{old,1901}
+\SetLanguageAliasValues{german}{script}{blackletter,fraktur}
\ifsystem@babelshorthands
- \setkeys{german}{babelshorthands=true}
+ \SetGlossOptions{german}{babelshorthands=true}
\else
- \setkeys{german}{babelshorthands=false}
+ \SetGlossOptions{german}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\german@shorthands{%
\xpg@activate@shorthands%
@@ -313,15 +325,15 @@
\def\german@language{%
\if@german@oldspelling
\if@swiss@locale
- \polyglossia@setup@language@patterns{swissgerman}%
+ \SetupPolyglossiaLangPatterns{swissgerman}%
\else
- \polyglossia@setup@language@patterns{german}%
+ \SetupPolyglossiaLangPatterns{german}%
\fi
\if@austrian@locale
\adddialect\l@austrian\l@german%
\fi
\else
- \polyglossia@setup@language@patterns{ngerman}%
+ \SetupPolyglossiaLangPatterns{ngerman}%
\if@austrian@locale
\adddialect\l@naustrian\l@ngerman%
\fi
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-germanb.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-germanb.ldf
index d5b6a8768b2..da48264a9c9 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-germanb.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-germanb.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-germanb.ldf}[polyglossia: module for German (old spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-gl.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-gl.ldf
index 11c6fdff929..c5be58f01c4 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-gl.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-gl.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-gl.ldf}[polyglossia: module for gl (Galician)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{galician}
+\InheritGlossFile{galician}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-grc.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-grc.ldf
index 82184ffaaa4..820df8e3198 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-grc.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-grc.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-grc.ldf}[polyglossia: module for grc (Greek)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf
index 537379cb7f4..b48684d1b58 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-greek.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-greek.ldf}[polyglossia: module for Greek]
@@ -22,7 +22,7 @@
% BCP-47 compliant aliases
\setlanguagealias*[variant=ancient]{greek}{grc}
-\setlanguagealias*[varant=polytonic]{greek}{el-polyton}
+\setlanguagealias*[variant=polytonic]{greek}{el-polyton}
\setlanguagealias*[variant=monotonic]{greek}{el-monoton}
\setlanguagealias*{greek}{el}
@@ -42,44 +42,9 @@
\newif\if@greek@ancient\@greek@ancientfalse
\newif\if@greek@poly\@greek@polyfalse
-\define@choicekey*+{greek}{variant}[\xpg@val\xpg@nr]{monotonic,mono,polytonic,poly,ancient,ancientgreek}[monotonic]{%
- \xpg@ifdefined{greek}{}{%
- \xpg@nopatterns{greek}%
- \adddialect\l@greek\l@nohyphenation
- }%
- \ifcase\xpg@nr\relax
- % monotonic:
- \@greek@polyfalse
- \@greek@ancientfalse
- \or
- % mono:
- \@greek@polyfalse
- \@greek@ancientfalse
- \or
- % polytonic:
- \@greek@polytrue
- \@greek@ancientfalse
- \or
- % poly:
- \@greek@polytrue
- \@greek@ancientfalse
- \or
- % ancient:
- \@greek@polyfalse
- \@greek@ancienttrue
- \or
- % ancientgreek:
- \@greek@polyfalse
- \@greek@ancienttrue
- \fi
- \greek@set@langdata
- \xpg@info{Option: Greek, variant=\xpg@val}%
-}{\xpg@warning{Unknown Greek variant `#1'}}
-
-
\def\greek@set@langdata{%
\if@greek@ancient
- \xpg@ifdefined{ancientgreek}{}%
+ \IfLanguageDefinedF{ancientgreek}%
{\xpg@warning{No hyphenation patterns were loaded for Ancient Greek\MessageBreak
I will use the patterns loaded for \string\l@greek\space instead}%
\adddialect\l@ancientgreek\l@greek\relax}%
@@ -89,7 +54,7 @@
\SetLanguageKeys{greek}{babelname=greek,bcp47=grc,bcp47-language=grc,bcp47-variant={}}%
\else
\if@greek@poly
- \xpg@ifdefined{polygreek}{}%
+ \IfLanguageDefinedF{polygreek}%
{\xpg@warning{No hyphenation patterns were loaded for Polytonic Greek\MessageBreak
I will use the patterns loaded for \string\l@greek\space instead}%
\adddialect\l@polygreek\l@greek\relax}%
@@ -98,7 +63,7 @@
\def\dategreek{\datepolygreek}%
\SetLanguageKeys{greek}{babelname=polutonikogreek,bcp47=el-polyton,bcp47-language=el,bcp47-variant=polyton}%
\else% monotonic greek
- \xpg@ifdefined{monogreek}{}%
+ \IfLanguageDefinedF{monogreek}%
{\xpg@warning{No hyphenation patterns were loaded for Monotonic Greek\MessageBreak
I will use the patterns loaded for \string\l@greek\space instead}%
\adddialect\l@monogreek\l@greek\relax}%
@@ -112,42 +77,85 @@
\def\greek@language{%
- \polyglossia@setup@language@patterns{\greek@variant}%
+ \SetupPolyglossiaLangPatterns{\greek@variant}%
}
\newif\if@greek@numerals
-\define@choicekey*+{greek}{numerals}[\xpg@val\xpg@nr]{greek,arabic}[greek]{%
- \ifcase\xpg@nr\relax
- % greek:
- \@greek@numeralstrue%
- \SetLanguageKeys{greek}{bcp47-extension-u=nu-grek}%
- \or
- % arabic:
- \@greek@numeralsfalse%
- \SetLanguageKeys{greek}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Greek, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Greek numerals value `#1'}}
-
-\define@boolkey{greek}[greek@]{capitaliota}[true]{%
- \ifgreek@capitaliota
- % \MakeUppercase converts the ypogegrammeni (subscript muted iota) to capital iota
- \SetLanguageKeys{greek}{bcp47-casing=el-x-iota,bcp47-extension-x=iota}
- \else
- % \MakeUppercase retains the subscript versions (default)
- \SetLanguageKeys{greek}{bcp47-casing=el,bcp47-extension-x={}}
- \fi
-}
-
-\define@boolkey{greek}{attic}[true]{\xpg@warning{Greek option `attic' is no longer required.}}
+\DeclareKeys[polyglossia/gloss/greek]
+ {
+ variant.choices:nn = { monotonic, mono,polytonic, poly,ancient, ancientgreek }
+ {%
+ \CheckHyphenationPatterns{greek}%
+ \ifcase\UseName{l_keys_choice_int}\or
+ % monotonic:
+ \@greek@polyfalse
+ \@greek@ancientfalse
+ \or
+ % mono:
+ \@greek@polyfalse
+ \@greek@ancientfalse
+ \or
+ % polytonic:
+ \@greek@polytrue
+ \@greek@ancientfalse
+ \or
+ % poly:
+ \@greek@polytrue
+ \@greek@ancientfalse
+ \or
+ % ancient:
+ \@greek@polyfalse
+ \@greek@ancienttrue
+ \or
+ % ancientgreek:
+ \@greek@polyfalse
+ \@greek@ancienttrue
+ \fi
+ \greek@set@langdata
+ },
+ variant.default:n = monotonic,
+ variant/unknown.code = \xpg@warning{Unknown Greek variant `#1'},
+ numerals.choice:,
+ numerals / greek.code =
+ {%
+ \@greek@numeralstrue
+ \SetLanguageKeys{greek}{bcp47-extension-u=nu-grek}%
+ },
+ numerals / arabic.code =
+ {%
+ \@greek@numeralsfalse
+ \SetLanguageKeys{greek}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = greek,
+ numerals/unknown.code = \xpg@warning{Unknown Greek numerals value `#1'},
+ capitaliota.choice:,
+ capitaliota / true.code =
+ {%
+ \@greek@capitaliotatrue
+ % \MakeUppercase converts the ypogegrammeni (subscript muted iota) to capital iota
+ \SetLanguageKeys{greek}{bcp47-casing=el-x-iota,bcp47-extension-x=iota}%
+ },
+ capitaliota / false.code =
+ {%
+ \@greek@capitaliotafalse
+ % \MakeUppercase retains the subscript versions (default)
+ \SetLanguageKeys{greek}{bcp47-casing=el,bcp47-extension-x={}}%
+ },
+ capitaliota.default:n = true,
+ attic.choices:nn = { true, false }
+ {%
+ \xpg@warning{Greek option `attic' is no longer required.}
+ },
+ capitaliota.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{greek}{variant=monotonic,numerals=greek}
+\InitializeGlossOptions{greek}{variant=monotonic,numerals=greek}
% Register alias options
-\xpg@set@alias@values{greek}{variant}{monotonic}{mono}
-\xpg@set@alias@values{greek}{variant}{polytonic}{poly}
+\SetLanguageAliasValues{greek}{variant}{monotonic,mono}
+\SetLanguageAliasValues{greek}{variant}{polytonic,poly}
\def\monogreekcaptions{%
\def\refname{Αναφορές}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-he.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-he.ldf
index 80a60baa797..05e2aa40bb5 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-he.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-he.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-he.ldf}[polyglossia: module for he (Hebrew)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{hebrew}
+\InheritGlossFile{hebrew}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf
index 7ee62033e1d..3b3491ce9ad 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hebrew.ldf}[polyglossia: module for Hebrew]
@@ -24,41 +24,48 @@
% BCP-47 compliant aliases
\setlanguagealias*{hebrew}{he}
-% hebrewcal options
-\define@key{hebrew}{marcheshvan}[true]{\setkeys{hebrewcal}{marcheshvan=#1}}
-\define@key{hebrew}{transliteration}[alt]{\setkeys{hebrewcal}{transliteration=#1}}
-\define@key{hebrew}{fullyear}[true]{\setkeys{hebrewcal}{fullyear=#1}}
-
\newif\if@calendar@hebrew
-\define@choicekey*+{hebrew}{calendar}[\xpg@val\xpg@nr]{hebrew,gregorian}[gregorian]{%
- \ifcase\xpg@nr\relax
- % hebrew:
- \@calendar@hebrewtrue
- \or
- % gregorian:
- \@calendar@hebrewfalse
- \fi
- \xpg@info{Option: Hebrew, calendar=\xpg@val}%
-}{\xpg@warning{Unknown Hebrew calendar `#1'}}
-
\newif\if@hebrew@numerals
-\define@choicekey*+{hebrew}{numerals}[\xpg@val\xpg@nr]{hebrew,arabic}[arabic]{%
- \ifcase\xpg@nr\relax
- % hebrew:
- \@hebrew@numeralstrue
- \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-hebr}%
- \or
- % arabic:
- \@hebrew@numeralsfalse
- \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Hebrew, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Hebrew numerals value `#1'}}
-\setkeys{hebrew}{numerals}
+\DeclareKeys[polyglossia/gloss/hebrew]
+ {
+ marcheshvan.code = \setkeys{hebrewcal}{marcheshvan=#1},
+ marcheshvan.default:n = true,
+ transliteration.code = \setkeys{hebrewcal}{transliteration=#1},
+ transliteration.default:n = alt,
+ fullyear.code = \setkeys{hebrewcal}{fullyear=#1},
+ fullyear.default:n = true,
+ calendar.choice:,
+ calendar / hebrew.code =
+ {%
+ \@calendar@hebrewtrue
+ },
+ calendar / gregorian.code =
+ {%
+ \@calendar@hebrewfalse
+ },
+ calendar.default:n = gregorian,
+ calendar/unknown.code = \xpg@warning{Unknown Hebrew calendar `#1'},
+ numerals.choice:,
+ numerals / hebrew.code =
+ {%
+ \@hebrew@numeralstrue
+ \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-hebr}%
+ },
+ numerals / arabic.code =
+ {%
+ \@hebrew@numeralsfalse
+ \SetLanguageKeys{hebrew}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Hebrew numerals value `#1'}
+ }
+
+
+\SetGlossOptions{hebrew}{numerals}
% Register default options
-\xpg@initialize@gloss@options{hebrew}{numerals=arabic,calendar=gregorian,marcheshvan=false,fullyear=false}
+\InitializeGlossOptions{hebrew}{numerals=arabic,calendar=gregorian,marcheshvan=false,fullyear=false}
\def\captionshebrew{%
\def\prefacename{מבוא}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hi.ldf
index 24ac6a0ea58..1e9f1240502 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hi.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hi.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hi.ldf}[polyglossia: module for hi (Hindi)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{hindi}
+\InheritGlossFile{hindi}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf
index 7803b17ef44..a3a6360fe04 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% UTF-8 strings kindly provided by Zdenĕk Wagner, 10-03-2008
% with corrections and additional contributions by Anshuman Pandey
@@ -25,8 +25,7 @@
\ifx\l@hindi\@undefined%
\ifx\l@sanskrit\@undefined%
- \xpg@nopatterns{Hindi}%
- \adddialect\l@hindi\l@nohyphenation%
+ \XPGNoPatternsFallback{hindi}%
\else
\xpg@warning{No hyphenation patterns were loaded for Hindi\MessageBreak
I will use the patterns for Sanskrit instead}
@@ -35,26 +34,31 @@
\fi
\def\hindi@language{%
- \polyglossia@setup@language@patterns{hindi}%
+ \SetupPolyglossiaLangPatterns{hindi}%
}
\newif\ifhindi@devanagari@numerals
\hindi@devanagari@numeralstrue
-\define@choicekey*+{hindi}{numerals}[\xpg@val\xpg@nr]{Devanagari,Western}[Devanagari]{%
- \ifcase\xpg@nr\relax
- % Devanagari:
- \hindi@devanagari@numeralstrue%
- \SetLanguageKeys{hindi}{bcp47-extension-u=nu-deva}%
- \or
- % Western:
- \hindi@devanagari@numeralsfalse%
- \SetLanguageKeys{hindi}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Hindi, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Hindi numeral `#1'}}
+
+\DeclareKeys[polyglossia/gloss/hindi]
+ {
+ numerals.choice:,
+ numerals / devanagari.code =
+ {%
+ \hindi@devanagari@numeralstrue
+ \SetLanguageKeys{hindi}{bcp47-extension-u=nu-deva}%
+ },
+ numerals / western.code =
+ {%
+ \hindi@devanagari@numeralsfalse
+ \SetLanguageKeys{hindi}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Hindi numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{hindi}{numerals=devanagari}
+\InitializeGlossOptions{hindi}{numerals=devanagari}
\newcommand{\hindinumerals}[2]{\hindinumber{#2}}
@@ -74,6 +78,7 @@
\def\contentsname{विषय सूची}%
\def\enclname{}%
\def\figurename{चित्र}% रेखाचित्र
+ \def\glossaryname{शब्दार्थ सूची}%
\def\headpagename{पृष्ठ}%
\def\headtoname{}%
\def\indexname{सूची}%
@@ -85,6 +90,7 @@
\def\pagename{पृष्ठ}%
\def\partname{खण्ड}%
\def\prefacename{प्रस्तावना}% प्राक्कथन
+ \def\proofname{प्रमाण}%
\def\refname{हवाले}%
\def\tablename{तालिका}%
\def\seename{देखिए}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hr.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hr.ldf
index 9354b06cadc..1bcc48ff4c6 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hr.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hr.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hr.ldf}[polyglossia: module for hr (Croatian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{croatian}
+\InheritGlossFile{croatian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hsb.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hsb.ldf
index f2c872c2c41..51d2499b0ac 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hsb.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hsb.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hsb.ldf}[polyglossia: module for hsb (Higher Sorbian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hu.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hu.ldf
index 9700f33025b..8f86fc248e4 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hu.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hu.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hu.ldf}[polyglossia: module for hu (Hungarian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{hungarian}
+\InheritGlossFile{hungarian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf
index a846c750bb8..0ed88f1aca6 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hungarian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hungarian.ldf}[polyglossia: module for Hungarian]
@@ -25,53 +25,61 @@
\newif\if@hungarian@swapcaptions
\newif\if@hungarian@swapheadings
\newif\if@hungarian@swapheaders
-\define@choicekey*+{hungarian}{swapstrings}[\xpg@val\xpg@nr]{all,captions,headings,headers,hheaders,none}[all]{%
- \ifcase\xpg@nr\relax
- % all:
- \@hungarian@swapcaptionstrue%
- \@hungarian@swapheadingstrue%
- \@hungarian@swapheaderstrue%
- \or
- % captions:
- \@hungarian@swapcaptionstrue%
- \@hungarian@swapheadingsfalse%
- \@hungarian@swapheadersfalse%
- \or
- % headings:
- \@hungarian@swapcaptionsfalse%
- \@hungarian@swapheadingstrue%
- \@hungarian@swapheadersfalse%
- \or
- % headers:
- \@hungarian@swapcaptionsfalse%
- \@hungarian@swapheadingsfalse%
- \@hungarian@swapheaderstrue%
- \or
- % hheaders:
- \@hungarian@swapcaptionsfalse%
- \@hungarian@swapheadingstrue%
- \@hungarian@swapheaderstrue%
- \or
- % none:
- \@hungarian@swapcaptionsfalse%
- \@hungarian@swapheadingsfalse%
- \@hungarian@swapheadersfalse%
- \fi
- \xpg@info{Option: Hungarian, swapstrings=\xpg@val}%
-}{\xpg@warning{Unknown Hungarian swapstrings value `#1'}}
-% Force punctuation: 1) after section type counters; 2) after @chapapp in the running head
-\define@boolkey{hungarian}[hungarian@]{forceheadingpunctuation}[true]{}
+\DeclareKeys[polyglossia/gloss/hungarian]
+ {
+ forceheadingpunctuation.if = hungarian@forceheadingpunctuation,
+ forceheadingpunctuation.default:n = true,
+ swapstrings.choice:,
+ swapstrings / all.code =
+ {%
+ \@hungarian@swapcaptionstrue
+ \@hungarian@swapheadingstrue
+ \@hungarian@swapheaderstrue
+ },
+ swapstrings / captions.code =
+ {%
+ \@hungarian@swapcaptionstrue
+ \@hungarian@swapheadingsfalse
+ \@hungarian@swapheadersfalse
+ },
+ swapstrings / headings.code =
+ {%
+ \@hungarian@swapcaptionsfalse
+ \@hungarian@swapheadingstrue
+ \@hungarian@swapheadersfalse
+ },
+ swapstrings / headers.code =
+ {%
+ \@hungarian@swapcaptionsfalse
+ \@hungarian@swapheadingsfalse
+ \@hungarian@swapheaderstrue
+ },
+ swapstrings / hheaders.code =
+ {%
+ \@hungarian@swapcaptionsfalse
+ \@hungarian@swapheadingstrue
+ \@hungarian@swapheaderstrue
+ },
+ swapstrings / none.code =
+ {%
+ \@hungarian@swapcaptionsfalse
+ \@hungarian@swapheadingsfalse
+ \@hungarian@swapheadersfalse
+ },
+ swapstrings.default:n = all,
+ swapstrings/unknown.code = \xpg@warning{Unknown Hungarian swapstrings value `#1'}
+ }
% Register default options
% forceheadinpunctuatin is recommended, but the default value is false for compatibility reasons
-\xpg@initialize@gloss@options{hungarian}{swapstrings=all,
+\InitializeGlossOptions{hungarian}{swapstrings=all,
forceheadingpunctuation=false}
\def\hungarian@language{%
- \polyglossia@setup@language@patterns{hungarian}%
- \xpg@ifdefined{hungarian}{\adddialect\l@magyar\l@hungarian}{}%
+ \SetupPolyglossiaLangPatterns{hungarian}%
+ \IfLanguageDefinedT{hungarian}{\adddialect\l@magyar\l@hungarian}%
}%
\def\captionshungarian{%
@@ -143,120 +151,104 @@
% change chapter and part headings
\if@hungarian@swapheadings
% With titlesec
- \ifcsdef{titleformat}{%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }{}%
- }
- \ifcsdef{chapter}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
- {\thechapter.\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }{}%
- }{% (not \ifdefined\titleformat)
+ \@ifundefined{titleformat}{%
% With KOMA
- \ifcsdef{sectionformat}{%
- \ifcsdef{partformat}{%
- \let\xpg@save@part@format\partformat%
- \renewcommand{\partformat}{\thepart.~\partname}%
- }{}%
- \ifcsdef{chapterformat}{%
- \let\xpg@save@chap@format\chapterformat%
- \renewcommand{\chapterformat}{\mbox{\thechapter\autodot%
- \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
- }{}%
- }{% (not \ifdefined\sectionformat)
- % With memoir
- \ifcsdef{@memptsize}{%
- \ifcsdef{@makechapterhead}{%
- \let\xpg@save@chap@format\@makechapterhead%
- \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
- {\printchapternum.\chapternamenum\printchaptername}%
- {}%
- {\xpg@warning{Failed to patch chapter for Hungarian}}%
- }{}%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part%
- \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
- {\printpartnum.\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
- {\printpartnum.\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Hungarian}}%
- }{}%
- }%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{sectionformat}{%
+ % Memoir?
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{@makechapterhead}{%
+ \@ifundefined{@makechapterhead}{}{%
\let\xpg@save@chap@format\@makechapterhead%
\patchcmd{\@makechapterhead}%
{\@chapapp\space \thechapter}%
{\thechapter.\space \@chapapp}%
{}%
{\xpg@warning{Failed to patch chapter for Hungarian}}%
- }{}%
- \ifcsdef{NR@part}{% Hyperref (nameref)
+ }%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\thepart.\nobreakspace\partname}%
+ {}%
+ {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Hungarian}}}%
+ }% (end \ifdefined\@part)
+ }{% Hyperref (nameref)
\let\xpg@save@part@format\NR@part%
\patchcmd{\NR@part}%
{\partname\nobreakspace\thepart}%
{\thepart.\nobreakspace\partname}%
{}%
{\xpg@warning{Failed to patch part for Hungarian}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\thepart.\nobreakspace\partname}%
- {}%
- {\ifcsdef{part}{\xpg@warning{Failed to patch part for Hungarian}}{}}%
- }{}% (end \ifdefined\@part)
}% (end not hyperref)
- }% (end \ifdefined\@memptsize)
- }% (end \ifdefined\sectionformat)
+ }{% with memoir (\ifdefined\@memptsize)
+ \@ifundefined{@makechapterhead}{}{%
+ \let\xpg@save@chap@format\@makechapterhead%
+ \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
+ {\printchapternum.\chapternamenum\printchaptername}%
+ {}%
+ {\xpg@warning{Failed to patch chapter for Hungarian}}%
+ }%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
+ {\printpartnum.\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Hungarian}}%
+ }%
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part%
+ \patchcmd{\NR@part}{\printpartname \partnamenum \printpartnum}%
+ {\printpartnum.\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Hungarian}}%
+ }%
+ }% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\sectionformat)
+ \@ifundefined{partformat}{}{%
+ \let\xpg@save@part@format\partformat%
+ \renewcommand{\partformat}{\thepart.~\partname}%
+ }%
+ \@ifundefined{chapterformat}{}{%
+ \let\xpg@save@chap@format\chapterformat%
+ \renewcommand{\chapterformat}{\mbox{\thechapter\autodot%
+ \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\thepart.\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Hungarian}}%
+ }%
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part%
+ \patchcmd{\NR@part}%
+ {\partname\nobreakspace\thepart}%
+ {\thepart.\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Hungarian}}%
+ }%
+ \@ifundefined{chapter}{}{%
+ \titleformat\chapter[display]%
+ {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
+ {\thechapter.\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
+ }%
}% (end \ifdefined\titleformat)
\fi% (end \if@hungarian@swapheadings)
%
% Change running headers
\if@hungarian@swapheaders
- \ifcsdef{chapterformat}{%
- % With KOMA
- \let\xpg@save@chaptermark@format\chaptermarkformat%
- \renewcommand*\chaptermarkformat{%
- \thechapter\autodot\ \IfChapterUsesPrefixLine{\chapapp\@hungarian@forced@dot\enskip}{}}
- }{% (not \ifdefined\chapterformat)
- \ifcsdef{@memptsize}{%
- % With memoir
- \let\xpg@save@chaptermark@format\chaptermark%
- \renewcommand*\chaptermark[1]{%
- \markboth{\memUChead{%
- \ifnum \c@secnumdepth >\m@ne
- \ifbool{@mainmatter}{%
- \thechapter.\ \@chapapp\@hungarian@forced@dot\ %
- }{}%
- \fi
- ##1}}{}}%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{chapterformat}{%
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermark}{}{%
\ifpatchable{\chaptermark}%
{\@chapapp\ \thechapter.}%
{\let\xpg@save@chaptermark@format\chaptermark%
@@ -266,8 +258,24 @@
{}%
{\xpg@warning{Failed to patch chaptermark for Hungarian}}}%
{}%
- }{}% (end \ifdefined\chaptermark)
+ }% (end \ifdefined\chaptermark)
+ }{% (\ifdefined\@memptsize)
+ % With memoir
+ \let\xpg@save@chaptermark@format\chaptermark%
+ \renewcommand*\chaptermark[1]{%
+ \markboth{\memUChead{%
+ \ifnum \c@secnumdepth >\m@ne
+ \ifbool{@mainmatter}{%
+ \thechapter.\ \@chapapp\@hungarian@forced@dot\ %
+ }{}%
+ \fi
+ ##1}}{}}%
}% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\chapterformat)
+ % With KOMA
+ \let\xpg@save@chaptermark@format\chaptermarkformat%
+ \renewcommand*\chaptermarkformat{%
+ \thechapter\autodot\ \IfChapterUsesPrefixLine{\chapapp\@hungarian@forced@dot\enskip}{}}
}% (end \ifdefined\chapterformat)
\fi% (end \if@hungarian@swapheaders)
}
@@ -279,58 +287,58 @@
\let\fnum@figure\xpg@save@fnum@figure%
%
% Reset chapter and part heading
- \ifcsdef{titleformat}{%
+ \@ifundefined{titleformat}{%
+ \@ifundefined{sectionformat}{%
+ % With memoir and standard classes
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
+ \let\@part\xpg@save@part@format%
+ }{%
+ \let\NR@part\xpg@save@part@format%
+ }%
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\@makechapterhead\xpg@save@chap@format
+ }%
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@part@format}{}{%
+ \let\partformat\xpg@save@part@format
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\chapterformat\xpg@save@chap@format
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
% With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format%
- }{%
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
\let\@part\xpg@save@part@format%
+ }{%
+ \let\NR@part\xpg@save@part@format%
}%
- }{}%
- \ifcsdef{chapter}{%
+ }%
+ \@ifundefined{chapter}{}{%
\titleformat\chapter[display]%
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
{\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }{}%
- }{% (not \ifdefined\titleformat)
- \ifcsdef{sectionformat}{%
- % With KOMA
- \ifcsdef{xpg@save@part@format}{%
- \let\partformat\xpg@save@part@format
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\chapterformat\xpg@save@chap@format
- }{}%
- }{%
- % With memoir and standard classes
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format%
- }{%
- \let\@part\xpg@save@part@format%
- }%
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\@makechapterhead\xpg@save@chap@format
- }{}%
- }% (end \ifdefined\sectionformat)
+ }%
}% (end \ifdefined\titleformat)
%
% Reset headers
- \ifcsdef{chaptermarkformat}{%
- % With KOMA
- \ifcsdef{xpg@save@chaptermark@format}{%
- \let\chaptermarkformat\xpg@save@chaptermark@format%
- }{}%
- }{%
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermarkformat}{%
+ \@ifundefined{chaptermark}{}{%
% With memoir and standard classes
- \ifcsdef{xpg@save@chaptermark@format}{%
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
\let\chaptermark\xpg@save@chaptermark@format%
- }{}%
- }{}% (end \ifdefined\chaptermark)
- }% (end \ifdefined\chapterformat)
+ }%
+ }% (end \ifdefined\chaptermark)
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
+ \let\chaptermarkformat\xpg@save@chaptermark@format%
+ }%
+ }% (end \ifdefined\chaptermarkformat)
}
% Hungarian needs 1) trailing dots in chapter headings; 2) trailing dot in section, subsection, etc, counters
\def\@hungarian@forced@dot{}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hy.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hy.ldf
index ee335e8b4dd..16b61a8776b 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hy.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hy.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-hy.ldf}[polyglossia: module for hy (Armenian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{armenian}
+\InheritGlossFile{armenian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ia.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ia.ldf
index 1652403941d..1e843ef5df8 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ia.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ia.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ia.ldf}[polyglossia: module for ia (Interlingua)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{interlingua}
+\InheritGlossFile{interlingua}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-icelandic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-icelandic.ldf
index 4415bbab088..43a9efe3f8a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-icelandic.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-icelandic.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-icelandic.ldf}[polyglossia: module for Icelandic]
\PolyglossiaSetup{icelandic}{
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-id.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-id.ldf
index e72a43d5f51..adf9c602827 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-id.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-id.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-id.ldf}[polyglossia: module for id (Malay)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{malay}
+\InheritGlossFile{malay}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-interlingua.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-interlingua.ldf
index d105dae74c7..ec3b1844e9a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-interlingua.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-interlingua.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-interlingua.ldf}[polyglossia: module for Interlingua]
\PolyglossiaSetup{interlingua}{
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf
index ed1fc5af650..0e5b9c888b3 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-irish.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-irish.ldf}[polyglossia: module for Irish]
% We only provide this gloss for babel compatibility. Since irish is
% a gaelic variety, we use 'gaelic' with variant 'irish' now.
-\xpg@load@master@language{gaelic}
+\InheritGlossFile{gaelic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-is.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-is.ldf
index aed4195b8d1..6724333f2bc 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-is.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-is.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-is.ldf}[polyglossia: module for is (Icelandic)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{icelandic}
+\InheritGlossFile{icelandic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-it.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-it.ldf
index e3bf7d00df8..42ae275e327 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-it.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-it.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-it.ldf}[polyglossia: module for it (Italian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{italian}
+\InheritGlossFile{italian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf
index edf9d4f79e9..da005e54c76 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-italian.ldf
@@ -1,5 +1,5 @@
% !TEX encoding = UTF-8 Unicode
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-italian.ldf}[polyglossia: module for Italian]
\PolyglossiaSetup{italian}{
@@ -18,24 +18,22 @@
% BCP-47 compliant aliases
\setlanguagealias*{italian}{it}
-
-%%% CHANGES START %%% by Enrico Gregorio
-\define@boolkey{italian}[italian@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/italian]
+ {
+ babelshorthands.if = italian@babelshorthands,
+ babelshorthands.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{italian}{babelshorthands=false}
+\InitializeGlossOptions{italian}{babelshorthands=false}
\ifsystem@babelshorthands
- \setkeys{italian}{babelshorthands=true}
+ \SetGlossOptions{italian}{babelshorthands=true}
\else
- \setkeys{italian}{babelshorthands=false}
+ \SetGlossOptions{italian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\italian@shorthands{%
\xpg@activate@shorthands%
@@ -115,7 +113,7 @@
%%% CHANGES START %%% by Enrico Gregorio
\let\xpgit@savedvalues\empty
-\AtEndPreamble{% the user or the class might define different values
+\AddToHook{begindocument/before}{% the user or the class might define different values
\edef\xpgit@savedvalues{%
\clubpenalty=\the\clubpenalty\space
\@clubpenalty=\the\@clubpenalty\space
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ja.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ja.ldf
index 7329e61bdc9..6abed7ecc51 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ja.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ja.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ja.ldf}[polyglossia: module for ja (Japanese)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{japanese}
+\InheritGlossFile{japanese}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-japanese.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-japanese.ldf
index 5d90a303747..43015d36cec 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-japanese.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-japanese.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-japanese.ldf}[polyglossia: module for Japanese]
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ka.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ka.ldf
index dc0fb85531e..c48b7287989 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ka.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ka.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ka.ldf}[polyglossia: module for ka (Georgian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{georgian}
+\InheritGlossFile{georgian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf
index 1ea7dfce332..97941ff1902 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-kannada.ldf
@@ -1,5 +1,5 @@
%% gloss-kannada.ldf
-%% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+%% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%%
%% Copyright 2011 Aravinda VK <hallimanearavind AT gmail.com>,
%% Shankar Prasad <prasad.mvs AT gmail.com>,
@@ -53,12 +53,20 @@
\def\tmp@western{Western}
\newif\ifkannada@numerals
\kannada@numeralstrue
-
-\define@key{kannada}{numerals}[Kannada]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@western
- \kannada@numeralsfalse
- \fi}
+
+\DeclareKeys[polyglossia/gloss/kannada]
+ {
+ numerals.choice:,
+ numerals / kannada.code =
+ {%
+ \kannada@numeralstrue
+ },
+ numerals / western.code =
+ {%
+ \kannada@numeralsfalse
+ },
+ numerals.default:n = kannada
+ }
\def\captionskannada{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-khmer.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-khmer.ldf
index 9c9ec53f328..0a8656b4c50 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-khmer.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-khmer.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-khmer.ldf}[polyglossia: module for Khmer]
\PolyglossiaSetup{khmer}{
@@ -19,18 +19,24 @@
\newif\if@khmer@numerals
\def\tmp@khmer{khmer}
-\define@key{khmer}{numerals}[arabic]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@khmer%
- \@khmer@numeralstrue%
- \SetLanguageKeys{khmer}{bcp47-extension-u=nu-khmr}%
- \else%
- \@khmer@numeralsfalse%
- \SetLanguageKeys{khmer}{bcp47-extension-u=nu-latn}%
- \fi%
-}
-\setkeys{khmer}{numerals}
+\DeclareKeys[polyglossia/gloss/khmer]
+ {
+ numerals.choice:,
+ numerals / khmer.code =
+ {%
+ \@khmer@numeralstrue
+ \SetLanguageKeys{khmer}{bcp47-extension-u=nu-khmr}%
+ },
+ numerals / arabic.code =
+ {%
+ \@khmer@numeralsfalse
+ \SetLanguageKeys{khmer}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = arabic
+ }
+
+\SetGlossOptions{khmer}{numerals}
\def\captionskhmer{%
\def\prefacename{អារម្ភកថា}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-km.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-km.ldf
index b37d1706ab6..f2af014aef5 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-km.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-km.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-km.ldf}[polyglossia: module for km (Khmer)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{khmer}
+\InheritGlossFile{khmer}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-kmr-Arab.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-kmr-Arab.ldf
index 523a68916e4..63807f6320b 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-kmr-Arab.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-kmr-Arab.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kmr-Arab.ldf}[polyglossia: module for kmr-Arab (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-kmr-Latn.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-kmr-Latn.ldf
index dfc34ce7ee9..64bb99df246 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-kmr-Latn.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-kmr-Latn.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kmr-Latn.ldf}[polyglossia: module for kmr-Latn (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-kmr.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-kmr.ldf
index a908ee2d815..254d0d846ca 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-kmr.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-kmr.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kmr.ldf}[polyglossia: module for kmr (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-kn.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-kn.ldf
index 66c45035a90..3c311112a86 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-kn.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-kn.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kn.ldf}[polyglossia: module for kn (Kannada)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kannada}
+\InheritGlossFile{kannada}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ko.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ko.ldf
index bf767b7cda9..c4b68924c06 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ko.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ko.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ko.ldf}[polyglossia: module for ko (Korean)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{korean}
+\InheritGlossFile{korean}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf
index 48464c50d25..fd464294356 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-korean.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-korean.ldf}[polyglossia: module for Korean]
@@ -18,40 +18,48 @@
% BCP-47 compliant aliases
\setlanguagealias*{korean}{ko}
-% variant : plain (0), classic (1), or modern (2)
-\define@choicekey{korean}{variant}[\xpg@val\xpg@nr]{plain,classic,modern}[plain]{%
- \let\xpg@korean@variant\xpg@nr
-}
-% captions : hangul (0) or hanja (1)
-\define@choicekey{korean}{captions}[\xpg@val\xpg@nr]{hangul,hanja}[hangul]{%
- \let\xpg@korean@captions\xpg@nr
-}
-% swapstrings: all (0), headings (1), headers (2), or none (3)
\newif\if@korean@swapheadings
\newif\if@korean@swapheaders
-\define@choicekey*+{korean}{swapstrings}[\xpg@val\xpg@nr]{all,headings,headers,none}[all]{%
- \ifcase\xpg@nr\relax
- % all:
- \@korean@swapheadingstrue%
- \@korean@swapheaderstrue%
- \or
- % headings:
- \@korean@swapheadingstrue%
- \@korean@swapheadersfalse%
- \or
- % headers:
- \@korean@swapheadingsfalse%
- \@korean@swapheaderstrue%
- \or
- % none:
- \@korean@swapheadingsfalse%
- \@korean@swapheadersfalse%
- \fi
- \xpg@info{Option: Korean, swapstrings=\xpg@val}%
-}{\xpg@warning{Unknown Korean swapstrings value `#1'}}
+
+\DeclareKeys[polyglossia/gloss/korean]
+ {
+ variant.choices:nn = { plain, classic, modern }
+ {%
+ \edef\xpg@korean@variant{\the\numexpr\UseName{l_keys_choice_int}-1\relax}
+ },
+ variant.default:n = plain,
+ captions.choices:nn = { hangul, hanja }
+ {%
+ \edef\xpg@korean@captions{\the\numexpr\UseName{l_keys_choice_int}-1\relax}
+ },
+ captions.default:n = hangul,
+ swapstrings.choice:,
+ swapstrings / all.code =
+ {%
+ \@korean@swapheadingstrue
+ \@korean@swapheaderstrue
+ },
+ swapstrings / headings.code =
+ {%
+ \@korean@swapheadingstrue
+ \@korean@swapheadersfalse
+ },
+ swapstrings / headers.code =
+ {%
+ \@korean@swapheadingsfalse
+ \@korean@swapheaderstrue
+ },
+ swapstrings / none.code =
+ {%
+ \@korean@swapheadingsfalse
+ \@korean@swapheadersfalse
+ },
+ swapstrings.default:n = all,
+ swapstrings/unknown.code = \xpg@warning{Unknown Korean swapstrings value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{korean}{variant=plain,swapstrings=all,captions=hangul}
+\InitializeGlossOptions{korean}{variant=plain,swapstrings=all,captions=hangul}
\def\captionskorean{%
\ifcase\xpg@korean@captions\relax
@@ -113,60 +121,48 @@
% change chapter and part headings
\if@korean@swapheadings
% With titlesec
- \ifcsdef{titleformat}{%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part
- \patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
- {}%
- {\xpg@warning{Failed to patch part for Korean}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part
- \patchcmd{\@part}%
+ \@ifundefined{titleformat}{%
+ % With KOMA
+ \@ifundefined{sectionformat}{%
+ % With memoir
+ \@ifundefined{@memptsize}{%
+ % With standard classes
+ \@ifundefined{@makechapterhead}{}{%
+ \let\xpg@save@chap@format\@makechapterhead
+ \patchcmd{\@makechapterhead}%
+ {\@chapapp\space \thechapter}%
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \appendixname\space \thechapter
+ \else
+ \koreanTHEname\space \thechapter\space \@chapapp
+ \fi
+ }%
+ {}%
+ {\xpg@warning{Failed to patch chapter for Korean}}%
+ }%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \ifpatchable{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\let\xpg@save@part@format\@part
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {}%
+ {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Korean}}}}%
+ {}%
+ }% (end \ifdefined\@part)
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part
+ \patchcmd{\NR@part}%
{\partname\nobreakspace\thepart}%
{\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
{}%
{\xpg@warning{Failed to patch part for Korean}}%
- }{}%
- }
- \ifcsdef{chapter}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\space \thechapter
- \else
- \koreanTHEname\space \thechapter\space \@chapapp
- \fi
- }{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
- }{}%
- }{% (not \ifdefined\titleformat)
- % With KOMA
- \ifcsdef{sectionformat}{%
- \ifcsdef{partformat}{%
- \let\xpg@save@part@format\partformat
- \renewcommand*{\partformat}{\koreanTHEname~\thepart~\partname}%
- }{}%
- \ifcsdef{chapterformat}{%
- \let\xpg@save@chap@format\chapterformat
- \renewcommand*{\chapterformat}{\mbox{%
- \IfChapterUsesPrefixLine
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \chapapp\nobreakspace \thechapter\autodot
- \else
- \koreanTHEname\nobreakspace \thechapter\nobreakspace \chapapp\autodot
- \fi
- }%
- {\thechapter\autodot\enskip}%
- }}%
- }{}%
- }{% (not \ifdefined\sectionformat)
- % With memoir
- \ifcsdef{@memptsize}{%
- \ifcsdef{@makechapterhead}{%
+ }% (end not hyperref)
+ }{% (\ifdefined\@memptsize)
+ \@ifundefined{@makechapterhead}{}{%
\let\xpg@save@chap@format\@makechapterhead
\patchcmd{\@makechapterhead}%
{\printchaptername \chapternamenum \printchapternum}%
@@ -184,19 +180,9 @@
\ifpatchable\printchaptername\@chapapp
{\chapnamefont\koreanTHEname\chapternamenum}{}}%
\fi
- }{}%
- \ifcsdef{NR@part}{% Hyperref (nameref)
- \let\xpg@save@part@format\NR@part
- \patchcmd{\NR@part}%
- {\printpartname \partnamenum \printpartnum}%
- {\printkoreanpartthe \printpartnum\partnamenum \printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Korean}}%
- \ifdefined\printkoreanpartthe\else
- \def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}%
- \fi
- }{% not hyperref
- \ifcsdef{@part}{%
+ }%
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
\let\xpg@save@part@format\@part
\patchcmd{\@part}%
{\printpartname \partnamenum \printpartnum}%
@@ -206,84 +192,77 @@
\ifdefined\printkoreanpartthe\else
\def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}%
\fi
- }{}%
- }%
- }{% (not \ifdefined\@memptsize)
- % With standard classes
- \ifcsdef{@makechapterhead}{%
- \let\xpg@save@chap@format\@makechapterhead
- \patchcmd{\@makechapterhead}%
- {\@chapapp\space \thechapter}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\space \thechapter
- \else
- \koreanTHEname\space \thechapter\space \@chapapp
- \fi
- }%
- {}%
- {\xpg@warning{Failed to patch chapter for Korean}}%
- }{}%
- \ifcsdef{NR@part}{% Hyperref (nameref)
+ }%
+ }{% Hyperref (nameref)
\let\xpg@save@part@format\NR@part
\patchcmd{\NR@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {\printpartname \partnamenum \printpartnum}%
+ {\printkoreanpartthe \printpartnum\partnamenum \printpartname}%
{}%
{\xpg@warning{Failed to patch part for Korean}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \ifpatchable{\@part}%
- {\partname\nobreakspace\thepart}%
- {\let\xpg@save@part@format\@part
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
- {}%
- {\ifcsdef{part}{\xpg@warning{Failed to patch part for Korean}}{}}}%
- {}%
- }{}% (end \ifdefined\@part)
- }% (end not hyperref)
+ \ifdefined\printkoreanpartthe\else
+ \def\printkoreanpartthe{\partnamefont\koreanTHEname\partnamenum}%
+ \fi
+ }%
}% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\sectionformat)
+ \@ifundefined{partformat}{}{%
+ \let\xpg@save@part@format\partformat
+ \renewcommand*{\partformat}{\koreanTHEname~\thepart~\partname}%
+ }%
+ \@ifundefined{chapterformat}{}{%
+ \let\xpg@save@chap@format\chapterformat
+ \renewcommand*{\chapterformat}{\mbox{%
+ \IfChapterUsesPrefixLine
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \chapapp\nobreakspace \thechapter\autodot
+ \else
+ \koreanTHEname\nobreakspace \thechapter\nobreakspace \chapapp\autodot
+ \fi
+ }%
+ {\thechapter\autodot\enskip}%
+ }}%
+ }%
}% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ \@ifundefined{NR@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Korean}}%
+ }%
+ }{% Hyperref (nameref)
+ \let\xpg@save@part@format\NR@part
+ \patchcmd{\NR@part}%
+ {\partname\nobreakspace\thepart}%
+ {\koreanTHEname\nobreakspace \thepart\nobreakspace \partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Korean}}%
+ }%
+ \@ifundefined{chapter}{}{%
+ \titleformat\chapter[display]%
+ {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \appendixname\space \thechapter
+ \else
+ \koreanTHEname\space \thechapter\space \@chapapp
+ \fi
+ }{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
+ }%
}% (end \ifdefined\titleformat)
\fi % (end \if@korean@swapheadings)
%
% Change running headers
\if@korean@swapheaders
- \ifcsdef{chapterformat}{%
- % With KOMA
- \let\xpg@save@chaptermark@format\chaptermarkformat
- \renewcommand*\chaptermarkformat{%
- \IfChapterUsesPrefixLine
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \chapapp\ \thechapter\autodot
- \else
- \koreanTHEname\ \thechapter\ \chapapp\autodot
- \fi
- }%
- {\thechapter\autodot}%
- \enskip
- }%
- }{% (not \ifdefined\chapterformat)
- \ifcsdef{@memptsize}{%
- % With memoir
- \let\xpg@save@chaptermark@format\chaptermark
- \patchcmd{\chaptermark}%
- {\@chapapp\ \@nameuse{thechapter}}%
- {%
- \ifx\@chapapp\korean@appendix@chapapp
- \appendixname\ \@nameuse{thechapter}%
- \else
- \koreanTHEname\ \@nameuse{thechapter}\ \@chapapp
- \fi
- }%
- {}%
- {\xpg@warning{Failed to patch chaptermark for Korean}}%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{chapterformat}{%
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermark}{}{%
\ifpatchable{\chaptermark}%
{\@chapapp\ \thechapter}%
{\let\xpg@save@chaptermark@format\chaptermark
@@ -299,65 +278,94 @@
{}%
{\xpg@warning{Failed to patch chaptermark for Korean}}}%
{}%
- }{}% (end \ifdefined\chaptermark)
+ }% (end \ifdefined\chaptermark)
+ }{% (\ifdefined\@memptsize)
+ % With memoir
+ \let\xpg@save@chaptermark@format\chaptermark
+ \patchcmd{\chaptermark}%
+ {\@chapapp\ \@nameuse{thechapter}}%
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \appendixname\ \@nameuse{thechapter}%
+ \else
+ \koreanTHEname\ \@nameuse{thechapter}\ \@chapapp
+ \fi
+ }%
+ {}%
+ {\xpg@warning{Failed to patch chaptermark for Korean}}%
}% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\chapterformat)
+ % With KOMA
+ \let\xpg@save@chaptermark@format\chaptermarkformat
+ \renewcommand*\chaptermarkformat{%
+ \IfChapterUsesPrefixLine
+ {%
+ \ifx\@chapapp\korean@appendix@chapapp
+ \chapapp\ \thechapter\autodot
+ \else
+ \koreanTHEname\ \thechapter\ \chapapp\autodot
+ \fi
+ }%
+ {\thechapter\autodot}%
+ \enskip
+ }%
}% (end \ifdefined\chapterformat)
\fi % (end \if@korean@swapheaders)
}
\def\nokorean@headingsformat{%
% Reset chapter and part heading
- \ifcsdef{titleformat}{%
+ \@ifundefined{titleformat}{%
+ \@ifundefined{sectionformat}{%
+ % With memoir and standard classes
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
+ \let\@part\xpg@save@part@format
+ }{%
+ \let\NR@part\xpg@save@part@format
+ }%
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\@makechapterhead\xpg@save@chap@format
+ }%
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@part@format}{}{%
+ \let\partformat\xpg@save@part@format
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\chapterformat\xpg@save@chap@format
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
% With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format
- }{%
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{NR@part}{%
\let\@part\xpg@save@part@format
+ }{%
+ \let\NR@part\xpg@save@part@format
}%
- }{}%
- \ifcsdef{chapter}{%
+ }%
+ \@ifundefined{chapter}{}{%
\titleformat\chapter[display]%
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}%
{\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}%
- }{}%
- }{% (not \ifdefined\titleformat)
- \ifcsdef{sectionformat}{%
- % With KOMA
- \ifcsdef{xpg@save@part@format}{%
- \let\partformat\xpg@save@part@format
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\chapterformat\xpg@save@chap@format
- }{}%
- }{%
- % With memoir and standard classes
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{NR@part}{%
- \let\NR@part\xpg@save@part@format
- }{%
- \let\@part\xpg@save@part@format
- }%
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\@makechapterhead\xpg@save@chap@format
- }{}%
- }% (end \ifdefined\sectionformat)
+ }%
}% (end \ifdefined\titleformat)
%
% Reset headers
- \ifcsdef{chaptermarkformat}{%
- % With KOMA
- \ifcsdef{xpg@save@chaptermark@format}{%
- \let\chaptermarkformat\xpg@save@chaptermark@format
- }{}%
- }{%
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermarkformat}{%
+ \@ifundefined{chaptermark}{}{%
% With memoir and standard classes
- \ifcsdef{xpg@save@chaptermark@format}{%
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
\let\chaptermark\xpg@save@chaptermark@format
- }{}%
- }{}% (end \ifdefined\chaptermark)
+ }%
+ }% (end \ifdefined\chaptermark)
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
+ \let\chaptermarkformat\xpg@save@chaptermark@format
+ }%
}% (end \ifdefined\chapterformat)
}
@@ -421,13 +429,13 @@
\XeTeXinterchartokenstate\z@
\XeTeXlinebreakpenalty\z@
\XeTeXlinebreakskip\z@skip
- \XeTeXlinebreaklocale "en"
+ \XeTeXlinebreaklocale ""
\noextras@korean@common
}
\else % luatex
- \def\inlineextras@korean{\xpg@attr@korean\xpg@korean@variant\relax}
+ \def\inlineextras@korean{\xpg@attr@cjkspacing\xpg@korean@variant\relax}
\def\noextras@korean{%
- \unsetattribute\xpg@attr@korean
+ \unsetattribute\xpg@attr@cjkspacing
\noextras@korean@common
}
\fi
@@ -447,7 +455,7 @@
\let\newattribute\newluatexattribute
\let\unsetattribute\unsetluatexattribute
\fi
-\newattribute\xpg@attr@korean
+\newattribute\xpg@attr@cjkspacing
\newattribute\xpg@attr@autojosa
% user commands for Josa
% Josa : particles in Korean grammar that immediately follow a noun or pronoun.
@@ -468,7 +476,7 @@
\protected\def\로{\으 로}
\def\xpg@reset@josa {\global\let\xpg@josa@zwang\z@}\xpg@reset@josa
% load lua file for korean
-\directlua{ require "polyglossia-korean" }
+\directlua{ require "polyglossia-cjk-spacing" }
\endinput\fi
% XeTeX
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ku-Arab.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ku-Arab.ldf
index 339368062c8..f25b8d53397 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ku-Arab.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ku-Arab.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ku-Arab.ldf}[polyglossia: module for ku-Arab (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ku-Latn.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ku-Latn.ldf
index 31f0b817406..ba7b6a32954 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ku-Latn.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ku-Latn.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ku-Latn.ldf}[polyglossia: module for ku-Latn (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ku.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ku.ldf
index 59805fb6261..b261cbc0df6 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ku.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ku.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ku.ldf}[polyglossia: module for ku (Kurdish)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf
index e114fd118aa..3b69d39e010 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-kurdish.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Created on September 1, 2019
% Last updated on May 17, 2020
@@ -41,36 +41,9 @@
\newif\if@kurdish@kurmanji
\def\kurdish@variant{sorani}
-\define@choicekey*+{kurdish}{variant}[\xpg@val\xpg@nr]{sorani,kurmanji}[sorani]{%
- \ifcase\xpg@nr\relax
- % sorani:
- \def\kurdish@variant{sorani}%
- \@kurdish@kurmanjifalse%
- \or
- % kurmanji:
- \def\kurdish@variant{kurmanji}%
- \@kurdish@kurmanjitrue%
- \fi
- \kurdish@set@variety%
- \xpg@info{Option: kurdish, variant=\xpg@val}%
-}{\xpg@warning{Unknown Kurdish variant `#1'}}
\newif\if@kurdish@latin
\newif\if@kurdish@arabic
-\define@choicekey*+{kurdish}{script}[\xpg@val\xpg@nr]{arabic,latin}{%
- \ifcase\xpg@nr\relax
- % arabic:
- \@kurdish@latinfalse%
- \@kurdish@arabictrue%
- \or
- % latin:
- \@kurdish@latintrue%
- \@kurdish@arabicfalse%
- \fi
- \kurdish@set@variety%
- \xpg@info{Option: kurdish, script=\xpg@val}%
-}{\xpg@warning{Unknown Kurdish script `#1'}}
-
\newif\if@western@numerals
\newif\if@force@western@numerals
@@ -87,7 +60,7 @@
\SetLanguageKeys{kurdish}{script=Latin,direction=LR,scripttag=latn,babelname=kurdish,bcp47=ckb-Arab,bcp47-language=ckb,bcp47-script=Arab,bcp47-casing=ckb-Arab}%
\fi
\def\kurdish@script{latin}
- \xpg@fontsetup@latin{kurdish}%
+ \SetupLatinPolyglossiaFont{kurdish}%
\else
\if@kurdish@arabic% arabic explicitly set
\if@kurdish@kurmanji
@@ -97,61 +70,84 @@
\else
\SetLanguageKeys{kurdish}{script=Arabic,direction=RL,scripttag=arab,babelname=kurdish,bcp47=ckb-Arab,bcp47-language=ckb,bcp47-script=Arab,bcp47-casing=ckb-Arab}%
\fi
- \xpg@fontsetup@nonlatin{kurdish}%
+ \SetupNonLatinPolyglossiaFont{kurdish}%
\else% sorani=arabic, kurmanji=latin
\if@kurdish@kurmanji
\@western@numeralstrue%
\SetLanguageKeys{kurdish}{script=Latin,direction=LR,scripttag=latn,babelname=kurmanji,bcp47=kmr-Latn,bcp47-language=kmr,bcp47-script=Latn,bcp47-casing=kmr-Latn}%
- \xpg@fontsetup@latin{kurdish}%
+ \SetupLatinPolyglossiaFont{kurdish}%
\def\kurdish@script{latin}
\else
\SetLanguageKeys{kurdish}{script=Arabic,direction=RL,scripttag=arab,babelname=kurdish,bcp47=ckb-Arab,bcp47-language=ckb,bcp47-script=Arab,bcp47-casing=ckb-Arab}%
- \xpg@fontsetup@nonlatin{kurdish}%
+ \SetupNonLatinPolyglossiaFont{kurdish}%
\fi
\fi
\fi
}
\newif\if@western@numerals
-\define@choicekey*+{kurdish}{numerals}[\xpg@val\xpg@nr]{eastern,western}[eastern]{%
- \ifcase\xpg@nr\relax
- % eastern:
- \@western@numeralsfalse%
- \or
- % western:
- \@western@numeralstrue%
- \@force@western@numeralstrue%
- \fi
- \xpg@info{Option: Kurdish, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Kurdish numerals option `#1'}}
\newif\ifkurdish@customsep\kurdish@customsepfalse
\def\xpg@sepmark{}
-\define@key{kurdish}{sectionsep}[.]{%
- \kurdish@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
-
-%this is needed for \abjad in arabicnumbers.sty
-\define@boolkey{kurdish}[kurdish@]{abjadjimnotail}[true]{%
- \ifkurdish@abjadjimnotail
- \abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi%
-}
-
-% NOT YET USED
-\define@key{kurdish}{locale}[default]{%
- \def\@kurdish@locale{#1}}
%TODO add option for CALENDAR
+\DeclareKeys[polyglossia/gloss/kurdish]
+ {
+ variant.choice:,
+ variant / sorani.code =
+ {%
+ \def\kurdish@variant{sorani}%
+ \@kurdish@kurmanjifalse
+ \kurdish@set@variety
+ },
+ variant / kurmanji.code =
+ {%
+ \def\kurdish@variant{kurmanji}%
+ \@kurdish@kurmanjitrue
+ \kurdish@set@variety
+ },
+ variant.default:n = sorani,
+ variant/unknown.code = \xpg@warning{Unknown Kurdish variant `#1'},
+ script.choice:,
+ script / arabic.code =
+ {%
+ \@kurdish@latinfalse
+ \@kurdish@arabictrue
+ \kurdish@set@variety
+ },
+ script / latin.code =
+ {%
+ \@kurdish@latintrue
+ \@kurdish@arabicfalse
+ \kurdish@set@variety
+ },
+ script.default:n = sorani,
+ script/unknown.code = \xpg@warning{Unknown Kurdish script `#1'},
+ numerals.choice:,
+ numerals / eastern.code =
+ {%
+ \@western@numeralsfalse
+ },
+ numerals / western.code =
+ {%
+ \@western@numeralstrue
+ \@force@western@numeralstrue
+ },
+ numerals.default:n = eastern,
+ numerals/unknown.code = \xpg@warning{Unknown Kurdish numerals value `#1'},
+ sectionsep.code = \gdef\xpg@sepmark{#1}\kurdish@customseptrue,
+ sectionsep.default:n = .,
+ abjadjimnotail.if = abjad@jim@notail,
+ abjadjimnotail.default:n = true,
+ locale.store = \@kurdish@locale
+ }
+
% Register default options
-\xpg@initialize@gloss@options{kurdish}{variant=sorani,locale=default,script=arabic,abjadjimnotail=false,numerals=eastern}
+\InitializeGlossOptions{kurdish}{variant=sorani,locale=default,script=arabic,abjadjimnotail=false,numerals=eastern}
\def\kurdish@language{%
- \polyglossia@setup@language@patterns{\kurdish@pattern}%
+ \SetupPolyglossiaLangPatterns{\kurdish@pattern}%
}%
\def\kurdishNativemonth#1{\ifcase#1%
@@ -404,16 +400,16 @@
}
\def\nokurdish@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi%
}
\def\kurdish@luatex@capsformat{%
%
% change chapter and part headings
\ifkurdish@customsep
- \ifcsdef{chapter}{%
+ \ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
@@ -425,7 +421,7 @@
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
+ \fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
@@ -440,30 +436,30 @@
}
\def\nokurdish@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
+ \ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
+ \fi%
+ \ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
+ \fi%
+ \ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
+ \fi%
+ \ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
+ \fi%
+ \ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
+ \ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
+ \fi%
+ \fi%
+ \ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
+ \fi%
+ \ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \fi%
}
\def\blockextras@kurdish{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-kurmanji.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-kurmanji.ldf
index db4eabba41d..79deb39afc7 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-kurmanji.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-kurmanji.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-kurmanji.ldf}[polyglossia: module for Kurmanji Kurdish]
% We provide this gloss for babel compatibility.
-\xpg@load@master@language{kurdish}
+\InheritGlossFile{kurdish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-classic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-classic.ldf
index abb9bc4bf2f..b4091d70014 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-classic.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-classic.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-la-xclassic.ldf}[polyglossia: module for la-xclassic (Latin)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latin}
+\InheritGlossFile{latin}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-ecclesia.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-ecclesia.ldf
index b00755c8ace..8eec40dbd49 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-ecclesia.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-ecclesia.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-la-xecclesiastic.ldf}[polyglossia: module for la-xecclesiastic (Latin)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latin}
+\InheritGlossFile{latin}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-medieval.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-medieval.ldf
index 0d75aaf005a..029ad4a9168 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-medieval.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-la-x-medieval.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-la-xmedieval.ldf}[polyglossia: module for la-xmedieval (Latin)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latin}
+\InheritGlossFile{latin}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-la.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-la.ldf
index c1e3e26ece0..99e36c42bf0 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-la.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-la.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-la.ldf}[polyglossia: module for la (Latin)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latin}
+\InheritGlossFile{latin}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf
index 4d979bb93c1..41a6817e115 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-lao.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lao.ldf}[polyglossia: module for Lao]
@@ -22,14 +22,23 @@
\newif\if@lao@numerals
\def\tmp@lao{lao}
-\define@key{lao}{numerals}[arabic]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@lao\@lao@numeralstrue\else
- \@lao@numeralsfalse\fi
-}
+
+\DeclareKeys[polyglossia/gloss/lao]
+ {
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \@lao@numeralsfalse
+ },
+ numerals / lao.code =
+ {%
+ \@lao@numeralstrue
+ },
+ numerals.default:n = arabic
+ }
% Register default options
-\xpg@initialize@gloss@options{lao}{numerals=arabic}
+\InitializeGlossOptions{lao}{numerals=arabic}
% Translations provided by Brian Wilson <bountonw at gmail.com>
\def\captionslao{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-latex.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-latex.ldf
index 18d83e92114..8479fbaa42a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-latex.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-latex.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-latex.ldf}[polyglossia: module for default language]
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf
index 2fc092c0638..d1211a83cb2 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-latin.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-latin.ldf}[polyglossia: module for Latin]
@@ -33,6 +33,9 @@
\bool_new:N \l_polyglossia_latin_use_v_bool
\bool_new:N \l_polyglossia_latin_use_ligatures_bool
\bool_new:N \l_polyglossia_latin_capitalize_month_bool
+\bool_new:N \l_polyglossia_latin_babelshorthands_bool
+\bool_new:N \l_polyglossia_latin_prosodic_shorthands_bool
+\bool_new:N \l_polyglossia_latin_ecclesiastic_footnotes_bool
\cs_new:Npn \polyglossia_latin_classical_character_codes:
{
@@ -68,11 +71,11 @@
\cs_new:Npn \polyglossia_latin_use_modern_patterns:
{
- \xpg@ifdefined {latin}
+ \IfLanguageDefinedTF {latin}
{
\def \latin@language
{
- \polyglossia@setup@language@patterns {latin}
+ \SetupPolyglossiaLangPatterns {latin}
\str_case:Vn \l_polyglossia_latin_variant_str
{
{classic} { \adddialect \l@classiclatin \l@latin }
@@ -96,11 +99,11 @@
\cs_new:Npn \polyglossia_latin_set_patterns:n #1
% #1 may be "classiclatin" or "liturgicallatin"
{
- \xpg@ifdefined {#1}
+ \IfLanguageDefinedTF {#1}
{
\def \latin@language
{
- \polyglossia@setup@language@patterns {#1}
+ \SetupPolyglossiaLangPatterns {#1}
\str_case:Vn \l_polyglossia_latin_variant_str
{
{classic} {
@@ -316,7 +319,8 @@
% Save original footnote definition
% Do this at the end of the preamble to catch other
% packages' footnote changes (#391)
-\AtEndPreamble{%
+\hook_gput_code:nnn { begindocument / before } {.}
+{
\cs_if_exist:NT \@makefntext
{
\cs_set_eq:NN \polyglossia_latin_original_footnote:n \@makefntext
@@ -340,40 +344,27 @@
\cs_new:Npn \polyglossia_latin_apply_footnote_option:
{
- \str_if_eq:VnTF \xpg@main@language {latin}
+ \IfMainLanguageTF {latin}
{
\cs_if_exist:NT \@makefntext
{
- \iflatin@ecclesiasticfootnotes
+ \bool_if:NTF \l_polyglossia_latin_ecclesiastic_footnotes_bool
+ {
\let \@makefntext \polyglossia_latin_variant_footnote:n
- \else
+ }
+ {
\let \@makefntext \polyglossia_latin_original_footnote:n
- \fi
+ }
}
}
{
- \iflatin@ecclesiasticfootnotes
- \msg_warning:nn {polyglossia} {latin / ineffective footnote option}
- \fi
- }
- }
-
-\define@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: }
+ \bool_if:NT \l_polyglossia_latin_ecclesiastic_footnotes_bool
+ {
+ \msg_warning:nn {polyglossia} {latin / ineffective footnote option}
+ }
}
}
-
%%%%% Language variants: classic, medieval, modern, and ecclesiastic
\str_new:N \l_polyglossia_latin_variant_str
@@ -436,58 +427,6 @@
\polyglossia_latin_use_modern_patterns:
}
-\define@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@boolkey{latin}[latin@]{usej}[true]
- {
- \iflatin@usej
- \bool_set_true:N \l_polyglossia_latin_use_j_bool
- \else
- \bool_set_false:N \l_polyglossia_latin_use_j_bool
- \fi
- }
-
-\define@boolkey{latin}[latin@]{capitalizemonth}[true]
- {
- \iflatin@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}
@@ -500,23 +439,6 @@
The~Latin~hyphenation~variant~"#1"~is~undefined~\msg_line_context:.
}
-\define@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
@@ -588,30 +510,89 @@
}
}
-
-%%%%% Latin shorthands
-
-\define@boolkey{latin}[latin@]{babelshorthands}[true]
- {
- }
-
-\define@boolkey{latin}[latin@]{prosodicshorthands}[true]
+\DeclareKeys[polyglossia/gloss/latin]
{
+ babelshorthands.bool_set:N = \l_polyglossia_latin_babelshorthands_bool,
+ babelshorthands.default:n = true,
+ prosodicshorthands.bool_set:N = \l_polyglossia_latin_prosodic_shorthands_bool,
+ prosodicshorthands.default:n = true,
+ usej.bool_set:N = \l_polyglossia_latin_use_j_bool,
+ capitalizemonth.bool_set:N = \l_polyglossia_latin_capitalize_month_bool,
+ hyphenation.code =
+ \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}
+ },
+ variant.code =
+ \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}
+ },
+ ecclesiasticfootnotes.choices:nn = { true, false }
+ {
+ \ifcase\UseName{l_keys_choice_int}\or
+ \bool_set_true:N \l_polyglossia_latin_ecclesiastic_footnotes_bool
+ \else
+ \bool_set_false:N \l_polyglossia_latin_ecclesiastic_footnotes_bool
+ \fi
+ \xpg_if_in_preamble:TF
+ {
+ % 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: }
+ }
+ {
+ % within the document
+ \polyglossia_latin_apply_footnote_option:
+ }
+ },
+ ecclesiasticfootnotes.default:n = true
}
% Register default options
-\xpg@initialize@gloss@options{latin}{variant=modern,hyphenation=modern,babelshorthands=false,
+\InitializeGlossOptions{latin}{variant=modern,hyphenation=modern,babelshorthands=false,
prosodicshorthands=false,ecclesiasticfootnotes=false,
usej=false,capitalizemonth=true}
\ifsystem@babelshorthands
- \setkeys{latin}{babelshorthands=true}
+ \SetGlossOptions{latin}{babelshorthands=true}
\else
- \setkeys{latin}{babelshorthands=false}
+ \SetGlossOptions{latin}{babelshorthands=false}
\fi
\ExplSyntaxOff % babelsh.def does not support expl3 syntax
-\ifcsundef{initiate@active@char}{\input{babelsh.def}}{}
+\@ifundefined{initiate@active@char}{\input{babelsh.def}}{}
\ExplSyntaxOn
\initiate@active@char {"}
@@ -643,13 +624,13 @@
\AtBeginDocument
{
- \str_if_eq:VnTF \xpg@main@language {latin}
+ \IfMainLanguageTF {latin}
{
- \iflatin@prosodicshorthands
- \else
+ \bool_if:NF \l_polyglossia_latin_prosodic_shorthands_bool
+ {
\shorthandoff {=}
\shorthandoff* {^}
- \fi
+ }
}
{
% The following command should not be called if the main language
@@ -1011,7 +992,7 @@
\let \xpgla@savedvalues \empty
-\AtEndPreamble
+\hook_gput_code:nnn { begindocument / before } {.}
{
\edef \xpgla@savedvalues
{
@@ -1024,12 +1005,14 @@
\def \noextras@latin
{
- \iflatin@babelshorthands
+ \bool_if:NT \l_polyglossia_latin_babelshorthands_bool
+ {
\polyglossia_latin_no_shorthands:
- \fi
- \iflatin@prosodicshorthands
+ }
+ \bool_if:NT \l_polyglossia_latin_prosodic_shorthands_bool
+ {
\polyglossia_latin_no_prosodic_shorthands:
- \fi
+ }
\xpgla@savedvalues
\polyglossia_latin_no_punctuation_spacing:
\polyglossia_latin_modern_character_codes:
@@ -1045,16 +1028,20 @@
{
\polyglossia_latin_punctuation_spacing:
}
- \iflatin@babelshorthands
+ \bool_if:NTF \l_polyglossia_latin_babelshorthands_bool
+ {
\polyglossia_latin_shorthands:
- \else
+ }
+ {
\polyglossia_latin_no_shorthands:
- \fi
- \iflatin@prosodicshorthands
+ }
+ \bool_if:NTF \l_polyglossia_latin_prosodic_shorthands_bool
+ {
\polyglossia_latin_prosodic_shorthands:
- \else
+ }
+ {
\polyglossia_latin_no_prosodic_shorthands:
- \fi
+ }
}
\def \blockextras@latin
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-latinclassic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-latinclassic.ldf
deleted file mode 100644
index 496d8356dde..00000000000
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-latinclassic.ldf
+++ /dev/null
@@ -1,9 +0,0 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-latinclassic.ldf}[polyglossia: module for classic Latin]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{latin}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-latinecclesiastic.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-latinecclesiastic.ldf
deleted file mode 100644
index aab9c456d44..00000000000
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-latinecclesiastic.ldf
+++ /dev/null
@@ -1,9 +0,0 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-latinecclesiastic.ldf}[polyglossia: module for ecclesiastic Latin]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{latin}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-latinmedieval.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-latinmedieval.ldf
deleted file mode 100644
index 1f76e51ba2b..00000000000
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-latinmedieval.ldf
+++ /dev/null
@@ -1,9 +0,0 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
-%
-\ProvidesFile{gloss-latinmedieval.ldf}[polyglossia: module for medieval Latin]
-
-% We provide this as a babel alias
-
-\xpg@load@master@language{latin}
-
-\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-latvian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-latvian.ldf
index 495a2384b07..a0e938f3c5a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-latvian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-latvian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-latvian.ldf}[polyglossia: module for Latvian]
\PolyglossiaSetup{latvian}{
@@ -25,12 +25,12 @@
\def\contentsname{Saturs}%
\def\listfigurename{Attēlu saraksts}%
\def\listtablename{Tabulu saraksts}%
- \def\indexname{Index}%
+ \def\indexname{Priekšmetu rādītājs}%
\def\figurename{Att.}%
\def\tablename{Tabula}%
\def\partname{Daļa}%
- \def\enclname{encl}%
- \def\ccname{cc}%
+ \def\enclname{Pielikumā}%
+ \def\ccname{Kopija(s)}%
\def\headtoname{To}%
\def\pagename{lpp.}%
\def\seename{sk.}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-lithuanian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-lithuanian.ldf
index c3f389702bb..c120f8394f7 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-lithuanian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-lithuanian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translated by Paulius Sladkevičius <komsas@gmail.com>
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-lo.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-lo.ldf
index dbb6a3406a2..d74145d09a8 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-lo.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-lo.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lo.ldf}[polyglossia: module for lo (Lao)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{lao}
+\InheritGlossFile{lao}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-lowersorbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-lowersorbian.ldf
index a754a11e9e2..a4927b4f86a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-lowersorbian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-lowersorbian.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lowersorbian.ldf}[polyglossia: module for Lower Sorbian]
% We provide this as a babel alias
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf
index 4f054727f6e..96cd05cede4 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-lsorbian.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lsorbian.ldf}[polyglossia: module for Lower Sorbian]
% We only provide this gloss for babel compatibility. Since lsorbian is
% a sorbian variety, we use 'sorbian' with variant 'lower' now.
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-lt.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-lt.ldf
index a229c22f599..c01d7f9cae3 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-lt.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-lt.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lt.ldf}[polyglossia: module for lt (Lithuanian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{lithuanian}
+\InheritGlossFile{lithuanian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-lv.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-lv.ldf
index 872db3d41eb..88932fe434d 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-lv.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-lv.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-lv.ldf}[polyglossia: module for lv (Latvian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{latvian}
+\InheritGlossFile{latvian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-macedonian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-macedonian.ldf
index 7d1465ee3d5..e1c8534b2a3 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-macedonian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-macedonian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-macedonian.ldf}[polyglossia: module for Macedonian]
\PolyglossiaSetup{macedonian}{
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf
index 034802242c0..9533a325b4a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-magyar.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-magyar.ldf}[polyglossia: module for Hungarian (Magyar)]
% We only provide this gloss for babel compatibility.
-\xpg@load@master@language{hungarian}
+\InheritGlossFile{hungarian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf
index c890ffcd2b9..451ed329b8f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-malay.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-malay.ldf}[polyglossia: module for Malay]
@@ -26,65 +26,44 @@
% Backwards compat. alias
\setlanguagealias[variant=malaysian]{malay}{bahasam}
-\providebool{malay@melayu}
+\@ifundefined{ifmalay@melayu}%
+ {\newif\ifmalay@melayu}{}
\malay@melayufalse
\def\malay@variant{malay}
-\define@choicekey*+{malay}{variant}[\xpg@val\xpg@nr]{indonesian,malaysian}[malaysian]{%
- \ifcase\xpg@nr\relax
- % indonesian:
- \def\malay@variant{indonesian}%
- \malay@melayufalse
- \or
- % malaysian:
- \def\malay@variant{malay}%
- \malay@melayutrue
- \fi
- \ifmalay@melayu
- \SetLanguageKeys{malay}{language=Malay,langtag=MLY,babelname=bahasam,bcp47=zsm,bcp47-language=zsm}%
- \xpg@fontsetup@latin{malay}%
- % Check if \l@malay is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{malay}{}{%
- \def\do##1{%
- \xpg@ifdefined{##1}%
- {\csletcs{l@malay}{l@##1}\listbreak}%
- {}%
- }%
- \docsvlist{melayu,bahasam,bahasai,indonesian,indon,bahasa}
- \xpg@ifdefined{malay}{}{%
- \xpg@warning{No hyphenation patterns for Malay (Malaysian) found\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@malay0%
- }%
- }%
- \else
- \SetLanguageKeys{malay}{language=Indonesian,langtag=IND,babelname=bahasa,bcp47=id,bcp47-language=id}%
- \xpg@fontsetup@latin{malay}%
- % Check if \l@indonesian is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{indonesian}{}{%
- \def\do##1{%
- \xpg@ifdefined{##1}%
- {\csletcs{l@indonesian}{l@##1}\listbreak}%
- {}%
- }%
- \docsvlist{indon,bahasai,bahasam,malay,melayu,bahasa}
- \xpg@ifdefined{indonesian}{}{%
- \xpg@warning{No hyphenation patterns for Malay (Indonesian) found\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@indonesian0
- }%
- }%
- \fi
- \xpg@info{Option: malay, variant=\xpg@val}%
-}{\xpg@warning{Unknown malay variant `#1'}}
+
+\DeclareKeys[polyglossia/gloss/malay]
+ {
+ variant.choice:,
+ variant / indonesian.code =
+ {%
+ \def\malay@variant{indonesian}%
+ \malay@melayufalse
+ \SetLanguageKeys{malay}{language=Indonesian,langtag=IND,babelname=bahasa,bcp47=id,bcp47-language=id}%
+ \SetupLatinPolyglossiaFont{malay}%
+ % Check if \l@indonesian is defined. If not, try to set it to some variety
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{indonesian}{indon,bahasai,bahasam,malay,melayu,bahasa}%
+ },
+ variant / malaysian.code =
+ {%
+ \def\malay@variant{malay}%
+ \malay@melayutrue
+ \SetLanguageKeys{malay}{language=Malay,langtag=MLY,babelname=bahasam,bcp47=zsm,bcp47-language=zsm}%
+ \SetupLatinPolyglossiaFont{malay}%
+ % Check if \l@malay is defined. If not, try to set it to some variety
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{malay}{melayu,bahasam,bahasai,indonesian,indon,bahasa}%
+ },
+ variant.default:n = malaysian,
+ variant/unknown.code = \xpg@warning{Unknown malay variant `#1'},
+ }
% Register default options
-\xpg@initialize@gloss@options{malay}{variant=malaysian}
+\InitializeGlossOptions{malay}{variant=malaysian}
\def\malay@language{%
- \polyglossia@setup@language@patterns{\malay@variant}%
+ \SetupPolyglossiaLangPatterns{\malay@variant}%
}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-malayalam.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-malayalam.ldf
index 44def596e77..84524dac5ce 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-malayalam.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-malayalam.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-malayalam.ldf}[polyglossia: module for Malayalam]
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf
index 79b48a24c5a..cbb0dce0cbb 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translations provided by Abhijit Navale <abhi_navale@live.in>
% Ordinals (1-100) added by Niranjan Tambe <niranjanvikastambe@gmail.com> on 14th December, 2019
@@ -28,21 +28,25 @@
\newif\ifmarathi@devanagari@numerals
\marathi@devanagari@numeralstrue
-\define@choicekey*+{marathi}{numerals}[\xpg@val\xpg@nr]{Western,Devanagari}[Devanagari]{%
- \ifcase\xpg@nr\relax
- % Western:
- \marathi@devanagari@numeralsfalse%
- \SetLanguageKeys{marathi}{bcp47-extension-u=nu-latn}%
- \or
- % Devanagari:
- \marathi@devanagari@numeralstrue%
- \SetLanguageKeys{marathi}{bcp47-extension-u=nu-deva}%
- \fi
- \xpg@info{Option: Marathi, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Marathi numerals value `#1'}}
+\DeclareKeys[polyglossia/gloss/marathi]
+ {
+ numerals.choice:,
+ numerals / western.code =
+ {%
+ \marathi@devanagari@numeralsfalse
+ \SetLanguageKeys{marathi}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / devanagari.code =
+ {%
+ \marathi@devanagari@numeralstrue
+ \SetLanguageKeys{marathi}{bcp47-extension-u=nu-deva}%
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Marathi numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{marathi}{numerals=Devanagari}
+\InitializeGlossOptions{marathi}{numerals=Devanagari}
\newcommand{\marathinumerals}[2]{\marathinumber{#2}}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-medievallatin.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-medievallatin.ldf
new file mode 100644
index 00000000000..f718bde8fa3
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-medievallatin.ldf
@@ -0,0 +1,9 @@
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
+%
+\ProvidesFile{gloss-medievallatin.ldf}[polyglossia: module for medieval Latin]
+
+% We provide this as a babel alias
+
+\InheritGlossFile{latin}
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-mk.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-mk.ldf
index d5795bc39d3..dd2fbe301bd 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-mk.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-mk.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-mk.ldf}[polyglossia: module for mk (Macedonian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{macedonian}
+\InheritGlossFile{macedonian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ml.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ml.ldf
index 74ebd5902fa..175a75bee7f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ml.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ml.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ml.ldf}[polyglossia: module for ml (Malayalam)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{malayalam}
+\InheritGlossFile{malayalam}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-mn.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-mn.ldf
index f19bfb63f24..985d73b69d8 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-mn.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-mn.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-mn.ldf}[polyglossia: module for mn (Mongolian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{mongolian}
+\InheritGlossFile{mongolian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf
index 04d4fe1e4da..d8eca6721d5 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-mongolian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-mongolian.ldf}[polyglossia: module for Mongolian]
@@ -30,43 +30,46 @@
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{mongolian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \fi
- \xpg@info{Option: Mongolian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Mongolian numerals value `#1'}}
-\define@boolkey{mongolian}[mongolian@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/mongolian]
+ {
+ babelshorthands.if = mongolian@babelshorthands,
+ babelshorthands.default:n = true,
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Mongolian numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{mongolian}{babelshorthands=false,numerals=arabic}
+\InitializeGlossOptions{mongolian}{babelshorthands=false,numerals=arabic}
\ifsystem@babelshorthands
- \setkeys{mongolian}{babelshorthands=true}
+ \SetGlossOptions{mongolian}{babelshorthands=true}
\else
- \setkeys{mongolian}{babelshorthands=false}
+ \SetGlossOptions{mongolian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\mongolian@shorthands{%
\xpg@activate@shorthands%
@@ -119,7 +122,7 @@
\def\bibname{Номзүй}%
\def\chaptername{Бүлэг}%
\def\appendixname{Хавсралт}%
- \ifcsundef{thechapter}%
+ \@ifundefined{thechapter}%
{\def\contentsname{Агуулга}}%
{\def\contentsname{Гарчиг}}%
\def\listfigurename{Зургийн жагсаалт}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-mr.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-mr.ldf
index fa37ee180c0..7a56186cb25 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-mr.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-mr.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-mr.ldf}[polyglossia: module for mr (Marathi)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{marathi}
+\InheritGlossFile{marathi}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-naustrian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-naustrian.ldf
index 01cb9a28833..32524dab4fe 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-naustrian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-naustrian.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-naustrian.ldf}[polyglossia: module for Austrian German (current spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-nb.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-nb.ldf
index 715d6a22841..34bfbbce49a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-nb.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-nb.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-nb.ldf}[polyglossia: module for nb (Norwegian)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{norwegian}
+\InheritGlossFile{norwegian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-newzealand.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-newzealand.ldf
index 298913ccb8d..baf56a91398 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-newzealand.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-newzealand.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-newzealand.ldf}[polyglossia: module for Newzealand English]
% We provide this as a babel alias
-\xpg@load@master@language{english}
+\InheritGlossFile{english}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ngerman.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ngerman.ldf
index cb77aa6be8d..7bacbf2b423 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ngerman.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ngerman.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ngerman.ldf}[polyglossia: module for German (current spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-nko.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-nko.ldf
index a7b7712520d..196b55d48ee 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-nko.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-nko.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-nko.ldf}[Polyglossia: module for N’Ko]
\PolyglossiaSetup{nko}{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf
index d000c9c1e38..95121a64502 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-norsk.ldf
@@ -1,11 +1,11 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-norsk.ldf}[polyglossia: module for Norwegian (Bokmal)]
% We only provide this gloss for babel compatibility. Since norsk is
% actually norwegian bokmal, we use 'norwegian' with variant 'bokmal' now.
-\xpg@load@master@language{norwegian}
+\InheritGlossFile{norwegian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf
index 544c8b7df79..ba7b7aca46d 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-norwegian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-norwegian.ldf}[polyglossia: module for Norwegian]
\PolyglossiaSetup{norwegian}{
@@ -20,28 +20,32 @@
\setlanguagealias[variant=nynorsk]{norwegian}{nynorsk}
\def\norwegian@variant{nynorsk}
-\define@choicekey*+{norwegian}{variant}[\xpg@val\xpg@nr]{nynorsk,bokmal}[nynorsk]{%
- \ifcase\xpg@nr\relax
- % nynorsk:
- \def\norwegian@variant{nynorsk}%
- \SetLanguageKeys{norwegian}{langtag=NYN,babelname=nynorsk,bcp47=nn,bcp47-language=nn}%
- \xpg@fontsetup@latin{norwegian}%
- \or
- % bokmal:
- \def\norwegian@variant{norsk}%
- \SetLanguageKeys{norwegian}{langtag=NOR,babelname=norsk,bcp47=nb,bcp47-language=nb}%
- \xpg@fontsetup@latin{norwegian}%
- \fi
- \xpg@info{Option: norwegian, variant=\xpg@val}%
-}{\xpg@warning{Unknown norwegian variant `#1'}}
+\DeclareKeys[polyglossia/gloss/norwegian]
+ {
+ variant.choice:,
+ variant / nynorsk.code =
+ {%
+ \def\norwegian@variant{nynorsk}%
+ \SetLanguageKeys{norwegian}{langtag=NYN,babelname=nynorsk,bcp47=nn,bcp47-language=nn}%
+ \SetupLatinPolyglossiaFont{norwegian}%
+ },
+ variant / bokmal.code =
+ {%
+ \def\norwegian@variant{norsk}%
+ \SetLanguageKeys{norwegian}{langtag=NOR,babelname=norsk,bcp47=nb,bcp47-language=nb}%
+ \SetupLatinPolyglossiaFont{norwegian}%
+ },
+ variant.default:n = nynorsk,
+ variant/unknown.code = \xpg@warning{Unknown norwegian variant `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{norwegian}{variant=nynorsk}
+\InitializeGlossOptions{norwegian}{variant=nynorsk}
\def\norwegian@language{%
- \polyglossia@setup@language@patterns{\norwegian@variant}%
+ \SetupPolyglossiaLangPatterns{\norwegian@variant}%
}%
\def\captionsnorwegian@nynorsk{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-nswissgerman.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-nswissgerman.ldf
index 5fa656d2a50..19d45a3143c 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-nswissgerman.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-nswissgerman.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-nswissgerman.ldf}[polyglossia: module for Swiss German (current spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf
index 648d2b346d4..5a44bced302 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-nynorsk.ldf
@@ -1,11 +1,11 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-nynorsk.ldf}[polyglossia: module for Norwegian (Nynorsk)]
% We only provide this gloss for babel compatibility. Since nynorsk is
% a norwegian variety, we use 'norwegian' with variant 'nynorsk' now.
-\xpg@load@master@language{norwegian}
+\InheritGlossFile{norwegian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf
index a383b92b28f..163fd7dc576 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-occitan.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
%%
%% This is file `gloss-occitan.ldf',
@@ -34,19 +34,19 @@
% BCP-47 compliant aliases
\setlanguagealias*{occitan}{oc}
-\define@boolkey{occitan}[occitan@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/occitan]
+ {
+ babelshorthands.if = occitan@babelshorthands,
+ babelshorthands.default:n = true
+ }
\ifsystem@babelshorthands
- \setkeys{occitan}{babelshorthands=true}
+ \SetGlossOptions{occitan}{babelshorthands=true}
\else
- \setkeys{occitan}{babelshorthands=false}
+ \SetGlossOptions{occitan}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\occitan@shorthands{%
\xpg@activate@shorthands%
@@ -138,7 +138,7 @@
\def\today{\occitanday\space \occitanmonth\space de~\number\year}%
}
\let\xpgoc@savedvalues\empty
-\AtEndPreamble{% the user or the class might define different values
+\AddToHook{begindocument/before}{% the user or the class might define different values
\edef\xpgoc@savedvalues{%
\clubpenalty=\the\clubpenalty\space
\@clubpenalty=\the\@clubpenalty\space
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-odia.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-odia.ldf
index 7efbd533912..7101033d02e 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-odia.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-odia.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% Translations provided by ଅଶୋକ ଦାସ୍ <das@pas.rochester.edu> and ଅଭିଷେକ ଜେନା <avisekjena@gmail.com>
% TODO implement Odia calendar
@@ -30,32 +30,37 @@
\newif\ifodia@devanagari@numerals
\newif\ifodia@odia@numerals
-\define@choicekey*+{odia}{numerals}[\xpg@val\xpg@nr]{Devanagari,Odia,Western}[Devanagari]{%
- \ifcase\xpg@nr\relax
- % Devanagari:
- \odia@odia@numeralsfalse%
- \odia@devanagari@numeralstrue%
- \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-deva}%
- \or
- % Odia:
- \odia@odia@numeralstrue%
- \odia@devanagari@numeralsfalse%
- \or
- % Western:
- \odia@odia@numeralsfalse%
- \odia@devanagari@numeralsfalse%
- \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Odia, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Odia numeral `#1'}}
-
\def\extras@odia{}
\def\noextras@odia{}
-\define@boolkey{odia}[odia@]{changecounternumbering}[true]{}
+\DeclareKeys[polyglossia/gloss/odia]
+ {
+ changecounternumbering.if = odia@changecounternumbering,
+ changecounternumbering.default:n = true,
+ numerals.choice:,
+ numerals / devanagari.code =
+ {%
+ \odia@odia@numeralsfalse
+ \odia@devanagari@numeralstrue
+ \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-deva}%
+ },
+ numerals / odia.code =
+ {%
+ \odia@odia@numeralstrue
+ \odia@devanagari@numeralsfalse
+ },
+ numerals / western.code =
+ {%
+ \odia@odia@numeralsfalse
+ \odia@devanagari@numeralsfalse
+ \SetLanguageKeys{odia}{bcp47=or,bcp47-language=or,bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Odia numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{odia}{changecounternumbering=false,numerals=Devanagari}
+\InitializeGlossOptions{odia}{changecounternumbering=false,numerals=Devanagari}
\def\captionsodia{%
\def\refname{ସନ୍ଦର୍ଭ}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-or.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-or.ldf
index a864d2040e0..7f9cee9b542 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-or.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-or.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-odia.ldf}[polyglossia: module for or (Odia)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{odia}
+\InheritGlossFile{odia}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-pa.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-pa.ldf
index c54ec572b9c..9f56ed05039 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-pa.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-pa.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-pa.ldf}[polyglossia: module for pa (Punjabi)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{punjabi}
+\InheritGlossFile{punjabi}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf
index ae1a9b0d288..6018964b451 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-persian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-persian.ldf}[polyglossia: module for Persian]
@@ -27,42 +27,36 @@
\setlanguagealias{persian}{farsi}
\newif\if@western@numerals
-\define@choicekey*+{persian}{numerals}[\xpg@val\xpg@nr]{eastern,western}[eastern]{%
- \ifcase\xpg@nr\relax
- % eastern:
- \@western@numeralsfalse%
- \SetLanguageKeys{persian}{bcp47-extension-u=nu-arab}%
- \or
- % western:
- \@western@numeralstrue%
- \SetLanguageKeys{persian}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Persian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Persian numerals option `#1'}}
-
\newif\ifpersian@customsep\persian@customsepfalse
\def\xpg@sepmark{}
-\define@key{persian}{sectionsep}[.]{%
- \persian@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
-
-%this is needed for \abjad in arabicnumbers.sty
-\define@boolkey{persian}[persian@]{abjadjimnotail}[true]{%
- \ifpersian@abjadjimnotail
- \abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi}
-
-% NOT YET USED
-\define@key{persian}{locale}[default]{%
- \def\@persian@locale{#1}}
%TODO add option for CALENDAR
+\DeclareKeys[polyglossia/gloss/persian]
+ {
+ sectionsep.code = \gdef\xpg@sepmark{#1}\persian@customseptrue,
+ sectionsep.default:n = .,
+ abjadjimnotail.if = abjad@jim@notail,
+ abjadjimnotail.default:n = true,
+ locale.store = \@persian@locale,
+ locale.default:n = default,
+ numerals.choice:,
+ numerals / eastern.code =
+ {%
+ \@western@numeralsfalse
+ \SetLanguageKeys{persian}{bcp47-extension-u=nu-arab}%
+ },
+ numerals / western.code =
+ {%
+ \@western@numeralstrue
+ \SetLanguageKeys{persian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = eastern,
+ numerals/unknown.code = \xpg@warning{Unknown Persian numerals option `#1'}
+ }
+
% Register default options
-\xpg@initialize@gloss@options{persian}{locale=default,numerals=eastern,abjadjimnotail=false}
+\InitializeGlossOptions{persian}{locale=default,numerals=eastern,abjadjimnotail=false}
\def\farsigregmonth#1{\ifcase#1%
\or ژانویه\or فوریه\or مارس\or آوریل\or مه\or ژوئن\or ژوئیه\or اوت\or سپتامبر\or اکتبر\or نوامبر\or دسامبر\fi}
@@ -147,16 +141,16 @@
}
\def\nopersian@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi%
}
\def\persian@luatex@capsformat{%
%
% change chapter and part headings
\ifpersian@customsep
- \ifcsdef{chapter}{%
+ \ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
@@ -168,7 +162,7 @@
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
+ \fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
@@ -183,30 +177,30 @@
}
\def\nopersian@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
+ \ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
+ \fi%
+ \ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
+ \fi%
+ \ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
+ \fi%
+ \ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
+ \fi%
+ \ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
+ \ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
+ \fi%
+ \fi%
+ \ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
+ \fi%
+ \ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \fi%
}
\def\blockextras@persian{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf
index 1b6b9b537d1..214182ba500 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-piedmontese.ldf
@@ -1,5 +1,5 @@
% !TEX encoding = UTF-8 Unicode
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-piedmontese.ldf}[2013/02/12 v1.0 polyglossia: module for Piedmontese]
\makeatletter
@@ -17,19 +17,19 @@
% BCP-47 compliant aliases
\setlanguagealias*{piedmontese}{pms}
-\define@boolkey{piedmontese}[piedmontese@]{babelshorthands}[true]{}
+\DeclareKeys[polyglossia/gloss/piedmontese]
+ {
+ babelshorthands.if = piedmontese@babelshorthands,
+ babelshorthands.default:n = true
+ }
\ifsystem@babelshorthands
- \setkeys{piedmontese}{babelshorthands=true}
+ \SetGlossOptions{piedmontese}{babelshorthands=true}
\else
- \setkeys{piedmontese}{babelshorthands=false}
+ \SetGlossOptions{piedmontese}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\piedmontese@shorthands{%
\xpg@activate@shorthands%
@@ -93,7 +93,7 @@
ëd luj\or d'agost\or dë stèmber\or d'otóber\or ëd novèmber\or dë dzèmber%
\fi\space dal\space\number\year}}
-\AtEndPreamble{%
+\AddToHook{begindocument/before}{%
\edef\xpgpms@savedvalues{%
\clubpenalty=\the\clubpenalty\space
\@clubpenalty=\the\@clubpenalty\space
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-polish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-polish.ldf
index 48ceed5bbb6..bc48e3e4b1e 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-polish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-polish.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-polish.ldf}[polyglossia: module for Polish]
@@ -20,26 +20,26 @@
\RequirePackage{luavlna}
\fi
-\define@boolkey{polish}[polish@]{babelshorthands}[true]{}
-
-\define@boolkey{polish}[polish@]{splithyphens}[true]{}
-
-\define@boolkey{polish}[polish@]{vlna}[true]{}
+\DeclareKeys[polyglossia/gloss/polish]
+ {
+ babelshorthands.if = polish@babelshorthands,
+ babelshorthands.default:n = true,
+ splithyphens.if = polish@splithyphens,
+ splithyphens.default:n = true,
+ vlna.if = polish@vlna,
+ vlna.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{polish}{babelshorthands=false,splithyphens=true,vlna=true}
+\InitializeGlossOptions{polish}{babelshorthands=false,splithyphens=true,vlna=true}
\ifsystem@babelshorthands
- \setkeys{polish}{babelshorthands=true}
+ \SetGlossOptions{polish}{babelshorthands=true}
\else
- \setkeys{polish}{babelshorthands=false}
+ \SetGlossOptions{polish}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\let\xpg@hyphen@char-
\def\polish@@splhyphen#1{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-polutonikogreek.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-polutonikogreek.ldf
index 68f53eb1f22..e8f541e486c 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-polutonikogreek.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-polutonikogreek.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-polutonikogreek.ldf}[polyglossia: module for polytonic Greek]
% We provide this as a babel alias
-\xpg@load@master@language{greek}
+\InheritGlossFile{greek}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf
index 6111b581193..d635007377a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-portuges.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-portuges.ldf}[polyglossia: module for Portuguese]
@@ -7,6 +7,6 @@
% introduced it in 8.3 filename times). Since polyglossia uses full
% English language names, we use 'portuguese' now.
-\xpg@load@master@language{portuguese}
+\InheritGlossFile{portuguese}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf
index bb03525be7e..e58233056a1 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-portuguese.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-portuguese.ldf}[polyglossia: module for Portuguese]
@@ -28,41 +28,42 @@
\fi
\def\portuguese@variant{portuges}
-\define@choicekey*+{portuguese}{variant}[\xpg@val\xpg@nr]{portuguese,brazilian}[portuguese]{%
- \ifcase\xpg@nr\relax
- % portuguese:
- \def\portuguese@variant{portuges}%
- \SetLanguageKeys{portuguese}{babelname=portuges,bcp47=pt-PT,bcp47-language=pt,bcp47-region=PT}%
- \or
- % brazilian:
- \def\portuguese@variant{brazil}%
- \SetLanguageKeys{portuguese}{babelname=brazil,bcp47=pt-BR,bcp47-language=pt,bcp47-region=BR}%
- % There are no specific brazil patterns
- \adddialect\l@brazil\l@portuges\relax%
- \fi
- \xpg@info{Option: portuguese, variant=\xpg@val}%
-}{\xpg@warning{Unknown portuguese variant `#1'}}
-
-\define@boolkey{portuguese}[portuguese@]{babelshorthands}[true]{}
-
-\define@boolkey{portuguese}[portuguese@]{splithyphens}[true]{}
+
+\DeclareKeys[polyglossia/gloss/portuguese]
+ {
+ babelshorthands.if = portuguese@babelshorthands,
+ babelshorthands.default:n = true,
+ splithyphens.if = portuguese@splithyphens,
+ splithyphens.default:n = true,
+ variant.choice:,
+ variant / portuguese.code =
+ {%
+ \def\portuguese@variant{portuges}%
+ \SetLanguageKeys{portuguese}{babelname=portuges,bcp47=pt-PT,bcp47-language=pt,bcp47-region=PT}%
+ },
+ variant / brazilian.code =
+ {%
+ \def\portuguese@variant{brazil}%
+ \SetLanguageKeys{portuguese}{babelname=brazil,bcp47=pt-BR,bcp47-language=pt,bcp47-region=BR}%
+ % There are no specific brazil patterns
+ \adddialect\l@brazil\l@portuges\relax
+ },
+ variant.default:n = portuguese,
+ variant/unknown.code = \xpg@warning{Unknown portuguese variant `#1'},
+ }
% Register default options
-\xpg@initialize@gloss@options{portuguese}{variant=portuguese,
+\InitializeGlossOptions{portuguese}{variant=portuguese,
babelshorthands=false,
splithyphens=true}
\ifsystem@babelshorthands
- \setkeys{portuguese}{babelshorthands=true}
+ \SetGlossOptions{portuguese}{babelshorthands=true}
\else
- \setkeys{portuguese}{babelshorthands=false}
+ \SetGlossOptions{portuguese}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\let\xpg@hyphen@char-
\def\portuguese@@splhyphen#1{%
@@ -131,7 +132,7 @@
}
\def\portuguese@language{%
- \polyglossia@setup@language@patterns{\portuguese@variant}%
+ \SetupPolyglossiaLangPatterns{\portuguese@variant}%
}%
\def\captionsportuguese@portuges{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-punjabi.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-punjabi.ldf
index 48eacd30e7f..e150176c02d 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-punjabi.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-punjabi.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
% UTF-8 strings kindly provided by
% Arvinder Singh Kang, <17-11-2022>
@@ -25,26 +25,31 @@
\def\punjabi@language{%
% patterns are spelled panjabi
- \polyglossia@setup@language@patterns{panjabi}%
+ \SetupPolyglossiaLangPatterns{panjabi}%
}
\newif\ifpunjabi@gurmukhi@numerals
\punjabi@gurmukhi@numeralstrue
-\define@choicekey*+{punjabi}{numerals}[\xpg@val\xpg@nr]{Gurmukhi,Western}[Gurmukhi]{%
- \ifcase\xpg@nr\relax
- % Gurmukhi:
- \punjabi@gurmukhi@numeralstrue%
- \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-guru}%
- \or
- % Western:
- \punjabi@gurmukhi@numeralsfalse%
- \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Punjabi, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Punjabi numeral `#1'}}
+
+\DeclareKeys[polyglossia/gloss/punjabi]
+ {
+ numerals.choice:,
+ numerals / gurmukhi.code =
+ {%
+ \punjabi@gurmukhi@numeralstrue
+ \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-guru}%
+ },
+ numerals / western.code =
+ {%
+ \punjabi@gurmukhi@numeralsfalse
+ \SetLanguageKeys{punjabi}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = gurmukhi,
+ numerals/unknown.code = \xpg@warning{Unknown Punjabi numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{punjabi}{numerals=gurmukhi}
+\InitializeGlossOptions{punjabi}{numerals=gurmukhi}
\newcommand{\punjabinumerals}[2]{\punjabinumber{#2}}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-romanian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-romanian.ldf
index 290dad9c71b..0051613ac77 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-romanian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-romanian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-romanian.ldf}[polyglossia: module for Romanian]
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-romansh.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-romansh.ldf
index aa50a200003..b8c9d628e01 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-romansh.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-romansh.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-romansh.ldf}[polyglossia: module for Romansh]
\makeatletter
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
index 8dcf535ebf5..34b2abd2445 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-russian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-russian.ldf}[polyglossia: module for Russian]
@@ -27,11 +27,6 @@
\setlanguagealias*[spelling=old]{russian}{ru-petr1708}
\newif\if@russian@modern
-\define@key{russian}{spelling}[modern]{%
- \ifstrequal{#1}{old}%
- {\@russian@modernfalse\SetLanguageKeys{russian}{bcp47=ru-petr1708,bcp47-variant=petr1708}}%
- {\@russian@moderntrue\SetLanguageKeys{russian}{bcp47=ru,bcp47-variant=luna1918}}%
-}
\def\captionsrussian{%
\if@russian@modern\captionsrussian@modern\else\captionsrussian@old\fi%
@@ -43,49 +38,68 @@
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{russian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-latn}%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
- \fi
- \xpg@info{Option: Russian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Russian numerals value `#1'}}
-
-\define@boolkey{russian}[russian@]{indentfirst}[true]{%
- \ifrussian@indentfirst
- \SetLanguageKeys{russian}{indentfirst=true}%
- \else
- \SetLanguageKeys{russian}{indentfirst=false}%
- \fi%
-}
-
-\define@boolkey{russian}[russian@]{babelshorthands}[true]{}
-
-% Force punctuation after heading number
-\define@boolkey{russian}[russian@]{forceheadingpunctuation}[true]{}
-% Define some math functions
-\define@boolkey{russian}[russian@]{mathfunctions}[true]{}
+\DeclareKeys[polyglossia/gloss/russian]
+ {
+ babelshorthands.if = russian@babelshorthands,
+ babelshorthands.default:n = true,
+ forceheadingpunctuation.if = russian@forceheadingpunctuation,
+ forceheadingpunctuation.default:n = true,
+ mathfunctions.if = russian@mathfunctions,
+ mathfunctions.default:n = true,
+ spelling.choice:,
+ spelling / modern.code =
+ {%
+ \@russian@moderntrue
+ \SetLanguageKeys{russian}{bcp47=ru,bcp47-variant=luna1918}%
+ },
+ spelling / old.code =
+ {%
+ \@russian@modernfalse
+ \SetLanguageKeys{russian}{bcp47=ru-petr1708,bcp47-variant=petr1708}%
+ },
+ spelling.default:n = modern,
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{russian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ \SetLanguageKeys{russian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Russian numerals value `#1'},
+ indentfirst.choice:,
+ indentfirst / true.code =
+ {%
+ \SetLanguageKeys{russian}{indentfirst=true}%
+ },
+ indentfirst / false.code =
+ {%
+ \SetLanguageKeys{russian}{indentfirst=false}%
+ },
+ indentfirst.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{russian}{babelshorthands=false,
+\InitializeGlossOptions{russian}{babelshorthands=false,
spelling=modern,
numerals=arabic,
indentfirst=true,
@@ -94,16 +108,12 @@
\ifsystem@babelshorthands
- \setkeys{russian}{babelshorthands=true}
+ \SetGlossOptions{russian}{babelshorthands=true}
\else
- \setkeys{russian}{babelshorthands=false}
+ \SetGlossOptions{russian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\russian@shorthands{%
\xpg@activate@shorthands%
@@ -155,7 +165,7 @@
\def\bibname{Литература}%
\def\chaptername{Глава}%
\def\appendixname{Приложение}%
- \ifcsundef{thechapter}%
+ \@ifundefined{thechapter}%
{\def\contentsname{Содержание}}%
{\def\contentsname{Оглавление}}%
\def\listfigurename{Список иллюстраций}%
@@ -198,7 +208,7 @@
\def\bibname{Библіографія}%
\def\chaptername{Глава}%
\def\appendixname{Приложеніе}%
- \ifcsundef{thechapter}%
+ \@ifundefined{thechapter}%
{\def\contentsname{Содержаніе}}%
{\def\contentsname{Оглавленіе}}%
\def\listfigurename{Списокъ иллюстрацій}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf
index 9efe055865f..802718dbc47 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-sami.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-sami.ldf}[polyglossia: module for Sami]
@@ -28,19 +28,19 @@
% % northern:
% \def\sami@variant{samin}%
% \SetLanguageKeys{sami}{language=Northern Sami,langtag=NSM}%
-% \xpg@fontsetup@latin{sami}%
+% \SetupLatinPolyglossiaFont{sami}%
% \or
% % other:
% \def\sami@variant{}%
% \SetLanguageKeys{sami}{language= Sami,langtag=}%
-% \xpg@fontsetup@latin{sami}%
+% \SetupLatinPolyglossiaFont{sami}%
% \fi
% \xpg@info{Option: sami, variant=\xpg@val}%
%}{\xpg@warning{Unknown sami variant `#1'}}
%\def\sami@language{%
-% \polyglossia@setup@language@patterns{\sami@variant}%
+% \SetupPolyglossiaLangPatterns{\sami@variant}%
%}%
\def\captionssami@northern{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf
index 0801e7423ab..e15a05b2430 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-samin.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-samin.ldf}[polyglossia: module for Northern Sami]
% We only provide this gloss for babel compatibility. Since samin is
% a sami variety, we use 'sami' with variant 'northern' now.
-\xpg@load@master@language{sami}
+\InheritGlossFile{sami}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf
index 094c6f6691d..1c9901082c9 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-sanskrit.ldf}[polyglossia: module for Sanskrit]
@@ -27,56 +27,55 @@
\setlanguagealias*[script=gujarati]{sanskrit}{sa-Gujr}
\setlanguagealias*[script=latin]{sanskrit}{sa-Latn}
-\define@key{sanskrit}{Script}[devanagari]{%
- \ifcsdef{fontsetup@sanskrit@#1}%
- {\csname fontsetup@sanskrit@#1\endcsname}%
- {\xpg@error{`#1' is not a valid script for Sanskrit}%
- }%
-}
-
-\define@key{sanskrit}{script}[devanagari]{\setkeys{sanskrit}{Script=#1}}
-
\def\fontsetup@sanskrit@devanagari{%
\SetLanguageKeys{sanskrit}{scripttag=deva,script=Devanagari,bcp47=sa-Deva,bcp47-language=sa,bcp47-script=Deva,bcp47-casing=sa-Deva}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@gujarati{%
\SetLanguageKeys{sanskrit}{scripttag=gujr,script=Gujarati,bcp47=sa-Gujr,bcp47-language=sa,bcp47-script=Gujr,bcp47-casing=sa-Gujr}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@malayalam{%
\SetLanguageKeys{sanskrit}{scripttag=mlym,script=Malayalam,bcp47=sa-Mlym,bcp47-language=sa,bcp47-script=Mlym,bcp47-casing=sa-Mlym}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@bengali{%
\SetLanguageKeys{sanskrit}{scripttag=beng,script=Bengali,bcp47=sa-Beng,bcp47-language=sa,bcp47-script=Beng,bcp47-casing=sa-Beng}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@kannada{%
\SetLanguageKeys{sanskrit}{scripttag=knda,script=Kannada,bcp47=sa-Knda,bcp47-language=sa,bcp47-script=Knda,bcp47-casing=sa-Knda}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@telugu{%
\SetLanguageKeys{sanskrit}{scripttag=telu,script=Telugu,bcp47=sa-Relu,bcp47-language=sa,bcp47-script=Relu,bcp47-casing=sa-Relu}
- \xpg@fontsetup@nonlatin{sanskrit}}
+ \SetupNonLatinPolyglossiaFont{sanskrit}}
\def\fontsetup@sanskrit@latin{%
\SetLanguageKeys{sanskrit}{scripttag=latn,script=Latin,bcp47=sa-Latn,bcp47-language=sa,bcp47-script=Latn,bcp47-casing=sa-Latn}
- \xpg@fontsetup@latin{sanskrit}}
+ \SetupLatinPolyglossiaFont{sanskrit}}
\newif\ifsanskrit@devanagari@numerals
\sanskrit@devanagari@numeralstrue
-\define@choicekey*+{sanskrit}{numerals}[\xpg@val\xpg@nr]{devanagari,western}[devanagari]{%
- \ifcase\xpg@nr\relax
- % devanagari:
- \sanskrit@devanagari@numeralstrue%
- \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-deva}%
- \or
- % western:
- \sanskrit@devanagari@numeralsfalse%
- \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Sanskrit, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Sanskrit numeral `#1'}}
+\DeclareKeys[polyglossia/gloss/sanskrit]
+ {
+ script.code = \@ifundefined{fontsetup@sanskrit@#1}%
+ {\xpg@error{`#1' is not a valid script for Sanskrit}}%
+ {\csname fontsetup@sanskrit@#1\endcsname},
+ script.default:n = devanagari,
+ numerals.choice:,
+ numerals / devanagari.code =
+ {%
+ \sanskrit@devanagari@numeralstrue
+ \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-deva}%
+ },
+ numerals / western.code =
+ {%
+ \sanskrit@devanagari@numeralsfalse
+ \SetLanguageKeys{sanskrit}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = devanagari,
+ numerals/unknown.code = \xpg@warning{Unknown Sanskrit numeral `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{sanskrit}{script=devanagari,numerals=devanagari}
+\InitializeGlossOptions{sanskrit}{script=devanagari,numerals=devanagari}
% Use \providecommand here as the ldf file might
% be reloaded via BCP.
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf
index a53cd0c6d3f..562e7358a5e 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-scottish.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-scottish.ldf}[polyglossia: module for Scottish Gaelic]
% We only provide this gloss for babel compatibility. Since scottish is
% a gaelic variety, we use 'gaelic' with variant 'scottish' now.
-\xpg@load@master@language{gaelic}
+\InheritGlossFile{gaelic}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf
index 3a80bdd1370..3bc4740ebb4 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-serbian.ldf}[polyglossia: module for Serbian]
%TODO split into gloss-serbiancyr.ldf and gloss-serbianlat.ldf
@@ -39,67 +39,10 @@
\fi
\newif\if@serbian@cyr
-\define@choicekey*+{serbian}{Script}[\xpg@val\xpg@nr]{cyrillic,latin}[cyrillic]{%
- \ifcase\xpg@nr\relax
- % cyrillic:
- \@serbian@cyrtrue
- \xpg@fontsetup@nonlatin{serbian}%
- \or
- % latin:
- \@serbian@cyrfalse
- \xpg@fontsetup@latin{serbian}%
- %TODO \def\serbian@language{\language=\l@serbianlat}%
- % or should we use Croatian patterns as a fallback for the time being???
- \fi
- \serbian@set@languagekeys%
- \xpg@info{Option: Serbian, script=\xpg@val}%
-}{\xpg@warning{Unknown Serbian script `#1'}}
-
-\define@key{serbian}{script}[cyrillic]{\setkeys{serbian}{Script=#1}}
-
\newif\if@serbian@ijekavian
-\define@choicekey*+{serbian}{variant}[\xpg@val\xpg@nr]{ekavian,ijekavian}[ekavian]{%
- \ifcase\xpg@nr\relax
- % ekavian:
- \@serbian@ijekavianfalse%
- \or
- % ijekavian:
- \@serbian@ijekaviantrue%
- \fi
- \serbian@set@languagekeys%
- \xpg@info{Option: Serbian, variant=\xpg@val}%
-}{\xpg@warning{Unknown Serbian variant `#1'}}
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{serbian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-latn}%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
- \fi
- \xpg@info{Option: Serbian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Serbian numerals value `#1'}}
-
-\define@boolkey{serbian}[serbian@]{splithyphens}[true]{}
-
-\define@boolkey{serbian}[serbian@]{datei}[true]{}
\def\serbian@set@languagekeys{%
\if@serbian@cyr
@@ -117,10 +60,75 @@
\fi%
}
-\setkeys{serbian}{Script,numerals}
+\DeclareKeys[polyglossia/gloss/serbian]
+ {
+ splithyphens.if = serbian@splithyphens,
+ splithyphens.default:n = true,
+ datei.if = serbian@datei,
+ datei.default:n = true,
+ variant.choice:,
+ variant / ekavian.code =
+ {%
+ \@serbian@ijekavianfalse
+ \serbian@set@languagekeys
+ },
+ variant / ijekavian.code =
+ {%
+ \@serbian@ijekaviantrue
+ \serbian@set@languagekeys
+ },
+ variant.default:n = ekavian,
+ variant/unknown.code = \xpg@warning{Unknown Serbian variant `#1'},
+ script.choice:,
+ script / cyrillic.code =
+ {%
+ \@serbian@cyrtrue
+ \SetupNonLatinPolyglossiaFont{serbian}%
+ \serbian@set@languagekeys
+ },
+ script / latin.code =
+ {%
+ \@serbian@cyrfalse
+ \SetupLatinPolyglossiaFont{serbian}%
+ %TODO \def\serbian@language{\language=\l@serbianlat}%
+ % or should we use Croatian patterns as a fallback for the time being???
+ \serbian@set@languagekeys
+ },
+ script.default:n = cyrillic,
+ script/unknown.code = \xpg@warning{Unknown Serbian script `#1'},
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{serbian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ \SetLanguageKeys{serbian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Serbian numerals value `#1'}
+ }
+
+\SetGlossOptions{serbian}{script,numerals}
% Register default options
-\xpg@initialize@gloss@options{serbian}{script=cyrillic,numerals=arabic,splithyphens=true}
+\InitializeGlossOptions{serbian}{script=cyrillic,numerals=arabic,splithyphens=true}
\def\captionsserbian{%
\if@serbian@cyr\captionsserbian@cyr\else\captionsserbian@lat\fi
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbianc.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbianc.ldf
index 7e395fbb602..5493765d9b6 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-serbianc.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-serbianc.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-serbianc.ldf}[polyglossia: module for Serbian (cyrillic)]
% We provide this as a babel alias
-\xpg@load@master@language{serbian}
+\InheritGlossFile{serbian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf
index 863b9babde3..b08d84335ed 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-slovak.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-slovak.ldf}[polyglossia: module for Slovak]
@@ -19,26 +19,26 @@
\RequirePackage{luavlna}
\fi
-\define@boolkey{slovak}[slovak@]{babelshorthands}[true]{}
-
-\define@boolkey{slovak}[slovak@]{splithyphens}[true]{}
-
-\define@boolkey{slovak}[slovak@]{vlna}[true]{}
+\DeclareKeys[polyglossia/gloss/slovak]
+ {
+ babelshorthands.if = slovak@babelshorthands,
+ babelshorthands.default:n = true,
+ splithyphens.if = slovak@splithyphens,
+ splithyphens.default:n = true,
+ vlna.if = slovak@vlna,
+ vlna.default:n = true,
+ }
% Register default options
-\xpg@initialize@gloss@options{slovak}{babelshorthands=false,splithyphens=true,vlna=true}
+\InitializeGlossOptions{slovak}{babelshorthands=false,splithyphens=true,vlna=true}
\ifsystem@babelshorthands
- \setkeys{slovak}{babelshorthands=true}
+ \SetGlossOptions{slovak}{babelshorthands=true}
\else
- \setkeys{slovak}{babelshorthands=false}
+ \SetGlossOptions{slovak}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\let\xpg@hyphen@char-
\def\slovak@@splhyphen#1{%
@@ -214,7 +214,7 @@
\def\contentsname{Obsah}%
\def\listfigurename{Zoznam obrázkov}%
\def\listtablename{Zoznam tabuliek}%
- \def\indexname{Index}%
+ \def\indexname{Register}%
\def\figurename{Obrázok}%
\def\tablename{Tabuľka}%
%\def\thepart{}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-slovene.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-slovene.ldf
index 4b932a45446..ce2de8083c9 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-slovene.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-slovene.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-slovene.ldf}[polyglossia: module for Slovenian]
% We provide this as a babel alias
-\xpg@load@master@language{slovenian}
+\InheritGlossFile{slovenian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf
index 2b574559ead..5a08442e3f0 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-slovenian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-slovenian.ldf}[polyglossia: module for Slovenian]
@@ -19,10 +19,14 @@
% Babel aliases
\setlanguagealias{slovenian}{slovene}
-\define@boolkey{slovenian}[slovenian@]{localalph}[true]{}
+\DeclareKeys[polyglossia/gloss/slovenian]
+ {
+ localalph.if = slovenian@localalph,
+ localalph.default:n = true
+ }
% Register default options
-\xpg@initialize@gloss@options{slovenian}{localalph=false}
+\InitializeGlossOptions{slovenian}{localalph=false}
\def\captionsslovenian{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf
index 27b0274d218..c7b0a1c0ce8 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-sorbian.ldf}[polyglossia: module for Sorbian]
@@ -26,60 +26,40 @@
\setlanguagealias[variant=upper]{sorbian}{uppersorbian}
\def\sorbian@variant{usorbian}
-\define@choicekey*+{sorbian}{variant}[\xpg@val\xpg@nr]{upper,lower}[upper]{%
- \ifcase\xpg@nr\relax
- % upper:
- \def\sorbian@variant{usorbian}%
- \SetLanguageKeys{sorbian}{language=Upper Sorbian,langtag=USB,babelname=uppersorbian,bcp47=hsb,bcp47-language=hsb}%
- \xpg@fontsetup@latin{sorbian}%
- % Check if \l@usorbian is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{usorbian}{}{%
- \def\do##1{%
- \xpg@ifdefined{##1}%
- {\csletcs{l@usorbian}{l@##1}\listbreak}%
- {}%
- }%
- \docsvlist{uppersorbian}
- \xpg@ifdefined{usorbian}{}{%
- \xpg@warning{No hyphenation patterns for Upper Sorbian found\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@usorbian0%
- }
- }%
- \or
- % lower:
- \def\sorbian@variant{lsorbian}%
- \SetLanguageKeys{sorbian}{language=Lower Sorbian,langtag=LSB,babelname=lowersorbian,bcp47=dsb,bcp47-language=dsb}%
- \xpg@fontsetup@latin{sorbian}%
- % Check if \l@lsorbian is defined. If not, try to set it to some variety
- % (specific order as in the csv list below), or null language if everything fails
- \xpg@ifdefined{lsorbian}{}{%
- \def\do##1{%
- \xpg@ifdefined{##1}%
- {\csletcs{l@lsorbian}{l@##1}\listbreak}%
- {}%
- }%
- \docsvlist{lowersorbian,Lsorbian,usorbian,uppersorbian}
- \xpg@ifdefined{lsorbian}{}{%
- \xpg@warning{No hyphenation patterns for Lower Sorbian found\MessageBreak
- I will use the 'null' language instead}%
- \adddialect\l@lsorbian0%
- }
- }%
- \fi
- \xpg@info{Option: sorbian, variant=\xpg@val}%
-}{\xpg@warning{Unknown sorbian variant `#1'}}
-
-
-\define@boolkey{sorbian}[sorbian@]{olddate}[true]{}
+
+\DeclareKeys[polyglossia/gloss/sorbian]
+ {
+ olddate.if = sorbian@olddate,
+ olddate.default:n = true,
+ variant.choice:,
+ variant / upper.code =
+ {%
+ \def\sorbian@variant{usorbian}%
+ \SetLanguageKeys{sorbian}{language=Upper Sorbian,langtag=USB,babelname=uppersorbian,bcp47=hsb,bcp47-language=hsb}%
+ \SetupLatinPolyglossiaFont{sorbian}%
+ % Check if \l@usorbian is defined. If not, try to set it to some variety
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{usorbian}{uppersorbian}%
+ },
+ variant / lower.code =
+ {%
+ \def\sorbian@variant{lsorbian}%
+ \SetLanguageKeys{sorbian}{language=Lower Sorbian,langtag=LSB,babelname=lowersorbian,bcp47=dsb,bcp47-language=dsb}%
+ \SetupLatinPolyglossiaFont{sorbian}%
+ % Check if \l@lsorbian is defined. If not, try to set it to some variety
+ % (specific order as in the csv list), or null language if everything fails
+ \TryPatternWithFallback{lsorbian}{lowersorbian,Lsorbian,usorbian,uppersorbian}%
+ },
+ variant.default:n = upper,
+ variant/unknown.code = \xpg@warning{Unknown sorbian variant `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{sorbian}{variant=upper,olddate=false}
+\InitializeGlossOptions{sorbian}{variant=upper,olddate=false}
\def\sorbian@language{%
- \polyglossia@setup@language@patterns{\sorbian@variant}%
+ \SetupPolyglossiaLangPatterns{\sorbian@variant}%
}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf
index c7f6358f047..0b5b128ae2a 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-spanish.ldf}[polyglossia: module for Spanish]
@@ -27,52 +27,58 @@
\newif\if@spanish@mexico
\@spanish@mexicofalse
-\define@choicekey*+{spanish}{variant}[\xpg@val\xpg@nr]{spanish,mexican}[spanish]{%
- \ifcase\xpg@nr\relax
- % spanish:
- \@spanish@mexicofalse%
- \SetLanguageKeys{spanish}{babelname=spanish,bcp47=es-ES,bcp47-region=ES}%
- \or
- % mexican:
- \@spanish@mexicotrue%
- \SetLanguageKeys{spanish}{babelname=spanishmx,bcp47=es-MX,bcp47-region=MX}%
- \fi
- \xpg@info{Option: spanish, variant=\xpg@val}%
-}{\xpg@warning{Unknown spanish variant `#1'}}
% Localized math operators à la babel
\newif\ifspanish@accentedoperators
\newif\ifspanish@spacedoperators
\newif\ifspanish@locoperators
-\define@choicekey*+{spanish}{spanishoperators}[\xpg@val\xpg@nr]{all,accented,spaced,none}[all]{%
- \ifcase\xpg@nr\relax
- % all:
- \spanish@locoperatorstrue%
- \spanish@accentedoperatorstrue%
- \spanish@spacedoperatorstrue%
- \or
- % accented:
- \spanish@locoperatorsfalse%
- \spanish@accentedoperatorstrue%
- \spanish@spacedoperatorsfalse%
- \or
- % spaced:
- \spanish@locoperatorsfalse%
- \spanish@accentedoperatorsfalse%
- \spanish@spacedoperatorstrue%
- \or
- % none:
- \spanish@locoperatorsfalse%
- \spanish@accentedoperatorsfalse%
- \spanish@spacedoperatorsfalse%
- \fi
- \xpg@info{Option: Spanish, spanishoperators=\xpg@val}%
-}{\xpg@warning{Unknown spanishoperators value `#1'}}
-
+\DeclareKeys[polyglossia/gloss/spanish]
+ {
+ variant.choice:,
+ variant / spanish.code =
+ {%
+ \@spanish@mexicofalse
+ \SetLanguageKeys{spanish}{babelname=spanish,bcp47=es-ES,bcp47-region=ES}%
+ },
+ variant / mexican.code =
+ {%
+ \@spanish@mexicotrue
+ \SetLanguageKeys{spanish}{babelname=spanishmx,bcp47=es-MX,bcp47-region=MX}%
+ },
+ variant.default:n = spanish,
+ variant/unknown.code = \xpg@warning{Unknown spanish variant `#1'},
+ spanishoperators.choice:,
+ spanishoperators / all.code =
+ {%
+ \spanish@locoperatorstrue
+ \spanish@accentedoperatorstrue
+ \spanish@spacedoperatorstrue
+ },
+ spanishoperators / accented.code =
+ {%
+ \spanish@locoperatorsfalse
+ \spanish@accentedoperatorstrue
+ \spanish@spacedoperatorsfalse
+ },
+ spanishoperators / spaced.code =
+ {%
+ \spanish@locoperatorsfalse
+ \spanish@accentedoperatorsfalse
+ \spanish@spacedoperatorstrue
+ },
+ spanishoperators / none.code =
+ {%
+ \spanish@locoperatorsfalse
+ \spanish@accentedoperatorsfalse
+ \spanish@spacedoperatorsfalse
+ },
+ spanishoperators.default:n = all,
+ spanishoperators/unknown.code = \xpg@warning{Unknown spanishoperators value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{spanish}{variant=spanish,spanishoperators=none}
+\InitializeGlossOptions{spanish}{variant=spanish,spanishoperators=none}
\let\xpg@save@lim\lim
\let\xpg@save@limsup\limsup
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-spanishmx.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-spanishmx.ldf
index 850f5564ec5..4c0e71b0235 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-spanishmx.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-spanishmx.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-spanishmx.ldf}[polyglossia: module for Mexican Spanish]
% We provide this as a babel alias
-\xpg@load@master@language{spanish}
+\InheritGlossFile{spanish}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-swedish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-swedish.ldf
index a47304f1291..142a4b2d795 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-swedish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-swedish.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-swedish.ldf}[polyglossia: module for Swedish]
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-swissgerman.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-swissgerman.ldf
index fe679140556..9ab9f7e8d57 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-swissgerman.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-swissgerman.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-swissgerman.ldf}[polyglossia: module for Swiss German (old spelling)]
% We provide this as a babel alias
-\xpg@load@master@language{german}
+\InheritGlossFile{german}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf
index 7bd32c3ddcd..e93148da005 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-syriac.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-syriac.ldf}[polyglossia: module for Syriac]
@@ -22,34 +22,37 @@
% BCP-47 compliant aliases
\setlanguagealias*{syriac}{syr}
-\def\syriacnumber#1{\@syriacnumber{#1}}%
+\def\syriacnumber#1{\@syriacnumber{#1}}
\newif\if@eastern@numerals
-\define@choicekey*+{syriac}{numerals}[\xpg@val\xpg@nr]{eastern,western,abjad}[eastern]{%
- \ifcase\xpg@nr\relax
- % eastern:
- \@eastern@numeralstrue
- \SetLanguageKeys{syriac}{bcp47-extension-u=nu-syrc}%
- \or
- % western:
- \@eastern@numeralsfalse
- \SetLanguageKeys{syriac}{bcp47-extension-u=nu-latn}%
- \or
- % abjad:
- \let\syriacnumber\abjadsyriac%
- \fi
- \xpg@info{Option: Syriac, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Syriac numerals option `#1'}}
-
\newif\ifsyriac@customsep\syriac@customsepfalse
\def\xpg@sepmark{}
-\define@key{syriac}{sectionsep}[.]{%
- \syriac@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
+
+\DeclareKeys[polyglossia/gloss/syriac]
+ {
+ sectionsep.code = \gdef\xpg@sepmark{#1}\syriac@customseptrue,
+ sectionsep.default:n = .,
+ numerals.choice:,
+ numerals / eastern.code =
+ {%
+ \@eastern@numeralstrue
+ \SetLanguageKeys{syriac}{bcp47-extension-u=nu-syrc}%
+ },
+ numerals / western.code =
+ {%
+ \@eastern@numeralsfalse
+ \SetLanguageKeys{syriac}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / abjad.code =
+ {%
+ \let\syriacnumber\abjadsyriac
+ },
+ numerals.default:n = eastern,
+ numerals/unknown.code = \xpg@warning{Unknown Syriac numerals option `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{syriac}{numerals=western}
+\InitializeGlossOptions{syriac}{numerals=western}
%\define@key{polyglossia}{syriaclocale}[default]{%
% \def\@syriac@locale{#1}}
@@ -136,13 +139,13 @@
\IfCharIsAvailableTF{0661}%
{\@ensure@LTR{\protect\arabicdigits{\number#1}}}%
{\@ensure@LTR{\arabicdigits{\number#1}}
- \ifcsdef{arabicfont}%
- {\@ensure@LTR{\protect\arabicdigits{\number#1}}%
- \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
- I am using \string\arabicfont instead}}%
+ \@ifundefined{arabicfont}%
{\number#1%%% <---changed from \RL{\protect\reset@font\protect\number#1}%
\xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
since \string\arabicfont is not defined, we'll use Western numerals instead}}%
+ {\@ensure@LTR{\protect\arabicdigits{\number#1}}%
+ \xpg@warning{You have specified the option numerals=eastern for Syriac, but the Syriac font does not contain the appropriate glyphs:
+ I am using \string\arabicfont instead}}%
}%
\else
%%\RL{\protect\reset@font\number#1}%
@@ -180,16 +183,16 @@
}
\def\nosyriac@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi%
}
\def\syriac@luatex@capsformat{%
%
% change chapter and part headings
\ifsyriac@customsep
- \ifcsdef{chapter}{%
+ \ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
@@ -201,7 +204,7 @@
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
+ \fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
@@ -216,30 +219,30 @@
}
\def\nosyriac@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
+ \ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
+ \fi%
+ \ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
+ \fi%
+ \ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
+ \fi%
+ \ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
+ \fi%
+ \ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
+ \ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
+ \fi%
+ \fi%
+ \ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
+ \fi%
+ \ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \fi%
}
\def\blockextras@syriac{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-tamil.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-tamil.ldf
index 3d737cfe785..38b4a1e7ba9 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-tamil.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-tamil.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-tamil.ldf}[polyglossia: module for Tamil]
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-telugu.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-telugu.ldf
index 25f4b29971f..dfe53caabd4 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-telugu.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-telugu.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-telugu.ldf}[polyglossia: module for Telugu]
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf
index ed530fbac5c..bfaa96cb1ed 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-thai.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-thai.ldf}[polyglossia: module for Thai]
%% This is partly based on thai-latex for Babel:
@@ -29,19 +29,25 @@
\newif\if@thai@numerals
\def\tmp@thai{thai}
-\define@key{thai}{numerals}[arabic]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@thai
- \@thai@numeralstrue%
- \SetLanguageKeys{thai}{bcp47-extension-u=nu-thai}%
- \else
- \@thai@numeralsfalse%
- \SetLanguageKeys{thai}{bcp47-extension-u=nu-latn}%
- \fi
-}
+
+\DeclareKeys[polyglossia/gloss/thai]
+ {
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \@thai@numeralsfalse
+ \SetLanguageKeys{thai}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / thai.code =
+ {%
+ \@thai@numeralstrue
+ \SetLanguageKeys{thai}{bcp47-extension-u=nu-thai}%
+ },
+ numerals.default:n = arabic,
+ }
% Register default options
-\xpg@initialize@gloss@options{thai}{numerals=arabic}
+\InitializeGlossOptions{thai}{numerals=arabic}
\def\captionsthai{%
\def\refname{หนังสืออ้างอิง}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-tibetan.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-tibetan.ldf
index 70de9a9ac24..b8223fe8458 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-tibetan.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-tibetan.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-tibetan.ldf}[polyglossia: module for Tibetan]
%% Copyright 2013 Elie Roux
@@ -24,20 +24,18 @@
\setlanguagealias*{tibetan}{bo}
\newif\if@tibetan@numerals
-\def\tmp@tibetan{tibetan}
-\define@key{tibetan}{numerals}[tibetan]{%
- \def\@tmpa{#1}%
- \ifx\@tmpa\tmp@tibetan
- \@tibetan@numeralstrue%
- \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-tibt}%
- \else
- \@tibetan@numeralsfalse%
- \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-latn}%
- \fi%
-}
+\DeclareKeys[polyglossia/gloss/tibetan]
+ {
+ numerals.choice:,
+ numerals/tibetan.code = \@tibetan@numeralstrue
+ \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-tibt},
+ numerals/arabic.code = \@tibetan@numeralsfalse
+ \SetLanguageKeys{tibetan}{bcp47-extension-u=nu-latn},
+ numerals.default:n = tibetan
+ }
\ifluatex
- \newluatexattribute\xpg@tibteol %
+ \newattribute\xpg@tibteol %
\directlua{polyglossia.load_tibt_eol()}%
\fi
@@ -62,7 +60,7 @@
}
% Register default options
-\xpg@initialize@gloss@options{tibetan}{numerals=tibetan}
+\InitializeGlossOptions{tibetan}{numerals=tibetan}
% some are known, but very few
% a few come from "Standardizing Tibetan Terms of Information Technology"
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-turkish.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-turkish.ldf
index a6784ae276b..da46f8a6dda 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-turkish.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-turkish.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-turkish.ldf}[polyglossia: module for Turkish]
\RequirePackage{hijrical}
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-turkmen.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-turkmen.ldf
index 9ec398470e3..af159166235 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-turkmen.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-turkmen.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-turkmen.ldf}[polyglossia: module for Turkmen]
%% Translations provided by Nazar Annagurban <nazartm at gmail dot com>
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ug.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ug.ldf
index 8093324dd00..65faa3e0795 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ug.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ug.ldf
@@ -1,8 +1,8 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ug.ldf}[polyglossia: module for ug (Uyghur)]
% BCP 47 tag for Uyghur
-\xpg@load@master@language{uyghur}
+\InheritGlossFile{uyghur}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf
index bf09149725d..4a9674f2feb 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-ukrainian.ldf}[polyglossia: module for Ukrainian]
% Strings taken from Babel
@@ -26,51 +26,52 @@
\newif\ifcyrillic@numerals
\newif\ifcyrillic@asbuk@numerals
-\define@choicekey*+{ukrainian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
- \ifcase\xpg@nr\relax
- % arabic:
- \cyrillic@numeralsfalse%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-latn}%
- \or
- % cyrillic:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-trad:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralsfalse%
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
- \or
- % cyrillic-alph:
- \cyrillic@numeralstrue%
- \cyrillic@asbuk@numeralstrue%
- \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
- \fi
- \xpg@info{Option: Ukrainian, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Ukrainian numerals value `#1'}}
-
-% Define some math functions
-\define@boolkey{ukrainian}[ukrainian@]{mathfunctions}[true]{}
+\DeclareKeys[polyglossia/gloss/ukrainian]
+ {
+ babelshorthands.if = ukrainian@babelshorthands,
+ babelshorthands.default:n = true,
+ mathfunctions.if = ukrainian@mathfunctions,
+ mathfunctions.default:n = true,
+ numerals.choice:,
+ numerals / arabic.code =
+ {%
+ \cyrillic@numeralsfalse
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-latn}%
+ },
+ numerals / cyrillic.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-trad.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralsfalse
+ \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals / cyrillic-alph.code =
+ {%
+ \cyrillic@numeralstrue
+ \cyrillic@asbuk@numeralstrue
+ \SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}%
+ },
+ numerals.default:n = arabic,
+ numerals/unknown.code = \xpg@warning{Unknown Ukrainian numerals value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{ukrainian}{numerals=arabic,mathfunctions=true}
-
-\define@boolkey{ukrainian}[ukrainian@]{babelshorthands}[true]{}
+\InitializeGlossOptions{ukrainian}{numerals=arabic,mathfunctions=true}
\ifsystem@babelshorthands
- \setkeys{ukrainian}{babelshorthands=true}
+ \SetGlossOptions{ukrainian}{babelshorthands=true}
\else
- \setkeys{ukrainian}{babelshorthands=false}
+ \SetGlossOptions{ukrainian}{babelshorthands=false}
\fi
-\ifcsundef{initiate@active@char}{%
- \input{babelsh.def}%
- \initiate@active@char{"}%
- \shorthandoff{"}%
-}{}
+\InitializeBabelShorthands
\def\ukrainian@shorthands{%
\xpg@activate@shorthands%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-uppersorbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-uppersorbian.ldf
index 9ca440a885c..418551d25f3 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-uppersorbian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-uppersorbian.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-uppersorbian.ldf}[polyglossia: module for Upper Sorbian]
% We provide this as a babel alias
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf
index f95459e7d5b..47af125a2b7 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-urdu.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
%%% Adapted from a file contributed by Kamal Abdali
\ProvidesFile{gloss-urdu.ldf}[polyglossia: module for Urdu]
@@ -25,52 +25,46 @@
\setlanguagealias*{urdu}{ur}
\newif\if@western@numerals
-\define@choicekey*+{urdu}{numerals}[\xpg@val\xpg@nr]{eastern,western}[eastern]{%
- \ifcase\xpg@nr\relax
- % eastern:
- \@western@numeralsfalse%
- \SetLanguageKeys{urdu}{bcp47-extension-u=nu-arab}%
- \or
- % western:
- \@western@numeralstrue%
- \SetLanguageKeys{urdu}{bcp47-extension-u=nu-latn}%
- \fi
- \xpg@info{Option: Urdu, numerals=\xpg@val}%
-}{\xpg@warning{Unknown Urdu numerals option `#1'}}
-
\newif\ifurdu@customsep\urdu@customsepfalse
\def\xpg@sepmark{}
-\define@key{urdu}{sectionsep}[.]{%
- \urdu@customseptrue%
- \gdef\xpg@sepmark{#1}%
-}
-
-%this is needed for \abjad in arabicnumbers.sty
-\define@boolkey{urdu}[urdu@]{abjadjimnotail}[true]{%
- \ifurdu@abjadjimnotail
- \abjad@jim@notailtrue%
- \else
- \abjad@jim@notailfalse
- \fi%
-}
-
\newif\if@hijrical
-\define@choicekey*+{urdu}{calendar}[\xpg@val\xpg@nr]{gregorian,hijri}[gregorian]{%
- \ifcase\xpg@nr\relax
- % gregorian:
- \@hijricalfalse
- \or
- % hijri:
- \@hijricaltrue
- \fi
- \xpg@info{Option: Urdu, calendar=\xpg@val}%
-}{\xpg@warning{Unknown Urdu calendar option `#1'}}
-\define@key{urdu}{hijricorrection}[0]{%
- \gdef\urdu@hijri@correction{#1}}%
+\DeclareKeys[polyglossia/gloss/urdu]
+ {
+ abjadjimnotail.if = abjad@jim@notail,
+ abjadjimnotail.default:n = true,
+ sectionsep.code = \gdef\xpg@sepmark{#1}\urdu@customseptrue,
+ sectionsep.default:n = .,
+ hijricorrection.code = \gdef\urdu@hijri@correction{#1},
+ hijricorrection.default:n = 0,
+ calendar.choice:,
+ calendar / gregorian.code =
+ {%
+ \@hijricalfalse
+ },
+ calendar / hijri.code =
+ {%
+ \@hijricaltrue
+ },
+ calendar.default:n = gregorian,
+ calendar/unknown.code = \xpg@warning{Unknown Urdu calendar option `#1'},
+ numerals.choice:,
+ numerals / eastern.code =
+ {%
+ \@western@numeralsfalse
+ \SetLanguageKeys{urdu}{bcp47-extension-u=nu-arab}%
+ },
+ numerals / western.code =
+ {%
+ \@western@numeralstrue
+ \SetLanguageKeys{urdu}{bcp47-extension-u=nu-latn}%
+ },
+ numerals.default:n = eastern,
+ numerals/unknown.code = \xpg@warning{Unknown Urdu numerals option `#1'}
+ }
% This should set the defaults
-\setkeys{urdu}{calendar,numerals,hijricorrection}
+\SetGlossOptions{urdu}{calendar,numerals,hijricorrection}
\def\urdugregmonth#1{\ifcase#1%
\or جنوری\or فروری\or مارچ\or اپریل\or مئی\or جون\or جولائی\or اگست\or ستمبر\or اکتوبر\or نومبر\or دسمبر\fi}
@@ -157,16 +151,16 @@
}
\def\nourdu@xetex@capsformat{%
- \ifcsdef{xpg@save@sepmark}{%
+ \ifcsname xpg@save@sepmark\endcsname%
\SepMark{\xpg@save@sepmark}
- }{}%
+ \fi%
}
\def\urdu@luatex@capsformat{%
%
% change chapter and part headings
\ifurdu@customsep
- \ifcsdef{chapter}{%
+ \ifcsname chapter\endcsname%
\let\xpg@save@thesection\thesection%
\renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section}
\let\xpg@save@theequation\theequation%
@@ -178,7 +172,7 @@
\let\xpg@save@thetable\thetable%
\renewcommand*\thetable{%
\ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table}
- }{}
+ \fi%
\let\xpg@save@thesubsection\thesubsection%
\renewcommand\thesubsection
{\thesection\xpg@sepmark\@arabic\c@subsection}
@@ -193,30 +187,30 @@
}
\def\nourdu@luatex@capsformat{%
- \ifcsdef{xpg@save@thesection}{%
+ \ifcsname xpg@save@thesection\endcsname%
\let\thesection\xpg@save@thesection%
- }{}%
- \ifcsdef{xpg@save@theequation}{%
+ \fi%
+ \ifcsname xpg@save@theequation\endcsname%
\let\theequation\xpg@save@theequation%
- }{}%
- \ifcsdef{xpg@save@thefigure}{%
+ \fi%
+ \ifcsname xpg@save@thefigure\endcsname%
\let\thefigure\xpg@save@thefigure%
- }{}%
- \ifcsdef{xpg@save@thetable}{%
+ \fi%
+ \ifcsname xpg@save@thetable\endcsname%
\let\thetable\xpg@save@thetable%
- }{}%
- \ifcsdef{xpg@save@thesubsection}{%
+ \fi%
+ \ifcsname xpg@save@thesubsection\endcsname%
\let\thesubsection\xpg@save@thesubsection%
- \ifcsdef{xpg@save@thesubsubsection}{%
+ \ifcsname xpg@save@thesubsubsection\endcsname%
\let\thesubsubsection\xpg@save@thesubsubsection%
- }{}%
- }{}%
- \ifcsdef{xpg@save@theparagraph}{%
+ \fi%
+ \fi%
+ \ifcsname xpg@save@theparagraph\endcsname%
\let\theparagraph\xpg@save@theparagraph%
- }{}%
- \ifcsdef{xpg@save@thesubparagraph}{%
+ \fi%
+ \ifcsname xpg@save@thesubparagraph\endcsname%
\let\thesubparagraph\xpg@save@thesubparagraph%
- }{}%
+ \fi%
}
\def\blockextras@urdu{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf
index 028f7987e0d..9c33a8be580 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-usorbian.ldf
@@ -1,10 +1,10 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-usorbian.ldf}[polyglossia: module for Upper Sorbian]
% We only provide this gloss for babel compatibility. Since usorbian is
% a sorbian variety, we use 'sorbian' with variant 'upper' now.
-\xpg@load@master@language{sorbian}
+\InheritGlossFile{sorbian}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-uyghur.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-uyghur.ldf
index 4d2c0bde96b..b96e21cda77 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-uyghur.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-uyghur.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-uyghur.ldf}[polyglossia: module for Uyghur]
%% Translations provided by Osman Tursun (Github Account: neouyghur)
@@ -22,62 +22,72 @@
\newif\if@uyghur@swapcaptions
\newif\if@uyghur@swapheadings
\newif\if@uyghur@swapheaders
-\define@choicekey*+{uyghur}{swapstrings}[\xpg@val\xpg@nr]{all,captions,headings,headers,hheaders,none}[all]{%
- \ifcase\xpg@nr\relax
- % all:
- \@uyghur@swapcaptionstrue%
- \@uyghur@swapheadingstrue%
- \@uyghur@swapheaderstrue%
- \or
- % captions:
- \@uyghur@swapcaptionstrue%
- \@uyghur@swapheadingsfalse%
- \@uyghur@swapheadersfalse%
- \or
- % headings:
- \@uyghur@swapcaptionsfalse%
- \@uyghur@swapheadingstrue%
- \@uyghur@swapheadersfalse%
- \or
- % headers:
- \@uyghur@swapcaptionsfalse%
- \@uyghur@swapheadingsfalse%
- \@uyghur@swapheaderstrue%
- \or
- % hheaders:
- \@uyghur@swapcaptionsfalse%
- \@uyghur@swapheadingstrue%
- \@uyghur@swapheaderstrue%
- \or
- % none:
- \@uyghur@swapcaptionsfalse%
- \@uyghur@swapheadingsfalse%
- \@uyghur@swapheadersfalse%
- \fi
- \xpg@info{Option: Uyghur, swapstrings=\xpg@val}%
-}{\xpg@warning{Unknown Uyghur swapstrings value `#1'}}
-
\newif\if@uyghur@ordchapter
\newif\if@uyghur@romchapter
-\define@choicekey*+{uyghur}{chapterformat}[\xpg@val\xpg@nr]{ordinal,roman,arabic}[ordinal]{%
- \ifcase\xpg@nr\relax
- % ordinal:
- \@uyghur@ordchaptertrue%
- \@uyghur@romchapterfalse%
- \or
- % roman:
- \@uyghur@ordchapterfalse%
- \@uyghur@romchaptertrue%
- \or
- % arabic:
- \@uyghur@ordchapterfalse%
- \@uyghur@romchapterfalse%
- \fi
- \xpg@info{Option: Uyghur, chapterformat=\xpg@val}%
-}{\xpg@warning{Unknown Uyghur chapterformat value `#1'}}
+
+\DeclareKeys[polyglossia/gloss/uyghur]
+ {
+ chapterformat.choice:,
+ chapterformat / ordinal.code =
+ {%
+ \@uyghur@ordchaptertrue
+ \@uyghur@romchapterfalse
+ },
+ chapterformat / roman.code =
+ {%
+ \@uyghur@ordchapterfalse
+ \@uyghur@romchaptertrue
+ },
+ chapterformat / arabic.code =
+ {%
+ \@uyghur@ordchapterfalse
+ \@uyghur@romchapterfalse
+ },
+ chapterformat.default:n = ordinal,
+ chapterformat/unknown.code = \xpg@warning{Unknown Uyghur chapterformat value `#1'},
+ swapstrings.choice:,
+ swapstrings / all.code =
+ {%
+ \@uyghur@swapcaptionstrue
+ \@uyghur@swapheadingstrue
+ \@uyghur@swapheaderstrue
+ },
+ swapstrings / captions.code =
+ {%
+ \@uyghur@swapcaptionstrue
+ \@uyghur@swapheadingsfalse
+ \@uyghur@swapheadersfalse
+ },
+ swapstrings / headings.code =
+ {%
+ \@uyghur@swapcaptionsfalse
+ \@uyghur@swapheadingstrue
+ \@uyghur@swapheadersfalse
+ },
+ swapstrings / headers.code =
+ {%
+ \@uyghur@swapcaptionsfalse
+ \@uyghur@swapheadingsfalse
+ \@uyghur@swapheaderstrue
+ },
+ swapstrings / hheaders.code =
+ {%
+ \@uyghur@swapcaptionsfalse
+ \@uyghur@swapheadingstrue
+ \@uyghur@swapheaderstrue
+ },
+ swapstrings / none.code =
+ {%
+ \@uyghur@swapcaptionsfalse
+ \@uyghur@swapheadingsfalse
+ \@uyghur@swapheadersfalse
+ },
+ swapstrings.default:n = all,
+ swapstrings/unknown.code = \xpg@warning{Unknown Uyghur swapstrings value `#1'}
+ }
% Register default options
-\xpg@initialize@gloss@options{uyghur}{swapstrings=all,chapterformat=ordinal}
+\InitializeGlossOptions{uyghur}{swapstrings=all,chapterformat=ordinal}
\def\captionsuyghur{%
@@ -125,120 +135,104 @@
% change chapter and part headings
\if@uyghur@swapheadings
% With titlesec
- \ifcsdef{titleformat}{%
- \ifcsdef{H@old@part}{% Hyperref
- \let\xpg@save@part@format\H@old@part%
- \patchcmd{\H@old@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }{}%
- }
- \ifcsdef{chapter}{%
- \titleformat\chapter[display]%
- {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
- {\the@uyghur@chapter\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }{}%
- }{% (not \ifdefined\titleformat)
+ \@ifundefined{titleformat}{%
% With KOMA
- \ifcsdef{sectionformat}{%
- \ifcsdef{partformat}{%
- \let\xpg@save@part@format\partformat%
- \renewcommand{\partformat}{\the@uyghur@part~\partname}%
- }{}%
- \ifcsdef{chapterformat}{%
- \let\xpg@save@chap@format\chapterformat%
- \renewcommand{\chapterformat}{\mbox{\the@uyghur@chapter%
- \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
- }{}%
- }{% (not \ifdefined\sectionformat)
+ \@ifundefined{sectionformat}{%
% With memoir
- \ifcsdef{@memptsize}{%
- \ifcsdef{@makechapterhead}{%
- \let\xpg@save@chap@format\@makechapterhead%
- \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
- {\chapnumfont\the@uyghur@chapter\chapternamenum\printchaptername}%
- {}%
- {\xpg@warning{Failed to patch chapter for Uyghur}}%
- }{}%
- \ifcsdef{H@old@part}{% Hyperref
- \let\xpg@save@part@format\H@old@part%
- \patchcmd{\H@old@part}{\printpartname \partnamenum \printpartnum}%
- {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
- {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
- {}%
- {\xpg@warning{Failed to patch part for Uyghur}}%
- }{}%
- }%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{@makechapterhead}{%
+ \@ifundefined{@makechapterhead}{}{%
\let\xpg@save@chap@format\@makechapterhead%
\patchcmd{\@makechapterhead}%
{\@chapapp\space \thechapter}%
{\the@uyghur@chapter\space \@chapapp}%
{}%
{\xpg@warning{Failed to patch chapter for Uyghur}}%
- }{}%
- \ifcsdef{H@old@part}{% Hyperref
+ }%
+ \@ifundefined{H@old@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\the@uyghur@part\nobreakspace\partname}%
+ {}%
+ {\@ifundefined{part}{}{\xpg@warning{Failed to patch part for Uyghur}}}%
+ }% (end \ifdefined\@part)
+ }{% Hyperref
\let\xpg@save@part@format\H@old@part%
\patchcmd{\H@old@part}%
{\partname\nobreakspace\thepart}%
{\the@uyghur@part\nobreakspace\partname}%
{}%
{\xpg@warning{Failed to patch part for Uyghur}}%
- }{% not hyperref
- \ifcsdef{@part}{%
- \let\xpg@save@part@format\@part%
- \patchcmd{\@part}%
- {\partname\nobreakspace\thepart}%
- {\the@uyghur@part\nobreakspace\partname}%
- {}%
- {\ifcsdef{part}{\xpg@warning{Failed to patch part for Uyghur}}{}}%
- }{}% (end \ifdefined\@part)
}% (end not hyperref)
- }% (end \ifdefined\@memptsize)
- }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\@memptsize)
+ \@ifundefined{@makechapterhead}{}{%
+ \let\xpg@save@chap@format\@makechapterhead%
+ \patchcmd{\@makechapterhead}{\printchaptername \chapternamenum \printchapternum}%
+ {\chapnumfont\the@uyghur@chapter\chapternamenum\printchaptername}%
+ {}%
+ {\xpg@warning{Failed to patch chapter for Uyghur}}%
+ }%
+ \@ifundefined{H@old@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}{\printpartname \partnamenum \printpartnum}%
+ {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Uyghur}}%
+ }%
+ }{% Hyperref
+ \let\xpg@save@part@format\H@old@part%
+ \patchcmd{\H@old@part}{\printpartname \partnamenum \printpartnum}%
+ {\chapnumfont\the@uyghur@part\partnamenum\printpartname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Uyghur}}%
+ }%
+ }% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\sectionformat)
+ \@ifundefined{partformat}{}{%
+ \let\xpg@save@part@format\partformat%
+ \renewcommand{\partformat}{\the@uyghur@part~\partname}%
+ }%
+ \@ifundefined{chapterformat}{}{%
+ \let\xpg@save@chap@format\chapterformat%
+ \renewcommand{\chapterformat}{\mbox{\the@uyghur@chapter%
+ \IfUsePrefixLine{\nobreakspace\chapapp}{\enskip}}}%
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
+ \@ifundefined{H@old@part}{% not hyperref
+ \@ifundefined{@part}{}{%
+ \let\xpg@save@part@format\@part%
+ \patchcmd{\@part}%
+ {\partname\nobreakspace\thepart}%
+ {\the@uyghur@part\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Uyghur}}%
+ }%
+ }{% Hyperref
+ \let\xpg@save@part@format\H@old@part%
+ \patchcmd{\H@old@part}%
+ {\partname\nobreakspace\thepart}%
+ {\the@uyghur@part\nobreakspace\partname}%
+ {}%
+ {\xpg@warning{Failed to patch part for Uyghur}}%
+ }%
+ \@ifundefined{chapter}{}{%
+ \titleformat\chapter[display]%
+ {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
+ {\the@uyghur@chapter\space\@chapapp}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
+ }%
}% (end \ifdefined\titleformat)
\fi% (end \if@uyghur@swapheadings)
%
% Change running headers
\if@uyghur@swapheaders
- \ifcsdef{chapterformat}{%
- % With KOMA
- \let\xpg@save@chaptermark@format\chaptermarkformat%
- \renewcommand*\chaptermarkformat{%
- \the@uyghur@chapter\ \IfChapterUsesPrefixLine{\chapapp\enskip}{}}
- }{% (not \ifdefined\chapterformat)
- \ifcsdef{@memptsize}{%
- % With memoir
- \let\xpg@save@chaptermark@format\chaptermark%
- \renewcommand*\chaptermark[1]{%
- \markboth{\memUChead{%
- \ifnum \c@secnumdepth >\m@ne
- \ifbool{@mainmatter}{%
- \the@uyghur@chapter\ \@chapapp\ %
- }{}%
- \fi
- ##1}}{}}%
- }{% (not \ifdefined\@memptsize)
+ \@ifundefined{chapterformat}{%
+ \@ifundefined{@memptsize}{%
% With standard classes
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermark}{}{%
\ifpatchable{\chaptermark}%
{\@chapapp\ \thechapter.}%
{\let\xpg@save@chaptermark@format\chaptermark%
@@ -248,21 +242,38 @@
{}%
{\xpg@warning{Failed to patch chaptermark for Uyghur}}}%
{}%
- }{}% (end \ifdefined\sectionmark)
- \ifcsdef{sectionmark}{%
- \ifpatchable{\sectionmark}%
- {\thesection.}%
- {\let\xpg@save@sectionmark@format\sectionmark%
- \patchcmd{\sectionmark}%
- {\thesection.}%
- {\thesection}%
- {}%
- {\xpg@warning{Failed to patch sectionmark for Uyghur}}}%
- {}%
- }{}% (end \ifdefined\chaptermark)
+ }% (end \ifdefined\sectionmark)
+ \@ifundefined{sectionmark}{}{%
+ \ifpatchable{\sectionmark}%
+ {\thesection.}%
+ {\let\xpg@save@sectionmark@format\sectionmark%
+ \patchcmd{\sectionmark}%
+ {\thesection.}%
+ {\thesection}%
+ {}%
+ {\xpg@warning{Failed to patch sectionmark for Uyghur}}%
+ }%
+ {}%
+ }% (end \ifdefined\chaptermark)
+ }{% (\ifdefined\@memptsize)
+ % With memoir
+ \let\xpg@save@chaptermark@format\chaptermark%
+ \renewcommand*\chaptermark[1]{%
+ \markboth{\memUChead{%
+ \ifnum \c@secnumdepth >\m@ne
+ \ifbool{@mainmatter}{%
+ \the@uyghur@chapter\ \@chapapp\ %
+ }{}%
+ \fi
+ ##1}}{}}%
}% (end \ifdefined\@memptsize)
+ }{% (\ifdefined\chapterformat)
+ % With KOMA
+ \let\xpg@save@chaptermark@format\chaptermarkformat%
+ \renewcommand*\chaptermarkformat{%
+ \the@uyghur@chapter\ \IfChapterUsesPrefixLine{\chapapp\enskip}{}}
}% (end \ifdefined\chapterformat)
- \fi% (end \if@uyghur@swapheaders)
+ \fi% (end \if@uyghur@swapheaders)
}
\def\nouyghur@capsformat{%
@@ -272,62 +283,62 @@
\let\fnum@figure\xpg@save@fnum@figure%
%
% Reset chapter and part heading
- \ifcsdef{titleformat}{%
+ \@ifundefined{titleformat}{%
+ \@ifundefined{sectionformat}{%
+ % With memoir and standard classes
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{H@old@part}{%
+ \let\@part\xpg@save@part@format%
+ }{%
+ \let\H@old@part\xpg@save@part@format%
+ }%
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\@makechapterhead\xpg@save@chap@format
+ }%
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@part@format}{}{%
+ \let\partformat\xpg@save@part@format
+ }%
+ \@ifundefined{xpg@save@chap@format}{}{%
+ \let\chapterformat\xpg@save@chap@format
+ }%
+ }% (end \ifdefined\sectionformat)
+ }{% (\ifdefined\titleformat)
% With titlesec
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{H@old@part}{%
- \let\H@old@part\xpg@save@part@format%
- }{%
+ \@ifundefined{xpg@save@part@format}{}{%
+ \@ifundefined{H@old@part}{%
\let\@part\xpg@save@part@format%
+ }{%
+ \let\H@old@part\xpg@save@part@format%
}%
- }{}%
- \ifcsdef{chapter}{%
+ }%
+ \@ifundefined{chapter}{}{%
\titleformat\chapter[display]%
{\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6}
{\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit}
- }{}%
- }{% (not \ifdefined\titleformat)
- \ifcsdef{sectionformat}{%
- % With KOMA
- \ifcsdef{xpg@save@part@format}{%
- \let\partformat\xpg@save@part@format
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\chapterformat\xpg@save@chap@format
- }{}%
- }{%
- % With memoir and standard classes
- \ifcsdef{xpg@save@part@format}{%
- \ifcsdef{H@old@part}{%
- \let\H@old@part\xpg@save@part@format%
- }{%
- \let\@part\xpg@save@part@format%
- }%
- }{}%
- \ifcsdef{xpg@save@chap@format}{%
- \let\@makechapterhead\xpg@save@chap@format
- }{}%
- }% (end \ifdefined\sectionformat)
+ }%
}% (end \ifdefined\titleformat)
%
% Reset headers
- \ifcsdef{chaptermarkformat}{%
- % With KOMA
- \ifcsdef{xpg@save@chaptermark@format}{%
- \let\chaptermarkformat\xpg@save@chaptermark@format%
- }{}%
- }{%
- \ifcsdef{chaptermark}{%
+ \@ifundefined{chaptermarkformat}{%
+ \@ifundefined{chaptermark}{}{%
% With memoir and standard classes
- \ifcsdef{xpg@save@chaptermark@format}{%
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
\let\chaptermark\xpg@save@chaptermark@format%
- }{}%
- }{}% (end \ifdefined\chaptermark)
- \ifcsdef{sectionmark}{%
- \ifcsdef{xpg@save@sectionmark@format}{%
+ }%
+ }% (end \ifdefined\chaptermark)
+ \@ifundefined{sectionmark}{}{%
+ \@ifundefined{xpg@save@sectionmark@format}{}{%
\let\sectionmark\xpg@save@sectionmark@format%
- }{}%
- }{}% (end \ifdefined\sectionmark)
+ }%
+ }% (end \ifdefined\sectionmark)
+ }{%
+ % With KOMA
+ \@ifundefined{xpg@save@chaptermark@format}{}{%
+ \let\chaptermarkformat\xpg@save@chaptermark@format%
+ }%
}% (end \ifdefined\chapterformat)
}
@@ -363,22 +374,22 @@
\let\the@uyghur@chapter\thechapter
\def\uyghur@chapterformat{%
- \ifcsdef{part}{%
+ \@ifundefined{part}{}{%
\if@uyghur@ordchapter%
\renewcommand{\the@uyghur@part}{\uyghurord{part}}%
\fi%
\if@uyghur@romchapter%
\renewcommand{\the@uyghur@part}{\Roman{part}}%
\fi%
- }{}%
- \ifcsdef{chapter}{%
+ }%
+ \@ifundefined{chapter}{}{%
\if@uyghur@ordchapter%
\renewcommand{\the@uyghur@chapter}{\uyghurord{chapter}}%
\fi%
\if@uyghur@romchapter%
\renewcommand{\the@uyghur@chapter}{\Roman{chapter}}%
\fi%
- }{}%
+ }%
}
\def\uyghur@numbers{%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-vietnamese.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-vietnamese.ldf
index d223d38d3a2..3689b48112f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-vietnamese.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-vietnamese.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-vietnamese.ldf}[polyglossia: module for Vietnamese]
%% Strings contributed by Daniel Owens < dhowens . pmbx . net >
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf
index 5b68cfa9d9c..81174769141 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-welsh.ldf
@@ -1,4 +1,4 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-welsh.ldf}[polyglossia: module for Welsh]
@@ -15,21 +15,26 @@
% BCP-47 compliant aliases
\setlanguagealias*{welsh}{cy}
-\providebool{welsh@formaldate}
+\@ifundefined{ifwelsh@formaldate}%
+ {\newif\ifwelsh@formaldate}{}
-\define@choicekey*+{welsh}{date}[\xpg@val\xpg@nr]{long,short}[short]{%
- \ifcase\xpg@nr\relax
- % long:
- \welsh@formaldatetrue
- \or
- % accented:
- \welsh@formaldatefalse
- \fi
- \xpg@info{Option: Welsh, date=\xpg@val}%
-}{\xpg@warning{Unknown date value `#1'}}
+\DeclareKeys[polyglossia/gloss/welsh]
+ {
+ date.choice:,
+ date / long.code =
+ {%
+ \welsh@formaldatetrue
+ },
+ date / short.code =
+ {%
+ \welsh@formaldatefalse
+ },
+ date.default:n = short,
+ date/unknown.code = \xpg@warning{Unknown date value `#1'},
+ }
% Register default options
-\xpg@initialize@gloss@options{welsh}{date=short}
+\InitializeGlossOptions{welsh}{date=short}
\def\captionswelsh{%
\def\refname{Cyfeiriadau}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-zh-CN.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-zh-CN.ldf
index 13a85e1f67e..2e99abca24d 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-zh-CN.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-zh-CN.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-zh-CN.ldf}[polyglossia: module for zh-CN (Chinese)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{chinese}
+\InheritGlossFile{chinese}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-zh-TW.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-zh-TW.ldf
index 10792a0d386..0b907e2a4e1 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/gloss-zh-TW.ldf
+++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-zh-TW.ldf
@@ -1,9 +1,9 @@
-% Language definition file (part of polyglossia v2.1 -- 2024/03/07)
+% Language definition file (part of polyglossia v2.2 -- 2024/07/15)
%
\ProvidesFile{gloss-zh-TW.ldf}[polyglossia: module for zh-TW (Chinese)]
% We provide this as a bcp47-compliant alias
-\xpg@load@master@language{chinese}
+\InheritGlossFile{chinese}
\endinput
diff --git a/Master/texmf-dist/tex/latex/polyglossia/hebrewcal.sty b/Master/texmf-dist/tex/latex/polyglossia/hebrewcal.sty
index c949624724e..679d2bfe6dd 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/hebrewcal.sty
+++ b/Master/texmf-dist/tex/latex/polyglossia/hebrewcal.sty
@@ -73,7 +73,7 @@
\ifnum#1<5000
\Hebrewnumeral{#1}%
\else
- \ifnum#1<6000 % current millenium, print without thousands
+ \ifnum#1<6000 % current millennium, print without thousands
\@tempcnta=#1\relax
\if@xpg@hebrew@fullyear\else\advance\@tempcnta by -5000\fi
\Hebrewnumeral{\@tempcnta}%
diff --git a/Master/texmf-dist/tex/latex/polyglossia/hijrical.sty b/Master/texmf-dist/tex/latex/polyglossia/hijrical.sty
index 79da8d0020b..2d396f5f71c 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/hijrical.sty
+++ b/Master/texmf-dist/tex/latex/polyglossia/hijrical.sty
@@ -16,7 +16,7 @@ l3calc. Please update expl3!
\@ifundefined{@Remainder}{\input{cal-util.def}}{}
%% The following functions are straightforward implementation
-%% of Reingold & Dershowitz, Calendrical Calculations, The Millenium Edition
+%% of Reingold & Dershowitz, Calendrical Calculations, The Millennium Edition
%%
\def\@FixedFromHijri#1#2#3#4{% year,month,day,counter
diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-korean.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-cjk-spacing.lua
index 59ec736b49d..7102dc0cf37 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-korean.lua
+++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-cjk-spacing.lua
@@ -1,6 +1,6 @@
--
--- polyglossia-korean.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- polyglossia-cjk-spacing.lua
+-- part of polyglossia v2.2 -- 2024/07/15
--
local glyph_id = node.id"glyph"
@@ -8,13 +8,17 @@ local hbox_id = node.id"hlist"
local vbox_id = node.id"vlist"
local glue_id = node.id"glue"
local penalty_id = node.id"penalty"
-local disc_id = node.id"disc"
+local whatsit_id = node.id"whatsit"
+local math_id = node.id"math"
--
--- attr_korean: variant = plain (0), classic (1), modern (2)
+-- attr_cjk: variant = plain: 0, JP/classic: 1, KR/modern: 2, SC: 3, TC: 4
--
-local attr_korean = luatexbase.attributes["xpg@attr@korean"]
-local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
+local attr_cjk = luatexbase.attributes["xpg@attr@cjkspacing"]
+--
+-- attr_josa: ONLY For Korean. DO NOT declare \newattribute for other langs
+--
+local attr_josa = luatexbase.attributes["xpg@attr@autojosa"]
--
-- characters after which linebreak is not allowed
@@ -63,9 +67,9 @@ local nobr_after = {
-- characters before which linebreak is not allowed
-- (currently, not much differences among the followings)
-- 1: normal chars
--- 2: hangul jamo vowels and trailing consonants
+-- 2: hangul jamo vowels and trailing consonants plus combinings
-- 3: kana small letters
--- 0: dashes (supress visible spacing)
+-- 0: dashes (suppress visible spacing after this char)
--
local nobr_before = setmetatable({
[0x21] = 1, -- ! EXCLAMATION MARK
@@ -76,7 +80,7 @@ local nobr_before = setmetatable({
[0x2D] = 0, -- - HYPHEN-MINUS
[0x2E] = 1, -- . FULL STOP
[0x2F] = 0, -- / SOLIDUS
- [0x3A] = 0, -- : COLON
+ [0x3A] = 1, -- : COLON
[0x3B] = 1, -- ; SEMICOLON
[0x3E] = 1, -- > GREATER-THAN SIGN
[0x3F] = 1, -- ? QUESTION MARK
@@ -88,11 +92,11 @@ local nobr_before = setmetatable({
[0xBB] = 1, -- » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
[0x2013] = 0, -- – EN DASH
[0x2014] = 0, -- — EM DASH
- [0x2015] = 1, -- ― HORIZONTAL BAR
+ [0x2015] = 0, -- ― HORIZONTAL BAR
[0x2019] = 1, -- ’ RIGHT SINGLE QUOTATION MARK
[0x201D] = 1, -- ” RIGHT DOUBLE QUOTATION MARK
- [0x2025] = 1, -- ‥ TWO DOT LEADER
- [0x2026] = 1, -- … HORIZONTAL ELLIPSIS
+ [0x2025] = 0, -- ‥ TWO DOT LEADER
+ [0x2026] = 0, -- … HORIZONTAL ELLIPSIS
[0x232A] = 1, -- 〉 RIGHT-POINTING ANGLE BRACKET
[0x3001] = 1, -- 、 IDEOGRAPHIC COMMA
[0x3002] = 1, -- 。 IDEOGRAPHIC FULL STOP
@@ -124,10 +128,10 @@ local nobr_before = setmetatable({
[0x308E] = 3, -- ゎ HIRAGANA LETTER SMALL WA
[0x3095] = 3, -- ゕ HIRAGANA LETTER SMALL KA
[0x3096] = 3, -- ゖ HIRAGANA LETTER SMALL KE
- [0x3099] = 1, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309A] = 1, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
- [0x309B] = 1, -- ゛ KATAKANA-HIRAGANA VOICED SOUND MARK
- [0x309C] = 1, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ [0x3099] = 2, -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK
+ [0x309A] = 2, -- COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ [0x309B] = 2, -- ゛ KATAKANA-HIRAGANA VOICED SOUND MARK
+ [0x309C] = 2, -- ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
[0x309D] = 1, -- ゝ HIRAGANA ITERATION MARK
[0x309E] = 1, -- ゞ HIRAGANA VOICED ITERATION MARK
[0x30A0] = 1, -- ゠ KATAKANA-HIRAGANA DOUBLE HYPHEN
@@ -147,9 +151,9 @@ local nobr_before = setmetatable({
[0x30FC] = 1, -- ー KATAKANA-HIRAGANA PROLONGED SOUND MARK
[0x30FD] = 1, -- ヽ KATAKANA ITERATION MARK
[0x30FE] = 1, -- ヾ KATAKANA VOICED ITERATION MARK
- [0xFE30] = 1, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
- [0xFE31] = 1, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
- [0xFE32] = 1, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
+ [0xFE30] = 0, -- ︰ PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
+ [0xFE31] = 0, -- ︱ PRESENTATION FORM FOR VERTICAL EM DASH
+ [0xFE32] = 0, -- ︲ PRESENTATION FORM FOR VERTICAL EN DASH
[0xFE36] = 1, -- ︶ PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
[0xFE38] = 1, -- ︸ PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
[0xFE3A] = 1, -- ︺ PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET
@@ -176,18 +180,18 @@ local nobr_before = setmetatable({
[0xFF63] = 1, -- 」 HALFWIDTH RIGHT CORNER BRACKET
[0xFF64] = 1, -- 、 HALFWIDTH IDEOGRAPHIC COMMA
[0xFF65] = 1, -- ・ HALFWIDTH KATAKANA MIDDLE DOT
- [0xFF9E] = 1, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
- [0xFF9F] = 1, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
+ [0xFF9E] = 2, -- ゙ HALFWIDTH KATAKANA VOICED SOUND MARK
+ [0xFF9F] = 2, -- ゚ HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
}, { __index = function(_,c)
if c >= 0x1160 and c <= 0x11FF then return 2 end
if c >= 0xD7B0 and c <= 0xD7FF then return 2 end
- if c >= 0x302A and c <= 0x302F then return 1 end
+ if c >= 0x302A and c <= 0x302F then return 2 end -- tone marks
if c >= 0x31F0 and c <= 0x31FF then return 3 end
if c >= 0xFF67 and c <= 0xFF70 then return 3 end
- if c >= 0xFE00 and c <= 0xFE0F then return 1 end
+ if c >= 0xFE00 and c <= 0xFE0F then return 2 end -- variation selectors
if c >= 0xFE10 and c <= 0xFE19 and not (c == 0xFE17) then return 1 end
if c >= 0xFE50 and c <= 0xFE58 then return 1 end
- if c >= 0xE0100 and c <= 0xE01EF then return 1 end
+ if c >= 0xE0100 and c <= 0xE01EF then return 2 end -- variation selecters
end
})
@@ -205,6 +209,7 @@ local function is_cjk (c)
or c >= 0xFF00 and c <= 0xFFEF
or c >= 0x1F100 and c <= 0x1F2FF
or c >= 0x20000 and c <= 0x2FA1F
+ or c >= 0x30000 and c <= 0x323AF
or nobr_after[c] and c > 0x2014
or nobr_before[c] and c > 0x2014
end
@@ -244,8 +249,28 @@ local charclass = setmetatable({
}, { __index = function() return 0 end })
--
+-- get character class
+-- var : variant = plain, JP/classic, KR/modern, SC, TC
+-- c : codepoint
+--
+local function get_charclass (var, c)
+ if var < 3 then
+ return charclass[c]
+ elseif var == 3 then
+ -- SC : these are left aligned
+ return (c == 0xFF01 or c == 0xFF1F) and 4 -- FULLWIDTH EXCLAMATION/QUESTION MARK
+ or (c == 0xFF1A or c == 0xFF1B) and 2 -- FULLWIDTH COLON/SEMICOLON
+ or charclass[c]
+ end
+ -- TC : these are center aligned
+ return (c == 0x3001 or c == 0xFF0C) and 3 -- IDEOGRAPHIC/FULLWIDTH COMMA
+ or (c == 0x3002 or c == 0xFF0E) and 3 -- IDEOGRAPHIC/FULLWIDTH FULL STOP -- 5 ?
+ or charclass[c]
+end
+
+--
-- table for spacing between char classes
--- 1 stands for 0.5*fontsize when variant=classic
+-- 1 stands for 0.5*fontsize when variant = JP/classic or SC or TC
--
local intercharclass = { [0] =
{ [0] = nil, {1,1}, nil, {.5,.5} },
@@ -277,7 +302,7 @@ end
--
-- return 0.5*fontsize of given fontid
--- space: true if variant=modern; then 0.5*interword_space
+-- space: true if variant=KR/modern; then 0.5*interword_space
--
local function get_font_size (fid, space)
local size = font.getparameters(fid)
@@ -291,7 +316,7 @@ end
--
-- charclass 1 thru 4 will be packed in \hbox to 0.5em{\hss? curr \hss?}
--- when variant=classic/modern
+-- when variant ~= plain
--
local function glyph_to_box (head, curr, class)
local g, h = curr
@@ -320,7 +345,7 @@ end
--
-- insert spacing defined as charclass[a][b] between a and b
-- f: fontid
--- var: variant = plain, classic, modern
+-- var: variant = plain, JP/classic, KR/modern, SC, TC
-- cc: charclass of current char
-- nc: charclass of next char
-- nobr: linebreak is not allowed
@@ -339,12 +364,16 @@ end
--
-- insert inter-character spacing in other normal cases
--- f: fontid
--- var: variant = plain, classic, modern
--- x: true between cjk and non-cjk (a little more spacing)
+-- f: fontid
+-- var: variant = plain, JP/classic, KR/modern, SC, TC
+-- nobr: no linebreak
+-- x: true between cjk and non-cjk (a little more spacing)
--
-local function insert_penalty_glue (head, curr, f, var, x)
- if var ~= 1 then
+local function insert_penalty_glue (head, curr, f, var, nobr, x)
+ if nobr then
+ local penalty = get_new_penalty(10000)
+ head, curr = node.insert_after(head, curr, penalty)
+ elseif var == 0 or var == 2 then
local penalty = get_new_penalty(50)
head, curr = node.insert_after(head, curr, penalty)
end
@@ -360,53 +389,64 @@ end
--
-- main process for linebreak and inter-character spacing
--- lb: true if pre_linebreak_filter
--
-local function korean_break (head, lb)
+local function cjk_break (head)
local curr = head
while curr do
- if curr.id == glyph_id then
- local var = node.has_attribute(curr, attr_korean)
+ if attr_cjk and (curr.id == glyph_id or curr.id == math_id and curr.subtype == 1) then
+ local var = node.has_attribute(curr, attr_cjk)
if var then
- local c, f = curr.char or 0, curr.font or 0
- local cc, cjkc = charclass[c], is_cjk(c)
+ local c, f = curr.char or 0, curr.font
+ local cc, cjkc = get_charclass(var, c), is_cjk(c)
-- compress cjk punctuations when charclass is 1 thru 4
if var > 0 and cc > 0 and cc < 5 then
head, curr = glyph_to_box(head, curr, cc)
end
- local next = curr.next
- if next and next.id == glyph_id then
+ local next = node.getnext(curr)
+ while next and next.id == whatsit_id do -- skip whatsit nodes
+ curr, next = next, node.getnext(next)
+ end
+
+ if next and (next.id == glyph_id or next.id == math_id and next.subtype == 0) then
local n = next.char or 0
- local nc = charclass[n]
+ f = f or next.font or 0 -- in case of curr == math_off
+
+ -- skip combining. or dash+dash case to suppress stretching
+ if nobr_before[n] == 2 or (nobr_before[c] == 0 and nobr_before[n] == 0) then
+ goto skip_combining
+ end
+
+ local nc = get_charclass(var, n)
local nobr = nobr_before[n] or nobr_after[c]
-- insert spacing as of intercharclass
if var > 0 and intercharclass[cc][nc] then
head, curr = insert_cjk_penalty_glue(head, curr, f, var, cc, nc, nobr)
- -- or insert spacing when linebreak is allowed
- elseif not nobr then
+ else
local cjkn = is_cjk(n)
-- if curr or next is cjk char
if cjkc or cjkn then
- -- if between cjk and non-cjk
- if var > 0 and not (cjkc and cjkn) and nobr_before[c] ~= 0 then
- head, curr = insert_penalty_glue(head, curr, f, var, true)
+ -- plain variant / cjk+cjk / nobr cjk+noncjk / after dash
+ -- : insert a 0pt glue
+ if var == 0 or (cjkc and cjkn) or nobr or nobr_before[c] == 0 then
+ head, curr = insert_penalty_glue(head, curr, f, var, nobr)
- -- or under pre_linebreak_filter
- elseif lb then
- head, curr = insert_penalty_glue(head, curr, f, var)
+ -- other cases: insert a small glue
+ else
+ head, curr = insert_penalty_glue(head, curr, f, var, nobr, true)
end
end
end
end
end
end
- curr = curr.next
+ ::skip_combining::
+ curr = node.getnext(curr)
end
return head
end
@@ -420,7 +460,7 @@ end
local function reorder_tm (head)
local curr, tone = node.slide(head)
while curr do
- if curr.id == glyph_id and node.has_attribute(curr, attr_korean) then
+ if curr.id == glyph_id and node.has_attribute(curr, attr_cjk) then
local f = font.getfont(curr.font) or font.fonts[curr.font]
if f and f.hb then -- harfbuzz do the right thing
tone = nil
@@ -436,7 +476,7 @@ local function reorder_tm (head)
end
end
end
- curr = curr.prev
+ curr = node.getprev(curr)
end
return head
end
@@ -523,7 +563,7 @@ local function get_prev_char (p)
local pc = get_prev_char(node.slide(p.head))
if pc then return pc end
end
- p = p.prev
+ p = node.getprev(p)
end
end
@@ -538,10 +578,10 @@ local function auto_josa (head)
if josa then
local cc = curr.char or 0
if josa == 0 then
- josa = josa_code[get_prev_char(curr.prev) or 0x30]
+ josa = josa_code[get_prev_char(node.getprev(curr)) or 0x30]
end
if cc == 0xC774 then
- local n = curr.next
+ local n = node.getnext(curr)
if n and n.char and n.char >= 0xAC00 and n.char <= 0xD7A3 then
else
cc = 0xAC00
@@ -560,7 +600,7 @@ local function auto_josa (head)
node.unset_attribute(curr, attr_josa)
end
end
- curr = curr.next
+ curr = node.getnext(curr)
end
for _,v in ipairs(tofree) do node.free(v) end
return head
@@ -571,39 +611,13 @@ end
-- As char value of glyphs can be changed by opentype GSUB process,
-- we have to occupy the first position among callback functions.
--
-local prepend_to_callback
-if luatexbase.base_add_to_callback then
- prepend_to_callback = function(name, func, desc)
- luatexbase.add_to_callback(name, func, desc, 1)
- end
-else
- prepend_to_callback = function(name, func, desc)
- local t = { {func, desc} }
- for _,v in ipairs(luatexbase.callback_descriptions(name)) do
- table.insert(t, {luatexbase.remove_from_callback(name, v)})
- end
- for _,v in ipairs(t) do
- luatexbase.add_to_callback(name, v[1], v[2])
- end
- end
-end
-
-prepend_to_callback ("pre_linebreak_filter",
- function(head)
- head = auto_josa(head)
- head = korean_break(head, true)
- head = reorder_tm(head)
- return head
- end,
- "polyglossia.lang_korean")
-
-prepend_to_callback ("hpack_filter",
- function(head)
- head = auto_josa(head)
- head = korean_break(head)
- head = reorder_tm(head)
- return head
- end,
- "polyglossia.lang_korean")
+luatexbase.add_to_callback( "pre_shaping_filter",
+function(head)
+ if attr_josa then head = auto_josa(head) end
+ head = cjk_break(head)
+ if attr_josa then head = reorder_tm(head) end
+ return head
+end,
+"polyglossia.lang_cjk_spacing")
-- vim:ft=lua:tw=0:sw=4:ts=4:expandtab
diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-french.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-french.lua
index c2a1a27bebe..d0257e93720 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-french.lua
+++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-french.lua
@@ -1,6 +1,6 @@
--
-- polyglossia-punct.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia-punct')
diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-latin.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-latin.lua
index 982f6ba8d4f..844d11cb5ac 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-latin.lua
+++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-latin.lua
@@ -1,6 +1,6 @@
--
-- polyglossia-latin.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia-punct')
diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua
index 99e538b1613..d8cfa89e5fa 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua
+++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-punct.lua
@@ -1,13 +1,12 @@
--
-- polyglossia-punct.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
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 declare_callback_rule = luatexbase.declare_callback_rule
local new_attribute = luatexbase.new_attribute
local node = node
@@ -331,13 +330,16 @@ local function activate(lang)
-- 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
+add_to_callback("pre_linebreak_filter",process,"polyglossia-punct.process")
+add_to_callback("hpack_filter",process,"polyglossia-punct.process")
+declare_callback_rule("pre_linebreak_filter",
+ "polyglossia-punct.process", "before", "luaotfload.node_processor")
+declare_callback_rule("hpack_filter",
+ "polyglossia-punct.process", "before", "luaotfload.node_processor")
+
+
local function deactivate()
tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset"
-- Though it would make compilation slightly faster, it is not possible to
diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-sanskrit.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-sanskrit.lua
index 61b891ac283..7a2b84270db 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-sanskrit.lua
+++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-sanskrit.lua
@@ -1,6 +1,6 @@
--
-- polyglossia-sanskrit.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia-punct')
diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-tibt.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-tibt.lua
index 8247e2deb33..d51a594de3f 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia-tibt.lua
+++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia-tibt.lua
@@ -1,30 +1,28 @@
--
-- polyglossia-tibt.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
require('polyglossia') -- just in case...
local add_to_callback = luatexbase.add_to_callback
local remove_from_callback = luatexbase.remove_from_callback
+local declare_callback_rule = luatexbase.declare_callback_rule
local priority_in_callback = luatexbase.priority_in_callback
local next, type = next, type
-
-local nodes, fonts, node = nodes, fonts, node
-
-local nodecodes = nodes.nodecodes --- <= preloaded node.types()
+local node = node
local insert_node_before = node.insert_before
local insert_node_after = node.insert_after
-local remove_node = nodes.remove
+local remove_node = node.remove
local copy_node = node.copy
local has_attribute = node.has_attribute
local end_of_math = node.end_of_math
if not end_of_math then -- luatex < .76
local traverse_nodes = node.traverse_id
- local math_code = nodecodes.math
+ local math_code = node.id('math_char')
local end_of_math = function (n)
for n in traverse_nodes(math_code, n.next) do
return n
@@ -32,10 +30,10 @@ if not end_of_math then -- luatex < .76
end
end
--- node types as of April 2013
-local glyph_code = nodecodes.glyph
-local penalty_code = nodecodes.penalty
-local kern_code = nodecodes.kern
+-- node types as of April 2024
+local glyph_code = node.id('glyph')
+local penalty_code = node.id('penalty')
+local kern_code = node.id('kern')
-- we make a new node, so that we can copy it later on
local penalty_node = node.new(penalty_code)
@@ -66,7 +64,6 @@ local function process(head)
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
@@ -79,15 +76,13 @@ end
local callback_name = "pre_linebreak_filter"
local function activate()
- if not priority_in_callback (callback_name, "polyglossia-tibt.process") then
- add_to_callback(callback_name, process, "polyglossia-tibt.process", 1)
- end
+ add_to_callback(callback_name, process, "polyglossia-tibt.process")
+ declare_callback_rule(callback_name,
+ "polyglossia-tibt.process", "before", "luaotfload.node_processor")
end
local function desactivate()
- if priority_in_callback (callback_name, "polyglossia-tibt.process") then
- remove_from_callback(callback_name, "polyglossia-tibt.process")
- end
+ remove_from_callback(callback_name, "polyglossia-tibt.process")
end
polyglossia.activate_tibt_eol = activate
diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua
index c07d8d9ac49..5f346bef767 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua
+++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.lua
@@ -1,6 +1,6 @@
--
-- polyglossia.lua
--- part of polyglossia v2.1 -- 2024/03/07
+-- part of polyglossia v2.2 -- 2024/07/15
--
local module_name = "polyglossia"
@@ -76,7 +76,7 @@ local function newloader(langentry)
end
-- language info will be written into the .log file
- local s = { "Language data for " .. langentry }
+ local s = { }
for k, v in pairs(langdata) do
if type(v) == 'table' then -- for 'synonyms'
s[#s+1] = k .. "\t" .. table.concat(v,',')
@@ -84,7 +84,10 @@ local function newloader(langentry)
s[#s+1] = k .. "\t" .. tostring(v)
end
end
- log_info(table.concat(s,"\n"))
+ local a = {}
+ for _,n in pairs(s) do table.insert(a, n) end
+ table.sort(a)
+ log_info("Language data for " .. langentry .. "\n" .. table.concat(a,"\n"))
--
-- LaTeX's \newlanguage increases language register (count19),
@@ -94,7 +97,7 @@ local function newloader(langentry)
-- this possible situation, our newloader() function will
-- unfortunately overwrite the language \lang@xyz.
--
- -- Threfore here we will compare LaTeX's \newlanguage number with
+ -- Therefore here we will compare LaTeX's \newlanguage number with
-- LuaTeX's lang.new() id and select the bigger one for our new
-- language object. Also we will update LaTeX's language register
-- by this new id, so that another possible \newlanguage should not
@@ -109,7 +112,7 @@ local function newloader(langentry)
local newlangid = math.max(langcnt, langid)
-- set language register for possible \newlanguage
tex.setcount('global', lang_register, newlangid)
- -- get new lang object if needeed
+ -- get new lang object if needed
if langid ~= newlangid then
langobject = lang.new(newlangid)
end
diff --git a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty
index 20f6538d448..a8d0c57b540 100644
--- a/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty
+++ b/Master/texmf-dist/tex/latex/polyglossia/polyglossia.sty
@@ -1,32 +1,27 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesExplPackage
- {polyglossia} {2024/03/07} {v2.1}
+ {polyglossia} {2024/07/15} {v2.2}
{Modern multilingual typesetting with XeLaTeX and LuaLaTeX}
+% TODO Handle remaining uses in the gloss files (\patchcmd)
+% and remove package call afterwards
\RequirePackage{etoolbox}
-\RequirePackage{xkeyval}[2008/08/13]
% Will raise error if used with anything else than XeTeX or LuaTeX
\RequirePackage{fontspec}[2010/06/08]% v2.0
\RequirePackage{iftex}
\prg_generate_conditional_variant:Nnn \clist_if_in:Nn {Ne} {TF, T, F} % check if needed
-% correct a bug in tracklang
-\AddToHook{package/tracklang/after}{%
- \IfPackageAtLeastTF{tracklang}{2019/08/30}
- {}
- {\cs_gset_eq:NN \AddTrackedLangage \AddTrackedLanguage}
-}
-
%% The following is for compatibility with Babel-aware package:
% \languageshorthands is provided by babelsh.def, which is
% only loaded by some glosses, but some classes presuppose
% it is there generally. So let's provide a stub:
\ProvideDocumentCommand \languageshorthands { m } {}
% These have to be provided at the end of the preamble
-\AddToHook{begindocument/before}{
- \cs_gset_eq:NN \bbl@set@language \xpg@set@language@aux % for biblatex
- \cs_gset_eq:NN \bbl@main@language \xpg@main@language % for biblatex
+\hook_gput_code:nnn {begindocument/before} {.}
+{
+ \cs_gset_eq:NN \bbl@set@language \xpg_set_language_aux:nn % for biblatex
+ \cs_gset_eq:NN \bbl@main@language \xpg_main_language_tl % for biblatex
\ProvideDocumentCommand \texorpdfstring { m m } { #1 } % dummy command if hyperref is not loaded
}
@@ -35,16 +30,15 @@
%% \l@nohyphenation is defined in polyglossia.lua
\sys_if_engine_luatex:TF
{
- \RequirePackage{luatexbase} % already included by fontspec, but needed here
- \RequireLuaModule{polyglossia}
+ \lua_load_module:n{polyglossia}
}{
\cs_if_free:cT { l@nohyphenation }
{ \chardef\l@nohyphenation=255 }
}
-% Which version of XeTeX do we use? What is the boudary class? 4095 or 255
+% Which version of XeTeX do we use? What is the boundary class? 4095 or 255
\cs_if_exist:cTF { e@alloc@intercharclass@top }
- { \let\xpg@boundaryclass=\e@alloc@intercharclass@top }
+ { \cs_gset_eq:NN \xpg@boundaryclass \e@alloc@intercharclass@top }
{ \chardef\xpg@boundaryclass=\@cclv }
% Useful for getting list of loaded languages and variants. Like babel's bbl@loaded
@@ -80,18 +74,18 @@
\cs_new_nopar:Nn \__xpg_at_begin_document:
{
% save various command
- \let\latin@alph\@alph % TODO rename when we have the C locale
- \let\latin@Alph\@Alph % TODO rename when we have the C locale
+ \cs_gset_eq:cc{latin@alph}{@alph}% TODO rename when we have the C locale
+ \cs_gset_eq:cc{latin@Alph}{@Alph}% TODO rename when we have the C locale
% push to C language gloss
- \let\polyglossia@Clang@@arabic\@arabic
- \let\polyglossia@Clang@arabic\arabic
+ \cs_gset_eq:cc{xpg_Clang_arabic}{@arabic}
\xpg_initial_setup:
% apply \familydefault changes
- \xpg@set@familydefault
+ \xpg_set_familydefault:
}
-\AddToHook{begindocument}{
+\hook_gput_code:nnn {begindocument} {.}
+{
\__xpg_at_begin_document:
}
@@ -99,7 +93,8 @@
% loaded after \set[main|other]language
% Track whether the main language has been set
\bool_new:N \g_xpg_main_lang_set_bool
-\AddToHook{begindocument/end}{
+\hook_gput_code:nnn {begindocument/end} {.}
+{
% now we have the C locale definition: select the language
\__xpg_at_begin_document_selectlanguage:
\bool_gset_true:N \g_xpg_main_lang_set_bool
@@ -107,99 +102,177 @@
\__xpg_at_begin_document_hyphenation:
}
-%% custom message macros
-\providecommand*{\xpg@error}[1]{
- \PackageError{polyglossia}{#1}{}
+%
+% MESSAGES
+%
+
+% message templates
+\msg_new:nnn { polyglossia } { general } { #1 }
+
+\msg_new:nnn { polyglossia } { languagenotloaded }
+{
+ The~ language~ #1~ is~ not~ loaded.~ You~ must~ load~ it~ in~ order~ to~ use~ it.
}
+\msg_redirect_name:nnn { polyglossia } { languagenotloaded } { critical }
-\providecommand*{\xpg@warning}[1]{
- \PackageWarning{polyglossia}{#1}
+\msg_new:nnn { polyglossia } { languagenolongerloaded }
+{
+ The~ language~ #1~ is~ no~ longer~ loaded.~ Please~ rerun~ LaTeX.
}
+\msg_redirect_name:nnn { polyglossia } { languagenolongerloaded } { warning }
-\providecommand*{\xpg@info}[1]{
- \PackageInfo{polyglossia}
- {#1\@gobble}
-} %% the \@gobble is to prevent displaying the line nr
+\msg_new:nnn { polyglossia } { unknownlocalnumeral }
+{
+ Unknown~ key~ "#1"~ in~ \string\localnumeral.
+}
-%TODO change all instances of \xpg@nopatterns in gloss-*.ldf files
-\providecommand*{\xpg@nopatterns@fallback}[2][nohyphenation]{
- \xpg@warning{No~ hyphenation~ patterns~ were~ loaded~ for~ `#2'\MessageBreak
- I~ will~ use~ \string\language=\string\l@ #1\space instead}
- \expandafter\adddialect\csname l@#2\expandafter\endcsname\csname l@#1\endcsname\relax}
+\msg_new:nnn { polyglossia } { localnumeralemptyvalue }
+{
+ Keys~ of~ \string\localnumeral~ must~ have~ a~ value.
+}
-\providecommand*{\xpg@nopatterns}[1]{
- \xpg@warning{No~ hyphenation~ patterns~ were~ loaded~ for~ `#1'\MessageBreak
- I~ will~ use~ \string\language=\string\l@nohyphenation\space instead}
- %%TODO? \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax
- }
+\msg_new:nnn { polyglossia } { illvalue }
+{
+ Illegal~ value~ (#1)~ for~ #2!
+}
-\def\xpg@ill@value#1#2{
- \xpg@warning{Illegal~ value~ (#1)~ for~ #2}}
+\msg_new:nnn { polyglossia } { illarg }
+{
+ Invalid~ argument~ (#1)~ for~ #2!
+}
-% error out if lang is not loaded
-\cs_new_nopar:Nn \xpg_error_if_lang_not_loaded:n
+\msg_new:nnn { polyglossia } { nopatterns }
{
- \seq_if_in:NeF \__xpg_langs_loaded {#1}
- {
- \xpg@error{language~ #1~ is~ not~ loaded.~ Please~ load~ it~ before~ using~ it.}
- }
+ No~ hyphenation~ patterns~ were~ loaded~ for~ `#2' \iow_newline:
+ I~ will~ use~ \string\language=\string\l@ #1\space instead.
}
-\msg_new:nnn { polyglossia } { languagenotloaded }
+\msg_new:nnn { polyglossia } { undefcmd }
{
- The~ language~ #1~ is~ not~ loaded.~ You~ should~ load~ it.
+ \tl_to_str:N {#1} ~ is~ not~ defined!
}
-\msg_redirect_name:nnn { polyglossia } { languagenotloaded } { critical }
-\msg_new:nnn { polyglossia } { languagenolongerloaded }
+%% custom message macros
+\cs_new_nopar:Nn \xpg_error_msg:n
{
- The~ language~ #1~ is~ no~ longer~ loaded.~ Please~ rerun~ LaTeX.
+ \exp_args:Nnne \msg_error:nnn { polyglossia } { general } { #1 }
}
-\msg_redirect_name:nnn { polyglossia } { languagenolongerloaded } { warning }
-\msg_new:nnn { polyglossia } { unknownlocalnumeral }
+\cs_new_nopar:Nn \xpg_warning_msg:n
{
- Unknown~ key~ "#1"~ in~ \string\localnumeral.
+ \exp_args:Nnne \msg_warning:nnn { polyglossia } { general } { #1 }
}
-\msg_new:nnn { polyglossia } { localnumeralemptyvalue }
+\cs_new_nopar:Nn \xpg_info_msg:n
{
- Keys~ of~ \string\localnumeral~ must~ have~ value.
+ \exp_args:Nnne \msg_info:nnn { polyglossia } { general } { #1 }
}
+\cs_new_nopar:Nn \xpg_no_patterns_msg:n
+{
+ \msg_warning:nnnn { polyglossia } { nopatterns } { nohyphenation } { #1 }
+}
+
+\cs_new_nopar:Nn \xpg_ill_value_msg:nn
+{
+ \msg_warning:nnnn { polyglossia } { illvalue } { #1 } { #2 }
+}
+
+\cs_new_nopar:Nn \xpg_ill_arg_msg:nn
+{
+ \msg_error:nnnn { polyglossia } { illarg } { #1 } { #2 }
+}
+
+% error out if lang is not loaded
+\cs_new_nopar:Nn \xpg_error_if_lang_not_loaded:n
+{
+ \seq_if_in:NeF \__xpg_langs_loaded {#1}
+ {
+ \msg_error:nnn { polyglossia } { languagenotloaded } { #1 }
+ }
+}
%% use macro if defined, else warn that it is not
\cs_new_nopar:Nn \__xpg_use_or_warn:N
{
\cs_if_exist_use:NF {#1}
{
- \xpg@warning { \tl_to_str:N {#1} ~ is~ not~ defined }
+ \msg_error:nnn { polyglossia } { undefcmd } { #1 }
}
}
\cs_generate_variant:Nn \__xpg_use_or_warn:N {c}
+% gloss message interface
+\cs_set_eq:cc { xpg@error } { xpg_error_msg:n }
+\cs_set_eq:cc { xpg@warning } { xpg_warning_msg:n }
+\cs_set_eq:cc { xpg@info } { xpg_info_msg:n }
+\cs_set_eq:cc { xpg@ill@value } { xpg_ill_value_msg:nn }
+
+
+\NewDocumentCommand \XPGNoPatternsFallback { O{ nohyphenation } m }
+{
+ \msg_warning:nnnn { polyglossia } { nopatterns } { #1 } { #2 }
+ \exp_args:Ncc \adddialect {l@#2} {l@#1}
+}
+
+\NewDocumentCommand \CheckHyphenationPatterns { m }
+{
+ \xpg_if_language_defined:nF {#1}
+ {
+ \XPGNoPatternsFallback{#1}
+ }
+}
+
+%
+% END MESSAGES
+
%% ensure directionality if bidi is loaded, else ignore
-\def\@@ensure@dir#1{\ifcsundef{@ensure@dir}{#1}{\@ensure@dir{#1}}}
-\def\@@ensure@maindir#1{\ifcsundef{@ensure@maindir}{#1}{\@ensure@maindir{#1}}}
+%%% FIXME still used?
+\cs_new_nopar:Npn \@@ensure@dir #1
+{
+ \cs_if_exist_use:c{@ensure@dir}{#1}
+}
-%% Used by the language definitions files for right-to-left languages
-\NewDocumentCommand \RequireBidi {}
+\cs_new_nopar:Npn \@@ensure@maindir #1
+{
+ \cs_if_exist_use:c{@ensure@maindir}{#1}
+}
+
+% if we are in the document preamble run T else F
+\prg_set_conditional:Nnn \xpg_if_in_preamble: {T, F, TF}
{
- \sys_if_engine_luatex:TF
- {\ifx\@onlypreamble\@notprerr\else\RequirePackage{luabidi}\fi}
- {\ifx\@onlypreamble\@notprerr\else\RequirePackage{bidi}\fi}
+ \cs_if_eq:NNTF { \@onlypreamble } { \@notprerr }
+ {
+ \prg_return_false:
+ }
+ {
+ \prg_return_true:
+ }
}
-% if #1 is LR run #2 else #3
+%% Used by the language definitions files for right-to-left languages
+\DeclareDocumentCommand \RequireBidi {}
+ {
+ \xpg_if_in_preamble:T
+ {
+ \sys_if_engine_luatex:TF
+ { \RequirePackage{luabidi} }
+ { \RequirePackage{bidi} }
+ }
+ \DeclareDocumentCommand \RequireBidi {} {}
+ }
+
+% if #1 is LR run T else F
\prg_set_conditional:Nnn \__xpg_if_LR_str:n {p, T, F, TF}
{
- \str_case_e:nnF{#1}{
+ \str_case_e:nnF{#1}
+ {
{LR}{\prg_return_true:}
{RL}{\prg_return_false:}
}
{
- \xpg@error{Unknown~ direction~#1}
+ \xpg_error_msg:n {Unknown~ direction~#1}
\prg_return_false:
}
}
@@ -212,17 +285,18 @@
{
\__xpg_if_LR_str:nF {#1}
{
- \xpg@error{right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
+ \xpg_error_msg:n {right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
}
}
\cs_new_nopar:Nn \__xpg_set_text_direction:n
{
\__xpg_if_LR_str:nF {#1}
{
- \xpg@error{right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
+ \xpg_error_msg:n {right-to-left,~ but~ (lua)bidi~ package~ was~ not~ loaded!}
}
}
-\AddToHook{package/bidi/after}{
+\hook_gput_code:nnn {package/bidi/after} {.}
+{
\cs_gset_nopar:Nn \__xpg_set_par_direction:n
{
\__xpg_if_LR_str:nTF{#1}
@@ -244,7 +318,8 @@
}
}
}
-\AddToHook{package/luabidi/after}{
+\hook_gput_code:nnn {package/luabidi/after} {.}
+{
\cs_gset_nopar:Nn \__xpg_set_par_direction:n
{
\__xpg_if_LR_str:nTF{#1}
@@ -273,13 +348,21 @@
{ \cs_new_nopar:Nn \__xpg_setRTLmain: { \@RTLmaintrue\setnonlatin } }
%% compatibility with babel
-\let\addto\gappto % gappto is defined in etoolbox
+\cs_set:Npn \addto #1 #2
+{
+ \cs_if_exist:NF { #1 }
+ { \cs_new:Npn { #1 } {} }
+ \tl_gput_right:Nn { #1 } { #2 }
+}
-%% NEW EXPERIMENTAL SETUP INTERFACE FOR GLOSS FILES
+%% SETUP INTERFACE FOR GLOSS FILES
%% options currently available:
%% language : the name of the language (as understood by fontspec)
%% hyphennames : the different hyphenation patterns to try (comma separated list)
-%%% TODO: if pattern is prefixed by !, then it should be loaded as a fallback, with \xpg@nopatterns@fallback - i.e. with a warning: e.g. sanskrit for hindi, or catalan for asturian. – Also for languages with variants! (English and German, etc.)
+%%% TODO: if pattern is prefixed by !, then it should be loaded as a fallback,
+%%%% with \CheckHyphenationPatterns - i.e. with a warning: e.g. sanskrit for hindi,
+%%%% or catalan for asturian. – Also for languages with variants!
+%%%% (English and German, etc.)
%% script : the name of the script (as understood by fontspec) – default is Latin
%% scripttag : the OpenType tag for the script
%% langtag : the OpenType tag for the language
@@ -287,19 +370,20 @@
%% frenchspacing : boolean
%% indentfirst : boolean
%% fontsetup : boolean
-%% TODO: nouppercase : boolean (for scripts like Arabic, Devanagari, etc which have no concept of uppercase/lowercase)
+%% TODO: nouppercase : boolean (for scripts like Arabic, Devanagari, etc which have
+%% no concept of uppercase/lowercase)
%% TODO: localalph = {<alph_csname>,<Alph_csname>}
%% TODO: localnumeral = <csname>
%% or even better localdigits = {0123456789} for fully automatic setup
-\newcommand*\PolyglossiaSetup[2]{
+\NewDocumentCommand \PolyglossiaSetup { m m }
+{
\__xpg_keys_define_lang:n{#1}
\keys_set:nn { polyglossia / #1 } { #2 }
\__xpg_setup_hyphen:n {#1}
%define booleans etoolbox style and set defaults
%% TODO ? \providetoggle{#1@setup@done}%
- % we initialize these so that we can use \gappto below
- \csgdef{init@extras@#1}{}
- \csgdef{init@noextras@#1}{} % we don't use this yet: remove?
+ % we initialize this so that we can append below
+ \cs_gset:cpn {init@extras@#1} {}
% here we do the fontsetup:
\__xpg_auto_setupfont:n { #1 }
%% TODO? \toggletrue{#1@setup@done}
@@ -318,35 +402,41 @@
\clist_map_inline:nn { #1 } { \keys_set:nn { polyglossia / ##1 } { #2 } }
}
-
+\bool_new:N \l__xpg_have_hyphen_bool
% setup hyphennames from a str list of hyphen
\cs_new:Nn \__xpg_setup_hyphen:n
{
- \clist_set:Ne{\l_tmpa_clist}{\prop_item:Nn \g_xpg_langsetup_prop {#1 / hyphennames}}
- \providebool{havehyphen}
- \boolfalse{havehyphen}
+ \clist_set:Ne{\l_tmpa_clist}{\prop_item:Nn \l_xpg_langsetup_prop {#1 / hyphennames}}
+ \bool_set_false:N \l__xpg_have_hyphen_bool
% for each hyphen in the set until we find one that works
- \clist_map_inline:Nn \l_tmpa_clist {
- \ifbool{havehyphen}{}{
+ \clist_map_inline:Nn \l_tmpa_clist
+ {
+ \bool_if:NF \l__xpg_have_hyphen_bool
+ {
% check if language hyphenname is defined
- \__xpg_check_if_exist_l@:nF{#1}{
+ \__xpg_pattern_check_if_exists:nF{#1}
+ {
% if not, first consider nohyphenation
\str_if_eq:nnTF{##1}{nohyphenation}
{
\cs_gset_eq:cc{l@#1}{l@##1}
- \global\booltrue{havehyphen}
- }{
+ \bool_gset_true:N \l__xpg_have_hyphen_bool
+ }
+ {
% then test if hyphenation is defined
- \xpg@ifdefined{##1}{
+ \xpg_if_language_defined:nT {##1}
+ {
% test if language hyphenation is nohyphenation
- \cs_if_eq:cNF{l@#1}{\l@nohyphenation}{\global\booltrue{havehyphen}}{%
+ \cs_if_eq:cNTF{l@#1}{\l@nohyphenation}
+ { \bool_gset_true:N \l__xpg_have_hyphen_bool }
+ {
% if false define language to hyphenation if it is not equal...
\str_if_eq:nnF{#1}{##1}{\cs_gset_eq:cc{l@#1}{l@##1}}
% ...and load
- \xpg@set@hyphenation@patterns{##1}
- \global\booltrue{havehyphen}
- }
- }{}
+ \xpg_set_hyphenation_patterns:n {##1}
+ \bool_gset_true:N \l__xpg_have_hyphen_bool
+ }
+ }
}
}
}
@@ -354,19 +444,17 @@
% if l@#1 does not yet exist,
% we assign it to nohyphenation
% we do this here in case and if the hyphennames key was omitted
- \ifbool{havehyphen}{}{
- \xpg@ifdefined{#1}{}
- {
- \xpg@nopatterns{#1}
- \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax
- }
+ \bool_if:NF \l__xpg_have_hyphen_bool
+ {
+ \CheckHyphenationPatterns{#1}
}
- \csdef{#1@language}{
- \polyglossia@setup@language@patterns{#1}
+ \cs_gset:cpn {#1@language}
+ {
+ \SetupPolyglossiaLangPatterns{#1}
}
% setup hyphenmins
\clist_set:Ne \l_tmpa_clist
- { \prop_item:Nn \g_xpg_langsetup_prop {#1 / hyphenmins} }
+ { \prop_item:Nn \l_xpg_langsetup_prop {#1 / hyphenmins} }
\cs_if_eq:cNF {l@#1} \l@nohyphenation
{
\use:x
@@ -378,7 +466,8 @@
}
}
-\newcommand*\polyglossia@setup@language@patterns[1]{
+\NewDocumentCommand \SetupPolyglossiaLangPatterns { m }
+{
\bool_if:NTF \g__xpg_hyphenation_disabled_bool
{
\tl_gset:Ne \g__xpg_lastlanguage_tl {\the\csname l@#1\endcsname}
@@ -392,32 +481,29 @@
\language=\l@nohyphenation
}
{
- \xpg@set@hyphenation@patterns{#1}
+ \xpg_set_hyphenation_patterns:n {#1}
}
}
{
% Since this function is sometimes called from the gloss files
% directly, we need to check whether the requested hyphenname exists.
- \xpg@ifdefined{#1}{}
- {
- \xpg@nopatterns{#1}
- \expandafter\adddialect\csname l@#1\endcsname\l@nohyphenation\relax%
- }
- \xpg@set@hyphenation@patterns{#1}
+ \CheckHyphenationPatterns{#1}
+ \xpg_set_hyphenation_patterns:n {#1}
}
}
}
-\prop_new:N \g_xpg_langsetup_prop
+\prop_new_linked:N \l_xpg_langsetup_prop
\cs_new_protected:Npn \__xpg_keys_define_lang:n #1
{
- \keys_define:nn {polyglossia}{
+ \keys_define:nn {polyglossia}
+ {
% the script font
#1 / script
.code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/script}{##1}
- \prop_gput:Nne{\g_xpg_langsetup_prop}{#1/lcscript}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/script}{##1}
+ \prop_put:Nne \l_xpg_langsetup_prop {#1/lcscript}
{\tl_if_empty:nF{##1}{\str_lowercase:n{##1}}}
},
#1 / script
@@ -426,84 +512,89 @@
.initial:n = latin,
% the opentype script tag
#1 / scripttag
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/scripttag}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/scripttag}{##1}},
#1 / scripttag
.default:n = {},
#1 / scripttag
.initial:n = {},
% the language full name
#1 / language
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/language}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/language}{##1}},
#1 / language
.value_required:n = true,
#1 / language
.initial:x = {\str_uppercase:n#1},
% the language tag
#1 / langtag
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/langtag}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/langtag}{##1}},
#1 / langtag
.value_required:n = true,
#1 / langtag
.initial:n = {},
% the BCP-47 tag
#1 / bcp47
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47}{##1}},
#1 / bcp47
.value_required:n = true,
#1 / bcp47
.initial:n = {},
% the BCP-47 language tag
#1 / bcp47-language
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-language}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-language}{##1}},
#1 / bcp47-language
.value_required:n = true,
#1 / bcp47-language
.initial:n = {},
% the BCP-47 region tag
#1 / bcp47-region
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-region}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-region}{##1}},
#1 / bcp47-region
.value_required:n = false,
#1 / bcp47-region
.initial:n = {},
% the BCP-47 script tag
#1 / bcp47-script
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-script}{##1}},
+ .code:n =
+ {
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-script}{##1}
+ \prop_put:Nne \l_xpg_langsetup_prop {#1/lc-bcp47-script}
+ {\tl_if_empty:nF{##1}{\str_lowercase:n{##1}}}
+ },
#1 / bcp47-script
.value_required:n = true,
#1 / bcp47-script
- .initial:n = {},
+ .initial:n = {Latn},
% the BCP-47 variant tag
#1 / bcp47-variant
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-variant}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-variant}{##1}},
#1 / bcp47-variant
.value_required:n = false,
#1 / bcp47-variant
.initial:n = {},
% the BCP-47 extension-t tag
#1 / bcp47-extension-t
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-extension-t}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-extension-t}{##1}},
#1 / bcp47-extension-t
.value_required:n = false,
#1 / bcp47-extension-t
.initial:n = {},
% the BCP-47 extension-u tag
#1 / bcp47-extension-u
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-extension-u}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-extension-u}{##1}},
#1 / bcp47-extension-u
.value_required:n = false,
#1 / bcp47-extension-u
.initial:n = {},
% the BCP-47 extension-x tag
#1 / bcp47-extension-x
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-extension-x}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-extension-x}{##1}},
#1 / bcp47-extension-x
.value_required:n = false,
#1 / bcp47-extension-x
.initial:n = {},
% the BCP-47 casing alias
#1 / bcp47-casing
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/bcp47-casing}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/bcp47-casing}{##1}},
#1 / bcp47-casing
.value_required:n = false,
#1 / bcp47-casing
@@ -512,7 +603,7 @@
#1 / hyphennames
.code:n = {
\clist_set:Nn{\l_tmpa_clist}{##1}
- \prop_gput:Nne{\g_xpg_langsetup_prop}{#1/hyphennames}{\clist_use:Nn \l_tmpa_clist {,}}
+ \prop_put:Nne \l_xpg_langsetup_prop {#1/hyphennames}{\clist_use:Nn \l_tmpa_clist {,}}
},
#1 / hyphennames
.value_required:n = true,
@@ -525,8 +616,8 @@
{LR}{}
{RL}{\RequireBidi}
}
- {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/direction}{##1}}
- {\xpg@error{Unknown~ direction~ "##1"~ for~ language~ "#1"}}
+ { \prop_put:Nnn \l_xpg_langsetup_prop {#1/direction}{##1} }
+ { \xpg_error_msg:n {Unknown~ direction~ "##1"~ for~ language~ "#1"} }
},
#1 / direction
.value_required:n = true,
@@ -537,9 +628,9 @@
.code:n = {
% check syntax
\int_compare:nNnF { \clist_count:n {##1} } = {2}
- {\xpg@error{hypenmins~should~be~a~list~of~two~entries,~got~"##1"}}
+ { \xpg_error_msg:n {hypenmins~should~be~a~list~of~two~entries,~got~"##1"} }
% set prop
- \prop_gput:Nnn \g_xpg_langsetup_prop {#1/hyphenmins} {##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/hyphenmins} {##1}
},
#1 / hyphenmins
.value_required:n = true,
@@ -550,9 +641,9 @@
.code:n = {
% check syntax
\int_compare:nNnF { \clist_count:n {##1} } = {1}
- {\xpg@error{totalhyphenhypenmin~should~be~a~single~entry,~got~"##1"}}
+ { \xpg_error_msg:n {totalhyphenhypenmin~should~be~a~single~entry,~got~"##1"} }
% set prop
- \prop_gput:Nnn \g_xpg_langsetup_prop {#1/totalhyphenmin} {##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/totalhyphenmin} {##1}
},
#1 / totalhyphenmin
.value_required:n = false,
@@ -571,35 +662,35 @@
% environment name
#1 / envname
.code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/envname}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/envname}{##1}
},
#1/ envname.value_required:n = true,
#1/ envname.initial:n = {#1},
% babel name
#1 / babelname
.code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/babelname}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/babelname}{##1}
},
#1/ babelname.value_required:n = true,
#1/ babelname.initial:n = {#1},
% default numerals
#1 / localnumeral
. code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/localnumeral}{##1}
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/Localnumeral}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/localnumeral}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/Localnumeral}{##1}
},
#1 / localnumeral.value_required:n = true,
- #1 / localnumeral.initial:n = {polyglossia@C@localnumeral},
+ #1 / localnumeral.initial:n = {xpg_C_localnumeral:nn},
% uppercased
#1 / Localnumeral
. code:n = {
- \prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/Localnumeral}{##1}
+ \prop_put:Nnn \l_xpg_langsetup_prop {#1/Localnumeral}{##1}
},
#1 / Localnumeral.value_required:n = true,
- #1 / Localnumeral.initial:n = {polyglossia@C@localnumeral},
+ #1 / Localnumeral.initial:n = {xpg_C_localnumeral:nn},
% environment define command (by default create the environment)
#1 / DefineCommandsCmd
- .code:n = {\prop_gput:Nnn{\g_xpg_langsetup_prop}{#1/DefineCommandsCmd}{##1}},
+ .code:n = {\prop_put:Nnn \l_xpg_langsetup_prop {#1/DefineCommandsCmd}{##1}},
#1 / DefineCommandsCmd
.value_required:n = true,
#1 / DefineCommandsCmd
@@ -607,9 +698,20 @@
}
}
+\DeclareExpandableDocumentCommand \babelname { }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \languagename / babelname }
+ }
+
+\DeclareExpandableDocumentCommand \mainbabelname { }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / babelname }
+ }
+
% TODO move to C module
-\newcommand*{\polyglossia@C@localnumeral}[2]{
- \polyglossia@Clang@@arabic{#2}
+\cs_new:Nn \xpg_C_localnumeral:nn
+{
+ \xpg_Clang_arabic{#2}
}
\cs_new:Npn \__xpg_localnumeral_parse:nn #1 #2
@@ -633,7 +735,7 @@
\__xpg_localnumeral_parse:nn
} { #2 }
}
- { \use:c { \prop_item:Ne \g_xpg_langsetup_prop
+ { \use:c { \prop_item:Ne \l_xpg_langsetup_prop
{ \languagename / #3 } } { } { #1 } }
}
@@ -668,31 +770,31 @@
\cs_new_nopar:Npn \__xpg_indent_first:n #1
{
\bool_if:cTF { g__xpg_#1_if_bool }
- { \french@indent } { \nofrench@indent }
+ { \__xpg_french_indent: } { \__xpg_no_french_indent: }
}
\cs_new:Nn \__xpg_lang_set_par_direction:n
{
- \prop_get:NeNTF \g_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
+ \prop_get:NeNTF \l_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
{
\__xpg_set_par_direction:n{\l_tmpa_tl}
}
{
- \xpg@error{Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
- \prop_show:N{\g_xpg_langsetup_prop}
+ \xpg_error_msg:n {Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
+ \prop_show:N{\l_xpg_langsetup_prop}
}
}
\cs_new:Nn \__xpg_lang_set_text_direction:nn
{
- \prop_get:NeNTF \g_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
+ \prop_get:NeNTF \l_xpg_langsetup_prop {#1/direction} \l_tmpa_tl
{
\__xpg_set_text_direction:n{\l_tmpa_tl}{#2}
}
{
- \xpg@error{Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
- \prop_show:N{\g_xpg_langsetup_prop}
+ \xpg_error_msg:n {Could~ not~ retrieve~ key~ direction~ for~ language~ "#1"}
+ \prop_show:N{\l_xpg_langsetup_prop}
}
}
@@ -723,7 +825,7 @@
{
\bool_gset_true:N \g__xpg_hyphenation_disabled_bool
\tl_gset:Ne \g__xpg_lastlanguage_tl { \the\language }
- % We do not call \xpg@set@hyphenation@patterns here to avoid a warning message.
+ % We do not call \xpg_set_hyphenation_patterns:n here to avoid a warning message.
% "nohyphenation" is not listed in language.dat.lua.
\language=\l@nohyphenation
}
@@ -735,19 +837,19 @@
{
\bool_gset_false:N \g__xpg_hyphenation_disabled_bool
\language=\tl_use:N{\g__xpg_lastlanguage_tl}
- }%
+ }
}
\cs_new:Npn \__xpg_auto_setupfont:n #1
{
\bool_if:cTF { g__xpg_#1_fontsetup_bool }
{
- \str_if_eq:eeTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript}}{latin}
- {\xpg@fontsetup@latin{#1}}
- {\xpg@fontsetup@nonlatin{#1}}
+ \str_if_eq:eeTF{\prop_item:Nn{\l_xpg_langsetup_prop}{#1/lcscript}}{latin}
+ {\SetupLatinPolyglossiaFont{#1}}
+ {\SetupNonLatinPolyglossiaFont{#1}}
}
{
- \xpg@info{Skipping~ automatic~ font~ setup~ for~ language~ #1}
+ \xpg_info_msg:n{Skipping~ automatic~ font~ setup~ for~ language~ #1}
}
}
@@ -759,40 +861,40 @@
\bool_if:nTF{\tl_if_empty_p:n{#1} || \tl_if_empty_p:n{#2}}
{
% maybe an error ?
- \xpg@warning{Asking~ to~ add~ empty~ feature~to~ main~ font~
+ \xpg_warning_msg:n{Asking~ to~ add~ empty~ feature~to~ main~ font~
(Language="#2"~ to~ langtag~ "#1")}
}
{
- \str_if_eq:nnTF{#2}{Turkish}{
+ \str_if_eq:nnTF{#2}{Turkish}
+ {
\fontspec_if_language:nTF {TRK}
{
\addfontfeature{Language=Turkish}
}
{
- \fontspec_if_language:nTF {TUR}
+ \fontspec_if_language:nT {TUR}
{
\addfontfeature{Language=Turkish}
- }{}
+ }
}
}{
- \fontspec_if_language:nTF{#1}
+ \fontspec_if_language:nT{#1}
{
\addfontfeature{Language=#2}
}
- {}
}
}
}
-\cs_generate_variant:Nn \__xpg_add_font_feature_language:nn { on , no, oo , Vn, nV, VV , xn, nx, xx}
+\cs_generate_variant:Nn \__xpg_add_font_feature_language:nn { ee }
-% add fontfeature Script=#2 to scripttag #1
-% do nothing if #1 or #2 is empty
+% add fontfeature Script=#3 to scripttag #2 for family #1
+% do nothing if #2 or #3 is empty
\cs_new:Nn \__xpg_add_font_feature_script:nnn
{
\bool_if:nTF{\tl_if_empty_p:n{#2} || \tl_if_empty_p:n{#3}}
{
% maybe an error ?
- \xpg@warning{Asking~ to~ add~ empty~ feature~to~ main~ font
+ \xpg_warning_msg:n{Asking~ to~ add~ empty~ feature~to~ main~ font
(Script="#3"~ to~ scripttag~ "#2")}
}
{
@@ -828,118 +930,58 @@
\regex_replace_once:nnN { \.[^\.]* \Z } { } \xpg_fname_str
% ... and, finally, quotation marks
\regex_replace_once:nnN { " } { } \xpg_fname_str
- \xpg@error{
- The~ current~ main ~ \xpg_ffamily_tl\space font,~ \xpg_fname_str,~ does~ not~ contain~ the~"#3"~ script!\MessageBreak
- Please~ define~\csname\tl_if_empty:nF{#3}{\str_lowercase:n{#3}}font\xpg_ffamilysh_tl\endcsname~
- with~ \string\newfontfamily\space command
+ \xpg_error_msg:n
+ {
+ The~ current~ main ~ \xpg_ffamily_tl\space font,~ \xpg_fname_str,~ does~ not~ contain~ the~"#3"~ script! \iow_newline:
+ Please~ define~\csname\tl_if_empty:nF{#3}{\str_lowercase:n{#3}}font\xpg_ffamilysh_tl\endcsname~
+ with~ \string\newfontfamily\space command
}
}
}
}
-\cs_generate_variant:Nn \__xpg_add_font_feature_script:nnn { non , nno, noo , nVn, nnV, nVV , nxn, nnx, nxx}
+\cs_generate_variant:Nn \__xpg_add_font_feature_script:nnn { nee }
-\def\xpg@fontsetup@latin#1{
- \begingroup
- \csgdef{#1@font@rm}{
- \cs_if_exist_use:cF{#1font}{
- \rmfamilylatin
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }
- }
- \csgdef{#1@font@sf}{
- \cs_if_exist_use:cF{#1fontsf}{
- \sffamilylatin
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }
- }
- \csgdef{#1@font@tt}{
- \cs_if_exist_use:cF{#1fonttt}{
- \ttfamilylatin
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }
- }
- \endgroup
-}
-
-\def\xpg@fontsetup@nonlatin#1{
- \begingroup
- \csgdef{#1@font@rm}{
- \cs_if_exist_use:cF{#1font}
- {
- \providetoggle{#1@use@script@font}
- \str_if_eq:nnTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- {\rmfamilylatin}
- {\cs_if_exist_use:cTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript} font}
- {
- \toggletrue{#1@use@script@font}
- }
- {
- \rmfamilylatin
- }
- }
- \iftoggle{#1@use@script@font}{}{
- \__xpg_add_font_feature_script:nxx{rm}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/scripttag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}
- }%
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }%
- \def\familytype{rm}
- }%
- \csgdef{#1@font@sf}{
- \cs_if_exist_use:cF{#1fontsf}
+%% TODO: probably can be cleaned a little more
+\cs_new_protected:Npn \__xpg_setup_font:nnnnn #1 #2 #3 #4 #5 % #1 = lang, #2 = family, #3 = family, #4 = gobble, #5 gobble
+ {
+ \cs_set_protected_nopar:cpn { #1@font@#2 }
{
- \providetoggle{#1@use@script@fontsf}
- \str_if_eq:nnTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- {\sffamilylatin}
- {\cs_if_exist_use:cTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript} fontsf}
+ \cs_if_exist_use:cF{ #1font#3 }
{
- \toggletrue{#1@use@script@fontsf}
- }
- {
- \sffamilylatin
- }
- }
- \iftoggle{#1@use@script@fontsf}{}{
- \__xpg_add_font_feature_script:nxx{sf}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/scripttag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}
- }%
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- }%
- \def\familytype{sf}
- }%
- \csgdef{#1@font@tt}{
- \cs_if_exist_use:cF{#1fonttt}
- {
- \providetoggle{#1@use@script@fonttt}
- \str_if_eq:nnTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
- {\ttfamilylatin}
- {\cs_if_exist_use:cTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript} fonttt}
- {
- \toggletrue{#1@use@script@fonttt}
- }
- {
- \ttfamilylatin
- }
- }
- \iftoggle{#1@use@script@fonttt}{}{
- \__xpg_add_font_feature_script:nxx{tt}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/scripttag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/script}}
- }
- \__xpg_add_font_feature_language:xx{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/langtag}}
- {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/language}}
+ \cs_if_exist_use:cF { \prop_item:Nn \l_xpg_langsetup_prop { #1 / lc-bcp47-script } font#3 }
+ {
+ #4 { \prop_item:Nn \l_xpg_langsetup_prop { #1 / lcscript } font#3 }
+ {
+ \use:c { #2familylatin }
+ #5
+ {
+ \__xpg_add_font_feature_script:nee { #2 }
+ { \prop_item:Nn \l_xpg_langsetup_prop { #1 / scripttag } }
+ { \prop_item:Nn \l_xpg_langsetup_prop { #1 / script } }
+ }
+ }
+ }
+ \__xpg_add_font_feature_language:ee
+ { \prop_item:Nn \l_xpg_langsetup_prop { #1 / langtag } }
+ { \prop_item:Nn \l_xpg_langsetup_prop { #1 / language } }
+ }
+ \tl_set:Nn \familytype { #2 }
}
- \def\familytype{tt}
}
- \endgroup
-}
+
+\NewDocumentCommand \SetupLatinPolyglossiaFont { m }
+ {
+ \__xpg_setup_font:nnnnn { #1 } { rm } { } { \use_ii:nn } { \use_none:n }
+ \__xpg_setup_font:nnnnn { #1 } { sf } { sf } { \use_ii:nn } { \use_none:n }
+ \__xpg_setup_font:nnnnn { #1 } { tt } { tt } { \use_ii:nn } { \use_none:n }
+ }
+
+\NewDocumentCommand \SetupNonLatinPolyglossiaFont { m }
+ {
+ \__xpg_setup_font:nnnnn { #1 } { rm } { } { \cs_if_exist_use:cF } { \use:n }
+ \__xpg_setup_font:nnnnn { #1 } { sf } { sf } { \cs_if_exist_use:cF } { \use:n }
+ \__xpg_setup_font:nnnnn { #1 } { tt } { tt } { \cs_if_exist_use:cF } { \use:n }
+ }
%%% END OF PolyglossiaSetup
@@ -948,40 +990,53 @@
\cs_new_nopar:Nn \__xpg_local_marks:n { }
\cs_new_nopar:Nn \__xpg_enable_local_marks:
{
- \xpg@info{Option:~ localmarks}
+ \xpg_info_msg:n{Option:~ localmarks}
\cs_gset_nopar:Nn \__xpg_local_marks:n
{
- \def\xpg@tmp@lang{##1}
- \DeclareRobustCommand\markboth[2]{
- \begingroup
- \let\label\relax \let\index\relax \let\glossary\relax
- \unrestored@protected@xdef\@themark
- {
- {\lowercase{\foreignlanguage{\xpg@tmp@lang}}{\protect\@@ensure@maindir{####1}}}
- {\lowercase{\foreignlanguage{\xpg@tmp@lang}}{\protect\@@ensure@maindir{####2}}}
- }
- \@temptokena \expandafter{\@themark}
- \mark{\the\@temptokena}
- \endgroup
- \if@nobreak\ifvmode\nobreak\fi\fi
- }
- \DeclareRobustCommand\markright[1]{
- \begingroup
- \let\label\relax \let\index\relax \let\glossary\relax
- \expandafter\@markright\@themark
- {\lowercase{\foreignlanguage{\xpg@tmp@lang}}{\protect\@@ensure@maindir{####1}}}
- \@temptokena \expandafter{\@themark}
- \mark{\the\@temptokena}
- \endgroup
- \if@nobreak\ifvmode\nobreak\fi\fi
- }
+ \DeclareDocumentCommand \markboth { m m }
+ {
+ \group_begin:
+ \cs_set_eq:cc { label } { relax }
+ \cs_set_eq:cc { index } { relax }
+ \cs_set_eq:cc { glossary } { relax }
+ \unrestored@protected@xdef\@themark
+ {
+ {\foreignlanguage{##1}{\protect\@@ensure@maindir{####1}}}
+ {\foreignlanguage{##1}{\protect\@@ensure@maindir{####2}}}
+ }
+ \@temptokena \expandafter{\@themark}
+ \mark_insert:nn{2e-left}{####1}
+ \mark_insert:nn{2e-right}{####2}
+ \tl_if_empty:nF{####2}{ \mark_insert:nn{2e-right-nonempty}{####2} }
+ \mark{\the\@temptokena}
+ \group_end:
+ \if@nobreak\ifvmode\nobreak\fi\fi
+ }
+ \DeclareDocumentCommand \markright { m }
+ {
+ \group_begin:
+ \cs_set_eq:cc { label } { relax }
+ \cs_set_eq:cc { index } { relax }
+ \cs_set_eq:cc { glossary } { relax }
+ \expandafter\@markright\@themark
+ {\foreignlanguage{##1}{\protect\@@ensure@maindir{####1}}}
+ \@temptokena \expandafter{\@themark}
+ \mark_insert:nn{2e-right}{####1}
+ \tl_if_empty:nF{####1}{ \mark_insert:nn{2e-right-nonempty}{####1} }
+ \mark{\the\@temptokena}
+ \group_end:
+ \if@nobreak\ifvmode\nobreak\fi\fi
+ }
}
}
%we call this macro when a gloss file is not found for a given language
-\def\xpg@nogloss#1{
- \xpg@warning{File~ gloss-#1.ldf~ do~ not~ exists!\MessageBreak
- I~ will~ nevertheless~ try~ to~ use~ hyphenation~ patterns~ for~ #1.}
+\cs_new_nopar:Nn \__xpg_no_gloss:n
+{
+ \xpg_warning_msg:n
+ {File~ gloss-#1.ldf~ do~ not~ exists! \iow_newline:
+ I~ will~ nevertheless~ try~ to~ use~ hyphenation~ patterns~ for~ #1.}
+
\PolyglossiaSetup{#1}{hyphenmins={2,3},hyphennames={#1},fontsetup=true}
% the above amounts to:
%\ifcsundef{l@#1}%
@@ -990,59 +1045,64 @@
%\csdef{#1@language}{\language=\csname l@#1\endcsname}%
}
-\newcommand{\xpg@input}[1]{
+\cs_new_nopar:Nn \xpg_input:n
+{
% Store catcode of @ before making at letter
- \chardef\xpg@saved@at@catcode\catcode`\@
- \makeatletter
- \input{#1}
+ \cs_set_protected_nopar:Npx \__xpg_restore_at_catcode:
+ { \char_set_catcode:nn { `@ } { \char_value_catcode:n {`\@ } } }
+ \char_set_catcode_letter:N @
+ \file_input:n { #1 }
% restore former @ catcode
- \catcode`\@=\xpg@saved@at@catcode
+ \__xpg_restore_at_catcode:
}
% try to load a language file
-\cs_new:Nn \__xpg_load_lang_definition:nn {
- \file_if_exist:nTF{gloss-#2.ldf}
+\cs_new:Nn \__xpg_load_lang_definition:nn
+{
+ \file_if_exist:nTF{gloss-#2.ldf}
{
- % Temporarily force catcode of ~ to 13 since babelsh.def
+ \tl_set:Nn \xpg__tmp_default_options_tl { #1 }
+ % Temporarily force catcode of ~ to 13 (active) since babelsh.def
% requires it. This is needed particularly with LaTeX3
% packages which force \ExplSyntaxOn (#425)
- \protected\edef\xpg@restore@tilde@catcode{\catcode 126 = \the\catcode 126\relax}
- \catcode 126 = 13
- \xpg@input{gloss-#2.ldf}
- \setkeys{#2}{#1}
+ \cs_gset_protected:Npx \__xpg_restore_tilde_catcode:
+ { \char_set_catcode:nn { 126 } { \char_value_catcode:n { 126 } } }
+ \char_set_catcode_active:n { 126 }
+ \xpg_input:n {gloss-#2.ldf}
% restore former ~ catcode
- \xpg@restore@tilde@catcode
+ \__xpg_restore_tilde_catcode:
}
{
- \xpg@nogloss{#2}
+ \__xpg_no_gloss:n {#2}
}
}
\cs_generate_variant:Nn \__xpg_load_lang_definition:nn { ee }
% load a master language from an alias file
-\newcommand*\xpg@load@master@language[1] {
- \xpg@input{gloss-#1.ldf}
+\NewDocumentCommand \InheritGlossFile { m }
+{
\seq_if_in:NeF \__xpg_langs_loaded {#1}
{
+ \xpg_input:n {gloss-#1.ldf}
% define environment and command if not alias
\str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#1/target}} {#1} {
- \use:c{\prop_item:Nn{\g_xpg_langsetup_prop}
+ \use:c{\prop_item:Nn{\l_xpg_langsetup_prop}
{#1/DefineCommandsCmd}}
{#1}
}
+ \seq_gput_right:Nn \__xpg_langs_loaded {#1}
}
\__xpg_register_language:nn{}{#1}
- \seq_gput_right:Nn \__xpg_langs_loaded {#1}
}
-\prop_new:N \__xpg_alias
+\prop_new_linked:N \__xpg_alias
% define environment and command if not alias
\cs_new:Nn \xpg_define_language_commands:n {
\str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#1/target}} {#1}
{
\exp_args:Ne
- \NewDocumentEnvironment {\prop_item:Nn{\g_xpg_langsetup_prop}{#1/envname}} { O{} }
+ \NewDocumentEnvironment {\prop_item:Nn{\l_xpg_langsetup_prop}{#1/envname}} { O{} }
{
\otherlanguage [ ##1 ] { #1 }
}
@@ -1070,7 +1130,7 @@
% target to self fall back to language table
\str_if_eq:eeTF { \prop_item:Ne \__xpg_alias {#1/target} } { #1 }
{
- \prop_item:Nn{\g_xpg_langsetup_prop} {#1/#2}
+ \prop_item:Nn{\l_xpg_langsetup_prop} {#1/#2}
}
% load alias by recursion
{
@@ -1193,20 +1253,29 @@
\clist_if_in:NeF \xpg@loaded {#2}{
\clist_gput_right:Ne \xpg@loaded {#2}
}
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@set@langvariant}
+ \group_begin:
+ % set language options
+ \__xpg_set_language_options:nn {#2} {#1}
% register babelname
- \prop_get:NeN \g_xpg_langsetup_prop {#2/babelname} \l_tmpa_tl
+ \prop_get:NeN \l_xpg_langsetup_prop {#2/babelname} \l_tmpa_tl
\clist_if_in:NeF \xpg@bloaded {\l_tmpa_tl}{
\clist_gput_right:Ne \xpg@bloaded {\l_tmpa_tl}
}
% register BCP-47 ID
- \prop_get:NeN \g_xpg_langsetup_prop {#2/bcp47} \l_tmpa_tl
+ \prop_get:NeN \l_xpg_langsetup_prop {#2/bcp47} \l_tmpa_tl
\clist_if_in:NeF \xpg@bcp@loaded {\l_tmpa_tl}{
\clist_gput_right:Ne \xpg@bcp@loaded {\l_tmpa_tl}
}
+ % register variant
+ \prop_get:NnNT \l_xpg_curropt_prop {#2/variant} \l_tmpa_tl {
+ \clist_if_in:NeF \xpg@vloaded {\l_tmpa_tl}{
+ \clist_gput_right:Ne \xpg@vloaded {\l_tmpa_tl}
+ }}
+ \group_end:
}
+\prop_new_linked:N \l_xpg_curropt_prop
+
\DeclareDocumentCommand \setdefaultlanguage { O{} m }
{
% latex is an internal language, so do not record
@@ -1221,12 +1290,13 @@
\__xpg_load_lang_definition:nn{#1}{#2}
% define environment and command if not alias
\str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#2/target}} {#2} {
- \use:c{\prop_item:Ne{\g_xpg_langsetup_prop}
+ \use:c{\prop_item:Ne{\l_xpg_langsetup_prop}
{#2/DefineCommandsCmd}}
{#2}
}
\seq_gput_right:Ne \__xpg_langs_loaded {#2}
}
+ \cs_set_nopar:Npe \mainlanguagevariant { \prop_item:Ne \l_xpg_curropt_prop { \xpg_alias_base_lang:n{#2} / variant } }
\exp_args:Nee \__xpg_set_default_language:nn {\xpg_alias_add_to_option_i:nn{#2}{#1}}
{\xpg_alias_base_lang:n{#2}}
}
@@ -1234,70 +1304,22 @@
\cs_new:Nn \__xpg_set_default_language:nn
{
- \gdef\xpg@main@language{#2}
- \tl_if_blank:nTF {#1}
- {
- \cs_gset_nopar:Npn \mainlanguagevariant {}
- }
- {
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@main@langvariant}
- }
- \csgdef{#2@gvar}{\mainlanguagevariant}
+ \tl_gset:Nn \xpg_main_language_tl {#2}
%% The following settings are for the default language and script
% this tells bidi.sty or luabidi.sty that the document is RTL
- \__xpg_if_LR_str:eF{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/direction}}
+ \__xpg_if_LR_str:eF{\prop_item:Nn{\l_xpg_langsetup_prop}{#2/direction}}
{
\__xpg_setRTLmain:
}
\cs_gset_nopar:Nn \__xpg_at_begin_document_selectlanguage: {
\selectbackgroundlanguage{#2}
- \selectlanguage[#1]{#2}%
+ \selectlanguage[#1]{#2}
}
- \xpg@info{Default~ language~ is~ #2}
- \polyglossia@set@language@name[#1]{#2}
+ \str_if_eq:eeF { #2 } { latex }
+ { \xpg_info_msg:n{Default~ language~ is~ #2} }
+ \xpg_set_language_name:n { #2 }
\cs_gset_nopar:Npn \mainlanguagename {#2}
- % Store babelname of main language (for external packages such as biblatex)
- \cs_gset_nopar:Npe \mainbabelname { \prop_item:Nn \g_xpg_langsetup_prop {#2/babelname} }
- % Store babelname of current language (for external packages such as biblatex)
- \cs_gset_eq:NN \babelname \mainbabelname
- \cs_gset_eq:cc{#2@gbabelname}{babelname}%
- % Store BCP-47 ID and subtags of main language:
- % 1. store main.* (sub)tags
- \cs_gset_nopar:cpe {bcp47.main.tag} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47 } }
- \cs_gset_nopar:cpe {bcp47.main.language} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-language } }
- \cs_gset_nopar:cpe {bcp47.main.region} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-region } }
- \cs_gset_nopar:cpe {bcp47.main.script} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-script } }
- \cs_gset_nopar:cpe {bcp47.main.variant} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-variant } }
- \cs_gset_nopar:cpe {bcp47.main.extension.t} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47extension-t } }
- \cs_gset_nopar:cpe {bcp47.main.extension.u} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-extension-u } }
- \cs_gset_nopar:cpe {bcp47.main.extension.x} { \prop_item:Nn \g_xpg_langsetup_prop { #2 / bcp47-extension-x } }
- % For casing, we fall back to language if bcp47-casing is not explicitly set
- \cs_set_nopar:cpx {tmpcasing} { \prop_item:Ne \g_xpg_langsetup_prop { #2 / bcp47-casing } }
- \str_if_empty:NTF \tmpcasing
- { \cs_gset_nopar:cpe {bcp47.main.casing} { \prop_item:Nn \g_xpg_langsetup_prop {#2 / bcp47-language} } }
- { \cs_gset_nopar:cpe {bcp47.main.casing} { \tmpcasing } }
- % 2. Store lang (sub)tags
- \cs_gset_eq:cc {bcp47.tag} {bcp47.main.tag}
- \cs_gset_eq:cc {bcp47.language} {bcp47.main.language}
- \cs_gset_eq:cc {bcp47.region} {bcp47.main.region}
- \cs_gset_eq:cc {bcp47.script} {bcp47.main.script}
- \cs_gset_eq:cc {bcp47.variant} {bcp47.main.variant}
- \cs_gset_eq:cc {bcp47.extension.t} {bcp47.main.extension.t}
- \cs_gset_eq:cc {bcp47.extension.u} {bcp47.main.extension.u}
- \cs_gset_eq:cc {bcp47.extension.x} {bcp47.main.extension.x}
- \cs_gset_eq:cc {bcp47.casing} {bcp47.main.casing}
- % 3. Store global language BCP47 settings (with default subtags as set by main language options)
- \cs_gset_eq:cc{#2@g.bcp47.tag}{bcp47.tag}
- \cs_gset_eq:cc{#2@g.bcp47.language}{bcp47.language}
- \cs_gset_eq:cc{#2@g.bcp47.region}{bcp47.region}
- \cs_gset_eq:cc{#2@g.bcp47.script}{bcp47.script}
- \cs_gset_eq:cc{#2@g.bcp47.variant}{bcp47.variant}
- \cs_gset_eq:cc{#2@g.bcp47.extension.t}{bcp47.extension.t}
- \cs_gset_eq:cc{#2@g.bcp47.extension.u}{bcp47.extension.u}
- \cs_gset_eq:cc{#2@g.bcp47.extension.x}{bcp47.extension.x}
- \cs_gset_eq:cc{#2@g.bcp47.casing}{bcp47.casing}
}
\DeclareCommandCopy \setmainlanguage \setdefaultlanguage
@@ -1308,11 +1330,11 @@
{
\str_case:nnF {#1}
{
- {bcp-47} { \csuse{bcp47.tag} }
- {bcp47} { \csuse{bcp47.tag} }
+ {bcp-47} { \use:c{bcp47.tag} }
+ {bcp47} { \use:c{bcp47.tag} }
}
{
- \xpg@error{Invalid~ \string\languageid\space argument:~ #1}
+ \xpg_ill_arg_msg:nn { #1 } { \languageid }
}
}
@@ -1322,11 +1344,11 @@
{
\str_case:nnF {#1}
{
- {bcp-47} { \csuse{bcp47.main.tag} }
- {bcp47} { \csuse{bcp47.main.tag} }
+ {bcp-47} { \use:c{bcp47.main.tag} }
+ {bcp47} { \use:c{bcp47.main.tag} }
}
{
- \xpg@error{Invalid~ \string\mainlanguageid\space argument:~ #1}
+ \xpg_ill_arg_msg:nn { #1 } { \mainlanguageid }
}
}
% Kernel command to access to BCP-47 data.
@@ -1346,281 +1368,205 @@
% and main.* variants thereof
% See https://github.com/latex3/latex2e/issues/1035
\DeclareExpandableDocumentCommand \BCPdata {m}
+ {
+ \cs_if_exist_use:cF{bcp47.#1}
+ { \xpg_ill_arg_msg:nn { #1 } { \BCPdata } }
+ }
+
+\clist_map_inline:nn
+ {
+ language, region, script, variant,
+ extension.t, extension.u, extension.x
+ }{
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_replace_once:Nnn \l_tmpa_tl { . } { - }
+ \cs_gset_nopar:cpe { bcp47.#1 }
+ {
+ \exp_not:n { \prop_item:Ne \l_xpg_langsetup_prop } { \exp_not:N \languagename / bcp47-\l_tmpa_tl }
+ }
+ \cs_gset_nopar:cpe { bcp47.main.#1 }
+ {
+ \exp_not:n { \prop_item:Ne \l_xpg_langsetup_prop } { \exp_not:N \mainlanguagename / bcp47-\l_tmpa_tl }
+ }
+ }
+\cs_gset_nopar:cpn { bcp47.casing }
+ {
+ \tl_if_empty:eTF { \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47-casing } }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47-language }
+ }{
+ \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47-casing }
+ }
+ }
+\cs_gset_nopar:cpn { bcp47.main.casing }
+ {
+ \tl_if_empty:eTF { \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47-casing } }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47-language }
+ }{
+ \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47-casing }
+ }
+ }
+\cs_gset_nopar:cpn { bcp47.tag }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \languagename / bcp47 }
+ }
+\cs_gset_nopar:cpn { bcp47.main.tag }
+ {
+ \prop_item:Ne \l_xpg_langsetup_prop { \mainlanguagename / bcp47 }
+ }
+
+\cs_new_nopar:Npn \languagevariant
+ {
+ \prop_item:Ne \l_xpg_curropt_prop { \languagename / variant }
+ }
+
+\cs_new:Nn \xpg_set_language_name:n
{
- \cs_if_exist_use:cF{bcp47.#1}
- { \xpg@error{Invalid~ \string\BCPdata\space argument:~ #1} }
-}
-
-% main babel name
-\cs_new_nopar:Npn \mainlanguagename {}
-\cs_new_nopar:Npn \mainbabelname {}
-\cs_new_nopar:cpn {bcp47.main.tag} {}
-\cs_new_nopar:cpn {bcp47.main.language} {}
-\cs_new_nopar:cpn {bcp47.main.region} {}
-\cs_new_nopar:cpn {bcp47.main.script} {}
-\cs_new_nopar:cpn {bcp47.main.variant} {}
-\cs_new_nopar:cpn {bcp47.main.extension.t} {}
-\cs_new_nopar:cpn {bcp47.main.extension.u} {}
-\cs_new_nopar:cpn {bcp47.main.extension.x} {}
-\cs_new_nopar:cpn {bcp47.main.casing} {}
-\cs_new_nopar:Npn \mainlanguagevariant {}%
-% Store main language variant for external packages
-\define@key{xpg@main@langvariant}{variant}{
- \cs_gset_nopar:Npn \mainlanguagevariant {#1}
-}
-
-\cs_new_nopar:Npn \babelname {}
-\def\languagevariant{}
-% Store current language variant for external packages
-\define@key{xpg@set@langvariant}{variant}{
- \def\languagevariant{#1}
-}
-
-\newcommand*\polyglossia@set@language@name[2][]{
- \def\languagename{#2}
- \tl_if_blank:nTF {#1}{
- \ifcsundef{#2@gvar}{\def\languagevariant{}}{\def\languagevariant{\csuse{#2@gvar}}}
- }{
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@set@langvariant}
- \cs_set_eq:cc{#2@var}{languagevariant}
- }%
+ \cs_set:Npn \languagename { #1 }
}
-
-\newcommand*{\resetdefaultlanguage}[2][]{
+\NewDocumentCommand \resetdefaultlanguage { O{} m }
+{
\__xpg_reset_default_language:nn
{\xpg_alias_add_to_option_i:nn{#2}{#1}}
{\xpg_alias_base_lang:n{#2}}
}
-\cs_new:Nn \__xpg_store_bcp_info:nn
-{
- % Store BCP-47 ID and subtags of current language
- \tl_if_blank:nTF {#1}{
- % tag (e.g., en-US)
- \ifcsundef{#2@g.bcp47.tag}{
- \csedef{bcp47.tag}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47 } }
- }{
- \csedef{bcp47.tag}{\csuse{#2@g.bcp47.tag}}
- }
- % language (e.g., en)
- \ifcsundef{#2@g.bcp47.language}{
- \csedef{bcp47.language}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-language } }
- }{
- \csedef{bcp47.language}{\csuse{#2@g.bcp47.language}}
- }
- % region (e.g., US)
- \ifcsundef{#2@g.bcp47.region}{%
- \csedef{bcp47.region}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-region } }
- }{
- \csedef{bcp47.region}{\csuse{#2@g.bcp47.region}}%
- }
- % script (e.g., Latn)
- \ifcsundef{#2@g.bcp47.script}{
- \csedef{bcp47.script}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-script } }
- }{
- \csedef{bcp47.script}{\csuse{#2@g.bcp47.script}}
- }
- % variant (e.g., 1996)
- \ifcsundef{#2@g.bcp47.variant}{
- \csedef{bcp47.variant}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-variant } }
- }{
- \csedef{bcp47.variant}{\csuse{#2@g.bcp47.variant}}
- }
- % extension.t (tranformation)
- \ifcsundef{#2@g.bcp47.extension.t}{%
- \csedef{bcp47.extension.t}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-t } }
- }{
- \csedef{bcp47.extension.t}{\csuse{#2@g.bcp47.extension.t}}
- }
- % extension.u (additional locale information)
- \ifcsundef{#2@g.bcp47.extension.u}{%
- \csedef{bcp47.extension.u}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-u } }
- }{
- \csedef{bcp47.extension.u}{\csuse{#2@g.bcp47.extension.u}}
- }
- % extension.x (private use area)
- \ifcsundef{#2@g.bcp47.extension.x}{
- \csedef{bcp47.extension.x}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-x } }
- }{
- \csedef{bcp47.extension.x}{\csuse{#2@g.bcp47.extension.x}}
- }
- % casing
- \ifcsundef{#2@g.bcp47.casing}{
- % For casing, we fall back to language if bcp47-casing is not explicitly set
- \cs_set_nopar:cpx {tmpcasing} { \prop_item:Ne \g_xpg_langsetup_prop { #2 / bcp47-casing } }
- \str_if_empty:NTF \tmpcasing
- { \cs_gset_eq:cc {bcp47.casing} {bcp47.language} }
- { \csedef{bcp47.casing}{ \tmpcasing } }
- }{
- \csedef{bcp47.casing}{\csuse{#2@g.bcp47.casing}}
- }
- }{
- \csedef{bcp47.tag}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47 } }
- \csedef{bcp47.language}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-language } }
- \csedef{bcp47.region}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-region } }
- \csedef{bcp47.script}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-script } }
- \csedef{bcp47.variant}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-variant } }
- \csedef{bcp47.extension.t}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-t } }
- \csedef{bcp47.extension.u}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-u } }
- \csedef{bcp47.extension.x}{ \prop_item:Nn{ \g_xpg_langsetup_prop}{ #2 / bcp47-extension-x } }
- % For casing, we fall back to language if bcp47-casing is not explicitly set
- \cs_set_nopar:cpx {tmpcasing} { \prop_item:Ne \g_xpg_langsetup_prop { #2 / bcp47-casing } }
- \str_if_empty:NTF \tmpcasing
- { \cs_gset_eq:cc {bcp47.casing} {bcp47.language} }
- { \csedef{bcp47.casing}{ \tmpcasing } }
- }
-}
-
\cs_new:Nn \__xpg_reset_default_language:nn
{
\xpg_error_if_lang_not_loaded:n{#2}
% disable globalnumbers of previously defined default language
- \csuse{no\xpg@main@language @globalnumbers}
- \csuse{noextras@\xpg@main@language}%
+ \use:c{no\xpg_main_language_tl @globalnumbers}
+ \use:c{noextras@\xpg_main_language_tl}
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
- \cs_if_exist_use:c{noextras@bbl@\mainbabelname}%
- \csuse{init@noextras@\xpg@main@language}%
- \polyglossia@set@language@name[#1]{#2}%
- \__xpg_if_LR_str:eF{\prop_item:Ne{\g_xpg_langsetup_prop}{#2/direction}}
+ \cs_if_exist_use:c{noextras@bbl@\mainbabelname}
+ \use:c{init@noextras@\xpg_main_language_tl}
+ \xpg_set_language_name:n { #2 }
+ \__xpg_if_LR_str:eF{\prop_item:Ne{\l_xpg_langsetup_prop}{#2/direction}}
{
\@rlmaintrue\@rl@footnotetrue
}
- \selectlanguage[#1]{#2}%
- \selectbackgroundlanguage{#2}%
- % Store babelname of current language (for external packages such as biblatex)
- \tl_if_blank:nTF {#1}{%
- \ifcsundef{#2@gbabelname}{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }{
- \edef\babelname{\csuse{#2@gbabelname}}
- }
- }{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }
- % Store variant
- \tl_if_blank:nTF {#1}
- {
- \cs_gset_nopar:Npn \mainlanguagevariant {}
- }
- {
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@main@langvariant}
- }
- \csgdef{#2@gvar}{\mainlanguagevariant}
- % Store BCP-47 id of current language
- \__xpg_store_bcp_info:nn {#1}{#2}
+ \selectlanguage[#1]{#2}
+ \selectbackgroundlanguage{#2}
+ \cs_set_nopar:Npe \mainlanguagevariant { \prop_item:Ne \l_xpg_curropt_prop { \xpg_alias_base_lang:n{#2} / variant } }
}
% This saves the normalfont for the latin script since we may change normalfont in other scripts
-\let\normalfontlatin=\normalfont
+\cs_set_eq:cc { normalfontlatin } { normalfont }
% Provide default fonts (as set with \setmainfont, \setsansfont and \setmonofont)
% for Latin scripts and as a fallback for non-Latin scripts.
-\DeclareRobustCommand\xpg@defaultfont@rm{
+\cs_set_protected:Nn \xpg_defaultfont_rm:
+{
\tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
\fontfamily\rmdefault
- \ifdefined\UseHook\UseHook{rmfamily}\fi
+ \hook_use:n { rmfamily }
\selectfont
}
-\DeclareRobustCommand\xpg@defaultfont@sf{
+
+\cs_set_protected:Nn \xpg_defaultfont_sf:
+{
\tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
\fontfamily\sfdefault
- \ifdefined\UseHook\UseHook{sffamily}\fi
+ \hook_use:n { sffamily }
\selectfont
}
-\DeclareRobustCommand\xpg@defaultfont@tt{
+
+\cs_set_protected:Nn \xpg_defaultfont_tt:
+{
\tl_if_empty:NF{\g__fontspec_nfss_enc_tl}{\fontencoding{\g__fontspec_nfss_enc_tl}}
\fontfamily\ttdefault
- \ifdefined\UseHook\UseHook{ttfamily}\fi
+ \hook_use:n { ttfamily }
\selectfont
}
-\def\xpg@patch@fontfamilies{
+\cs_new:Nn \__xpg_patch_fontfamilies:
+{
% This robustifies the redefinitions of \<xx>family (suggestion by Enrico Gregorio)
% e.g. to prevent expansion of the \familytype redefinition in auxiliary files
- \csgappto{rmfamily~}{\def\familytype{rm}}
- \csgappto{sffamily~}{\def\familytype{sf}}
- \csgappto{ttfamily~}{\def\familytype{tt}}
+ \tl_put_right:cn {rmfamily~} {\tl_set:Nn \familytype {rm}}
+ \tl_put_right:cn {sffamily~} {\tl_set:Nn \familytype {sf}}
+ \tl_put_right:cn {ttfamily~} {\tl_set:Nn \familytype {tt}}
}
% 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@defaultfont@rm}
-\cs_gset_eq:cc{sffamilylatin}{xpg@defaultfont@sf}
-\cs_gset_eq:cc{ttfamilylatin}{xpg@defaultfont@tt}
-
-\def\xpg@set@familydefault{
- % We need the \edef route here in order
- % to detect both \renewcommand and \let
- % changes.
- \edef\tempa{\familydefault}
- \edef\tempb{\sfdefault}
- \ifcsequal{tempa}{tempb}
- {\def\familytype{sf}}
- {\edef\tempb{\ttdefault}
- \ifcsequal{tempa}{tempb}
- {\def\familytype{tt}}
- {\def\familytype{rm}}}
- \xpg@patch@fontfamilies
+\cs_set_eq:cc{rmfamilylatin}{xpg_defaultfont_rm:}
+\cs_set_eq:cc{sffamilylatin}{xpg_defaultfont_sf:}
+\cs_set_eq:cc{ttfamilylatin}{xpg_defaultfont_tt:}
+
+\cs_new:Nn \xpg_set_familydefault:
+{
+ \tl_set:Ne \l_tmpa_tl { \familydefault }
+ \tl_set:Ne \l_tmpb_tl { \sfdefault }
+ \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
+ { \tl_set:Nn \familytype {sf} }
+ { \tl_set_eq:NN \l_tmpb_tl \ttdefault
+ \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
+ { \tl_set:Nn \familytype {tt} }
+ { \tl_set:Nn \familytype {rm} }
+ }
+ \__xpg_patch_fontfamilies:
% This (re-)saves the normalfont for the latin script since we may
% change normalfont in other scripts
- \let\normalfontlatin=\normalfont
+ \cs_set_eq:cc{ normalfontlatin }{ normalfont }
% And for all cases, we also reset \<xx>familylatin
- \cs_gset_eq:cc{rmfamilylatin}{xpg@defaultfont@rm}
- \cs_gset_eq:cc{sffamilylatin}{xpg@defaultfont@sf}
- \cs_gset_eq:cc{ttfamilylatin}{xpg@defaultfont@tt}
-}
-
-\def\resetfontlatin{
- \DeclareRobustCommand\rmfamily{\xpg@defaultfont@rm}
- \DeclareRobustCommand\sffamily{\xpg@defaultfont@sf}
- \DeclareRobustCommand\ttfamily{\xpg@defaultfont@tt}
- \xpg@patch@fontfamilies
- \global\let\normalfont=\normalfontlatin
-}
-
-\def\selectfontfamilylatin{
- \def\tmp@tt{tt}\def\tmp@sf{sf}
- \ifx\familytype\tmp@tt
- \ttfamilylatin
- \else\ifx\familytype\tmp@sf
- \sffamilylatin
- \else\rmfamilylatin\fi\fi}
-
-\def\xpg@select@fontfamily#1{
- \def\tmp@tt{tt}\def\tmp@sf{sf}
- \ifx\familytype\tmp@tt
- \__xpg_use_or_warn:c{#1@font@tt}
- \else\ifx\familytype\tmp@sf
- \__xpg_use_or_warn:c{#1@font@sf}
- \else\__xpg_use_or_warn:c{#1@font@rm}\fi\fi}
-
-\def\xpg@set@normalfont#1{
- \letcs{\rmfamily}{#1@font@rm}
- \letcs{\sffamily}{#1@font@sf}
- \letcs{\ttfamily}{#1@font@tt}
- \robustify\rmfamily
- \robustify\sffamily
- \robustify\ttfamily
- \gdef\normalfont{\protect\xpg@select@fontfamily{#1}
- \fontseries{\seriesdefault}\selectfont
- \fontshape{\shapedefault}
- \ifdefined\UseHook\UseHook{normalfont}\fi
- \selectfont}
- \gdef\reset@font{\protect\normalfont}
-}
-
-\let\@@fterindentfalse\@afterindentfalse
-\def\french@indent{
- \let\@afterindentfalse\@afterindenttrue
+ \cs_set_eq:cc{ rmfamilylatin }{ xpg_defaultfont_rm: }
+ \cs_set_eq:cc{ sffamilylatin }{ xpg_defaultfont_sf: }
+ \cs_set_eq:cc{ ttfamilylatin }{ xpg_defaultfont_tt: }
+}
+
+\cs_set_nopar:Nn \xpg_select_fontfamily:n
+{
+ \str_if_eq:VnTF \familytype { tt }
+ { \__xpg_use_or_warn:c { #1@font@tt } }
+ { \str_if_eq:VnTF \familytype { sf }
+ { \__xpg_use_or_warn:c { #1@font@sf } }
+ { \__xpg_use_or_warn:c { #1@font@rm } }
+ }
+}
+
+\cs_set_protected:Npn \xpg_select_default_fontfamily:n #1
+ {
+ \tl_set:Ne \l_tmpa_tl { \familydefault }
+ \tl_set:Ne \l_tmpb_tl { \sfdefault }
+ \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
+ { \tl_set:Nn \familytype {sf} }
+ { \tl_set_eq:NN \l_tmpb_tl \ttdefault
+ \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl
+ { \tl_set:Nn \familytype {tt} }
+ { \tl_set:Nn \familytype {rm} }
+ }
+ \xpg_select_fontfamily:n{#1}
+ }
+
+\cs_new_nopar:Nn \xpg_set_normalfont:n
+{
+ \cs_set_eq:cc { rmfamily } { #1@font@rm }
+ \cs_set_eq:cc { sffamily } { #1@font@sf }
+ \cs_set_eq:cc { ttfamily } { #1@font@tt }
+ \cs_set_nopar:Npn \normalfont
+ { \xpg_select_default_fontfamily:n {#1}
+ \fontseries{\seriesdefault}\selectfont
+ \fontshape{\shapedefault}
+ \hook_use:n { normalfont }
+ \selectfont
+ }
+ \cs_set_nopar:Npn \reset@font {\protect\normalfont}
+}
+
+\cs_gset_eq:cc { @@fterindentfalse } { @afterindentfalse }
+\cs_new_nopar:Nn \__xpg_french_indent:
+{
+ \cs_set_eq:cc { @afterindentfalse } { @afterindenttrue }
\@afterindenttrue
}
-\def\nofrench@indent{
- \let\@afterindentfalse\@@fterindentfalse
+\cs_new_nopar:Nn \__xpg_no_french_indent:
+{
+ \cs_set_eq:cc { @afterindentfalse } { @@fterindentfalse }
\@afterindentfalse
}
@@ -1631,10 +1577,10 @@
\cs_new:Nn \__xpg_select_background_language:n
{
- \str_if_eq:eeTF{\prop_item:Nn{\g_xpg_langsetup_prop}{#1/lcscript}}{latin}
+ \str_if_eq:eeTF { \prop_item:Nn{\l_xpg_langsetup_prop}{#1/lcscript} } { latin }
{}
- {\xpg@set@normalfont{#1}}
- \csuse{#1@globalnumbers}
+ { \xpg_set_normalfont:n{#1} }
+ \use:c{#1@globalnumbers}
}
\cs_generate_variant:Nn \__xpg_select_background_language:n {e}
% Declare secondary language #2 with language options #1
@@ -1645,7 +1591,7 @@
\__xpg_load_lang_definition:ee {#1} {#2}
% define environment and command if not alias
\str_if_eq:eeT {\prop_item:Ne \__xpg_alias {#2/target}} {#2} {
- \use:c{\prop_item:Ne{\g_xpg_langsetup_prop}
+ \use:c{\prop_item:Ne{\l_xpg_langsetup_prop}
{#2/DefineCommandsCmd}}
{#2}
}
@@ -1658,28 +1604,13 @@
\cs_new:Nn \__xpg_set_otherlanguage:nn
{
\__xpg_register_language:nn{#1}{#2}
- % If a variant is set, store it.
- \gdef\otherlanguagevariant{}
- % Register the language options
- \__xpg_set_language_options:nnn {#2} {#1} {@xpg@other@langvariant}
-
- \csgdef{#2@gvar}{\otherlanguagevariant}
- \prop_get:NeNT \g_xpg_langsetup_prop {#2/babelname} \l_tmpa_tl
- { \xdef\otherlanguagebabelname{\l_tmpa_tl} }
- \cs_gset_eq:cc{#2@gbabelname}{otherlanguagebabelname}
}
\cs_generate_variant:Nn \__xpg_set_otherlanguage:nn { ee }
-
-% Store main language variant for external packages
-\define@key{xpg@other@langvariant}{variant}{
- \gdef\otherlanguagevariant{#1}
-}
-
\NewDocumentCommand \setotherlanguages { m }
- {
+{
\clist_map_function:eN { #1 } \setotherlanguage
- }
+}
\cs_set:Nn \xpg_common_language:
{% FIXME is this really needed???
@@ -1702,7 +1633,8 @@
% for specific (esp. tag-based) aliases
% where \text<alias> would cause clashes
% (e.g., \textit)
-\newcommand\textlang[3][]{
+\NewDocumentCommand \textlang { O{} m +m }
+{
\__xpg_textlanguage:een {#1} {#2} {#3}
}
@@ -1711,45 +1643,20 @@
% inside case changing commands (e.g. \MakeUppercase)
\tl_put_right:Nn \l_text_case_exclude_arg_tl { \textlang }
-% Alias to {<lang>}, but more suitable
-% for specific (esp. tag-based) aliases
-% where {<alias>} would cause clashes
-% (e.g., \fi)
-\DeclareEnvironmentCopy { lang } { otherlanguage }
-
% wrapper for foreignlanguage and otherlanguage*
-\newcommand*\polyglossia@setforeignlanguage[2][]{
- \select@@language[#1]{#2}
+\cs_new_nopar:Nn \xpg_set_foreign_language:nn
+{
+ \xpg_select_language:nn { #1 } { #2 }
\__xpg_register_language:nn{#1}{#2}
- % Store babelname of current language (for external packages such as biblatex)
- \tl_if_blank:nTF {#1}{
- \ifcsundef{#2@gbabelname}{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }{
- \edef\babelname{\csuse{#2@gbabelname}}
- }
- }{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }
- % Store BCP-47 id of current language
- \__xpg_store_bcp_info:nn {#1}{#2}
-}
-
-% Expandable lowercasing. We use this to assure keyval
-% options are lowercased (also when used in \MakeUppercase
-% contexts e.g. in headings)
-% Macro adapted from tudscr.sty
-\newcommand*\xpg@str@lowercase[2]{
- \protected@edef#1{
- \lowercase{\def\noexpand#1{#2}}
- }#1
}
% lowercase options before passing to setkeys
-\cs_new:Nn \__xpg_set_keys:nn
+\NewDocumentCommand \SetGlossOptions { m m }
{
- \xpg@str@lowercase{\xpg@tmp@opts}{#2}
- \exp_args:Nne \setkeys{#1}{\xpg@tmp@opts}
+ % \text_lowercase:n fully expands
+ % (as opposed to \str_lowercase:n)
+ \use:c { xpg_#1_default_options_tl }
+ \exp_args:Ne \keys_set:ne{ polyglossia / gloss / #1 }{ \text_lowercase:n {#2} }
}
% joint code of \foreignlanguage, otherlanguage*
@@ -1759,54 +1666,30 @@
\cs_new:Nn \xpg_otherlanguage:nn
{
\xpg_error_if_lang_not_loaded:n{#2}
- \__xpg_set_keys:nn{#2}{#1}
- \polyglossia@setforeignlanguage[#1]{#2}
+ \SetGlossOptions{#2}{#1}
+ \xpg_set_foreign_language:nn { #1 } { #2 }
% Hook for external packages such as biblatex
\polyglossia@language@switched
% buggy restoration heure
- \csuse{inlineextras@#2}
+ \use:c{inlineextras@#2}
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
\cs_if_exist_use:c{inlineextras@bbl@\babelname}
}
\DeclareDocumentCommand { \foreignlanguage } { O{} m +m }
- {
+{
\__xpg_foreignlanguage:eeen {#1} {#2} {\xpg_alias_base_lang:n{#2}} {#3}
- }
+}
% prevent case changing of language name in \foreignlanguage
\tl_put_right:Nn \l_text_case_exclude_arg_tl { \foreignlanguage }
-% Direct access to polyglossia@setforeignlanguage
+% Direct access to \xpg_set_foreign_language:nn
% used in captions
-\newcommand{\setforeignlanguage}[2][]
-{
- \polyglossia@setforeignlanguage[#1]{#2}
-}
-
-% Stack to store matrix languages
-\seq_new:N \__xpg_current_matrixlang_stack
-
-% Store embedding language when an embedded language is switched to
-\cs_new_nopar:Nn \__xpg_store_matrixlang:
+\NewDocumentCommand \setforeignlanguage { O{} m }
{
- \seq_gput_left:Nn \__xpg_current_matrixlang_stack \languagename
-}
-
-% When an embedded language is closed, reset to the embedding language
-% and remove stored matrix language from stack
-\cs_new_nopar:Nn \__xpg_reset_to_matrixlang:
-{
- % if stack is empty, use main language
- \seq_gpop_left:NNTF \__xpg_current_matrixlang_stack \l_tmpa_tl
- { \cs_set_eq:NN \__xpg_current_matrixlang \l_tmpa_tl }
- { \cs_set_eq:NN \__xpg_current_matrixlang \mainlanguagename }
- % Reset the language's/script's font families if the embedding script is latin
- \str_if_eq:eeT{\prop_item:Ne{\g_xpg_langsetup_prop}{\__xpg_current_matrixlang/lcscript}}{latin}
- {\resetfontlatin}
- % In case a \<lang>font is defined, re-activate that
- \exp_args:Ne \xpg@set@normalfont{\__xpg_current_matrixlang}
+ \xpg_set_foreign_language:nn { #1 } { #2 }
}
% internal wrapper for foreign language
@@ -1820,12 +1703,10 @@
{
\msg_show:nnn { polyglossia } { languagenotloaded } {#2}
}{
- \__xpg_store_matrixlang:
\group_begin:
\xpg_otherlanguage:nn{ \xpg_alias_add_to_option_i:nn{#2}{#1} }{ #3 }
\__xpg_lang_set_text_direction:nn{#3}{#4}
\group_end:
- \__xpg_reset_to_matrixlang:
}
}
\cs_generate_variant:Nn \__xpg_foreignlanguage:nnnn {eeen}
@@ -1834,11 +1715,9 @@
% otherlanguage* is the environment equivalent of \foreignlanguage
\DeclareDocumentEnvironment { otherlanguage* } { O{} m }
{
- \__xpg_store_matrixlang:
\__xpg_otherlanguage:eee { #1 } { #2 } { \xpg_alias_base_lang:n { #2 } }
}{
- \egroup% \group_end: does not work here!
- \__xpg_reset_to_matrixlang:
+ \c_group_end_token% \group_end: does not work here!
}
% internal wrapper
@@ -1853,7 +1732,7 @@
}{
\xpg_otherlanguage:nn{ \xpg_alias_add_to_option_i:nn{#2}{#1} }{ #3 }
\__xpg_lang_set_text_direction:nn{#3}%
- \bgroup% \group_begin: does not work here!
+ \c_group_begin_token% \group_begin: does not work here!
}
}
\cs_generate_variant:Nn \__xpg_otherlanguage:nnn { eee }
@@ -1869,9 +1748,6 @@
}
\cs_generate_variant:Nn \__xpg_textlanguage:nnn {een}
-% Track whether we are in an inline lang (\text...) switch
-\bool_new:N \l__xpg_inline_lang_bool
-
% use by \text<lang> and \textlang. Equivalent to \foreignlanguage,
% except that dates are localized.
% #1: option
@@ -1885,41 +1761,43 @@
\msg_show:nnn { polyglossia } { languagenotloaded } {#2}
}
{
- \__xpg_store_matrixlang:
\group_begin:
- \bool_set_true:N \l__xpg_inline_lang_bool
\xpg_otherlanguage:nn{#1}{#3}
- \csuse{date#3}
+ \use:c{date#3}
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
\cs_if_exist_use:c{date@bbl@\babelname}
\__xpg_lang_set_text_direction:nn{#3}{#4}
\group_end:
- \__xpg_reset_to_matrixlang:
}
}
\cs_generate_variant:Nn \__xpg_textlanguage:nnnn {nnen}
% Define language-specific hyphenation exceptions
-\newcommand\pghyphenation[3][]{
- \bgroup
- \xpg_error_if_lang_not_loaded:n{#2}
- \setkeys{#2}{#1}
- \select@@language[#1]{#2}
+\NewDocumentCommand \pghyphenation {O{} m m}
+{
+ \c_group_begin_token
+ \xpg_error_if_lang_not_loaded:n { #2 }
+ \SetGlossOptions{#2}{#1}
+ \xpg_select_language:nn { #1 } { #2 }
\hyphenation{#3}
- \egroup
+ \c_group_end_token
}
% Hook that other package authors can use
% (for instance biblatex):
% Do not rename!
-\newcommand*{\xpg@hook@setlanguage}{}
+\cs_set_nopar:Npn \xpg@hook@setlanguage {}
-\def\xpg@pop@language@i#1#2{
- \xpg@set@language@aux[#1]{#2}
+\cs_set_nopar:Nn \__xpg_pop_language:nn
+{
+ \xpg_set_language_aux:nn { #1 } { #2 }
\xpg@hook@setlanguage
- \let\emp@langname\@undefined}
+% FIXME This seems to be a very old relict.
+% The macro is nowhere used. Probably remove.
+% \let\emp@langname\@undefined
+}
\DeclareDocumentCommand \selectlanguage {s O{} m}
{
@@ -1938,131 +1816,124 @@
\cs_new:Nn \__xpg_select_language:nnn
{
% Register the language options
- \__xpg_set_language_options:nnn {#3} {#2} {@xpg@set@langvariant}
+ \__xpg_set_language_options:nn {#3} {#2}
\IfBooleanTF { #1 } % The starred variant does not write to the aux
{
- \xpg@set@language@nonaux[#2]{#3}
+ \xpg_set_language_nonaux:nn { #2 } { #3 }
}{
- \cs_set_nopar:Npe \xpg@pop@language { \exp_not:N \xpg@pop@language@i {#2} {#3} }
- \group_insert_after:N \xpg@pop@language
- \xpg@set@language@aux[#2]{#3}
+ \cs_set_nopar:Ne \xpg_pop_language: { \exp_not:N \__xpg_pop_language:nn { #2 } { #3 } }
+ \group_insert_after:N \xpg_pop_language:
+ \xpg_set_language_aux:nn { #2 } { #3 }
}
- \__xpg_register_language:nn{#2}{#3}
+ \__xpg_register_language:nn { #2 } { #3 }
}
\cs_generate_variant:Nn \__xpg_select_language:nnn { nee, nne }
-
% set lang option #2 for lang #1
-\cs_new:Nn \__xpg_set_language_options:nnn
+\cs_new:Nn \__xpg_set_language_options:nn
{
- \tl_if_blank:nF {#2}
+ \cs_if_exist:cT { xpg_#1_default_options_prop }
{
- % If the optional argument sets a value for the key “variant”, copy it to xpg@langvariant
- \clist_map_inline:nn { #2 } {
- \xpg@parsevariantkeyvalue##1=#3:#1\relax
- }%
- \__xpg_set_keys:nn{#1}{#2}
+ \prop_concat:ccc { l_xpg_curropt_prop } { l_xpg_curropt_prop }
+ { xpg_#1_default_options_prop }
}
+ \xpg__keyval_parser:eeN { #2 } { #1 } \l_xpg_curropt_prop
+ \SetGlossOptions{#1}{#2}
}
% Initialize default language options, so that
% \iflanguageoption has the info it needs also
% for default settings
-\newcommand*\xpg@initialize@gloss@options[2]{
- \__xpg_set_language_options:nnn {#1} {#2} {@xpg@set@langvariant}
-}
+\NewDocumentCommand \InitializeGlossOptions { m m }
+{
+ \tl_new:c { xpg_#1_default_options_tl }
+ \prop_new:c { xpg_#1_default_options_prop }
+ \keys_precompile:nec { polyglossia / gloss / #1 }
+ { \text_lowercase:n { #2, \xpg__tmp_default_options_tl } }
+ { xpg_#1_default_options_tl }
+ \xpg__keyval_parser:enc { #2, \xpg__tmp_default_options_tl } { #1 }
+ { xpg_#1_default_options_prop }
+ \prop_concat:ccc { l_xpg_curropt_prop } { l_xpg_curropt_prop }
+ { xpg_#1_default_options_prop }
+ \use:c { xpg_#1_default_options_tl }
+ \__xpg_set_language_options:nn {#1} {#2}
+}
+\tl_new:N \xpg__tmp_default_options_tl
+\cs_generate_variant:Nn \keys_precompile:nnN { nec }
% Record synonymous keyvals such as variant=us and variant=american
-% Syntax: \xpg@set@alias@values{<lang>}{<key>}{<val>}{<alias vals, comma-separated>}
-\newcommand*\xpg@set@alias@values[4]{%
- \prop_if_exist:cF { xpg@alias@keyvals@#1@#3 }
- { \prop_new:c {xpg@alias@keyvals@#1@#3} }
- \prop_put:cnn { xpg@alias@keyvals@#1@#3 }
- {#2}{#4}
- \prop_if_exist:cF { xpg@alias@keyvals@#1@#4 }
- { \prop_new:c {xpg@alias@keyvals@#1@#4} }
- \prop_put:cnn { xpg@alias@keyvals@#1@#4 }
- {#2}{#3}
-}
-
-% Patch xkeyval to record default values of keys
-\pretocmd{\XKV@define@default}{%
- \csgdef{xpg@default@opt@\XKV@header #1}{#2}
-}{}{\xpg@warning{Patching xkeyval failed!}}
-
-% Helper to get and register option keyvals
-\def\xpg@parsevariantkeyvalue#1=#2@#3:#4\relax{
- \def\@tmpa{#1}
- \def\@tmpb{variant}
- % variant values are stored in specific macros
- % (\xpg@main@langvariant, \xpg@other@langvariant
- % and \xpg@set@langvariant)
- \ifx\@tmpa\@tmpb\setkeys{#3}{#1=#2}\fi
- \tl_if_empty:nTF{#2}
- {
- \ifcsdef{xpg@default@opt@KV@#4@#1}
- {\xpg@store@opt@keyval#1:\csuse{xpg@default@opt@KV@#4@#1}=:#4\relax}
- {}%
- }
- { \xpg@store@opt@keyval#1:#2:#4\relax }
-}%
-
-% Store option keys and values
-% This strips trailing '=' from values.
-\def\xpg@store@opt@keyval#1:#2=:#3\relax{
- \prop_if_exist:cF { xpg@current@options@#3 }
- { \prop_new:c {xpg@current@options@#3} }
- \prop_put:cnn { xpg@current@options@#3 }
- {#1}{#2}
+% Syntax: \SetLanguageAliasValues{<lang>}{<key>}{<alias vals, comma-separated>}
+\int_new:N \l_xpg_alias_keyvals_int
+\int_set:Nn \l_xpg_alias_keyvals_int { 2 }
+\NewDocumentCommand \SetLanguageAliasValues { m m m }
+{
+ \clist_map_inline:nn { #3 }
+ {
+ \int_const:cn { c_xpg_alias_keyvals_#1_#2_##1_int } { \l_xpg_alias_keyvals_int }
+ }
+ \int_incr:N \l_xpg_alias_keyvals_int
}
+\cs_new:Npn \xpg__keyval_parser:nnN #1 #2 #3 % #1 = key-vals, #2 = language, #3 = prop
+ {
+ \keyval_parse:nnn
+ { \xpg__keyval_parser_default:nnn { #2 } { #3 } }
+ { \xpg__keyval_parser_nondefault:nnnn { #2 } { #3 } }
+ { #1 }
+ }
+\cs_generate_variant:Nn \xpg__keyval_parser:nnN { eeN, enc }
+
+\cs_new:Npn \xpg__keyval_parser_default:nnn #1 #2 #3 % #1 = lang, #2 = prop, #3 = key
+ {
+ \str_set:Nn \l_tempa_str { #1 / #3 }
+ \str_concat:NNN \l_tempa_str \c__keys_default_root_str \l_tempa_str
+ \prop_put:Nne #2 { #1 / #3 } { \use:c { \l_tempa_str } }
+ }
+
+\cs_new:Npn \xpg__keyval_parser_nondefault:nnnn #1 #2 #3 #4 % #1 = lang, #2 = prop, #3 = key, #4 = value
+ {
+ \prop_put:Nnn #2 { #1 / #3 } { #4 }
+ }
\prg_set_conditional:Npnn \__xpg_check_option_value:NNN #1#2#3 { p , T , F , TF }
-{
- \prop_get:cnNTF {xpg@current@options@#1} {#2} \l_tmpa_tl
- {
- \str_if_eq:eeTF{\l_tmpa_tl}{#3}
- {\prg_return_true:}
+ {
+ \bool_lazy_or:nnTF
+ {
+ \str_if_eq_p:ee { \prop_item:Nn \l_xpg_curropt_prop { #1 / #2 } } { #3 }
+ } {
+ \int_compare_p:nNn
{
- \prop_get:cnNTF {xpg@alias@keyvals@#1@#3} {#2} \l_tmpb_tl
- {
- \clist_set:Ne{\l_tmpa_clist}{\l_tmpb_tl}
- \providetoggle{xpgvalfound}
- \togglefalse{xpgvalfound}
- \clist_map_inline:Nn \l_tmpa_clist {
- \str_if_eq:eeT{##1}{\l_tmpa_tl}
- { \toggletrue{xpgvalfound} }
- }
- \iftoggle{xpgvalfound}{\prg_return_true:}{\prg_return_false:}
- }
- {
- \prg_return_false:
- }
- }
- }
- {
- \prg_return_false:
- }
+ \cs_if_exist_use:cF { c_xpg_alias_keyvals_#1_#2_#3_int } { 0 }
+ } = {
+ \cs_if_exist_use:cF { c_xpg_alias_keyvals_#1_#2_\prop_item:Nn \l_xpg_curropt_prop { #1 / #2 }_int } { 1 }
+ }
+ } { \prg_return_true: } { \prg_return_false: }
+ }
+
+\prg_set_conditional:Npnn \xpg_if_main_language:n #1 { T, F, TF }
+{
+ \str_if_eq:VnTF \xpg_main_language_tl { #1 }
+ { \prg_return_true: }
+ { \prg_return_false: }
}
+\cs_set_eq:NN \IfMainLanguageTF \xpg_if_main_language:nTF
+
+\cs_set_eq:NN \IfMainLanguageT \xpg_if_main_language:nT
+
+\cs_set_eq:NN \IfMainLanguageF \xpg_if_main_language:nF
+
% Test if option value is set
\DeclareDocumentCommand \iflanguageoption { m m m m m }
{
\__xpg_check_option_value:NNNTF{#1}{#2}{#3}{#4}{#5}
}
-
-% Append any variant to csv list of variants
-\define@key{xpg@langvariant}{variant}{
- \clist_if_in:NeF \xpg@vloaded {#1}{
- \clist_gput_right:Ne \xpg@vloaded {#1}
- }
-}
-
% Test if language is loaded
\DeclareDocumentCommand \iflanguageloaded { m m m }
{
- \AddToHook{begindocument/end}{
+ \hook_gput_code:nnn {begindocument/end} {.}
+ {
\clist_if_in:NeTF \xpg@loaded{#1}{#2}{#3}
}
}
@@ -2070,7 +1941,8 @@
% Same for babellanguage is loaded
\DeclareDocumentCommand \ifbabellanguageloaded { m m m }
{
- \AddToHook{begindocument/end}{
+ \hook_gput_code:nnn {begindocument/end} {.}
+ {
\clist_if_in:NeTF \xpg@bloaded{#1}{#2}{#3}
}
}
@@ -2078,7 +1950,8 @@
% Same for languageid
\DeclareDocumentCommand \iflanguageidloaded { m m m m }
{
- \AddToHook{begindocument/end}{
+ \hook_gput_code:nnn {begindocument/end} {.}
+ {
\str_case:nnTF {#1}
{
{bcp-47} { \clist_if_in:NeTF \xpg@bcp@loaded{#2}{#3}{#4} }
@@ -2086,7 +1959,7 @@
}
{}
{
- \xpg@error{Invalid~ \string\iflanguageidloaded\space argument:~ #1}
+ \xpg_ill_arg_msg:nn { #1 } { \iflanguageidloaded }
}
}%
}
@@ -2116,53 +1989,46 @@
}
-\newcommand*{\xpg@set@language@nonaux}[2][]{
- \@select@language[#1]{#2}
+\cs_new_nopar:Nn \xpg_set_language_nonaux:nn
+{
+ \__xpg_start_language:nn { #1 } { #2 }
}
-\newcommand*{\xpg@set@language@aux}[2][]{
- % Store babelname of current language (for external packages such as biblatex)
- \tl_if_blank:nTF {#1}{
- \ifcsundef{#2@gbabelname}{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }{
- \edef\babelname{\csuse{#2@gbabelname}}
- }
- }{
- \edef\babelname{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/babelname}}
- }
- % Store BCP-47 id of current language
- \__xpg_store_bcp_info:nn {#1}{#2}
- \@select@language[#1]{#2}
+\cs_new_nopar:Nn \xpg_set_language_aux:nn
+{
+ \__xpg_start_language:nn { #1 } { #2 }
% Write to the aux
- \xpg@set@language@only@aux[#1]{#2}
+ \xpg_set_language_only_aux:nn { #1 } { #2 }
}
-\newcommand*{\xpg@set@language@only@aux}[2][]{
+\cs_new_nopar:Nn \xpg_set_language_only_aux:nn
+{
% Write to the aux (toc files)
\if@filesw
\addtocontents{toc}{\selectlanguage*[#1]{#2}}
\fi
}
-\AtBeginDocument{
+\hook_gput_code:nnn {begindocument} {.}
+{
\if@filesw
- \immediate\write\@mainaux
- {\ProvideDocumentCommand\selectlanguage{sO{}m}{}}
+ \immediate\write\@mainaux
+ {\ProvideDocumentCommand\selectlanguage{sO{}m}{}}
\fi
}
% Since captions might float to other language regions,
% we need to change the language here (#542)
-\AddToHook{cmd/caption/before}{
+\hook_gput_code:nnn {cmd/caption/before} {.}
+{
\ifhmode\unskip\fi
\addtocontents{lof}{\protect\setforeignlanguage{\languagename}}
\addtocontents{lot}{\protect\setforeignlanguage{\languagename}}
}
% check if language is defined
-\prg_set_conditional:Npnn \__xpg_check_if_exist_l@:n #1 { F, TF }
+\prg_set_conditional:Npnn \__xpg_pattern_check_if_exists:n #1 { F, TF }
{
\bool_lazy_and:nnTF
{ \cs_if_exist_p:c { l@#1 } }
@@ -2171,82 +2037,125 @@
{ \prg_return_false: }
}
-\def\polyglossia@luatex@load@lang#1{
+\cs_new_nopar:Nn \__xpg_luatex_load_lang:n
+{
% if \l@#1 is not properly defined, call lua function newloader(#1),
% and assign the returned number to \l@#1
- \__xpg_check_if_exist_l@:nF {#1}
+ \__xpg_pattern_check_if_exists:nF {#1}
{
\directlua { token.set_char('l@#1', polyglossia.newloader'#1') }
}
}
-% This check is also used by biblatex, so don't
-% rename silently.
-\newcommand\xpg@ifdefined[3]{
+% check if language is defined
+\prg_set_conditional:Npnn \xpg_if_language_defined:n #1 { T, F, TF }
+{
% With luatex, we first need to define \l@#1.
\sys_if_engine_luatex:T
{
- \polyglossia@luatex@load@lang{#1}
+ \__xpg_luatex_load_lang:n {#1}
}
- \__xpg_check_if_exist_l@:nTF{#1}{#2}{#3}
+ \__xpg_pattern_check_if_exists:nTF{#1}
+ { \prg_return_true: }
+ { \prg_return_false: }
+}
+
+% Aliases for gloss files
+\cs_gset_eq:cc { IfLanguageDefinedTF } { xpg_if_language_defined:nTF }
+\cs_gset_eq:cc { IfLanguageDefinedT } { xpg_if_language_defined:nT }
+\cs_gset_eq:cc { IfLanguageDefinedF } { xpg_if_language_defined:nF }
+
+% Check if patterns for language #1 is defined. If not, try
+% the comma-separated list of fallbacks in #2
+\NewDocumentCommand \TryPatternWithFallback { m m }
+{
+ \xpg_if_language_defined:nF { #1 }
+ {
+ \clist_clear_new:N \l_xpg_lang_patterns
+ \clist_set:Ne \l_xpg_lang_patterns { #2 }
+ \bool_set_false:N \l_tmpa_bool
+ \clist_map_inline:Nn \l_xpg_lang_patterns
+ {
+ \xpg_if_language_defined:nT { ##1 }
+ {
+ \cs_gset_eq:cc { l@#1 } { l@##1 }
+ \bool_set_true:N \l_tmpa_bool
+ \clist_map_break:
+ }
+ }
+ \bool_if:NF \l_tmpa_bool
+ {
+ \xpg_warning_msg:n
+ {No~ hyphenation~ patterns~ for~ #1~ found \iow_newline:
+ Falling~ back~ to~ the~ default~ patterns~ (=~English)!}
+ \exp_args:Nc \adddialect {l@#1} 0
+ }
+ }
}
+% This old term is used by biblatex, so don't drop!
+\cs_gset_eq:cc { xpg@ifdefined } { xpg_if_language_defined:nTF }
+
% Set \bbl@hyphendata@\the\language, which is (lua)babel's
% hyphenation pattern hook
% FIXME Clarifiy why/when this is needed.
-\newcommand*\xpg@set@bbl@hyphendata[1]{
+\cs_new:Nn \xpg_set_bbl_hyphendata:n
+{
\sys_if_engine_luatex:T
{
- \ifcsdef{bbl@hyphendata@#1}{}{
- \global\@namedef{bbl@hyphendata@\the\language}{}
+ \cs_if_exist:cF {bbl@hyphendata@#1}
+ {
+ \cs_gset:cpn {bbl@hyphendata@\the\language} {}
}
}
}
% Set hyphenation patterns for a given language. This does the right
% thing both for XeTeX and LuaTeX
-\newcommand*\xpg@set@hyphenation@patterns[1]{
- \sys_if_engine_luatex:T { \polyglossia@luatex@load@lang{#1} }
+\cs_new:Nn \xpg_set_hyphenation_patterns:n
+{
+ \sys_if_engine_luatex:T { \__xpg_luatex_load_lang:n {#1} }
\language=\csname l@#1\endcsname
}
-\newcommand*\@select@language[2][]{
+\cs_new:Nn \__xpg_start_language:nn
+{
% hook for compatibility with biblatex
- \select@language{#2}
- \xpg@set@bbl@hyphendata{\the\language}
+ \select@language { #2 }
+ \xpg_set_bbl_hyphendata:n {\the\language}
\xpg_initial_setup:
- \select@@language[#1]{#2}%
+ \xpg_select_language:nn { #1 } { #2 }
% Hook for external packages such as biblatex
- \polyglossia@language@switched%
- \__xpg_lang_set_par_direction:n{#2}
- \csuse{captions#2}%
- \csuse{date#2}%
+ \polyglossia@language@switched
+ \__xpg_lang_set_par_direction:n {#2}
+ \use:c {captions#2}
+ \use:c {date#2}
% These are hooks for external packages which want to access variants
% via babelname (such as biblatex)
- \cs_if_exist_use:c{captions@bbl@\babelname}
- \cs_if_exist_use:c{date@bbl@\babelname}
- \__xpg_local_marks:n{#2}
- \csuse{init@extras@#2}%
+ \cs_if_exist_use:c {captions@bbl@\babelname}
+ \cs_if_exist_use:c {date@bbl@\babelname}
+ \__xpg_local_marks:n {#2}
+ \use:c {init@extras@#2}
\__xpg_indent_first:n { #2 }
- \csuse{blockextras@#2}%
+ \cs_if_exist_use:c {blockextras@#2}
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
- \cs_if_exist_use:c{blockextras@bbl@\babelname}
- }
+ \cs_if_exist_use:c {blockextras@bbl@\babelname}
+}
% hook for compatibility with biblatex
% (probably no longer used due to the
% more general hook that follows, but
% we keep it for backwards comp.)
-\def\select@language#1{}
+\cs_set:Npn \select@language #1 {}
% Hook for external packages such as biblatex
% do not rename!
-\def\polyglossia@language@switched{}
+\cs_new:Npn \polyglossia@language@switched {}
-% remove all custumization for language #1
+% remove all customization for language #1
\cs_new:Npn \noextrascurrent #1
-{%
+{
\cs_if_exist_use:c{noextras@#1}%
% This is a hook for external packages which want to access variants
% via babelname (such as biblatex)
@@ -2254,160 +2163,105 @@
}
% Common code for `\select@language' and `\foreignlanguage'.
-\newcommand{\select@@language}[2][]{%
+\cs_new:Nn \xpg_select_language:nn
+{
% disable the extras and number settings of the previous language
\cs_if_exist:cT{languagename}
{
\noextrascurrent{\languagename}
\cs_if_exist_use:c{no\languagename @numbers}
\sys_if_engine_xetex:T{
- \__xpg_if_LR_str:eTF{\prop_item:Ne{\g_xpg_langsetup_prop}{\languagename/direction}}
+ \__xpg_if_LR_str:eTF{\prop_item:Ne{\l_xpg_langsetup_prop}{\languagename/direction}}
{
- \__xpg_if_LR_str:eF{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/direction}}
+ \__xpg_if_LR_str:eF{\prop_item:Nn{\l_xpg_langsetup_prop}{#2/direction}}
{\setnonlatin} % LTR -> RTL
}
{
- \__xpg_if_LR_str:eT{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/direction}}
+ \__xpg_if_LR_str:eT{\prop_item:Nn{\l_xpg_langsetup_prop}{#2/direction}}
{\setlatin} % RTL -> LTR
}
}
}
- \polyglossia@set@language@name[#1]{#2}
- % Set the language's/script's font families
- \str_if_eq:eeT{\prop_item:Nn{\g_xpg_langsetup_prop}{#2/lcscript}} {latin}
- {
- \resetfontlatin
- }
- \bool_if:NF \l__xpg_inline_lang_bool
- { % This for non-inline font switches
- % in case a \<lang>font is defined
- \xpg@set@normalfont{#2}
- }
- \xpg@select@fontfamily{#2}
+ \xpg_set_language_name:n { #2 }
+ \xpg_set_normalfont:n { #2 }
+ \xpg_select_fontfamily:n { #2 }
\__xpg_use_or_warn:c{#2@language}
\cs_if_exist_use:c{#2@numbers}
- \use@localhyphenmins[#1]{#2}
+ \__xpg_use_localhyphenmins:nn { #1 } { #2 }
\__xpg_french_spacing:n { #2 }
}
-\let\xpg@pop@language\relax
+\cs_undefine:N \xpg_pop_language:
-%
-% Keep track of the active (nested) languages and options
-%
-\clist_new:N \l_xpg_lang_stack
-
-\cs_new:Nn \__xpg_stack_language:nn
-{
- \clist_gpush:Nn \l_xpg_lang_stack {#1:#2}
-}
+\DeclareDocumentEnvironment { otherlanguage } { O{} m }
+ {
+ \selectlanguage[#1]{#2}
+ } { }
-\cs_generate_variant:Nn \__xpg_stack_language:nn {nx}
+% Alias to {<lang>}, but more suitable
+% for specific (esp. tag-based) aliases
+% where {<alias>} would cause clashes
+% (e.g., \fi)
+\DeclareEnvironmentCopy { lang } { otherlanguage }
-\cs_new:Nn \__xpg_unstack_language:n
+\NewDocumentCommand \setlocalhyphenmins { m m m }
{
- \clist_gpop:NNTF \l_xpg_lang_stack \l_tmpa_tl {
- % Stored format = options:language => split:
- \seq_set_split:Nne \l_tmpa_seq {:} \l_tmpa_tl
- \seq_get_left:NN \l_tmpa_seq \l_tmpb_tl
- \seq_get_right:NN \l_tmpa_seq \l_tmpc_tl
- % Execute passed command with language and maybe options
- % and re-set stored language's keys
- \tl_if_empty:NTF \l_tmpb_tl {\cs_if_exist_use:c{#1}{\l_tmpc_tl}}
- {\__xpg_set_keys:nn{\l_tmpc_tl}{\l_tmpb_tl}
- \cs_if_exist_use:c{#1}[\l_tmpb_tl]{\l_tmpc_tl}
- }
- }
- {}
-}
-
-\DeclareDocumentEnvironment { otherlanguage } { O{} m }
- {
- % Get real current (pre-switch) options (incl. defaults)
- \clist_clear_new:N \l_xpg_current_options
- \prop_if_exist:cF { xpg@current@options@\languagename }
- { \prop_new:c {xpg@current@options@\languagename} }
- \prop_map_inline:cn {xpg@current@options@\languagename}
+ \xpg_if_language_defined:nTF{#1}
+ {
+ \cs_if_eq:ccTF { l@#1 } { l@nohyphenation }
{
- \clist_put_right:Nn \l_xpg_current_options {##1=##2}
+ \xpg_warning_msg:n {\string\setlocalhyphenmin\space~ useless~ for~ unhyphenated~ language~ #1}
+ }{
+ \providehyphenmins{#1}{#2#3}
}
- % Store current (pre-switch) options and language on stack
- \__xpg_stack_language:nx{\clist_use:Nn \l_xpg_current_options {,}}{\languagename}
- \selectlanguage[#1]{#2}
- }
- {
- % restore previous language in aux file and remove closed one from stack
- \__xpg_unstack_language:n{xpg@set@language@only@aux}
- }
-
-\newcommand{\setlocalhyphenmins}[3]{
- \xpg@ifdefined{#1}{
- \expandafter\ifx\csname l@#1\endcsname\l@nohyphenation
- \xpg@warning{\string\setlocalhyphenmin\space~ useless~ for~ unhyphenated~ language~ #1}
- \else
- \providehyphenmins{#1}{#2#3}
- \fi
}{
- \xpg@warning{\string\setlocalhyphenmin\space~ useless~ for~ unknown~ language~ #1}
+ \xpg_warning_msg:n {\string\setlocalhyphenmin\space~ useless~ for~ unknown~ language~ #1}
}
}
% \setlanghyphenmins[options]{lang}{l}{r}
-\newcommand*\setlanghyphenmins[4][]{%
+\NewDocumentCommand \setlanghyphenmins { O{} m m m }
+{
% Check for real language name and options
- \edef\xpg@tmp@opts{\xpg_alias_add_to_option_i:nn{#2}{#1}}
- \edef\xpg@tmp@lang{\xpg_alias_base_lang:n{#2}}
- \bgroup
- \xpg_error_if_lang_not_loaded:n{\xpg@tmp@lang}
- \__xpg_set_keys:nn{\xpg@tmp@lang}{\xpg@tmp@opts}
+ \tl_set:Nx \l_tmp_opts_tl { \xpg_alias_add_to_option_i:nn{#2}{#1} }
+ \tl_set:Nx \l_tmp_lang_tl { \xpg_alias_base_lang:n{#2} }
+ \c_group_begin_token
+ \xpg_error_if_lang_not_loaded:n{\l_tmp_lang_tl}
+ \SetGlossOptions{\l_tmp_lang_tl}{ \l_tmp_opts_tl }
% Store bcp47.tag@hypenmins
- \tl_if_blank:nTF {\xpg@tmp@opts}{%
- \ifcsundef{\csname xpg@tmp@lang\endcsname @g.bcp47.tag}{
- \csedef{tmp@bcp47.tag}{\prop_item:Ne{\g_xpg_langsetup_prop}{ \xpg@tmp@lang / bcp47 }}
- }{
- \csedef{tmp@bcp47.tag}{\csuse{#2@g.bcp47.tag}}
- }
- }{
- \csedef{tmp@bcp47.tag}{\prop_item:Ne{\g_xpg_langsetup_prop}{ \xpg@tmp@lang / bcp47 }}
- }
- \csgdef{\csname tmp@bcp47.tag\endcsname @hyphenmins}{{#3}{#4}}
- \egroup
+ \cs_set_nopar:cpe {tmp@bcp47.tag} { \prop_item:Ne{\l_xpg_langsetup_prop}{ \l_tmp_lang_tl / bcp47 } }
+ \cs_gset:cpn {\csname tmp@bcp47.tag\endcsname @hyphenmins} {{#3}{#4}}
+ \c_group_end_token
}
-% \use@localhypenmins[options]{lang}
-\newcommand*\use@localhyphenmins[2][]{
- \bgroup
- \xpg_error_if_lang_not_loaded:n{#2}
- \__xpg_set_keys:nn{#2}{#1}
+% \__xpg_use_localhyphenmins:nn {options}{lang}
+\cs_new_nopar:Nn \__xpg_use_localhyphenmins:nn
+{
+ \c_group_begin_token
+ \xpg_error_if_lang_not_loaded:n {#2}
+ \SetGlossOptions {#2} {#1}
% Use bcp47.tag@hypenmins
- \tl_if_blank:nTF {#1}{
- \ifcsundef{#2@g.bcp47.tag}{
- \csxdef{tmp@bcp47.tag}{\prop_item:Nn{\g_xpg_langsetup_prop}{ #2 / bcp47 }}
- }{
- \csxdef{tmp@bcp47.tag}{\csuse{#2@g.bcp47.tag}}
- }
- }{
- \csxdef{tmp@bcp47.tag}{\prop_item:Nn{\g_xpg_langsetup_prop}{ #2 / bcp47 }}
- }
- \egroup
- \ifcsundef{\csname tmp@bcp47.tag\endcsname @hyphenmins}{
- \ifcsundef{#2hyphenmins}{}
+ \cs_gset_nopar:cpe {tmp@bcp47.tag} { \prop_item:Nn{\l_xpg_langsetup_prop}{ #2 / bcp47 } }
+ \c_group_end_token
+ \cs_if_exist:cTF {\csname tmp@bcp47.tag\endcsname @hyphenmins}
+ {
+ \tl_set:Ne \l_tmpa_tl { \use:c{\csname tmp@bcp47.tag\endcsname @hyphenmins} }
+ \expandafter \set@hyphenmins \l_tmpa_tl
+ }{
+ \cs_if_exist:cT{#2hyphenmins}
{
\expandafter\expandafter\expandafter\set@hyphenmins\csname #2hyphenmins\endcsname\relax
}
- }{
- \edef\tmpa{\csuse{\csname tmp@bcp47.tag\endcsname @hyphenmins}}
- \expandafter\expandafter\expandafter\set@hyphenmins\tmpa\relax
}
- \sys_if_engine_luatex:T{
+ \sys_if_engine_luatex:T
+ {
% Set \totalhyphenmin if specified
- \prop_get:NeNTF \g_xpg_langsetup_prop {#2/totalhyphenmin} \l_tmpa_tl
+ \prop_get:NeNT \l_xpg_langsetup_prop {#2/totalhyphenmin} \l_tmpb_tl
{
- \xpg@info{totalhyphenmin: '\l_tmpa_tl'}
- \expandafter\hyphenationmin \l_tmpa_tl
+ \xpg_info_msg:n {totalhyphenmin: '\l_tmpb_tl'}
+ \expandafter\hyphenationmin \l_tmpb_tl
}
- {}
}
}
@@ -2419,23 +2273,26 @@
\DeclareDocumentEnvironment { hyphenrules } { O{} m }
{
% Check for real language name and options
- \edef\xpg@tmp@opts{\xpg_alias_add_to_option_i:nn{#2}{#1}}
- \edef\xpg@tmp@lang{\xpg_alias_base_lang:n{#2}}
+ \tl_set:Nx \l_tmp_opts_tl { \xpg_alias_add_to_option_i:nn{#2}{#1} }
+ \tl_set:Nx \l_tmp_lang_tl { \xpg_alias_base_lang:n{#2} }
% Register the language options
- \__xpg_set_language_options:nnn {\xpg@tmp@lang} {\xpg@tmp@opts} {@xpg@set@langvariant}
+ \__xpg_set_language_options:nn { \l_tmp_lang_tl } { \l_tmp_opts_tl }
% Now switch patterns
- \__xpg_use_or_warn:c{\use:c{xpg@tmp@lang}@language}
+ \__xpg_use_or_warn:c{\use:c{l_tmp_lang_tl}@language}
% And activate hyphenmins
- \use@localhyphenmins[\xpg@tmp@opts]{\xpg@tmp@lang}
+ \__xpg_use_localhyphenmins:nn { \l_tmp_opts_tl } { \l_tmp_lang_tl }
}
{ }
-\AddToHook{begindocument/before}{
- \IfPackageLoadedTF{bidi}{
- \providecommand*{\aemph}[1]{$\overline{\hboxR{#1}}$}
+\hook_gput_code:nnn {begindocument/before} {.}
+{
+ \IfPackageLoadedTF{bidi}
+ {
+ \ProvideDocumentCommand \aemph { m } { $\overline{\hboxR{#1}}$ }
}{}
- \IfPackageLoadedTF{luabidi}{
- \providecommand*{\aemph}[1]{$\overline{\hbox{\RL{#1}}}$}
+ \IfPackageLoadedTF{luabidi}
+ {
+ \ProvideDocumentCommand \aemph { m } { $\overline{\hbox{\RL{#1}}}$ }
}{}
}
@@ -2469,7 +2326,8 @@
.value_required:n = true,
}
-\keys_set:nn { polyglossia } {
+\keys_set:nn { polyglossia }
+{
localmarks = false,
verbose = true,
babelshorthands = false,
@@ -2486,23 +2344,35 @@
\sys_if_engine_luatex:T{
\str_if_eq:eeF{\g_xpg_luatex_renderer_str}{none}
{
- \xpg@info{Setting~ LuaTeX~ font~ renderer~ to~ \g_xpg_luatex_renderer_str}
+ \xpg_info_msg:n{Setting~ LuaTeX~ font~ renderer~ to~ \g_xpg_luatex_renderer_str}
\exp_args:Ne \defaultfontfeatures{Renderer=\g_xpg_luatex_renderer_str}
}
}
-\bool_if:nF \g_xpg_verbose_bool {
- \gdef\@latex@info#1{\relax} % no latex info
- \gdef\@font@info#1{\relax} % no latex font info
- \gdef\@font@warning#1{\relax} % no latex font warnings
- \gdef\zf@PackageInfo#1{\relax} % no fontspec info
- \gdef\xpg@info#1{\relax} % no polyglossia info
+\bool_if:nF \g_xpg_verbose_bool
+{
+ \cs_gset_nopar:Npn \@latex@info #1 { \relax } % no latex info
+ \cs_gset_nopar:Npn \@font@info #1 { \relax } % no latex font info
+ \cs_gset_nopar:Npn \@font@warning #1 { \relax } % no latex font warnings
+ \msg_redirect_module:nnn { fontspec } { info } { none } % no fontspec info
+ \msg_redirect_module:nnn { polyglossia } { info } { none } % no polyglossia info
}
\bool_if:nT \g_xpg_localmarks_bool {
\__xpg_enable_local_marks:
}
+% common code to initiate babelshordhands in glosses
+\cs_new:Npn \InitializeBabelShorthands
+{
+ \cs_if_exist:cF {initiate@active@char}
+ {
+ \file_input:n {babelsh.def}
+ \initiate@active@char{"}
+ \shorthandoff{"}
+ }
+}
+
% Control shorthand (de-)activation
% This checks that the shorthand char is only deactivated
% if we have activated it ourselves and hence keeps
@@ -2530,21 +2400,22 @@
% Inherit shorthands in other languages
\NewDocumentCommand \inheritbabelshorthands { m m }
{
- \AddToHook{begindocument/before}{
+ \hook_gput_code:nnn {begindocument/before} {.}
+ {
% Load the involved languages if necessary
% Error if they do not exist
\tl_set:Nn \l__xpg_tmpa_lang_tl { \xpg_alias_base_lang:n{#1} }
\clist_if_in:NeF \xpg@loaded {\l__xpg_tmpa_lang_tl}{
\file_if_exist:nTF{gloss-\l__xpg_tmpa_lang_tl .ldf}
{ \setotherlanguage{#1} }
- { \xpg@error{ Source~ language~ #1,~ used~ in~
+ { \xpg_error_msg:n { Source~ language~ #1,~ used~ in~
\string\inheritbabelshorthands,~ does~ not~ exist } }
}
\tl_set:Nn \l__xpg_tmpb_lang_tl { \xpg_alias_base_lang:n{#2} }
\clist_if_in:NeF \xpg@loaded {\l__xpg_tmpb_lang_tl}{
\file_if_exist:nTF{gloss-\l__xpg_tmpb_lang_tl .ldf}
{ \setotherlanguage{#2} }
- { \xpg@error{ Target~ language~ #2,~ used~ in~
+ { \xpg_error_msg:n { Target~ language~ #2,~ used~ in~
\string\inheritbabelshorthands,~ does~ not~ exist } }
}
% Test whether the requested shorthands exist
@@ -2556,7 +2427,7 @@
{ \bool_set_true:N \l__xpg_no_shorthands_bool }
\bool_if:nT { \l__xpg_no_shorthands_bool }
{
- \xpg@error{ No~ babel~ shorthands~ exist~ for~ language~ #1 }
+ \xpg_error_msg:n { No~ babel~ shorthands~ exist~ for~ language~ #1 }
}
% If so, apply:
\bool_if:nF { \l__xpg_no_shorthands_bool }
@@ -2581,7 +2452,7 @@
\iflanguageloaded{\l__xpg_tmpa_lang_tl}{
\use:c{\l__xpg_tmpa_lang_tl @shorthands}
}{
- \xpg@error{ Language~ #1,~ requested~ in~
+ \xpg_error_msg:n { Language~ #1,~ requested~ in~
\string\startbabelshorthands,~ is~ not~ loaded }
}
}