Skip to content

Commit

Permalink
Fix first number of abjadmaghrib numbering for Algeria, Morocco and T…
Browse files Browse the repository at this point in the history
…unisia (#640)
  • Loading branch information
jspitz committed May 18, 2024
1 parent f0ecfe9 commit 72fa643
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/polyglossia.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2727,6 +2727,8 @@ \subsection*{2.2 (forthcoming)}
\subsubsection*{Bug fixes}
\begin{itemize}
\item Fix \texttt{lang} environment (\TXI{633}).
\item Fix first number of Maghrib abjad numbering for Algeria, Morocco and
Tunisia (\TXI{640}).
\end{itemize}

\subsubsection*{New Features}
Expand Down
3 changes: 2 additions & 1 deletion tex/arabicnumbers.sty
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@
\fi
}
\def\abjad@zero{}
\def\abjad@one{ا}
\def\abjad@three\ifabjad@jim@notail\char"200D\fi}
\def\abj@num@i@iso#1{%
\ifcase#1\or ا\or ب\or\abjad@three\or د%
\or ه\char"200D\or و\or ز\or ح\or ط\fi%
\ifnum#1=\z@\abjad@zero\fi}
\def\abj@num@i#1{%
\ifcase#1\or ا\or ب\or\abjad@three\or د%
\ifcase#1\or\abjad@one\or ب\or\abjad@three\or د%
\or ه\or و\or ز\or ح\or ط\fi%
\ifnum#1=\z@\abjad@zero\fi}
\def\abj@num@ii#1{%
Expand Down
13 changes: 13 additions & 0 deletions tex/gloss-arabic.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
\setlanguagealias*[locale=mashriq]{arabic}{ar-PS}

\newif\ifeastern@numerals
\newif\ifabjad@alef
\newif\if@hijrical
\newif\ifarabic@customsep\arabic@customsepfalse

Expand Down Expand Up @@ -76,36 +77,43 @@
\ifcase\UseName{l_keys_choice_int}\or
% default:
\eastern@numeralstrue%
\abjad@aleffalse%
\SetLanguageKeys{arabic}{bcp47=ar-YE,bcp47-language=ar}%
\xpg@info{Option: arabic, locale=default}%
\or
% mashriq:
\eastern@numeralstrue%
\abjad@aleffalse%
\SetLanguageKeys{arabic}{bcp47=ar-IQ,bcp47-language=ar}%
\xpg@info{Option: arabic, locale=mashriq}%
\or
% libya:
\eastern@numeralstrue%
\abjad@aleffalse%
\SetLanguageKeys{arabic}{bcp47=ayl,bcp47-language=ar,bcp47-region=LY}%
\xpg@info{Option: arabic, locale=libya}%
\or
% algeria:
\eastern@numeralsfalse%
\abjad@aleftrue%
\SetLanguageKeys{arabic}{bcp47=arq,bcp47-language=ar,bcp47-region=DZ,bcp47-extension-u=nu-latn}%
\xpg@info{Option: arabic, locale=algeria}%
\or
% tunisia:
\eastern@numeralsfalse%
\abjad@aleftrue%
\SetLanguageKeys{arabic}{bcp47=aeb,bcp47-language=ar,bcp47-region=TN,bcp47-extension-u=nu-latn}%
\xpg@info{Option: arabic, locale=tunisia}%
\or
% morocco:
\eastern@numeralsfalse%
\abjad@aleftrue%
\SetLanguageKeys{arabic}{bcp47=ary,bcp47-language=ar,bcp47-region=MA,bcp47-extension-u=nu-latn}%
\xpg@info{Option: arabic, locale=morocco}%
\or
% mauritania:
\eastern@numeralstrue%
\abjad@aleffalse%
\SetLanguageKeys{arabic}{bcp47=ar-MR,bcp47-language=ar,bcp47-region=MR}%
\xpg@info{Option: arabic, locale=mauritania}%
\fi
Expand Down Expand Up @@ -233,6 +241,11 @@


\def\abjadmaghribi#1{%
\ifabjad@alef
\def\abjad@one{أ}%
\else
\def\abjad@one{ا}%
\fi%
\ifnum#1>1999\xpg@ill@value{#1}{abjad}%
\else
\ifnum#1<\z@\space\xpg@ill@value{#1}{abjad}%
Expand Down

0 comments on commit 72fa643

Please sign in to comment.