summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/polyglossia/gloss-sorbian.ldf
blob: 53b1d3a6e1573b38e60cec65287b6fd6b30b1545 (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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
\ProvidesFile{gloss-sorbian.ldf}[polyglossia: module for sorbian]

\PolyglossiaSetup{sorbian}{
  bcp47=hsb,
  language=Upper Sorbian,
  babelname=uppersorbian,
  hyphennames={usorbian,uppersorbian},
  langtag=USB,
  hyphenmins={2,2},
  fontsetup=true,
}

% BCP-47 compliant aliases
\setlanguagealias*[variant=upper]{sorbian}{hsb}
\setlanguagealias*[variant=lower]{sorbian}{dsb} 
% Backwards compat. aliases
\setlanguagealias[variant=lower]{sorbian}{lsorbian}
\setlanguagealias[variant=upper]{sorbian}{usorbian}

% Babel aliases
\setlanguagealias[variant=lower]{sorbian}{lowersorbian}
\setlanguagealias[variant=upper]{sorbian}{uppersorbian}

\def\sorbian@variant{usorbian}
\define@choicekey*+{sorbian}{variant}[\xpg@val\xpg@nr]{upper,lower}[upper]{%
   \ifcase\xpg@nr\relax
      % upper:
      \def\sorbian@variant{usorbian}%
      \SetLanguageKeys{sorbian}{language=Upper Sorbian,langtag=USB,babelname=uppersorbian,bcp47=hsb}%
      \xpg@fontsetup@latin{sorbian}%
      % Check if \l@usorbian is defined. If not, try to set it to some variety
      % (specific order as in the csv list below), or null language if everything fails
      \xpg@ifdefined{usorbian}{}{%
        \def\do##1{%
            \xpg@ifdefined{##1}%
              {\csletcs{l@usorbian}{l@##1}\listbreak}%
              {}%
        }%
        \docsvlist{uppersorbian}
        \xpg@ifdefined{usorbian}{}{%
                 \xpg@warning{No hyphenation patterns for Upper Sorbian found\MessageBreak
                              I will use the 'null' language instead}%
                 \adddialect\l@usorbian0%
        }
      }%
   \or
      % lower:
      \def\sorbian@variant{lsorbian}%
      \SetLanguageKeys{sorbian}{language=Lower Sorbian,langtag=LSB,babelname=lowersorbian,bcp47=dsb}%
      \xpg@fontsetup@latin{sorbian}%
      % Check if \l@lsorbian is defined. If not, try to set it to some variety
      % (specific order as in the csv list below), or null language if everything fails
      \xpg@ifdefined{lsorbian}{}{%
        \def\do##1{%
           \xpg@ifdefined{##1}%
              {\csletcs{l@lsorbian}{l@##1}\listbreak}%
              {}%
        }%
        \docsvlist{lowersorbian,Lsorbian,usorbian,uppersorbian}
        \xpg@ifdefined{lsorbian}{}{%
                 \xpg@warning{No hyphenation patterns for Lower Sorbian found\MessageBreak
                              I will use the 'null' language instead}%
                 \adddialect\l@lsorbian0%
        }
     }%
   \fi
   \xpg@info{Option: sorbian, variant=\xpg@val}%
}{\xpg@warning{Unknown sorbian variant `#1'}}


\define@boolkey{sorbian}[sorbian@]{olddate}[true]{}

% Register default options
\xpg@initialize@gloss@options{sorbian}{variant=upper,olddate=false}


\def\sorbian@language{%
   \polyglossia@setup@language@patterns{\sorbian@variant}%
}%


\def\captionssorbian@lsorbian{%
   \def\refname{Referency}%
   \def\abstractname{Abstrakt}%
   \def\bibname{Literatura}%
   \def\prefacename{Zawod}%
   \def\chaptername{Kapitl}%
   \def\appendixname{Dodawki}%
   \def\contentsname{Wopśimjeśe}%
   \def\listfigurename{Zapis wobrazow}%
   \def\listtablename{Zapis tabulkow}%
   \def\indexname{Indeks}%
   \def\figurename{Wobraz}%
   \def\tablename{Tabulka}%
   %\def\thepart{}%
   \def\partname{Źěl}%
   \def\pagename{Strona}%
   \def\seename{gl.}%
   \def\alsoname{gl.~teke}%
   \def\enclname{Pśiłoga}%
   \def\ccname{CC}%
   \def\headtoname{Komu}%
   \def\proofname{Proof}%
   \def\glossaryname{Glossary}%
}

\def\captionssorbian@usorbian{%
   \def\refname{Referency}%
   \def\abstractname{Abstrakt}%
   \def\bibname{Literatura}%
   \def\prefacename{Zawod}%
   \def\chaptername{Kapitl}%
   \def\appendixname{Dodawki}%
   \def\contentsname{Wobsah}%
   \def\listfigurename{Zapis wobrazow}%
   \def\listtablename{Zapis tabulkow}%
   \def\indexname{Indeks}%
   \def\figurename{Wobraz}%
   \def\tablename{Tabulka}%
   %\def\thepart{}%
   \def\partname{Dźěl}%
   \def\pagename{Strona}%
   \def\seename{hl.}%
   \def\alsoname{hl.~tež}%
   \def\enclname{Přłoha}%
   \def\ccname{CC}%
   \def\headtoname{Komu}%
   \def\proofname{Proof}% <-- needs translation
   \def\glossaryname{Glossary}% <-- needs translation
}%

\def\captionssorbian{%
  \csname captionssorbian@\sorbian@variant\endcsname%
}

\def\datesorbian@lsorbian{%
    \def\oldtoday{%
      \number\day.~\ifcase\month\or
      wjelikego rožka\or małego rožka\or nalětnika\or
      jatšownika\or rožownika\or smažnika\or pražnika\or
      žnjeńca\or požnjeńca\or winowca\or nazymnika\or 
      godownika\fi\space \number\year}%
    \def\today{%
      \ifsorbian@olddate
        \oldtoday%
      \else
        \number\day.~\ifcase\month\or
        januara\or februara\or měrca\or apryla\or maja\or
        junija\or julija\or awgusta\or septembra\or oktobra\or
        nowembra\or decembra\fi
        \space \number\year%
      \fi
   }%
}

\def\datesorbian@usorbian{%
  \def\oldtoday{\number\day.~\ifcase\month\or
    wulkeho róžka\or małeho róžka\or nalětnika\or
    jutrownika\or róžownika\or  smažnika\or pražnika\or
    žnjenca\or požnjenca\or winowca\or nazymnika\or
    hodownika\fi \space \number\year}%
  \def\today{%
    \ifsorbian@olddate
      \oldtoday%
    \else
      \number\day.~\ifcase\month\or
      januara\or februara\or měrca\or apryla\or meje\or junija\or
      julija\or awgusta\or septembra\or oktobra\or
      nowembra\or decembra\fi
      \space \number\year%
    \fi
  }%
}

\def\datesorbian{%
  \csname datesorbian@\sorbian@variant\endcsname%
}

\endinput