% Language definition file (part of polyglossia v2.2 -- 2024/07/15) % \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