summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/polyglossia/gloss-finnish.ldf
blob: d0a4adfe37d984af7c7647613c060f42f3c522bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
% Language definition file (part of polyglossia v1.59 -- 2022/11/29)
%
\ProvidesFile{gloss-finnish.ldf}[polyglossia: module for Finnish]
\PolyglossiaSetup{finnish}{
  bcp47=fi,
  hyphennames={finnish},
  hyphenmins={2,2},
  langtag=FIN,
  frenchspacing=true,
  fontsetup=true,
}

% BCP-47 compliant aliases
\setlanguagealias*{finnish}{fi}

\define@boolkey{finnish}[finnish@]{babelshorthands}[true]{}

\define@boolkey{finnish}[finnish@]{schoolhyphens}[true]{}

% Register default options
\xpg@initialize@gloss@options{finnish}{babelshorthands=false,schoolhyphens=false}

\ifsystem@babelshorthands
  \setkeys{finnish}{babelshorthands=true}
\else
  \setkeys{finnish}{babelshorthands=false}
\fi

\ifcsundef{initiate@active@char}{%
    \input{babelsh.def}%
    \initiate@active@char{"}%
    \shorthandoff{"}%
}{}

\def\finnish@shorthands{%
  \bbl@activate{"}%
  \def\language@group{finnish}%
  \declare@shorthand{finnish}{"-}{\nobreak-\bbl@allowhyphens}
  \declare@shorthand{finnish}{"|}{\textormath{\penalty\@M\discretionary{-}{}{\kern.03em}}{}}%
  \declare@shorthand{finnish}{""}{\hskip\z@skip}%
  \declare@shorthand{finnish}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
  \declare@shorthand{finnish}{"=}{\penalty\@M-\hskip\z@skip}%
  \declare@shorthand{finnish}{"/}{\textormath
    {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}%
}

\def\nofinnish@shorthands{%
  \@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
}

\def\captionsfinnish{%
   \def\refname{Viitteet}%
   \def\abstractname{Tiivistelmä}%
   \def\bibname{Kirjallisuutta}%
   \def\prefacename{Esipuhe}%
   \def\chaptername{Luku}%
   \def\appendixname{Liite}%
   \def\contentsname{Sisällys}%
   \def\listfigurename{Kuvat}%
   \def\listtablename{Taulukot}%
   \def\indexname{Hakemisto}%
   \def\figurename{Kuva}%
   \def\tablename{Taulukko}%
   %\def\thepart{}%
   \def\partname{Osa}%
   \def\pagename{Sivu}%
   \def\seename{katso}%
   \def\alsoname{katso myös}%
   \def\enclname{Liitteet}%
   \def\ccname{Jakelu}%
   \def\headtoname{Vastaanottaja}%
   \def\proofname{Todistus}%
   \def\glossaryname{Sanasto}%
}

\def\finnish@language{%
  \iffinnish@schoolhyphens
      \xpg@ifdefined{schoolfinnish}{%
         \polyglossia@setup@language@patterns{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}%
     }%
  \else
      \polyglossia@setup@language@patterns{finnish}%
  \fi
}

\def\datefinnish{%
   \def\today{\number\day.~\ifcase\month\or
    tammikuuta\or helmikuuta\or maaliskuuta\or huhtikuuta\or
    toukokuuta\or kesäkuuta\or heinäkuuta\or elokuuta\or
    syyskuuta\or lokakuuta\or marraskuuta\or joulukuuta\fi
    \space\number\year}}

\def\noextras@finnish{%
  \iffinnish@babelshorthands\nofinnish@shorthands\fi%
}

\def\blockextras@finnish{%
  \iffinnish@babelshorthands\finnish@shorthands\else\nofinnish@shorthands\fi%
}

\def\inlineextras@finnish{%
  \iffinnish@babelshorthands\finnish@shorthands\else\nofinnish@shorthands\fi%
}

\endinput

% TODO ? this is set in babel:
\gappto\blockextrasfinnish{%
  \babel@savevariable\hyphenpenalty\hyphenpenalty=30%
  \babel@savevariable\exhyphenpenalty\exhyphenpenalty=30%
  \babel@savevariable\doublehyphendemerits\doublehyphendemerits=5000%
  \babel@savevariable\finalhyphendemerits\finalhyphendemerits=5000%
}