%%% Adapted from a file contributed by Kamal Abdali \ProvidesFile{gloss-urdu.ldf}[polyglossia: module for Urdu] \ifluatex \xpg@warning{Urdu is not supported with LuaTeX.\MessageBreak I will proceed with the compilation, but\MessageBreak the output is not guaranteed to be correct\MessageBreak and may look very wrong.} \fi \RequirePackage{bidi} \RequirePackage{arabicnumbers} \RequirePackage{hijrical} \PolyglossiaSetup{urdu}{ script=Arabic, direction=RL, scripttag=arab, langtag=URD, hyphennames={urdu,nohyphenation}, fontsetup=true %TODO localalph={abjad,abjad} %TODO localnumber=urdunumber } \newif\if@western@numerals \def\tmp@western{western} \define@key{urdu}{numerals}[eastern]{% \def\@tmpa{#1}% \ifx\@tmpa\tmp@western\@western@numeralstrue% \else\@western@numeralsfalse% \fi} %% TODO USE boolkey instead !!! %this is needed for \abjad in arabicnumbers.sty \def\tmp@true{true} \define@key{urdu}{abjadjimnotail}[true]{% \def\@tmpa{#1}% \ifx\@tmpa\tmp@true\abjad@jim@notailtrue% \else \abjad@jim@notailfalse \fi} \newif\if@hijrical \def\tmp@hijri{hijri} \define@key{urdu}{calendar}[gregorian]{% \def\@tmpa{#1}% \ifx\@tmpa\tmp@hijri\@hijricaltrue% \else\@hijricalfalse% \fi} \define@key{urdu}{hijricorrection}[0]{% \gdef\@hijri@correction{#1}}% % This should set the defaults \setkeys{urdu}{calendar,numerals,hijricorrection} \def\urdugregmonth#1{\ifcase#1% \or جنوری\or فروری\or مارچ\or اپریل\or مئی\or جون\or جولائی\or اگست\or ستمبر\or اکتوبر\or نومبر\or دسمبر\fi} \def\urduhijrimonth#1{\ifcase#1% \or محرّم\or صفر\or ربیع الاوّل\or ربیع الثّانی\or جمادی الاوّل\or جمادی الثّانی\or رجب\or شعبان\or رمضان\or شوّال\or ذیقعدہ\or ذی الحجّہ\fi} %\Hijritoday is now locale-aware and will format the date with this macro: \DefineFormatHijriDate{urdu}{\@ensure@RTL{% \urdunumber{\value{Hijriday}}؍\space\urduhijrimonth{\value{Hijrimonth}}\space\urdunumber{\value{Hijriyear}}}} \def\captionsurdu{% \def\refname{\@ensure@RTL{حوالہ جات}}% \def\abstractname{\@ensure@RTL{ملخّص}}% \def\bibname{\@ensure@RTL{کتابیات}}% \def\prefacename{\@ensure@RTL{دیباچہ}}% \def\chaptername{\@ensure@RTL{باب}}% \def\appendixname{\@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\thepart{}% \def\partname{\@ensure@RTL{حصّہ}}% \def\pagename{\@ensure@RTL{صفحہ}}% \def\seename{\@ensure@RTL{ملاحظہ ہو}}% \def\alsoname{\@ensure@RTL{ایضاً}}% \def\enclname{\@ensure@RTL{منسلک}}% \def\ccname{\@ensure@RTL{نقل}}% \def\headtoname{\@ensure@RTL{بملاحظہ}}% \def\proofname{\@ensure@RTL{ثبوت}}% \def\glossaryname{\@ensure@RTL{لغت}}% \def\sectionname{\@ensure@RTL{فصل}}% } \def\dateurdu{% \def\today{% \if@hijrical \Hijritoday[\@hijri@correction]% \else \@ensure@RTL{\urdunumber\day؍\space\urdugregmonth{\month}% \space\urdunumber\year}% \fi}% } \def\urdunumber#1{% \if@western@numerals \number#1% \else %%FIXME use farsidigits instead??? \protect\arabicdigits{\number#1}% \fi} \def\urdu@numbers{% \let\@latinalph\@alph% \let\@latinAlph\@Alph% \let\@alph\abjad% \let\@Alph\abjad% } \def\nourdu@numbers{% \let\@alph\@latinalph% \let\@Alph\@latinAlph% } \def\urdu@globalnumbers{% \let\orig@arabic\@arabic% \let\@arabic\urdunumber% % For some reason \thefootnote needs to be set separately: \renewcommand\thefootnote{\protect\urdunumber{\c@footnote}}% } \def\nourdu@globalnumbers{ \let\@arabic\orig@arabic% \renewcommand\thefootnote{\protect\number{\c@footnote}}% } \def\blockextras@urdu{% \let\@@MakeUppercase\MakeUppercase% \def\MakeUppercase##1{##1}% } \def\noextras@urdu{% \let\MakeUppercase\@@MakeUppercase% } \endinput