| 1 |
% Language definition file (part of polyglossia v2.10 -- 2026/04/18) |
| 2 |
% |
| 3 |
\ProvidesFile{gloss-croatian.ldf}[polyglossia: module for Croatian] |
| 4 |
\PolyglossiaSetup{croatian}{ |
| 5 |
bcp47=hr, |
| 6 |
bcp47-language=hr, |
| 7 |
bcp47-script=Latn, |
| 8 |
langtag=HRV, |
| 9 |
hyphennames={croatian}, |
| 10 |
hyphenmins={2,2}, % aligned with https://ctan.org/pkg/hrhyph patterns and http://lebesgue.math.hr/~nenad/Diplomski/Maja_Ribaric_2011.pdf |
| 11 |
frenchspacing=true, % recommendation from Damir Bralić |
| 12 |
indentfirst=false, % recommendation from Damir Bralić |
| 13 |
} |
| 14 |
|
| 15 |
% BCP-47 compliant aliases |
| 16 |
\setlanguagealias*{croatian}{hr} |
| 17 |
|
| 18 |
\ifluatex |
| 19 |
\RequirePackage{luavlna} |
| 20 |
\fi |
| 21 |
|
| 22 |
\DeclareKeys[polyglossia/gloss/croatian] |
| 23 |
{ |
| 24 |
babelshorthands.if = croatian@babelshorthands, |
| 25 |
babelshorthands.default:n = true, |
| 26 |
disabledigraphs.if = croatian@disabledigraphs, |
| 27 |
disabledigraphs.default:n = true, |
| 28 |
splithyphens.if = croatian@splithyphens, |
| 29 |
splithyphens.default:n = true, |
| 30 |
localalph.if = croatian@localalph, |
| 31 |
localalph.default:n = true, |
| 32 |
disableligatures.choices:nn = { true, false } |
| 33 |
{% |
| 34 |
\xpg@warning{The option disableligatures is deprecated.\MessageBreak |
| 35 |
Please use disabledigraphs instead}% |
| 36 |
\ifcase\UseName{l_keys_choice_int}\or |
| 37 |
\croatian@disabledigraphstrue |
| 38 |
\or |
| 39 |
\croatian@disabledigraphsfalse |
| 40 |
\fi |
| 41 |
}, |
| 42 |
disableligatures.default:n = true, |
| 43 |
} |
| 44 |
|
| 45 |
\ifsystem@babelshorthands |
| 46 |
\SetGlossOptions{croatian}{babelshorthands=true} |
| 47 |
% Register default options |
| 48 |
\InitializeGlossOptions{croatian}{babelshorthands=true, |
| 49 |
disabledigraphs=false, |
| 50 |
splithyphens=true, |
| 51 |
localalph=true} |
| 52 |
\else |
| 53 |
\SetGlossOptions{croatian}{babelshorthands=false} |
| 54 |
% Register default options |
| 55 |
\InitializeGlossOptions{croatian}{babelshorthands=false, |
| 56 |
disabledigraphs=false, |
| 57 |
splithyphens=true, |
| 58 |
localalph=true} |
| 59 |
\fi |
| 60 |
|
| 61 |
\InitializeBabelShorthands |
| 62 |
|
| 63 |
\let\xpg@hyphen@char- |
| 64 |
\def\croatian@@splhyphen#1{% |
| 65 |
\def\croatian@sh@tmp{% |
| 66 |
\ifx\croatian@sh@next\xpg@hyphen@char#1% |
| 67 |
\else\expandafter\croatian@@@splhyphen{#1}\fi% |
| 68 |
}% |
| 69 |
\futurelet\croatian@sh@next\croatian@sh@tmp% |
| 70 |
} |
| 71 |
|
| 72 |
\def\croatian@@@splhyphen#1{% |
| 73 |
\ifnum\hyphenchar \font>0% |
| 74 |
\kern\z@\discretionary{-}{\char\hyphenchar\the\font}{#1}% |
| 75 |
\nobreak\hskip\z@% |
| 76 |
\else% |
| 77 |
#1% |
| 78 |
\fi% |
| 79 |
} |
| 80 |
|
| 81 |
\def\croatian@splhyphen{% |
| 82 |
\croatian@@splhyphen{-}% |
| 83 |
} |
| 84 |
|
| 85 |
\def\croatian@shorthands{% |
| 86 |
\xpg@activate@shorthands% |
| 87 |
\def\language@group{croatian}% |
| 88 |
\declare@shorthand{croatian}{"=}{\xpg@breakable@hyphen}% |
| 89 |
\declare@shorthand{croatian}{""}{\xpg@invisible@break}% |
| 90 |
\declare@shorthand{croatian}{"~}{\xpg@nobreak@hyphen}% |
| 91 |
\declare@shorthand{croatian}{"-}{\xpg@add@hyphenation@point}% |
| 92 |
\declare@shorthand{croatian}{"|}{\xpg@ligature@break}% |
| 93 |
\declare@shorthand{croatian}{"/}{\xpg@breakable@slash}% |
| 94 |
\declare@shorthand{croatian}{"`}{„}% |
| 95 |
\declare@shorthand{croatian}{"'}{”}% |
| 96 |
\declare@shorthand{croatian}{"<}{«}% |
| 97 |
\declare@shorthand{croatian}{">}{»}% |
| 98 |
\declare@shorthand{croatian}{"D}{\xpg@hr@digraph{D}}% |
| 99 |
\declare@shorthand{croatian}{"d}{\xpg@hr@digraph{d}}% |
| 100 |
\declare@shorthand{croatian}{"L}{\xpg@hr@digraph{L}}% |
| 101 |
\declare@shorthand{croatian}{"l}{\xpg@hr@digraph{l}}% |
| 102 |
\declare@shorthand{croatian}{"N}{\xpg@hr@digraph{N}}% |
| 103 |
\declare@shorthand{croatian}{"n}{\xpg@hr@digraph{n}}% |
| 104 |
} |
| 105 |
|
| 106 |
\def\nocroatian@shorthands{% |
| 107 |
\xpg@deactivate@shorthands% |
| 108 |
} |
| 109 |
|
| 110 |
\ifxetex |
| 111 |
% splithyphens |
| 112 |
\newXeTeXintercharclass\croatian@hyphen % - |
| 113 |
\newXeTeXintercharclass\croatian@nonsyllabicpreposition% |
| 114 |
\fi |
| 115 |
|
| 116 |
\def\croatian@hyphens{% |
| 117 |
\ifluatex |
| 118 |
\AfterPreamble{\enablesplithyphens{croatian}}% |
| 119 |
\else |
| 120 |
\XeTeXinterchartokenstate=1 |
| 121 |
\XeTeXcharclass `\- \croatian@hyphen |
| 122 |
\XeTeXinterchartoks \z@ \croatian@hyphen = {\croatian@@splhyphen}% "-" -> "\croatian@@splhyphen-" |
| 123 |
% necessary if used together with vlna: |
| 124 |
\XeTeXinterchartoks \croatian@nonsyllabicpreposition \croatian@hyphen = {\croatian@@splhyphen}% "-" -> "\croatian@@splhyphen-" |
| 125 |
\fi% |
| 126 |
} |
| 127 |
|
| 128 |
\def\nocroatian@hyphens{% |
| 129 |
\ifluatex |
| 130 |
\AfterPreamble{\disablesplithyphens{croatian}}% |
| 131 |
\else |
| 132 |
\XeTeXcharclass `\- \z@ |
| 133 |
\fi% |
| 134 |
} |
| 135 |
|
| 136 |
\newcommand*\hr@charifavailable[3]{% |
| 137 |
\ifcroatian@disabledigraphs% no notion of digraphs at all |
| 138 |
\bgroup#3\egroup% |
| 139 |
\else% digraph... |
| 140 |
\charifavailable{#1}{#2}% ... either a Unicode original or a mimic of one |
| 141 |
\fi% |
| 142 |
} |
| 143 |
|
| 144 |
% Provide croatian digraphs if available in current font |
| 145 |
\protected\def\xpg@hr@digraph#1#2{% |
| 146 |
\bgroup% |
| 147 |
% 1. DŽ, Dž and dž |
| 148 |
\ifx#1D% |
| 149 |
\ifx#2Z\relax% |
| 150 |
\hr@charifavailable{01C4}{D\nobreak Ž}{DŽ}% |
| 151 |
\else% |
| 152 |
\ifx#2z\relax |
| 153 |
\hr@charifavailable{01C5}{D\nobreak ž}{Dž}% |
| 154 |
\else |
| 155 |
D#2% |
| 156 |
\fi% |
| 157 |
\fi% |
| 158 |
\fi% |
| 159 |
\ifx#1d% |
| 160 |
\ifx#2z\relax |
| 161 |
\hr@charifavailable{01C6}{d\nobreak ž}{dž}% |
| 162 |
\else |
| 163 |
d#2% |
| 164 |
\fi% |
| 165 |
\fi% |
| 166 |
% 2. LJ, Lj and lj |
| 167 |
\ifx#1L% |
| 168 |
\ifx#2J\relax% |
| 169 |
\hr@charifavailable{01C7}{L\nobreak J}{LJ}% |
| 170 |
\else% |
| 171 |
\ifx#2j\relax |
| 172 |
\hr@charifavailable{01C8}{L\nobreak j}{Lj}% |
| 173 |
\else |
| 174 |
L#2% |
| 175 |
\fi% |
| 176 |
\fi% |
| 177 |
\fi% |
| 178 |
\ifx#1l% |
| 179 |
\ifx#2j\relax |
| 180 |
\hr@charifavailable{01C9}{l\nobreak j}{lj}% |
| 181 |
\else |
| 182 |
l#2% |
| 183 |
\fi% |
| 184 |
\fi% |
| 185 |
% 2. NJ, Nj and nj |
| 186 |
\ifx#1N% |
| 187 |
\ifx#2J\relax% |
| 188 |
\hr@charifavailable{01CA}{N\nobreak J}{NJ}% |
| 189 |
\else% |
| 190 |
\ifx#2j\relax |
| 191 |
\hr@charifavailable{01CB}{N\nobreak j}{Nj}% |
| 192 |
\else |
| 193 |
N#2% |
| 194 |
\fi% |
| 195 |
\fi% |
| 196 |
\fi% |
| 197 |
\ifx#1n% |
| 198 |
\ifx#2j\relax |
| 199 |
\hr@charifavailable{01CC}{n\nobreak j}{nj}% |
| 200 |
\else |
| 201 |
n#2% |
| 202 |
\fi% |
| 203 |
\fi% |
| 204 |
\egroup% |
| 205 |
} |
| 206 |
|
| 207 |
\def\captionscroatian{% |
| 208 |
\def\prefacename{Predgovor}% |
| 209 |
\def\refname{Literatura}% |
| 210 |
\def\abstractname{Sažetak}% |
| 211 |
\def\bibname{Bibliografija}% |
| 212 |
\def\chaptername{Poglav\xpg@hr@digraph{l}{j}e}% |
| 213 |
\def\appendixname{Dodatak}% |
| 214 |
\def\contentsname{Sadržaj}% |
| 215 |
\def\listfigurename{Popis slika}% |
| 216 |
\def\listtablename{Popis tablica}% |
| 217 |
\def\indexname{Kazalo}% |
| 218 |
\def\figurename{Slika}% |
| 219 |
\def\tablename{Tablica}% |
| 220 |
\def\partname{Dio}% |
| 221 |
\def\enclname{Prilozi}% |
| 222 |
\def\ccname{Kopija}% |
| 223 |
\def\headtoname{Prima}% |
| 224 |
\def\pagename{Stranica}% |
| 225 |
\def\seename{Vidjeti}% |
| 226 |
\def\alsoname{Također vidjeti}% |
| 227 |
\def\proofname{Dokaz}% |
| 228 |
\def\glossaryname{Pojmovnik}% |
| 229 |
} |
| 230 |
|
| 231 |
\def\datecroatian{% |
| 232 |
\def\today{\number\day.~\ifcase\month\or |
| 233 |
siječ\xpg@hr@digraph{n}{j}a\or ve\xpg@hr@digraph{l}{j}ače\or |
| 234 |
ožujka\or trav\xpg@hr@digraph{n}{j}a\or svib\xpg@hr@digraph{n}{j}a\or |
| 235 |
lip\xpg@hr@digraph{n}{j}a\or srp\xpg@hr@digraph{n}{j}a\or |
| 236 |
kolovoza\or rujna\or listopada\or studenoga\or prosinca\fi \space \number\year.}% |
| 237 |
} |
| 238 |
|
| 239 |
\def\croatian@@alph#1{% |
| 240 |
\ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or |
| 241 |
m\or n\or o\or p\or r\or s\or t\or u\or v\or z\else#1\fi |
| 242 |
} |
| 243 |
\def\croatian@@Alph#1{% |
| 244 |
\ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or |
| 245 |
M\or N\or O\or P\or R\or S\or T\or U\or V\or Z\else#1\fi |
| 246 |
} |
| 247 |
|
| 248 |
\def\croatian@alph#1{\expandafter\croatian@@alph\csname c@#1\endcsname} |
| 249 |
\def\croatian@Alph#1{\expandafter\croatian@@Alph\csname c@#1\endcsname} |
| 250 |
|
| 251 |
\def\noextras@croatian{% |
| 252 |
\ifcroatian@babelshorthands\nocroatian@shorthands\fi% |
| 253 |
\nocroatian@hyphens% |
| 254 |
\let\alph\latinalph\let\Alph\latinAlph% |
| 255 |
} |
| 256 |
|
| 257 |
\def\blockextras@croatian{% |
| 258 |
\ifcroatian@babelshorthands\croatian@shorthands\else\nocroatian@shorthands\fi% |
| 259 |
\ifcroatian@splithyphens\croatian@hyphens\else\nocroatian@hyphens\fi% |
| 260 |
\ifcroatian@localalph\let\alph\croatian@alph\let\Alph\croatian@Alph\fi% |
| 261 |
} |
| 262 |
|
| 263 |
\def\inlineextras@croatian{% |
| 264 |
\ifcroatian@babelshorthands\croatian@shorthands\else\nocroatian@shorthands\fi% |
| 265 |
\ifcroatian@splithyphens\croatian@hyphens\else\nocroatian@hyphens\fi% |
| 266 |
\ifcroatian@localalph\let\alph\croatian@alph\let\Alph\croatian@Alph\fi% |
| 267 |
} |
| 268 |
|
| 269 |
\def\nestedextras@croatian{% |
| 270 |
\ifluatex% |
| 271 |
\ifcroatian@splithyphens\croatian@hyphens\else\nocroatian@hyphens\fi% |
| 272 |
\fi% |
| 273 |
} |
| 274 |
|
| 275 |
\endinput |