| 1 |
% Language definition file (part of polyglossia v2.10 -- 2026/04/18) |
| 2 |
% |
| 3 |
\ProvidesFile{gloss-ukrainian.ldf}[polyglossia: module for Ukrainian] |
| 4 |
% Strings taken from Babel |
| 5 |
% and revised by Roman Kyrylych |
| 6 |
|
| 7 |
\RequirePackage{xpg-cyrillicnumbers} |
| 8 |
|
| 9 |
\PolyglossiaSetup{ukrainian}{% |
| 10 |
bcp47=uk, |
| 11 |
bcp47-language=uk, |
| 12 |
bcp47-script=Cyrl, |
| 13 |
script=Cyrillic, |
| 14 |
scripttag=cyrl, |
| 15 |
langtag=UKR, |
| 16 |
hyphennames={ukrainian}, |
| 17 |
hyphenmins={2,2}, |
| 18 |
frenchspacing=true, |
| 19 |
localnumeral=ukrainiannumerals, |
| 20 |
Localnumeral=Ukrainiannumerals |
| 21 |
} |
| 22 |
|
| 23 |
% BCP-47 compliant aliases |
| 24 |
\setlanguagealias*{ukrainian}{uk} |
| 25 |
|
| 26 |
\newif\ifcyrillic@numerals |
| 27 |
\newif\ifcyrillic@asbuk@numerals |
| 28 |
|
| 29 |
\DeclareKeys[polyglossia/gloss/ukrainian] |
| 30 |
{ |
| 31 |
babelshorthands.if = ukrainian@babelshorthands, |
| 32 |
babelshorthands.default:n = true, |
| 33 |
mathfunctions.if = ukrainian@mathfunctions, |
| 34 |
mathfunctions.default:n = true, |
| 35 |
numerals.choice:, |
| 36 |
numerals / arabic.code = |
| 37 |
{% |
| 38 |
\cyrillic@numeralsfalse |
| 39 |
\cyrillic@asbuk@numeralsfalse |
| 40 |
\SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-latn}% |
| 41 |
}, |
| 42 |
numerals / cyrillic.code = |
| 43 |
{% |
| 44 |
\cyrillic@numeralstrue |
| 45 |
\cyrillic@asbuk@numeralsfalse |
| 46 |
\SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}% |
| 47 |
}, |
| 48 |
numerals / cyrillic-trad.code = |
| 49 |
{% |
| 50 |
\cyrillic@numeralstrue |
| 51 |
\cyrillic@asbuk@numeralsfalse |
| 52 |
\SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}% |
| 53 |
}, |
| 54 |
numerals / cyrillic-alph.code = |
| 55 |
{% |
| 56 |
\cyrillic@numeralstrue |
| 57 |
\cyrillic@asbuk@numeralstrue |
| 58 |
\SetLanguageKeys{ukrainian}{bcp47-extension-u=nu-cyrl}% |
| 59 |
}, |
| 60 |
numerals.default:n = arabic, |
| 61 |
numerals/unknown.code = \xpg@warning{Unknown Ukrainian numerals value `#1'} |
| 62 |
} |
| 63 |
|
| 64 |
\ifsystem@babelshorthands |
| 65 |
\SetGlossOptions{ukrainian}{babelshorthands=true} |
| 66 |
% Register default options |
| 67 |
\InitializeGlossOptions{ukrainian}{numerals=arabic,mathfunctions=true,babelshorthands=true} |
| 68 |
\else |
| 69 |
\SetGlossOptions{ukrainian}{babelshorthands=false} |
| 70 |
% Register default options |
| 71 |
\InitializeGlossOptions{ukrainian}{numerals=arabic,mathfunctions=true,babelshorthands=false} |
| 72 |
\fi |
| 73 |
|
| 74 |
\InitializeBabelShorthands |
| 75 |
|
| 76 |
\def\ukrainian@shorthands{% |
| 77 |
\xpg@activate@shorthands% |
| 78 |
\def\language@group{ukrainian}% |
| 79 |
% \declare@shorthand{ukrainian}{"`}{„}% |
| 80 |
% \declare@shorthand{ukrainian}{"'}{“}% |
| 81 |
% \declare@shorthand{ukrainian}{"<}{«}% |
| 82 |
% \declare@shorthand{ukrainian}{">}{»}% |
| 83 |
\declare@shorthand{ukrainian}{""}{\xpg@invisible@break}% |
| 84 |
\declare@shorthand{ukrainian}{"~}{\xpg@nobreak@hyphen}% |
| 85 |
\declare@shorthand{ukrainian}{"=}{\xpg@breakable@hyphen}% |
| 86 |
\declare@shorthand{ukrainian}{"|}{\xpg@ligature@break}% |
| 87 |
\declare@shorthand{ukrainian}{"-}{\xpg@cyrillic@dash}% |
| 88 |
\declare@shorthand{ukrainian}{",}{\xpg@thinspace@allow@hyphenation@after}% |
| 89 |
} |
| 90 |
|
| 91 |
\ifx\cyrdash\undefined |
| 92 |
\def\cyrdash{\leavevmode\hbox to.8em{\textendash\hss\textendash}}% |
| 93 |
\fi |
| 94 |
|
| 95 |
\def\noukrainian@shorthands{% |
| 96 |
\xpg@deactivate@shorthands% |
| 97 |
} |
| 98 |
|
| 99 |
\def\captionsukrainian{% |
| 100 |
\def\refname{Література}% |
| 101 |
\def\abstractname{Анотація}% |
| 102 |
\def\bibname{Бібліоґрафія}% |
| 103 |
\def\prefacename{Вступ}% |
| 104 |
\def\chaptername{Розділ}% |
| 105 |
\def\appendixname{Додаток}% |
| 106 |
\def\contentsname{Зміст}% |
| 107 |
\def\listfigurename{Перелік ілюстрацій}% |
| 108 |
\def\listtablename{Перелік таблиць}% |
| 109 |
\def\indexname{Покажчик}% |
| 110 |
\def\authorname{Іменний покажчик}% babel has "Їменний покажчик" |
| 111 |
\def\figurename{Рис.}% |
| 112 |
\def\tablename{Табл.}% |
| 113 |
%\def\thepart{}% |
| 114 |
\def\partname{Частина}% |
| 115 |
\def\pagename{с.}% |
| 116 |
\def\seename{див.}% |
| 117 |
\def\alsoname{див.\ також}% |
| 118 |
\def\enclname{вкладка}% |
| 119 |
\def\ccname{копія}% |
| 120 |
\def\headtoname{До}% |
| 121 |
\def\proofname{Доведення}% |
| 122 |
\def\glossaryname{Словник термінів}% |
| 123 |
} |
| 124 |
|
| 125 |
\def\dateukrainian{% |
| 126 |
\def\today{\number\day~\ifcase\month\or |
| 127 |
січня\or |
| 128 |
лютого\or |
| 129 |
березня\or |
| 130 |
квітня\or |
| 131 |
травня\or |
| 132 |
червня\or |
| 133 |
липня\or |
| 134 |
серпня\or |
| 135 |
вересня\or |
| 136 |
жовтня\or |
| 137 |
листопада\or |
| 138 |
грудня\fi% |
| 139 |
\space\number\year~р.}% |
| 140 |
} |
| 141 |
|
| 142 |
% The following is based on some ideas from ruscor.sty |
| 143 |
\def\ukrainian@capsformat{% |
| 144 |
\def\@seccntformat##1{\csname pre##1\endcsname% |
| 145 |
\csname the##1\endcsname% |
| 146 |
\csname post##1\endcsname}% |
| 147 |
\def\@aftersepkern{\hspace{0.5em}}% |
| 148 |
\def\postchapter{.\@aftersepkern}% |
| 149 |
\def\postsection{.\@aftersepkern}% |
| 150 |
\def\postsubsection{.\@aftersepkern}% |
| 151 |
\def\postsubsubsection{.\@aftersepkern}% |
| 152 |
\def\postparagraph{.\@aftersepkern}% |
| 153 |
\def\postsubparagraph{.\@aftersepkern}% |
| 154 |
\def\prechapter{}% |
| 155 |
\def\presection{}% |
| 156 |
\def\presubsection{}% |
| 157 |
\def\presubsubsection{}% |
| 158 |
\def\preparagraph{}% |
| 159 |
\def\presubparagraph{}% |
| 160 |
} |
| 161 |
|
| 162 |
\newcommand{\ukrainiannumerals}[2]{\ukrainiannumber{#2}} |
| 163 |
\newcommand{\Ukrainiannumerals}[2]{\Ukrainiannumber{#2}} |
| 164 |
|
| 165 |
\def\ukrainiannumber#1{% |
| 166 |
\ifcyrillic@numerals |
| 167 |
\ifcyrillic@asbuk@numerals |
| 168 |
\ukrainian@asbuk@alph{#1}% |
| 169 |
\else |
| 170 |
\cyr@alph{#1}% |
| 171 |
\fi |
| 172 |
\else |
| 173 |
\number#1% |
| 174 |
\fi% |
| 175 |
} |
| 176 |
|
| 177 |
\def\Ukrainiannumber#1{% |
| 178 |
\ifcyrillic@numerals |
| 179 |
\ifcyrillic@asbuk@numerals |
| 180 |
\ukrainian@asbuk@Alph{#1}% |
| 181 |
\else |
| 182 |
\cyr@Alph{#1}% |
| 183 |
\fi |
| 184 |
\else |
| 185 |
\number#1% |
| 186 |
\fi% |
| 187 |
} |
| 188 |
|
| 189 |
\let\ukrainiannumeral=\ukrainiannumber |
| 190 |
\let\Ukrainiannumeral=\Ukrainiannumber |
| 191 |
|
| 192 |
\def\Asbuk#1{\expandafter\ukrainian@asbuk@Alph\csname c@#1\endcsname} |
| 193 |
\def\asbuk#1{\expandafter\ukrainian@asbuk@alph\csname c@#1\endcsname} |
| 194 |
|
| 195 |
\def\AsbukTrad#1{\expandafter\cyr@Alph\csname c@#1\endcsname} |
| 196 |
\def\asbukTrad#1{\expandafter\cyr@alph\csname c@#1\endcsname} |
| 197 |
|
| 198 |
% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and |
| 199 |
% thus ends at 30. |
| 200 |
\def\ukrainian@asbuk@Alph#1{\ifcase#1\or |
| 201 |
А\or Б\or В\or Г\or Д\or Е\or Ж\or |
| 202 |
З\or И\or К\or Л\or М\or Н\or О\or |
| 203 |
П\or Р\or С\or Т\or У\or Ф\or Х\or |
| 204 |
Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я% |
| 205 |
\else\xpg@ill@value{#1}{ukrainian@asbuk@Alph}\fi% |
| 206 |
} |
| 207 |
|
| 208 |
\def\ukrainian@asbuk@alph#1{\ifcase#1\or |
| 209 |
а\or б\or в\or г\or д\or е\or ж\or |
| 210 |
з\or и\or к\or л\or м\or н\or о\or |
| 211 |
п\or р\or с\or т\or у\or ф\or х\or |
| 212 |
ц\or ч\or ш\or щ\or э\or ю\or я% |
| 213 |
\else\xpg@ill@value{#1}{ukrainian@asbuk@alph}\fi% |
| 214 |
} |
| 215 |
|
| 216 |
\def\ukrainian@numbers{% |
| 217 |
\ifcyrillic@numerals |
| 218 |
\def\ukrainian@alph##1{\expandafter\ukrainiannumeral\expandafter{\the##1}}% |
| 219 |
\def\ukrainian@Alph##1{\expandafter\Ukrainiannumeral\expandafter{\the##1}}% |
| 220 |
\let\@Alph\ukrainian@Alph% |
| 221 |
\let\@alph\ukrainian@alph% |
| 222 |
\fi |
| 223 |
} |
| 224 |
|
| 225 |
\def\noukrainian@numbers{% |
| 226 |
\let\@Alph\latin@Alph% |
| 227 |
\let\@alph\latin@alph% |
| 228 |
} |
| 229 |
|
| 230 |
\def\noextras@ukrainian{% |
| 231 |
\def\@seccntformat##1{\csname the##1\endcsname\quad}% = LaTeX kernel |
| 232 |
\ifcyrillic@numerals\noukrainian@numbers\fi |
| 233 |
\ifukrainian@babelshorthands\noukrainian@shorthands\fi% |
| 234 |
} |
| 235 |
|
| 236 |
\def\blockextras@ukrainian{% |
| 237 |
\ukrainian@capsformat% |
| 238 |
\ifcyrillic@numerals\ukrainian@numbers\else\noukrainian@numbers\fi% |
| 239 |
\ifukrainian@babelshorthands\ukrainian@shorthands\else\noukrainian@shorthands\fi% |
| 240 |
} |
| 241 |
|
| 242 |
\def\inlineextras@ukrainian{% |
| 243 |
\ifukrainian@babelshorthands\ukrainian@shorthands\else\noukrainian@shorthands\fi% |
| 244 |
} |
| 245 |
|
| 246 |
%%% stuff from Babel |
| 247 |
\AtBeginDocument{% |
| 248 |
\ifukrainian@mathfunctions% |
| 249 |
\def\sh{\mathop{\operator@font sh}\nolimits} |
| 250 |
\def\ch{\mathop{\operator@font ch}\nolimits} |
| 251 |
\def\tg{\mathop{\operator@font tg}\nolimits} |
| 252 |
\def\arctg{\mathop{\operator@font arctg}\nolimits} |
| 253 |
\def\arcctg{\mathop{\operator@font arcctg}\nolimits} |
| 254 |
\def\ctg{\mathop{\operator@font ctg}\nolimits} |
| 255 |
\def\cth{\mathop{\operator@font cth}\nolimits} |
| 256 |
\def\cosec{\mathop{\operator@font cosec}\nolimits} |
| 257 |
\def\Prob{\mathop{\kern\z@\mathsf{P}}\nolimits} |
| 258 |
\def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits} |
| 259 |
\def\nsd{\mathop{\mathrm{н.с.д.}}\nolimits} |
| 260 |
\def\nsk{\mathop{\mathrm{н.с.к.}}\nolimits} |
| 261 |
\def\NSD{\mathop{\mathrm{НСД}}\nolimits} |
| 262 |
\def\NSK{\mathop{\mathrm{НСК}}\nolimits} |
| 263 |
\def\nod{\mathop{\mathrm{н.о.д.}}\nolimits} |
| 264 |
\def\nok{\mathop{\mathrm{н.о.к.}}\nolimits} |
| 265 |
\def\NOD{\mathop{\mathrm{НОД}}\nolimits} |
| 266 |
\def\NOK{\mathop{\mathrm{НОК}}\nolimits} |
| 267 |
\def\Proj{\mathop{\mathrm{пр}}\nolimits} |
| 268 |
\fi |
| 269 |
} |
| 270 |
|
| 271 |
\endinput |