[latex3-commits] [git/LaTeX3-latex3-babel] main: New calendars: Buddhist, Coptic. (d18c5fe)

Javier email at dante.de
Sat Jun 18 13:49:42 CEST 2022


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

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

commit d18c5fee91bc2110aa91de856abb4d9cf3030652
Author: Javier <email at localhost>
Date:   Sat Jun 18 13:49:42 2022 +0200

    New calendars: Buddhist, Coptic.


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

d18c5fee91bc2110aa91de856abb4d9cf3030652
 README.md                 |   9 +--
 babel.dtx                 | 144 +++++++++++++++++++++++++++-------------------
 babel.ins                 |   3 +-
 babel.pdf                 | Bin 883974 -> 885154 bytes
 bbcompat.dtx              |   2 +-
 locale/ar/babel-ar-EG.ini |  23 +++++++-
 locale/cop/babel-cop.ini  |  28 +++++++--
 7 files changed, 138 insertions(+), 71 deletions(-)

diff --git a/README.md b/README.md
index 9f3c923..c8d1751 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.76.2766
+## Babel 3.76.2772
 
 *Development*.
 
@@ -10,9 +10,9 @@ is a set of ini files for about 250 languages.
 
 The latest stable version is available on <https://ctan.org/pkg/babel>.
 
-Changes in version 3.76 are described in:
+Changes in version 3.77 are described in:
 
-https://latex3.github.io/babel/news/whats-new-in-babel-3.76.html
+https://latex3.github.io/babel/news/whats-new-in-babel-3.77.html
 
 Apart from the manual, you can find information on some aspects of babel at:
 
@@ -48,12 +48,13 @@ respective authors.
 
 ### Summary of latest changes
 ```
-3.77   2022-07-?? (dev)
+3.77   2022-06-?? (dev)
        * More con calendar conversions: \localedate, \today.
        * New Arabic locale for Saudi Arabia, with the Umm al-Qura
          calendar.
        * Date now defaults to 'persian' in a few locales: Persian,
          Northern Luri, Mazanderani, Pashto.
+       * New calendars: coptic (ar-EG, cop), buddhist (th).
        
 3.76   2022-06-06
        * Calendar conversion with a new macro \babelcalendar: hebrew,
diff --git a/babel.dtx b/babel.dtx
index 790e4b4..f5796ad 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2022/06/12 v3.76.2766 The Babel package]
+\ProvidesFile{babel.dtx}[2022/06/18 v3.76.2772 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -2857,7 +2857,7 @@ strings for other calendars (currently |ar|, |ar-|*, |he|, |fa|, |hi|).
 In the latter case, the three arguments are the year, the month, and
 the day in those in the corresponding calendar. They are \textit{not}
 the Gregorian data to be converted (which means, say, 13 is a valid
-month number with |calendar=hebrew|).
+month number with |calendar=hebrew| and |calendar=coptic|).
 
 Even with a certain calendar there may be variants. In Kurmanji the
 default variant prints something like \textit{30. Çileya Pêşîn 2019},
@@ -5157,8 +5157,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.76.2766>>
-%<<date=2022/06/12>>
+%<<version=3.76.2772>>
+%<<date=2022/06/18>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -10022,9 +10022,23 @@ help from Bernd Raichle, for which I am grateful.
         \let\\\@Alph\<bbl at cntr@\bbl at KVP@Alph @\languagename>}}%
   \fi
   % == Calendars ==
-  \ifx\bbl at KVP@calendar\@nil\else
-    \bbl at csarg\let{calpr@\languagename}\bbl at KVP@calendar
+  \ifx\bbl at KVP@calendar\@nil
+    \edef\bbl at KVP@calendar{\bbl at cl{calpr}}%
   \fi
+  \def\bbl at tempe##1 ##2\@@{% Get first calendar
+    \def\bbl at tempa{##1}}%
+    \bbl at exp{\\\bbl at tempe\bbl at KVP@calendar\space\\\@@}%
+  \def\bbl at tempe##1.##2.##3\@@{%
+    \def\bbl at tempc{##1}%
+    \def\bbl at tempb{##2}}%
+  \expandafter\bbl at tempe\bbl at tempa..\@@
+  \bbl at csarg\edef{calpr@\languagename}{%
+    \ifx\bbl at tempc\@empty\else
+      calendar=\bbl at tempc
+    \fi
+    \ifx\bbl at tempb\@empty\else
+      ,variant=\bbl at tempb
+    \fi}
   % == require.babel in ini ==
   % To load or reaload the babel-*.tex, if require.babel in ini
   \ifx\bbl at beforestart\relax\else  % But not in doc aux or body
@@ -10720,7 +10734,11 @@ help from Bernd Raichle, for which I am grateful.
 \fi
 %    \end{macrocode}
 %
-% \textbf{Date.} TODO. Document
+% \textbf{Date.} Arguments (year, month, day) are \textit{not}
+% protected, on purpose. In |\today|, arguments are always gregorian,
+% and therefore always converted with other calendars – |@today| works
+% as an internal tag to force conversion if necessary in this
+% particular case (it’s \textit{not} a user interface). TODO. Document
 %
 %    \begin{macrocode}
 % Arguments are _not_ protected.
@@ -10728,16 +10746,12 @@ help from Bernd Raichle, for which I am grateful.
 \DeclareRobustCommand\localedate[1][]{\bbl at localedate{#1}}
 \def\bbl at localedate#1#2#3#4{%
   \begingroup
-    \edef\bbl at tempe{#1}%
     \edef\bbl at they{#2}%
     \edef\bbl at them{#3}%
     \edef\bbl at thed{#4}%
-    \ifx\bbl at tempe\@empty
-      \bbl at ifunset{bbl at calpr@\languagename}{}%
-        {\edef\bbl at tempe{convert,calendar=\bbl at cl{calpr}}%
-         \@nameuse{regex\string_replace\string_once\string:nnN}%
-           {\ .*}{}\bbl at tempe}% TODO. Must be more efficient
-    \fi  
+    \edef\bbl at tempe{%
+      \bbl at ifunset{bbl at calpr@\languagename}{}{\bbl at cl{calpr}},%
+      #1}%
     \bbl at replace\bbl at tempe{ }{}%
     \bbl at replace\bbl at tempe{convert}{convert=}%
     \let\bbl at ld@calendar\@empty
@@ -10745,21 +10759,14 @@ help from Bernd Raichle, for which I am grateful.
     \let\bbl at ld@convert\relax
     \def\bbl at tempb##1=##2\@@{\@namedef{bbl at ld@##1}{##2}}%
     \bbl at foreach\bbl at tempe{\bbl at tempb##1\@@}%
-    \ifx\bbl at ld@convert\relax\else
-      \let\bbl at ld@convert\bbl at ld@calendar
-      \bbl at replace\bbl at ld@convert{gregorian}{}%
-      \ifx\bbl at ld@convert\@empty\else
-        \let\bbl at ld@convert\bbl at ld@calendar % For conversion
-        \@nameuse{regex\string_replace\string_once\string:nnN}%
-          {\..*}{}\bbl at ld@convert
-        \ifx\bbl at ld@convert\@empty\else
-          \babelcalendar[\bbl at they-\bbl at them-\bbl at thed]%
-            {\bbl at ld@convert}\bbl at they\bbl at them\bbl at thed
-        \fi
+    \bbl at replace\bbl at ld@calendar{gregorian}{}%
+    \ifx\bbl at ld@calendar\@empty\else
+      \ifx\bbl at ld@convert\relax\else
+        \babelcalendar[\bbl at they-\bbl at them-\bbl at thed]%
+          {\bbl at ld@calendar}\bbl at they\bbl at them\bbl at thed
       \fi
     \fi
-    \bbl at replace\bbl at ld@calendar{gregorian}{}%
-    \@nameuse{bbl at precalendar}%
+    \@nameuse{bbl at precalendar}% Remove, eg, +, -civil (-ca-islamic)
     \edef\bbl at calendar{% Used in \month..., too
       \bbl at ld@calendar
       \ifx\bbl at ld@variant\@empty\else
@@ -10787,14 +10794,15 @@ help from Bernd Raichle, for which I am grateful.
        \global\bbl at csarg\let{date@\languagename @\bbl at tempb}\bbl at toreplace
        \ifx\bbl at savetoday\@empty
          \bbl at exp{% TODO. Move to a better place.
-           \gdef\<\languagename date>{\\\protect\<\languagename date >}%
-           \gdef\<\languagename date >####1####2####3{%
-             \\\bbl at usedategrouptrue
-             \<bbl at ensure@\languagename>{%
-               \\\localedate{####1}{####2}{####3}}}%
+           \\\AfterBabelCommands{%
+             \def\<\languagename date>{\\\protect\<\languagename date >}%
+             \\\newcommand\<\languagename date >[4][]{%
+               \\\bbl at usedategrouptrue
+               \<bbl at ensure@\languagename>{%
+                 \\\localedate[####1]{####2}{####3}{####4}}}}%
            \def\\\bbl at savetoday{%
              \\\SetString\\\today{%
-               \<\languagename date>%
+               \<\languagename date>[convert]%
                   {\\\the\year}{\\\the\month}{\\\the\day}}}}%
        \fi}%
       {}}}
@@ -22750,24 +22758,28 @@ Babel.cjk_breaks = {
 % specific files, loaded when requested by an |ini| file in the
 % |identification| section with |require.calendars|. 
 %
-% \subsection{Islamic}
-% 
 % Start with function to compute the Julian day. It’s based on the
 % little library |calendar.js|, by John Walker, in the public domain.
-% The code for the Civil calendar is based on it, too.
-%
 %    \begin{macrocode}
-%<*ca-islamic>
-\ExplSyntaxOn
+%<<*Compute Julian day>>
 \def\bbl at fpmod#1#2{(#1-#2*floor(#1/#2))}
 \def\bbl at cs@gregleap#1{%
   (\bbl at fpmod{#1}{4} == 0) &&
     (!((\bbl at fpmod{#1}{100} == 0) && (\bbl at fpmod{#1}{400} != 0)))}
-\def\bbl at ca@jd#1#2#3{% year, month, day
+\def\bbl at cs@jd#1#2#3{% year, month, day
   \fp_eval:n{ 1721424.5   + (365 * (#1 - 1)) +
     floor((#1 - 1) / 4)   + (-floor((#1 - 1) / 100)) +
     floor((#1 - 1) / 400) + floor((((367 * #2) - 362) / 12) +
     ((#2 <= 2) ? 0 : (\bbl at cs@gregleap{#1} ? -1 : -2)) + #3) }}
+%<</Compute Julian day>>
+%    \end{macrocode}
+% \subsection{Islamic}
+% The code for the Civil calendar is based on it, too.
+%
+%    \begin{macrocode}
+%<*ca-islamic>
+\ExplSyntaxOn
+<@Compute Julian day@>
 % == islamic (default)
 % Not yet implemented
 \def\bbl at ca@islamic#1-#2-#3\@@#4#5#6{}
@@ -22787,7 +22799,7 @@ Babel.cjk_breaks = {
 \@namedef{bbl at ca@islamic-civil--}{\bbl at ca@islamicvl at x{-2}}
 \def\bbl at ca@islamicvl at x#1#2-#3-#4\@@#5#6#7{%
   \edef\bbl at tempa{%
-    \fp_eval:n{ floor(\bbl at ca@jd{#2}{#3}{#4})+0.5 #1}}%
+    \fp_eval:n{ floor(\bbl at cs@jd{#2}{#3}{#4})+0.5 #1}}%
   \edef#5{%
     \fp_eval:n{ floor(((30*(\bbl at tempa-1948439.5)) + 10646)/10631) }}%
   \edef#6{\fp_eval:n{
@@ -22803,7 +22815,7 @@ Babel.cjk_breaks = {
 % $\sim$2014/$\sim$2038).
 %
 %    \begin{macrocode}
-\def\bbl at ca@umalqura at data{56660, 56690,56719,56749,56778,56808,%
+\def\bbl at cs@umalqura at data{56660, 56690,56719,56749,56778,56808,%
   56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,%
   57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,%
   57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,%
@@ -22843,9 +22855,9 @@ Babel.cjk_breaks = {
   \fi\fi
     {\bbl at error{Year~out~of~range}{The~allowed~range~is~2014-2038}}%
   \edef\bbl at tempd{\fp_eval:n{ % (Julian) day
-    \bbl at ca@jd{#2}{#3}{#4} + 0.5 - 2400000 #1}}%
+    \bbl at cs@jd{#2}{#3}{#4} + 0.5 - 2400000 #1}}%
   \count@\@ne
-  \bbl at foreach\bbl at ca@umalqura at data{%
+  \bbl at foreach\bbl at cs@umalqura at data{%
     \advance\count@\@ne
     \ifnum##1>\bbl at tempd\else
       \edef\bbl at tempe{\the\count@}%
@@ -23144,16 +23156,8 @@ Babel.cjk_breaks = {
 %    \begin{macrocode}
 %<*ca-persian>
 \ExplSyntaxOn
-\def\bbl at fpmod#1#2{(#1-#2*floor(#1/#2))}
-\def\bbl at cs@gregleap#1{%
-  (\bbl at fpmod{#1}{4} == 0) &&
-    (!((\bbl at fpmod{#1}{100} == 0) && (\bbl at fpmod{#1}{400} != 0)))}  
-\def\bbl at ca@jd#1#2#3{% year, month, day
-  \fp_eval:n{ 1721424.5   + (365 * (#1 - 1)) +
-    floor((#1 - 1) / 4)   + (-floor((#1 - 1) / 100)) +
-    floor((#1 - 1) / 400) + floor((((367 * #2) - 362) / 12) +
-    ((#2 <= 2) ? 0 : (\bbl at cs@gregleap{#1} ? -1 : -2)) + #3) }}   
-\def\bbl at ca@firstjal at xx{2012,2016,2020,2024,2028,2029,% March 20
+<@Compute Julian day@>
+\def\bbl at cs@firstjal at xx{2012,2016,2020,2024,2028,2029,% March 20
   2032,2033,2036,2037,2040,2041,2044,2045,2048,2049}
 \def\bbl at ca@persian#1-#2-#3\@@#4#5#6{%
   \edef\bbl at tempa{#1}%  20XX-03-\bbl at tempe = 1 farvardin:
@@ -23161,15 +23165,15 @@ Babel.cjk_breaks = {
     \bbl at afterfi\expandafter\@gobble
   \fi\fi
     {\bbl at error{Year~out~of~range}{The~allowed~range~is~2013-2050}}%
-  \bbl at xin@{\bbl at tempa}{\bbl at ca@firstjal at xx}%
+  \bbl at xin@{\bbl at tempa}{\bbl at cs@firstjal at xx}%
   \ifin@\def\bbl at tempe{20}\else\def\bbl at tempe{21}\fi
-  \edef\bbl at tempc{\fp_eval:n{\bbl at ca@jd{\bbl at tempa}{#2}{#3}+.5}}% current
-  \edef\bbl at tempb{\fp_eval:n{\bbl at ca@jd{\bbl at tempa}{03}{\bbl at tempe}+.5}}% begin
+  \edef\bbl at tempc{\fp_eval:n{\bbl at cs@jd{\bbl at tempa}{#2}{#3}+.5}}% current
+  \edef\bbl at tempb{\fp_eval:n{\bbl at cs@jd{\bbl at tempa}{03}{\bbl at tempe}+.5}}% begin
   \ifnum\bbl at tempc<\bbl at tempb
     \edef\bbl at tempa{\fp_eval:n{\bbl at tempa-1}}% go back 1 year and redo
-    \bbl at xin@{\bbl at tempa}{\bbl at ca@firstjal at xx}%
+    \bbl at xin@{\bbl at tempa}{\bbl at cs@firstjal at xx}%
     \ifin@\def\bbl at tempe{20}\else\def\bbl at tempe{21}\fi
-    \edef\bbl at tempb{\fp_eval:n{\bbl at ca@jd{\bbl at tempa}{03}{\bbl at tempe}+.5}}%
+    \edef\bbl at tempb{\fp_eval:n{\bbl at cs@jd{\bbl at tempa}{03}{\bbl at tempe}+.5}}%
   \fi
   \edef#4{\fp_eval:n{\bbl at tempa-621}}% set Jalali year
   \edef#6{\fp_eval:n{\bbl at tempc-\bbl at tempb+1}}% days from 1 farvardin
@@ -23181,6 +23185,28 @@ Babel.cjk_breaks = {
 %</ca-persian>
 %    \end{macrocode}
 %
+% \section{Coptic}
+%
+% Adapted from \texttt{jquery.calendars.package-1.1.4}, written by Keith
+% Wood, 2010. Dual license: GPL and MIT.
+%
+%    \begin{macrocode}
+%<*ca-coptic>
+\ExplSyntaxOn
+<@Compute Julian day@>
+\def\bbl at ca@coptic#1-#2-#3\@@#4#5#6{%
+  \edef\bbl at tempd{\fp_eval:n{floor(\bbl at cs@jd{#1}{#2}{#3}) + 0.5}}%
+  \edef\bbl at tempc{\fp_eval:n{\bbl at tempd - 1825029.5}}%
+  \edef#4{\fp_eval:n{%
+    floor((\bbl at tempc - floor((\bbl at tempc+366) / 1461)) / 365) + 1}}%
+  \edef\bbl at tempc{\fp_eval:n{%
+     \bbl at tempd - (#4-1) * 365 - floor(#4/4) - 1825029.5}}%
+  \edef#5{\fp_eval:n{floor(\bbl at tempc / 30) + 1}}%
+  \edef#6{\fp_eval:n{\bbl at tempc - (#5 - 1) * 30 + 1}}}
+\ExplSyntaxOff
+%</ca-coptic>
+%    \end{macrocode}
+%
 % \section{Buddhist}
 %
 % That’s very simple.
diff --git a/babel.ins b/babel.ins
index a6b30ff..b50d658 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/12}
+\def\filedate{2022/06/18}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
@@ -136,6 +136,7 @@
           \file{hyphen.cfg}{\from{babel.dtx}{patterns}}
           \file{nil.ldf}{\from{babel.dtx}{nil}}
           \file{babel-ca-buddhist.tex}{\from{babel.dtx}{ca-buddhist}}
+          \file{babel-ca-coptic.tex}{\from{babel.dtx}{ca-coptic}}
           \file{babel-ca-hebrew.tex}{\from{babel.dtx}{ca-hebrew}}
           \file{babel-ca-islamic.tex}{\from{babel.dtx}{ca-islamic}}
           \file{babel-ca-persian.tex}{\from{babel.dtx}{ca-persian}}
diff --git a/babel.pdf b/babel.pdf
index 8f10dc8..0b879e0 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index ac487c8..a39ee5a 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2022/06/12 v3.76.2766]
+\ProvidesFile{bbcompat.dtx}[2022/06/18 v3.76.2772]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
diff --git a/locale/ar/babel-ar-EG.ini b/locale/ar/babel-ar-EG.ini
index 9be40ee..ec3f4b6 100644
--- a/locale/ar/babel-ar-EG.ini
+++ b/locale/ar/babel-ar-EG.ini
@@ -11,8 +11,8 @@
 
 [identification]
 charset = utf8
-version = 1.0
-date = 2022-06-02
+version = 1.1
+date = 2022-06-14
 name.local = العربية
 name.english = Arabic
 name.babel = arabic-egypt arabic-eg
@@ -52,6 +52,9 @@ also = راجع أيضًا
 proof = برهان
 glossary = قاموس
 
+[date]
+calendar.preferred = gregorian coptic islamic islamic-civil islamic-tbla
+
 [date.gregorian]
 date.long = [d] [MMMM] [y]
 date.short = [d]‏/[M]‏/[y]
@@ -134,6 +137,22 @@ months.narrow.10 = ١٠
 months.narrow.11 = ١١
 months.narrow.12 = ١٢
 
+[date.coptic]
+date.long = [d] [MMMM]، [y]
+months.wide.1    = توت
+months.wide.2    = بابه
+months.wide.3    = هاتور
+months.wide.4    = كيهك
+months.wide.5    = طوبة
+months.wide.6    = أمشير
+months.wide.7    = برمهات
+months.wide.8    = برمودة
+months.wide.9    = بشنس
+months.wide.10   = بؤونة
+months.wide.11   = أبيب
+months.wide.12   = مسرى
+months.wide.13   = نسيئ
+
 [time.gregorian]
 time.medium = [h]:[mm]:[ss] [a]
 time.short = [h]:[mm] [a]
diff --git a/locale/cop/babel-cop.ini b/locale/cop/babel-cop.ini
index b5ab675..91f3805 100644
--- a/locale/cop/babel-cop.ini
+++ b/locale/cop/babel-cop.ini
@@ -3,10 +3,10 @@
 
 [identification]
 charset = utf8
-version = 0.7
-date = 2020-06-30
-; Sahidic name (Bohairic is ϯⲙⲉⲧⲣⲉⲙⲛ̀ⲭⲏⲙⲓ)
-name.local = ⲧⲙⲛ̄ⲧⲣⲙ̄ⲛ̄ⲕⲏⲙⲉ
+version = 0.8
+date = 2022-06-14
+; Use Bohairic name (Sahidic is ⲧⲙⲛ̄ⲧⲣⲙ̄ⲛ̄ⲕⲏⲙⲉ)
+name.local = ϯⲙⲉⲧⲣⲉⲙⲛ̀ⲭⲏⲙⲓ
 name.english = Coptic
 name.babel = coptic
 name.polyglossia = coptic
@@ -43,6 +43,9 @@ also       =
 proof      = 
 glossary   = 
 
+[date]
+calendar.preferred = gregorian coptic islamic islamic-civil islamic-tbla
+
 [date.gregorian]
 date.long      = 
 date.short     = 
@@ -59,6 +62,23 @@ months.wide.10 =
 months.wide.11 = 
 months.wide.12 = 
 
+[date.coptic]
+date.long      = [d] [MMMM] [y]
+date.short     = 
+months.wide.1  = Ⲑⲱⲟⲩⲧ	
+months.wide.2  = Ⲡⲁⲟⲡⲓ	
+months.wide.3  = Ⲁⲑⲱⲣ	
+months.wide.4  = Ⲭⲟⲓⲁⲕ	
+months.wide.5  = Ⲧⲱⲃⲓ	
+months.wide.6  = Ⲙⲉϣⲓⲣ	
+months.wide.7  = Ⲡⲁⲣⲉⲙϩⲁⲧ	
+months.wide.8  = Ⲫⲁⲣⲙⲟⲩⲑⲓ	
+months.wide.9  = Ⲡⲁϣⲟⲛⲥ	
+months.wide.10 = Ⲡⲁⲱⲛⲓ	
+months.wide.11 = Ⲉⲡⲓⲡ	
+months.wide.12 = Ⲙⲉⲥⲱⲣⲓ	
+months.wide.13 = Ⲡⲓⲕⲟⲩϫⲓ ⲛ̀ⲁ̀ⲃⲟⲧ	
+
 [time.gregorian]
 time.medium = 
 time.short = 





More information about the latex3-commits mailing list.