Debian Codegraph @

texmf-dist/tex/latex/polyglossia/gloss-polish.ldf

raw
1 % Language definition file (part of polyglossia v2.10 -- 2026/04/18)
2 %
3 \ProvidesFile{gloss-polish.ldf}[polyglossia: module for Polish]
4
5 \PolyglossiaSetup{polish}{
6 bcp47=pl,
7 bcp47-language=pl,
8 bcp47-script=Latn,
9 hyphennames={polish},
10 hyphenmins={2,2},
11 langtag=PLK,
12 frenchspacing=true,
13 }
14
15 % BCP-47 compliant aliases
16 \setlanguagealias*{polish}{pl}
17
18 \ifluatex
19 \RequirePackage{luavlna}
20 \fi
21
22 \DeclareKeys[polyglossia/gloss/polish]
23 {
24 babelshorthands.if = polish@babelshorthands,
25 babelshorthands.default:n = true,
26 splithyphens.if = polish@splithyphens,
27 splithyphens.default:n = true,
28 vlna.if = polish@vlna,
29 vlna.default:n = true,
30 }
31
32 \ifsystem@babelshorthands
33 \SetGlossOptions{polish}{babelshorthands=true}
34 % Register default options
35 \InitializeGlossOptions{polish}{babelshorthands=true,splithyphens=true,vlna=true}
36 \else
37 \SetGlossOptions{polish}{babelshorthands=false}
38 % Register default options
39 \InitializeGlossOptions{polish}{babelshorthands=false,splithyphens=true,vlna=true}
40 \fi
41
42 \InitializeBabelShorthands
43
44 \let\xpg@hyphen@char-
45 \def\polish@@splhyphen#1{%
46 \def\polish@sh@tmp{%
47 \ifx\polish@sh@next\xpg@hyphen@char#1%
48 \else\expandafter\polish@@@splhyphen{#1}\fi%
49 }%
50 \futurelet\polish@sh@next\polish@sh@tmp%
51 }
52
53 \def\polish@@@splhyphen#1{%
54 \ifnum\hyphenchar \font>0%
55 \kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}%
56 \nobreak\hskip\z@%
57 \else%
58 #1%
59 \fi%
60 }
61
62 \def\polish@splhyphen{%
63 \polish@@splhyphen{-}%
64 }
65
66 \def\polish@shorthands{%
67 \xpg@activate@shorthands%
68 \def\language@group{polish}%
69 \declare@shorthand{polish}{"=}{\polish@splhyphen}%
70 \declare@shorthand{polish}{""}{\xpg@invisible@break}%
71 \declare@shorthand{polish}{"~}{\xpg@nobreak@hyphen}%
72 \declare@shorthand{polish}{"-}{\xpg@add@hyphenation@point}%
73 \declare@shorthand{polish}{"|}{\xpg@ligature@break}%
74 \declare@shorthand{polish}{"/}{\xpg@breakable@slash}%
75 \declare@shorthand{polish}{"`}{„}%
76 \declare@shorthand{polish}{"'}{”}%
77 \declare@shorthand{polish}{"<}{«}%
78 \declare@shorthand{polish}{">}{»}%
79 }
80
81 \def\nopolish@shorthands{%
82 \xpg@deactivate@shorthands%
83 }
84
85 \ifxetex
86 % splithyphens
87 \newXeTeXintercharclass\polish@hyphen % -
88 % vlna
89 \newXeTeXintercharclass\polish@openpunctuation
90 \newXeTeXintercharclass\polish@nonsyllabicpreposition
91 \ifdefined\e@alloc@intercharclass@top
92 \chardef\polish@boundary=\e@alloc@intercharclass@top
93 \else
94 \ifdefined\XeTeXinterwordspaceshaping
95 \chardef\polish@boundary=4095 %
96 \def\newXeTeXintercharclass{%
97 \e@alloc\XeTeXcharclass\chardef
98 \xe@alloc@intercharclass\m@ne\@ucharclass@boundary}%
99 \else
100 \chardef\polish@boundary=255
101 \fi
102 \fi
103 \fi
104
105 \def\polish@hyphens{%
106 \ifluatex
107 \AfterPreamble{\enablesplithyphens{polish}}%
108 \else
109 \XeTeXinterchartokenstate=1
110 \XeTeXcharclass `\- \polish@hyphen
111 \XeTeXinterchartoks \z@ \polish@hyphen = {\polish@@splhyphen}% "-" -> "\polish@@splhyphen-"
112 % necessary if used together with vlna:
113 \XeTeXinterchartoks \polish@nonsyllabicpreposition \polish@hyphen = {\polish@@splhyphen}% "-" -> "\polish@@splhyphen-"
114 \fi%
115 }
116
117 \def\nopolish@hyphens{%
118 \ifluatex
119 \AfterPreamble{\disablesplithyphens{polish}}%
120 \else
121 \XeTeXcharclass `\- \z@
122 \fi%
123 }
124
125 % Add nonbreakable space after single-letter word to
126 % prevent them to land at the end of a line
127 % vlna code taken and adapted from xevlna.sty
128 \ifxetex
129 \def\polish@nointerchartoks{\let\polish@interchartoks\polish@PreCSpreposition}%
130 \def\polish@PreCSpreposition{%
131 \def\next{}%
132 \ifnum\catcode`\ =10 % nothing will be done in verbatim
133 \ifmmode % nothing in math
134 \else
135 \let\polish@interchartoks\polish@nointerchartoks
136 \let\next\polish@ExamineCSpreposition
137 \fi\fi
138 \next%
139 }%
140 \def\polish@ExamineCSpreposition #1{#1\futurelet\next\polish@ProcessCSpreposition}%
141 \def\polish@ProcessCSpreposition{\ifx\next\polish@XeTeXspace\nobreak\fi}%
142 \futurelet\polish@XeTeXspace{ }\polish@nointerchartoks
143 \fi
144
145 \def\polish@vlna{%
146 \ifluatex
147 \singlechars{polish}{AaIiOoUuWwZz}%
148 \preventsingleon
149 \else
150 % Code taken and adapted from xevlna.sty
151 \XeTeXinterchartokenstate=1
152 \XeTeXcharclass `\( \polish@openpunctuation
153 \XeTeXcharclass `\[ \polish@openpunctuation
154 \XeTeXcharclass `\„ \polish@openpunctuation
155 \XeTeXcharclass `\« \polish@openpunctuation
156 \XeTeXcharclass `\W \polish@nonsyllabicpreposition
157 \XeTeXcharclass `\w \polish@nonsyllabicpreposition
158 \XeTeXcharclass `\Z \polish@nonsyllabicpreposition
159 \XeTeXcharclass `\z \polish@nonsyllabicpreposition
160 \XeTeXcharclass `\O \polish@nonsyllabicpreposition
161 \XeTeXcharclass `\o \polish@nonsyllabicpreposition
162 \XeTeXcharclass `\U \polish@nonsyllabicpreposition
163 \XeTeXcharclass `\u \polish@nonsyllabicpreposition
164 \XeTeXcharclass `\A \polish@nonsyllabicpreposition
165 \XeTeXcharclass `\a \polish@nonsyllabicpreposition
166 \XeTeXcharclass `\I \polish@nonsyllabicpreposition
167 \XeTeXcharclass `\i \polish@nonsyllabicpreposition
168 \XeTeXinterchartoks \polish@boundary \polish@nonsyllabicpreposition {\polish@interchartoks}%
169 \XeTeXinterchartoks \polish@openpunctuation \polish@nonsyllabicpreposition {\polish@interchartoks}%
170 \fi
171 }
172
173 \def\nopolish@vlna{%
174 \ifluatex
175 \preventsingleoff
176 \else
177 \XeTeXcharclass`\(\z@
178 \XeTeXcharclass`\[\z@
179 \XeTeXcharclass`\„\z@
180 \XeTeXcharclass`\«\z@
181 \XeTeXcharclass`\W\z@
182 \XeTeXcharclass`\w\z@
183 \XeTeXcharclass`\Z\z@
184 \XeTeXcharclass`\z\z@
185 \XeTeXcharclass`\O\z@
186 \XeTeXcharclass`\o\z@
187 \XeTeXcharclass`\U\z@
188 \XeTeXcharclass`\u\z@
189 \XeTeXcharclass`\A\z@
190 \XeTeXcharclass`\a\z@
191 \XeTeXcharclass`\I\z@
192 \XeTeXcharclass`\i\z@
193 \fi
194 }
195
196 \def\captionspolish{%
197 \def\prefacename{Przedmowa}%
198 \def\refname{Literatura}%
199 \def\abstractname{Streszczenie}%
200 \def\bibname{Bibliografia}%
201 \def\chaptername{Rozdział}%
202 \def\appendixname{Dodatek}%
203 \def\contentsname{Spis treści}%
204 \def\listfigurename{Spis rysunków}%
205 \def\listtablename{Spis tabel}%
206 \def\indexname{Indeks}%
207 \def\figurename{Rysunek}%
208 \def\tablename{Tabela}%
209 \def\partname{Część}%
210 \def\enclname{Załącznik}%
211 \def\ccname{Kopie:}%
212 \def\headtoname{Do}%
213 \def\pagename{Strona}%
214 \def\seename{Zobacz}%
215 \def\alsoname{Zobacz też}%
216 \def\proofname{Dowód}%
217 \def\glossaryname{Słowniczek}%
218 }
219
220 \def\datepolish{%
221 \def\today{\number\day\space\ifcase\month\or
222 stycznia\or lutego\or marca\or kwietnia\or maja\or czerwca\or
223 lipca\or sierpnia\or września\or października\or
224 listopada\or grudnia\fi\space
225 \number\year}%
226 }
227
228 \def\noextras@polish{%
229 \ifpolish@babelshorthands\nopolish@shorthands\fi%
230 \nopolish@hyphens%
231 \nopolish@vlna%
232 \ifxetex\XeTeXinterchartokenstate=0\fi%
233 }
234
235 \def\blockextras@polish{%
236 \ifpolish@babelshorthands\polish@shorthands\else\nopolish@shorthands\fi%
237 \ifpolish@vlna\polish@vlna\else\nopolish@vlna\fi%
238 \ifpolish@splithyphens\polish@hyphens\else\nopolish@hyphens\fi%
239 }
240
241 \def\inlineextras@polish{%
242 \ifpolish@babelshorthands\polish@shorthands\else\nopolish@shorthands\fi%
243 \ifpolish@vlna\polish@vlna\else\nopolish@vlna\fi%
244 \ifpolish@splithyphens\polish@hyphens\else\nopolish@hyphens\fi%
245 }
246
247 \def\nestedextras@polish{%
248 \ifluatex%
249 \ifpolish@vlna\polish@vlna\else\nopolish@vlna\fi%
250 \ifpolish@splithyphens\polish@hyphens\else\nopolish@hyphens\fi%
251 \fi%
252 }
253
254 \endinput