Debian Codegraph @

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

raw
1 % Language definition file (part of polyglossia v2.10 -- 2026/04/18)
2 %
3 \ProvidesFile{gloss-finnish.ldf}[polyglossia: module for Finnish]
4 \PolyglossiaSetup{finnish}{
5 bcp47=fi,
6 bcp47-language=fi,
7 bcp47-region=FI,
8 bcp47-script=Latn,
9 hyphennames={finnish},
10 hyphenmins={2,2},
11 langtag=FIN,
12 frenchspacing=true,
13 }
14
15 % BCP-47 compliant aliases
16 \setlanguagealias*{finnish}{fi}
17
18 \newif\if@finnish@schoolhyphens
19 \newif\if@finnish@babelhyphens
20
21 \DeclareKeys[polyglossia/gloss/finnish]
22 {
23 babelshorthands.if = finnish@babelshorthands,
24 babelshorthands.default:n = true,
25 hyphens.choice:,
26 hyphens / default.code =
27 {%
28 \@finnish@schoolhyphensfalse
29 \@finnish@babelhyphensfalse
30 },
31 hyphens / school.code =
32 {%
33 \@finnish@schoolhyphenstrue
34 \@finnish@babelhyphensfalse
35 },
36 hyphens / babel.code =
37 {%
38 \@finnish@schoolhyphensfalse
39 \@finnish@babelhyphenstrue
40 },
41 hyphens.default:n = default,
42 hyphens/unknown.code = \xpg@warning{Unknown Finnish hyphens `#1'},
43 schoolhyphens.choice:,
44 schoolhyphens / true.code =
45 {%
46 \@finnish@schoolhyphenstrue
47 \@finnish@babelhyphensfalse
48 },
49 schoolhyphens / false.code =
50 {%
51 \@finnish@schoolhyphensfalse
52 },
53 schoolhyphens.default:n = true
54 }
55
56 \ifsystem@babelshorthands
57 \SetGlossOptions{finnish}{babelshorthands=true}
58 % Register default options
59 \InitializeGlossOptions{finnish}{babelshorthands=true,hyphens=default}
60 \else
61 \SetGlossOptions{finnish}{babelshorthands=false}
62 % Register default options
63 \InitializeGlossOptions{finnish}{babelshorthands=false,hyphens=default}
64 \fi
65
66 \InitializeBabelShorthands
67
68 \def\finnish@shorthands{%
69 \xpg@activate@shorthands%
70 \def\language@group{finnish}%
71 \declare@shorthand{finnish}{"-}{\xpg@breakable@hyphen}%
72 \declare@shorthand{finnish}{"|}{\xpg@ligature@break}%
73 \declare@shorthand{finnish}{""}{\xpg@invisible@break}%
74 \declare@shorthand{finnish}{"~}{\xpg@nobreak@hyphen}%
75 \declare@shorthand{finnish}{"=}{\xpg@nobreak@hyphen}%
76 \declare@shorthand{finnish}{"/}{\xpg@breakable@slash}%
77 }
78
79 \def\nofinnish@shorthands{%
80 \xpg@deactivate@shorthands%
81 }
82
83 \def\captionsfinnish{%
84 \def\refname{Viitteet}%
85 \def\abstractname{Tiivistelmä}%
86 \def\bibname{Kirjallisuutta}%
87 \def\prefacename{Esipuhe}%
88 \def\chaptername{Luku}%
89 \def\appendixname{Liite}%
90 \def\contentsname{Sisällys}%
91 \def\listfigurename{Kuvat}%
92 \def\listtablename{Taulukot}%
93 \def\indexname{Hakemisto}%
94 \def\figurename{Kuva}%
95 \def\tablename{Taulukko}%
96 %\def\thepart{}%
97 \def\partname{Osa}%
98 \def\pagename{Sivu}%
99 \def\seename{katso}%
100 \def\alsoname{katso myös}%
101 \def\enclname{Liitteet}%
102 \def\ccname{Jakelu}%
103 \def\headtoname{Vastaanottaja}%
104 \def\proofname{Todistus}%
105 \def\glossaryname{Sanasto}%
106 }
107
108 \def\finnish@language{%
109 \if@finnish@schoolhyphens
110 \IfLanguageDefinedTF{schoolfinnish}{%
111 \SetupPolyglossiaLangPatterns{schoolfinnish}%
112 }{%
113 \xpg@warning{Finnish 'School' hyphenation patterns (schoolfinnish) not available.\MessageBreak
114 I will use the standard patterns for Finnish instead}%
115 \SetupPolyglossiaLangPatterns{finnish}%
116 }%
117 \else
118 \SetupPolyglossiaLangPatterns{finnish}%
119 \fi
120 }
121
122 % activate babel-style hyphen settings if requested
123 \AtBeginDocument{%
124 \if@finnish@babelhyphens
125 \let\xpg@save@hyphenpenalty\hyphenpenalty%
126 \let\xpg@save@exhyphenpenalty\exhyphenpenalty%
127 \let\xpg@save@doublehyphendemerits\doublehyphendemerits%
128 \let\xpg@save@finalhyphendemerits\finalhyphendemerits%
129 \addto\blockextras@finnish{%
130 \hyphenpenalty=30%
131 \exhyphenpenalty=30%
132 \doublehyphendemerits=5000%
133 \finalhyphendemerits=5000%
134 }%
135 \addto\noextras@finnish{%
136 \let\hyphenpenalty\xpg@save@hyphenpenalty%
137 \let\exhyphenpenalty\xpg@save@exhyphenpenalty%
138 \let\doublehyphendemerits\xpg@save@doublehyphendemerits%
139 \let\finalhyphendemerits\xpg@save@finalhyphendemerits%
140 }%
141 \fi
142 }
143
144 \def\datefinnish{%
145 \def\today{\number\day.~\ifcase\month\or
146 tammikuuta\or helmikuuta\or maaliskuuta\or huhtikuuta\or
147 toukokuuta\or kesäkuuta\or heinäkuuta\or elokuuta\or
148 syyskuuta\or lokakuuta\or marraskuuta\or joulukuuta\fi
149 \space\number\year}}
150
151 \def\noextras@finnish{%
152 \iffinnish@babelshorthands\nofinnish@shorthands\fi%
153 }
154
155 \def\blockextras@finnish{%
156 \iffinnish@babelshorthands\finnish@shorthands\else\nofinnish@shorthands\fi%
157 }
158
159 \def\inlineextras@finnish{%
160 \iffinnish@babelshorthands\finnish@shorthands\else\nofinnish@shorthands\fi%
161 }
162
163 \endinput
164