% Language definition file (part of polyglossia v2.2 -- 2024/07/15) % \ProvidesFile{gloss-arabic.ldf}[polyglossia: module for Arabic] \RequireBidi \RequirePackage{arabicnumbers} \RequirePackage{hijrical} \PolyglossiaSetup{arabic}{ bcp47=ar, bcp47-language=ar, bcp47-script=Arab, bcp47-region=YE, script=Arabic, direction=RL, langtag=ARA, scripttag=arab, hyphennames={nohyphenation}, fontsetup=true, envname=Arabic, localnumeral=arabicnumerals %TODO localalph={abjad,abjad} } % BCP-47 compliant aliases \setlanguagealias*{arabic}{ar} \setlanguagealias*[locale=mashriq]{arabic}{ar-IQ} \setlanguagealias*[locale=default]{arabic}{ar-YE} \setlanguagealias*[locale=mashriq]{arabic}{ar-LB} \setlanguagealias*[locale=mashriq]{arabic}{ar-JO} \setlanguagealias*[locale=default]{arabic}{afb} \setlanguagealias*[locale=mauritania]{arabic}{ar-MR} \setlanguagealias*[locale=default]{arabic}{arz} \setlanguagealias*[locale=morocco]{arabic}{ary} \setlanguagealias*[locale=algeria]{arabic}{arq} \setlanguagealias*[locale=tunisia]{arabic}{aeb} \setlanguagealias*[locale=mashriq]{arabic}{ar-SY} \setlanguagealias*[locale=libya]{arabic}{ayl} \setlanguagealias*[locale=default]{arabic}{apd} \setlanguagealias*[locale=mashriq]{arabic}{ar-PS} \newif\ifeastern@numerals \newif\if@hijrical \newif\ifarabic@customsep\arabic@customsepfalse \DeclareKeys[polyglossia/gloss/arabic] { hijricorrection.code = \gdef\arabic@hijri@correction{#1}, hijricorrection.default:n = 0, sectionsep.code = \gdef\xpg@sepmark{#1}\arabic@customseptrue, sectionsep.default:n = ., abjadalph.if = arabic@abjadalph, abjadalph.default:n = true, abjadjimnotail.if = abjad@jim@notail, abjadjimnotail.default:n = true, numerals.choice:, numerals / mashriq.code = {% \eastern@numeralstrue }, numerals / maghrib.code = {% \eastern@numeralsfalse }, numerals / eastern.code = {% \eastern@numeralstrue }, numerals / western.code = {% \eastern@numeralsfalse }, numerals.default:n = mashriq, numerals/unknown.code = \xpg@warning{Unknown Arabic numerals option `#1'}, locale.choice:, locale / default.code = {% \eastern@numeralstrue \def\abjad@one{ا}% \SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar}% \gdef\@@arabic@month{\@arabic@month{#1}}% }, locale / mashriq.code = {% \eastern@numeralstrue \def\abjad@one{ا}% \SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar}% \gdef\@@arabic@month{\@arabic@month{#1}}% }, locale / libya.code = {% \eastern@numeralstrue \def\abjad@one{ا}% \SetLanguageKeys{arabic}{bcp47=ayl,bcp47-language=ar,bcp47-region=LY}% \gdef\@@arabic@month{\@arabic@month{#1}}% }, locale / algeria.code = {% \eastern@numeralsfalse \def\abjad@one{أ}% \SetLanguageKeys{arabic}{bcp47=arq,bcp47-language=ar,bcp47-region=DZ,bcp47-extension-u=nu-latn}% \gdef\@@arabic@month{\@arabic@month{#1}}% }, locale / tunisia.code = {% \eastern@numeralsfalse \def\abjad@one{أ}% \SetLanguageKeys{arabic}{bcp47=aeb,bcp47-language=ar,bcp47-region=TN,bcp47-extension-u=nu-latn}% \gdef\@@arabic@month{\@arabic@month{#1}}% }, locale / morocco.code = {% \eastern@numeralsfalse \def\abjad@one{أ}% \SetLanguageKeys{arabic}{bcp47=ary,bcp47-language=ar,bcp47-region=MA,bcp47-extension-u=nu-latn}% \gdef\@@arabic@month{\@arabic@month{#1}}% }, locale / mauritania.code = {% \eastern@numeralstrue \def\abjad@one{ا}% \SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}% \gdef\@@arabic@month{\@arabic@month{#1}}% }, locale.default:n = default, locale/unknown.code = \xpg@warning{Unknown Arabic locale `#1'}, calendar.choice:, calendar / gregorian.code = {% \@hijricalfalse }, calendar / hijri.code = {% \@hijricaltrue }, calendar / islamic.code = {% \@hijricaltrue }, calendar.default:n = gregorian, calendar/unknown.code = \xpg@warning{Unknown Arabic calendar option `#1'} } % Register default options \InitializeGlossOptions{arabic}{locale=default,calendar=gregorian,numerals=mashriq,hijricorrection=0,abjadjimnotail=false} % Register alias options \SetLanguageAliasValues{arabic}{calendar}{islamic,hijri} \def\arabicgregmonth@default#1{\ifcase#1% % Egypt, Sudan, Yemen and Golf states \or يناير\or فبراير\or مارس\or أبريل\or مايو\or يونيو\or يوليو\or أغسطس\or سبتمبر\or أكتوبر\or نوفمبر\or ديسمبر\fi} \def\arabicgregmonth@mashriq#1{\ifcase#1% % Iraq Syria Jordan Lebanon Palestine \or كانون الثاني\or شباط\or آذار\or نيسان\or أيار\or حزيران\or تموز\or آب\or أيلول\or تشرين الأول\or تشرين الثاني\or كانون الأول\fi} \def\arabicgregmonth@libya#1{\ifcase#1% %Lybia «تعرف في ليبيا بأسماء عربية وضعها معمر القذافي ترمز إلى فصول السنة وبعض الشخصيات التاريخية» (ar.wikipedia.org) \or أي النار\or النوار\or الربيع\or الطير\or الماء\or الصيف\or ناصر\or هانيبال\or الفاتح\or التمور\or الحرث\or الكانون\fi} \def\arabicgregmonth@morocco#1{\ifcase#1% \or يناير\or فبراير\or مارس\or أبريل\or ماي\or يونيو\or يوليوز\or غشت\or شتنبر\or أكتوبر\or نونبر\or دجنبر\fi} \def\arabicgregmonth@algeria#1{\ifcase#1% % Tunisia and Algeria \or جانفي\or فيفري\or مارس\or أفريل\or ماي\or جوان\or جويلية\or أوت\or سبتمبر\or أكتوبر\or نوفمبر\or ديسمبر\fi} \let\arabicgregmonth@tunisia\arabicgregmonth@algeria \def\arabicgregmonth@mauritania#1{\ifcase#1% \or يناير\or فبراير\or مارس\or إبريل\or مايو\or يونيو\or يوليو\or أغشت\or شتمبر\or أكتوبر\or نوفمبر\or دجمبر\fi} \def\@arabic@month#1{% \@ifundefined{arabicgregmonth@#1}% {\xpg@warning{Option `locale=#1' is not defined for Arabic: using `default' instead}% \arabicgregmonth@default}% {\expandafter\csname arabicgregmonth@#1\endcsname}% } %\Hijritoday is now locale-aware and will format the date with this macro: \DefineFormatHijriDate{arabic}{\@ensure@RTL{\arabicnumber{\value{Hijriday}}% \space\HijriMonthArabic{\value{Hijrimonth}}\space\arabicnumber{\value{Hijriyear}}}} \def\captionsarabic{% \def\prefacename{\@ensure@RTL{مدخل}}% \def\refname{\@ensure@RTL{المراجع}}% \def\abstractname{\@ensure@RTL{ملخص}}% \def\bibname{\@ensure@RTL{المصادر}}% \def\chaptername{\@ensure@RTL{باب}}% \def\appendixname{\@ensure@RTL{الملاحق}}% \def\contentsname{\@ensure@RTL{المحتويات}}% %\def\contentsname{\@ensure@RTL{الفهرس}}% \def\listfigurename{\@ensure@RTL{قائمة الأشكال}}% \def\listtablename{\@ensure@RTL{قائمة الجداول}}% \def\indexname{\@ensure@RTL{الفهرس}}% \def\figurename{\@ensure@RTL{شكل}}% \def\tablename{\@ensure@RTL{جدول}}% \def\partname{\@ensure@RTL{القسم}}% \def\enclname{\@ensure@RTL{المرفقات}}%<-- Needs translation \def\ccname{\@ensure@RTL{نسخة ل‬}}% << \def\headtoname{\@ensure@RTL{إلى}}%<-- Needs translation \def\pagename{\@ensure@RTL{صفحة}}% \def\seename{\@ensure@RTL{راجع}}%\alefhamza\nun\za\ra \def\alsoname{\@ensure@RTL{راجع أيضًا}}%<<\alefhamza\nun\za\ra \def\proofname{\@ensure@RTL{برهان}}% \def\glossaryname{\@ensure@RTL{قاموس}}%<< } \def\datearabic{% \def\today{% \if@hijrical \Hijritoday[\arabic@hijri@correction]% \else% \if@RTL \arabicnumber\day\space\@@arabic@month{\month}% \space\arabicnumber\year% \else% in LR environment we format the gregorian date within \textenglish \iflanguageloaded{english}{\textenglish{\today}}%else US format {\normalfontlatin\ifcase\month\or January\or February\or March\or April\or May\or June\or July\or August\or September\or October\or November\or December\fi \space\number\day,\space\number\year}% \fi \fi}} % Use \providecommand here as the ldf file might % be reloaded via aeb (BCP). \providecommand{\arabicnumerals}[2]{\arabicnumber{#2}} \def\arabicnumber#1{% \ifeastern@numerals \@ensure@LTR{\arabicdigits{\number#1}}% \else \number#1% \fi} \def\@ornatebracearabic#1{\RL{\char"FD3F\@arabic#1\char"FD3E}} \def\@ornatebracealph#1{\RL{\char"FD3F\@alph#1\char"FD3E}} \def\abjadalph#1{\expandafter\arabic@abjad@alph{\number#1}} % This is a poor man's Arabic alphanumeric. It just uses the alphabet and % thus ends at 28. \def\arabic@abjad@alph#1{\ifcase#1% \or ا\or ب\or\abjad@three\or د\or و\or ه‍\or ز% \or ح\or ط\or ي\or ك\or ل\or م\or ن% \or س\or ع\or ف\or ص\or ق\or ر\or ش% \or ت\or ث\or خ\or ذ\or ض\or ظ\or غ% \else\xpg@ill@value{#1}{arabic@abjad@alph}\fi } \def\abjadmaghribi#1{% \ifnum#1>1999\xpg@ill@value{#1}{abjad}% \else \ifnum#1<\z@\space\xpg@ill@value{#1}{abjad}% \else \ifnum#1<10\expandafter\abj@num@i\number#1% \else \ifnum#1<100\expandafter\abj@maghribi@num@ii\number#1% \else \ifnum#1<\@m\expandafter\abj@maghribi@num@iii\number#1% \else \ifnum#1<\@M\expandafter\abj@maghribi@num@iv\number#1% \fi \fi \fi \fi \fi \fi } %maghribi س -> ص ص -> ض ش -> س ض -> ظ ظ -> غ غ -> ش \def\abj@maghribi@num@ii#1{% \ifcase#1\abjad@zero\or ي\or ك\or ل\or م\or ن% \or ص\or ع\or ف\or ض\fi \abj@num@i} \def\abj@maghribi@num@iii#1{% \ifcase#1\or ق\or ر\or س\or ت\or ث% \or خ\or ذ\or ظ\or غ\fi \abj@maghribi@num@ii} \def\abj@maghribi@num@iv#1{% \ifcase#1\or ش\fi \abj@maghribi@num@iii} \def\arabic@numbers{% \ifarabic@abjadalph \let\@alph\abjadalph \let\@Alph\abjadalph \else \let\@alph\abjad \let\@Alph\abjad \fi } \def\noarabic@numbers{% \let\@alph\latin@alph \let\@Alph\latin@Alph } % Store original definition \let\xpg@save@arabic\@arabic \def\arabic@globalnumbers{% \let\@arabic\arabicnumber \renewcommand\thefootnote{\localnumeral*{footnote}}% \renewcommand\theequation{\localnumeral*{equation}}% } \def\noarabic@globalnumbers{% \let\@arabic\xpg@save@arabic } \def\arabic@xetex@capsformat{% \let\xpg@save@sepmark\@SepMark \SepMark{\xpg@sepmark} } \def\noarabic@xetex@capsformat{% \ifcsname xpg@save@sepmark\endcsname \SepMark{\xpg@save@sepmark} \fi } \def\arabic@luatex@capsformat{% % % change chapter and part headings \ifarabic@customsep \ifcsname chapter\endcsname \let\xpg@save@thesection\thesection \renewcommand*\thesection{\thechapter\xpg@sepmark\@arabic\c@section} \let\xpg@save@theequation\theequation \renewcommand*\theequation{% \ifnum \c@chapter>\z@ \thechapter\xpg@sepmark\fi\@arabic\c@equation} \let\xpg@save@thefigure\thefigure \renewcommand*\thefigure{% \ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@figure} \let\xpg@save@thetable\thetable \renewcommand*\thetable{% \ifnum\c@chapter>\z@\thechapter\xpg@sepmark\fi\@arabic\c@table} \fi \let\xpg@save@thesubsection\thesubsection \renewcommand\thesubsection {\thesection\xpg@sepmark\@arabic\c@subsection} \let\xpg@save@thesubsubsection\thesubsubsection \renewcommand\thesubsubsection{\thesubsection\xpg@sepmark\@arabic\c@subsubsection} \let\xpg@save@theparagraph\theparagraph \renewcommand\theparagraph {\thesubsubsection\xpg@sepmark\@arabic\c@paragraph} \let\xpg@save@thesubparagraph\thesubparagraph \renewcommand\thesubparagraph{\theparagraph\xpg@sepmark\@arabic\c@subparagraph} \fi % (end \ifarabic@customsep) } \def\noarabic@luatex@capsformat{% \ifcsname xpg@save@thesection\endcsname \let\thesection\xpg@save@thesection \fi \ifcsname xpg@save@theequation\endcsname \let\theequation\xpg@save@theequation \fi \ifcsname xpg@save@thefigure\endcsname \let\thefigure\xpg@save@thefigure \fi \ifcsname xpg@save@thetable\endcsname \let\thetable\xpg@save@thetable \fi \ifcsname xpg@save@thesubsection\endcsname \let\thesubsection\xpg@save@thesubsection \ifcsname xpg@save@thesubsubsection\endcsname \let\thesubsubsection\xpg@save@thesubsubsection \fi \fi \ifcsname xpg@save@theparagraph\endcsname \let\theparagraph\xpg@save@theparagraph \fi \ifcsname xpg@save@thesubparagraph\endcsname \let\thesubparagraph\xpg@save@thesubparagraph \fi } \def\blockextras@arabic{% \ifarabic@customsep \ifxetex \arabic@xetex@capsformat \else \arabic@luatex@capsformat \fi \fi } \def\noextras@arabic{% \ifarabic@customsep \ifxetex \noarabic@xetex@capsformat \else \noarabic@luatex@capsformat \fi \fi } \endinput