[latex3-commits] [git/LaTeX3-latex3-babel] main: Load calendars based on [date.<calendar>]. (81d8585)

Javier email at dante.de
Thu Jun 2 18:09:56 CEST 2022


Repository : https://github.com/latex3/babel
On branch  : main
Link       : https://github.com/latex3/babel/commit/81d85851c80e1264f0dab3766473f651598e5fc5

>---------------------------------------------------------------

commit 81d85851c80e1264f0dab3766473f651598e5fc5
Author: Javier <email at localhost>
Date:   Thu Jun 2 18:09:56 2022 +0200

    Load calendars based on [date.<calendar>].


>---------------------------------------------------------------

81d85851c80e1264f0dab3766473f651598e5fc5
 README.md              |   2 +-
 babel.dtx              |  57 +++++++++++++++++++++++++++++++------------------
 babel.ins              |   2 +-
 babel.pdf              | Bin 880288 -> 882379 bytes
 bbcompat.dtx           |   2 +-
 locale/ar/babel-ar.ini |   5 ++---
 locale/fa/babel-fa.ini |   5 ++---
 locale/he/babel-he.ini |   1 -
 8 files changed, 43 insertions(+), 31 deletions(-)

diff --git a/README.md b/README.md
index 8dad649..74dabec 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.75.2755
+## Babel 3.75.2756
 
 *(Development)*
 
diff --git a/babel.dtx b/babel.dtx
index 004832a..2cd0e1f 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2022/06/01 v3.75.2755 The Babel package]
+\ProvidesFile{babel.dtx}[2022/06/02 v3.75.2756 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -2850,7 +2850,7 @@ date corresponding to the Gregorian calendar and other lunisolar systems
 with the following command.
 
 \Describe{\localedate}{\oarg{calendar=.., variant=..}%
-  {\marg{year}\m{month}\m{day}}}
+  {\marg{year}\marg{month}\marg{day}}}
 
 By default the calendar is the Gregorian, but an |ini| file may define
 strings for other calendars (currently |ar|, |ar-|*, |he|, |fa|, |hi|).
@@ -2863,6 +2863,20 @@ Even with a certain calendar there may be variants. In Kurmanji the
 default variant prints something like \textit{30. Çileya Pêşîn 2019},
 but with |variant=izafa| it prints \textit{31’ê Çileya Pêşînê 2019}.
 
+\Describe{\babelcalendar}{\oarg{date}%
+  \marg{calendar}\marg{year-macro}\m{month-macro}\m{day-macro}}
+  
+\New{3.76} Although calendars aren’t the primary concern of \babel, the
+package should be able to, at least, generate correctly the current
+date in the way users would expect in their own culture. Currently,
+|\localedate| can print dates in a few calendars (provided the
+\textsf{ini} locale file has been imported), but year, month and day
+had to be entered by hand, which is very inconvenient. With this macro,
+the current date is converted and stored in the three last arguments,
+which must be macros. The optional argument converts the given date, in
+the form ‘\m{year}-\m{month}-\m{day}’. Please, refer to the page on the
+news for 3.76 in the \babel{} site for further details.
+
 \subsection{Accessing language info}
 
 \Describe{\languagename}{}
@@ -5143,8 +5157,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.75.2755>>
-%<<date=2022/06/01>>
+%<<version=3.75.2756>>
+%<<date=2022/06/02>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -9682,6 +9696,7 @@ help from Bernd Raichle, for which I am grateful.
   \let\bbl at KVP@Alph\@nil
   \let\bbl at KVP@labels\@nil
   \bbl at csarg\let{KVP at labels*}\@nil
+  \let\bbl at calendars\@empty
   \global\let\bbl at inidata\@empty
   \global\let\bbl at extend@ini\@gobble
   \gdef\bbl at key@list{;}% 
@@ -10018,17 +10033,14 @@ help from Bernd Raichle, for which I am grateful.
          \let\atcatcode\relax
          \global\bbl at csarg\let{rqtex@\languagename}\relax
        \fi}%
-    \bbl at ifunset{bbl at rqcal@\languagename}{}%
-      {\edef\bbl at tempa{\bbl at cs{rqcal@\languagename}}%
-         \bbl at replace\bbl at tempa{ }{,}%
-         \bbl at foreach\bbl at tempa{%
-           \bbl at ifunset{bbl at ca@##1}{%
-             \chardef\atcatcode=\catcode`\@
-             \catcode`\@=11\relax
-             \InputIfFileExists{babel-ca-##1.tex}{}{}%
-             \catcode`\@=\atcatcode
-             \let\atcatcode\relax}%
-           {}}}%
+    \bbl at foreach\bbl at calendars{%
+      \bbl at ifunset{bbl at ca@##1}{%
+        \chardef\atcatcode=\catcode`\@
+        \catcode`\@=11\relax
+        \InputIfFileExists{babel-ca-##1.tex}{}{}%
+        \catcode`\@=\atcatcode
+        \let\atcatcode\relax}%
+      {}}%
   \fi
   % == frenchspacing ==
   \ifcase\bbl at howloaded\in at true\else\in at false\fi
@@ -10292,7 +10304,9 @@ help from Bernd Raichle, for which I am grateful.
     \def\bbl at section{##1}%
     \in@{=date.}{=##1}% Find a better place
     \ifin@
-      \bbl at ini@calendar{##1}%
+      \bbl at ifunset{bbl at inikv@##1}%
+        {\bbl at ini@calendar{##1}}%
+        {}%
     \fi
     \in@{=identification/extension.}{=##1/##2}%
     \ifin@
@@ -10336,7 +10350,7 @@ help from Bernd Raichle, for which I am grateful.
   \bbl at endcommands}
 %    \end{macrocode}
 %
-% A somewhat hackish tool to handle calendar sections. To be improved.
+% A somewhat hackish tool to handle calendar sections. TODO. To be improved.
 %
 %    \begin{macrocode}
 \def\bbl at ini@calendar#1{%
@@ -10353,6 +10367,9 @@ help from Bernd Raichle, for which I am grateful.
  \fi
  \ifx\bbl at tempa\relax\else
    \bbl at replace\bbl at tempa{=}{}%
+   \ifx\bbl at tempa\@empty\else
+     \xdef\bbl at calendars{,\bbl at tempa}%
+   \fi
    \bbl at exp{%
      \def\<bbl at inikv@#1>####1####2{% 
        \\\bbl at inidate####1...\relax{####2}{\bbl at tempa}}}%
@@ -10471,7 +10488,6 @@ help from Bernd Raichle, for which I am grateful.
     \bbl at exportkey{dgnat}{numbers.digits.native}{}%
     \ifnum#1=\tw@           % only (re)new
       \bbl at exportkey{rqtex}{identification.require.babel}{}%
-      \bbl at exportkey{rqcal}{identification.require.calendars}{}%
       \bbl at toglobal\bbl at savetoday
       \bbl at toglobal\bbl at savedate
       \bbl at savestrings
@@ -22750,9 +22766,8 @@ Babel.cjk_breaks = {
   \edef#7{\fp_eval:n{ \bbl at tempa - \bbl at cs@isltojd{#5}{#6}{1} + 1} }}
 %    \end{macrocode}
 %
-% The Umm al-Qura calendar, used mainly in Saudi Arabia. Based on
-% \texttt{islamdate\_today.js} on |https://webspace.science.uu.nl/|.
-% Copyright 1999-2002 by Ray Stott. Free to use if credited.
+% The Umm al-Qura calendar, used mainly in Saudi Arabia, is based
+% on \textsf{moment-hijri}, by Abdullah Alsigar (license MIT).
 %
 % Since the main aim is to provide a suitable |\today|, and maybe some
 % close dates, data just covers Hijri $\sim$1435/$\sim$1460 (Gregorian
diff --git a/babel.ins b/babel.ins
index ea1dc95..6ab3002 100644
--- a/babel.ins
+++ b/babel.ins
@@ -26,7 +26,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %%
-\def\filedate{2022/06/01}
+\def\filedate{2022/06/02}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index 0a03c24..c6bc9a4 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 4948261..546f4a9 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2022/06/01 v3.75.2755]
+\ProvidesFile{bbcompat.dtx}[2022/06/02 v3.75.2756]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
diff --git a/locale/ar/babel-ar.ini b/locale/ar/babel-ar.ini
index a99b849..25f8f01 100644
--- a/locale/ar/babel-ar.ini
+++ b/locale/ar/babel-ar.ini
@@ -11,8 +11,8 @@
 
 [identification]
 charset = utf8
-version = 1.15
-date = 2022-05-25
+version = 1.14
+date = 2022-05-15
 name.local = العربية
 name.english = Arabic
 name.babel = arabic
@@ -26,7 +26,6 @@ script.tag.opentype = arab
 level = 1
 encodings = LAE
 derivate = no
-require.calendars = islamic
 
 [captions]
 preface = مدخل
diff --git a/locale/fa/babel-fa.ini b/locale/fa/babel-fa.ini
index 61c2f02..dcd28df 100644
--- a/locale/fa/babel-fa.ini
+++ b/locale/fa/babel-fa.ini
@@ -11,8 +11,8 @@
 
 [identification]
 charset = utf8
-version = 1.9
-date = 2022-06-01
+version = 1.8
+date = 2021-05-16
 name.local = فارسی
 name.english = Persian
 name.babel = persian
@@ -27,7 +27,6 @@ script.tag.opentype = arab
 level = 1
 encodings = 
 derivate = no
-require.calendars = persian
 
 [captions]
 preface = پیشگفتار
diff --git a/locale/he/babel-he.ini b/locale/he/babel-he.ini
index af25b9a..9893a7e 100644
--- a/locale/he/babel-he.ini
+++ b/locale/he/babel-he.ini
@@ -27,7 +27,6 @@ script.tag.opentype = hebr
 level = 1
 encodings = 
 derivate = no
-require.calendars = hebrew
 
 [captions]
 preface = מבוא





More information about the latex3-commits mailing list.