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
|
% Language definition file (part of polyglossia v2.3 -- 2024/09/23)
%
\ProvidesFile{gloss-hebrew.ldf}[polyglossia: module for Hebrew]
\RequireBidi
\RequirePackage{hebrewcal}
\PolyglossiaSetup{hebrew}{
bcp47=he,
bcp47-language=hr,
bcp47-region=HE,
bcp47-script=Hebr,
script=Hebrew,
direction=RL,
scripttag=hebr,
langtag=IWR,
hyphennames={nohyphenation},
fontsetup=true,
localnumeral=hebrewnumerals
%TODO localalph={hebrewnumeral,Hebrewnumeral}
%digits = hebrewnumber
}
% BCP-47 compliant aliases
\setlanguagealias*{hebrew}{he}
\newif\if@calendar@hebrew
\newif\if@hebrew@numerals
\DeclareKeys[polyglossia/gloss/hebrew]
{
marcheshvan.code = \setkeys{hebrewcal}{marcheshvan=#1},
marcheshvan.default:n = true,
transliteration.code = \setkeys{hebrewcal}{transliteration=#1},
transliteration.default:n = alt,
fullyear.code = \setkeys{hebrewcal}{fullyear=#1},
fullyear.default:n = true,
calendar.choice:,
calendar / hebrew.code =
{%
\@calendar@hebrewtrue
},
calendar / gregorian.code =
{%
\@calendar@hebrewfalse
},
calendar.default:n = gregorian,
calendar/unknown.code = \xpg@warning{Unknown Hebrew calendar `#1'},
numerals.choice:,
numerals / hebrew.code =
{%
\@hebrew@numeralstrue
\SetLanguageKeys{hebrew}{bcp47-extension-u=nu-hebr}%
},
numerals / arabic.code =
{%
\@hebrew@numeralsfalse
\SetLanguageKeys{hebrew}{bcp47-extension-u=nu-latn}%
},
numerals.default:n = arabic,
numerals/unknown.code = \xpg@warning{Unknown Hebrew numerals value `#1'}
}
\SetGlossOptions{hebrew}{numerals}
% Register default options
\InitializeGlossOptions{hebrew}{numerals=arabic,calendar=gregorian,marcheshvan=false,fullyear=false}
\def\captionshebrew{%
\def\prefacename{מבוא}%
\def\refname{מקורות}%
\def\abstractname{תקציר}%
\def\bibname{ביבליוגרפיה}%
\def\chaptername{פרק}%
\def\appendixname{נספח}%
\def\contentsname{תוכן העניינים}%
\def\listfigurename{רשימת האיורים}%
\def\listtablename{רשימת הטבלאות}%
\def\indexname{מפתח}%
\def\figurename{איור}%
\def\tablename{טבלה}%
\def\partname{חלק}%
\def\enclname{רצ"ב}%
\def\ccname{העתקים}%
\def\headtoname{אל}%
\def\pagename{עמוד}%
\def\psname{נ.ב.}%
\def\seename{ראה}%
\def\alsoname{ראה גם}% check
\def\proofname{הוכחה}%
\def\glossaryname{מילון מונחים}% check
}
\def\datehebrew{%
\def\today{%
\if@calendar@hebrew
\hebrewtoday
\else
\hebrewnumber\day
\space ב\hebrewgregmonth{\month}\space
\hebrewnumber\year
\fi
}%
}
\def\hebrewgregmonth#1{\ifcase#1%
\or ינואר% יאנואר
\or פברואר\or מרץ% מרס / מארס
\or אפריל\or מאי% מי
\or יוני\or יולי\or אוגוסט %אבגוסט
\or ספטמבר\or אוקטובר\or נובמבר\or דצמבר\fi}
\input{babel-hebrewalph.def}
\newcommand{\hebrewnumerals}[2]{\hebrewnumber{#2}}
\def\hebrewnumber#1{%
\if@hebrew@numerals
\hebrewnumeral{#1}%
\else
\number#1%
\fi
}
\ifxetex
% Bidi inserts an RTL mark (0x200f) between number and number separator (- .),
% forcing numbers to RTL. This is wrong for Hebrew.
% So we defunc the respective command with XeTeX.
\let\xpg@orig@DigitsDotDashInterCharToks\DigitsDotDashInterCharToks
\def\hebrew@ltr@numbers{%
\renewcommand*{\DigitsDotDashInterCharToks}{}%
}
\def\nohebrew@ltr@numbers{%
% Restore bidi's \DigitsDotDashInterCharToks
\let\DigitsDotDashInterCharToks\xpg@orig@DigitsDotDashInterCharToks
}
\else
% Only dummy commands (nothing to do here) for LuaTeX
\def\hebrew@ltr@numbers{}
\def\nohebrew@ltr@numbers{}
\fi
\def\hebrew@numbers{%
\let\@alph\hebrewnumeral
\let\@Alph\Hebrewnumeral
% Prevent bidi from setting the numbers RTL
\hebrew@ltr@numbers
}
\def\nohebrew@numbers{%
\let\@alph\latin@alph
\let\@Alph\latin@Alph
% Restore previous bidi numbers definition
\nohebrew@ltr@numbers
}
\def\hebrew@globalnumbers{%
\let\@arabic\hebrewnumber
\renewcommand\thefootnote{\localnumeral*{footnote}}%
% Prevent bidi from setting the numbers RTL
\hebrew@ltr@numbers
}
% Store original definition
\let\xpg@save@arabic\@arabic
\def\nohebrew@globalnumbers{%
\let\@arabic\xpg@save@arabic
}
\endinput
|