Debian Codegraph @

texmf-dist/source/latex/datetime2-french/datetime2-french.dtx

raw
1 %\iffalse
2 %<*package>
3 %% \CharacterTable
4 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
5 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
6 %% Digits \0\1\2\3\4\5\6\7\8\9
7 %% Exclamation \! Double quote \" Hash (number) \#
8 %% Dollar \$ Percent \% Ampersand \&
9 %% Acute accent \' Left paren \( Right paren \)
10 %% Asterisk \* Plus \+ Comma \,
11 %% Minus \- Point \. Solidus \/
12 %% Colon \: Semicolon \; Less than \<
13 %% Equals \= Greater than \> Question mark \?
14 %% Commercial at \@ Left bracket \[ Backslash \\
15 %% Right bracket \] Circumflex \^ Underscore \_
16 %% Grave accent \` Left brace \{ Vertical bar \|
17 %% Right brace \} Tilde \~}
18 %</package>
19 %\fi
20 % \iffalse
21 % Doc-Source file to use with LaTeX2e
22 % Copyright (C) 2015-2020 Nicola Talbot, all rights reserved.
23 % Copyright (C) 2017-2020 Paul A. Patience <[email protected]>, all rights reserved.
24 % \fi
25 % \iffalse
26 %<*driver>
27 \documentclass{ltxdoc}
28
29 \usepackage{alltt}
30 \usepackage{graphicx}
31 \usepackage[utf8]{inputenc}
32 \usepackage[T1]{fontenc}
33 \usepackage[colorlinks,
34 bookmarks,
35 hyperindex=false,
36 pdfauthor={Nicola L.C. Talbot and Paul A. Patience},
37 pdftitle={datetime2.sty French Module}]{hyperref}
38
39
40 \CheckSum{580}
41
42 \renewcommand*{\usage}[1]{\hyperpage{#1}}
43 \renewcommand*{\main}[1]{\hyperpage{#1}}
44 \IndexPrologue{\section*{\indexname}\markboth{\indexname}{\indexname}}
45 \setcounter{IndexColumns}{2}
46
47 \newcommand*{\sty}[1]{\textsf{#1}}
48 \newcommand*{\opt}[1]{\texttt{#1}\index{#1=\texttt{#1}|main}}
49
50 \RecordChanges
51 \PageIndex
52 \CodelineNumbered
53
54 \begin{document}
55 \DocInput{datetime2-french.dtx}
56 \end{document}
57 %</driver>
58 %\fi
59 %
60 %\MakeShortVerb{"}
61 %
62 %\title{French Module for datetime2 Package}
63 %\author{Nicola L. C. Talbot (inactive) \\
64 % Paul A. Patience\thanks{E-mail: [email protected]}}
65 %\date{2020-09-21 (v1.03)}
66 %\maketitle
67 %
68 %\begin{abstract}
69 %This is the French language module for the \sty{datetime2}
70 %package. If you want to use the settings in this module you must
71 %install it in addition to installing \sty{datetime2}. If you use
72 %\sty{babel} or \sty{polyglossia}, you will need this module to
73 %prevent them from redefining \cs{today}. The \sty{datetime2}
74 % \opt{useregional} setting must be set to "text" or "numeric"
75 % for the language styles to be set.
76 % Alternatively, you can set the style in the document using
77 % \cs{DTMsetstyle}, but this may be changed by \cs{date}\meta{language}
78 % depending on the value of the \opt{useregional} setting.
79 %\end{abstract}
80 %
81 %\StopEventually{%
82 %\clearpage
83 %\phantomsection
84 %\addcontentsline{toc}{section}{Change History}%
85 %\PrintChanges
86 %\addcontentsline{toc}{section}{\indexname}%
87 %\PrintIndex}
88 %\section{The Code}
89 %\iffalse
90 % \begin{macrocode}
91 %<*datetime2-french-utf8.ldf>
92 % \end{macrocode}
93 %\fi
94 %\subsection{UTF-8}
95 %This file contains the settings that use UTF-8 characters. This
96 %file is loaded if XeLaTeX or LuaLaTeX are used. Please make sure
97 %your text editor is set to UTF-8 if you want to view this code.
98 %\changes{1.0}{2015-03-27}{Initial release}
99 % Identify module
100 % \begin{macrocode}
101 \ProvidesDateTimeModule{french-utf8}[2020/09/21 v1.03]
102 % \end{macrocode}
103 %\begin{macro}{\DTMfrenchordinal}
104 % \begin{macrocode}
105 \ifdef\ier
106 {%
107 \newcommand*{\DTMfrenchordinal}[1]{%
108 \number#1
109 \ifnum#1=1\DTMtexorpdfstring{\protect\ier}{er}\fi
110 }
111 }%
112 {%
113 \newcommand*{\DTMfrenchordinal}[1]{%
114 \number#1
115 \ifnum#1=1\DTMtexorpdfstring{\protect\textsuperscript{er}}{er}\fi
116 }
117 }%
118 % \end{macrocode}
119 %\end{macro}
120 %
121 %\begin{macro}{\DTMfrenchmonthname}
122 % French month names.
123 % \begin{macrocode}
124 \newcommand*{\DTMfrenchmonthname}[1]{%
125 \ifcase#1
126 \or
127 janvier%
128 \or
129 février%
130 \or
131 mars%
132 \or
133 avril%
134 \or
135 mai%
136 \or
137 juin%
138 \or
139 juillet%
140 \or
141 août%
142 \or
143 septembre%
144 \or
145 octobre%
146 \or
147 novembre%
148 \or
149 décembre%
150 \fi
151 }
152 % \end{macrocode}
153 %\end{macro}
154 %
155 %\begin{macro}{\DTMfrenchMonthname}
156 % As above but start with a capital.
157 % \begin{macrocode}
158 \newcommand*{\DTMfrenchMonthname}[1]{%
159 \ifcase#1
160 \or
161 Janvier%
162 \or
163 Février%
164 \or
165 Mars%
166 \or
167 Avril%
168 \or
169 Mai%
170 \or
171 Juin%
172 \or
173 Juillet%
174 \or
175 Août%
176 \or
177 Septembre%
178 \or
179 Octobre%
180 \or
181 Novembre%
182 \or
183 Décembre%
184 \fi
185 }
186 % \end{macrocode}
187 %\end{macro}
188 %
189 %\begin{macro}{\DTMfrenchshortmonthname}
190 % Abbreviated French month names.
191 %\changes{1.01}{2017-04-08}{Add abbreviated month names}
192 % \begin{macrocode}
193 \newcommand*{\DTMfrenchshortmonthname}[1]{%
194 \ifcase#1
195 \or
196 janv.%
197 \or
198 févr.%
199 \or
200 mars%
201 \or
202 avr.%
203 \or
204 mai%
205 \or
206 juin%
207 \or
208 juill.%
209 \or
210 août%
211 \or
212 sept.%
213 \or
214 oct.%
215 \or
216 nov.%
217 \or
218 déc.%
219 \fi
220 }
221 % \end{macrocode}
222 %\end{macro}
223 %
224 %\begin{macro}{\DTMfrenchshortMonthname}
225 % As above but start with a capital.
226 % \begin{macrocode}
227 \newcommand*{\DTMfrenchshortMonthname}[1]{%
228 \ifcase#1
229 \or
230 Janv.%
231 \or
232 Févr.%
233 \or
234 Mars%
235 \or
236 Avr.%
237 \or
238 Mai%
239 \or
240 Juin%
241 \or
242 Juill.%
243 \or
244 Août%
245 \or
246 Sept.%
247 \or
248 Oct.%
249 \or
250 Nov.%
251 \or
252 Déc.%
253 \fi
254 }
255 % \end{macrocode}
256 %\end{macro}
257 %
258 %\begin{macro}{\DTMfrenchweekdayname}
259 % French day of week names.
260 % \begin{macrocode}
261 \newcommand*{\DTMfrenchweekdayname}[1]{%
262 \ifcase#1
263 lundi%
264 \or
265 mardi%
266 \or
267 mercredi%
268 \or
269 jeudi%
270 \or
271 vendredi%
272 \or
273 samedi%
274 \or
275 dimanche%
276 \fi
277 }
278 % \end{macrocode}
279 %\end{macro}
280 %
281 %\begin{macro}{\DTMfrenchWeekdayname}
282 % As above but start with a capital.
283 % \begin{macrocode}
284 \newcommand*{\DTMfrenchWeekdayname}[1]{%
285 \ifcase#1
286 Lundi%
287 \or
288 Mardi%
289 \or
290 Mercredi%
291 \or
292 Jeudi%
293 \or
294 Vendredi%
295 \or
296 Samedi%
297 \or
298 Dimanche%
299 \fi
300 }
301 % \end{macrocode}
302 %\end{macro}
303 %
304 %\begin{macro}{\DTMfrenchshortweekdayname}
305 % French abbreviated day of week names.
306 %\changes{1.01}{2017-04-08}{Add abbreviated day of week names}
307 % \begin{macrocode}
308 \newcommand*{\DTMfrenchshortweekdayname}[1]{%
309 \ifcase#1
310 lun.%
311 \or
312 mar.%
313 \or
314 mer.%
315 \or
316 jeu.%
317 \or
318 ven.%
319 \or
320 sam.%
321 \or
322 dim.%
323 \fi
324 }
325 % \end{macrocode}
326 %\end{macro}
327 %
328 %\begin{macro}{\DTMfrenchshortWeekdayname}
329 % As above but start with a capital.
330 % \begin{macrocode}
331 \newcommand*{\DTMfrenchshortWeekdayname}[1]{%
332 \ifcase#1
333 Lun.%
334 \or
335 Mar.%
336 \or
337 Mer.%
338 \or
339 Jeu.%
340 \or
341 Ven.%
342 \or
343 Sam.%
344 \or
345 Dim.%
346 \fi
347 }
348 % \end{macrocode}
349 %\end{macro}
350 %
351 %\begin{macro}{\DTMfrenchmidnight}
352 % \begin{macrocode}
353 \newcommand*\DTMfrenchmidnight{minuit}%
354 % \end{macrocode}
355 %\end{macro}
356 %
357 %\begin{macro}{\DTMfrenchnoon}
358 % \begin{macrocode}
359 \newcommand*\DTMfrenchnoon{midi}%
360 % \end{macrocode}
361 %\end{macro}
362 %
363 %\begin{macro}{\DTMfrenchtimesymsep}
364 % \begin{macrocode}
365 \newcommand*\DTMfrenchtimesymsep{\,}%
366 % \end{macrocode}
367 %\end{macro}
368 %
369 %\begin{macro}{\DTMfrenchhoursym}
370 % \begin{macrocode}
371 \newcommand*\DTMfrenchhoursym{h}%
372 % \end{macrocode}
373 %\end{macro}
374 %
375 % This style ignores seconds.
376 %\changes{1.01}{2017-04-08}{Add frenchalpha time style}
377 % \begin{macrocode}
378 \DTMnewtimestyle
379 {frenchalpha}% label
380 {%
381 \renewcommand*\DTMdisplaytime[3]{%
382 \ifnum##2=0
383 \ifnum##1=12
384 \DTMfrenchnoon
385 \else
386 \ifnum##1=0
387 \DTMfrenchmidnight
388 \else
389 \ifnum##1=24
390 \DTMfrenchmidnight
391 \else
392 \number##1
393 \DTMfrenchtimesymsep\DTMfrenchhoursym
394 \fi
395 \fi
396 \fi
397 \else
398 \ifnum##1=24
399 0%
400 \else
401 \number##1
402 \fi
403 \DTMfrenchtimesymsep\DTMfrenchhoursym
404 \DTMfrenchtimesymsep\DTMtwodigits{##2}%
405 \fi
406 }%
407 }%
408 % \end{macrocode}
409 %
410 %\iffalse
411 % \begin{macrocode}
412 %</datetime2-french-utf8.ldf>
413 % \end{macrocode}
414 %\fi
415 %\iffalse
416 % \begin{macrocode}
417 %<*datetime2-french-ascii.ldf>
418 % \end{macrocode}
419 %\fi
420 %\subsection{ASCII}
421 %This file contains the settings that use \LaTeX\ commands for
422 %non-ASCII characters. This should be input if neither XeLaTeX nor
423 %LuaLaTeX are used. Even if the user has loaded \sty{inputenc} with
424 %"utf8", this file should still be used not the
425 %\texttt{datetime2-french-utf8.ldf} file as the non-ASCII
426 %characters are made active in that situation and would need
427 %protecting against expansion.
428 %\changes{1.0}{2015-03-27}{Initial release}
429 % Identify module
430 % \begin{macrocode}
431 \ProvidesDateTimeModule{french-ascii}[2020/09/21 v1.03]
432 % \end{macrocode}
433 %
434 %\begin{macro}{\DTMfrenchordinal}
435 % \begin{macrocode}
436 \ifdef\ier
437 {%
438 \newcommand*{\DTMfrenchordinal}[1]{%
439 \number#1
440 \ifnum#1=1\DTMtexorpdfstring{\protect\ier}{er}\fi
441 }
442 }%
443 {%
444 \newcommand*{\DTMfrenchordinal}[1]{%
445 \number#1
446 \ifnum#1=1\DTMtexorpdfstring{\protect\textsuperscript{er}}{er}\fi
447 }
448 }%
449 % \end{macrocode}
450 %\end{macro}
451 %
452 %\begin{macro}{\DTMfrenchmonthname}
453 % French month names.
454 % \begin{macrocode}
455 \newcommand*{\DTMfrenchmonthname}[1]{%
456 \ifcase#1
457 \or
458 janvier%
459 \or
460 f\protect\'evrier%
461 \or
462 mars%
463 \or
464 avril%
465 \or
466 mai%
467 \or
468 juin%
469 \or
470 juillet%
471 \or
472 ao\protect\^ut%
473 \or
474 septembre%
475 \or
476 octobre%
477 \or
478 novembre%
479 \or
480 d\protect\'ecembre%
481 \fi
482 }
483 % \end{macrocode}
484 %\end{macro}
485 %
486 %\begin{macro}{\DTMfrenchMonthname}
487 % As above but start with a capital.
488 % \begin{macrocode}
489 \newcommand*{\DTMfrenchMonthname}[1]{%
490 \ifcase#1
491 \or
492 Janvier%
493 \or
494 F\protect\'evrier%
495 \or
496 Mars%
497 \or
498 Avril%
499 \or
500 Mai%
501 \or
502 Juin%
503 \or
504 Juillet%
505 \or
506 Ao\protect\^ut%
507 \or
508 Septembre%
509 \or
510 Octobre%
511 \or
512 Novembre%
513 \or
514 D\protect\'ecembre%
515 \fi
516 }
517 % \end{macrocode}
518 %\end{macro}
519 %
520 %\begin{macro}{\DTMfrenchshortmonthname}
521 % Abbreviated French month names.
522 %\changes{1.01}{2017-04-08}{Add abbreviated month names}
523 % \begin{macrocode}
524 \newcommand*{\DTMfrenchshortmonthname}[1]{%
525 \ifcase#1
526 \or
527 janv.%
528 \or
529 f\protect\'evr.%
530 \or
531 mars%
532 \or
533 avr.%
534 \or
535 mai%
536 \or
537 juin%
538 \or
539 juill.%
540 \or
541 ao\protect\^ut%
542 \or
543 sept.%
544 \or
545 oct.%
546 \or
547 nov.%
548 \or
549 d\protect\'ec.%
550 \fi
551 }
552 % \end{macrocode}
553 %\end{macro}
554 %
555 %\begin{macro}{\DTMfrenchshortMonthname}
556 % As above but start with a capital.
557 % \begin{macrocode}
558 \newcommand*{\DTMfrenchshortMonthname}[1]{%
559 \ifcase#1
560 \or
561 Janv.%
562 \or
563 F\protect\'evr.%
564 \or
565 Mars%
566 \or
567 Avr.%
568 \or
569 Mai%
570 \or
571 Juin%
572 \or
573 Juill.%
574 \or
575 Ao\protect\^ut%
576 \or
577 Sept.%
578 \or
579 Oct.%
580 \or
581 Nov.%
582 \or
583 D\protect\'ec.%
584 \fi
585 }
586 % \end{macrocode}
587 %\end{macro}
588 %
589 %\begin{macro}{\DTMfrenchweekdayname}
590 % French day of week names.
591 % \begin{macrocode}
592 \newcommand*{\DTMfrenchweekdayname}[1]{%
593 \ifcase#1
594 lundi%
595 \or
596 mardi%
597 \or
598 mercredi%
599 \or
600 jeudi%
601 \or
602 vendredi%
603 \or
604 samedi%
605 \or
606 dimanche%
607 \fi
608 }
609 % \end{macrocode}
610 %\end{macro}
611 %
612 %\begin{macro}{\DTMfrenchWeekdayname}
613 % As above but start with a capital.
614 % \begin{macrocode}
615 \newcommand*{\DTMfrenchWeekdayname}[1]{%
616 \ifcase#1
617 Lundi%
618 \or
619 Mardi%
620 \or
621 Mercredi%
622 \or
623 Jeudi%
624 \or
625 Vendredi%
626 \or
627 Samedi%
628 \or
629 Dimanche%
630 \fi
631 }
632 % \end{macrocode}
633 %\end{macro}
634 %
635 %\begin{macro}{\DTMfrenchshortweekdayname}
636 % French abbreviated day of week names.
637 %\changes{1.01}{2017-04-08}{Add abbreviated day of week names}
638 % \begin{macrocode}
639 \newcommand*{\DTMfrenchshortweekdayname}[1]{%
640 \ifcase#1
641 lun.%
642 \or
643 mar.%
644 \or
645 mer.%
646 \or
647 jeu.%
648 \or
649 ven.%
650 \or
651 sam.%
652 \or
653 dim.%
654 \fi
655 }
656 % \end{macrocode}
657 %\end{macro}
658 %
659 %\begin{macro}{\DTMfrenchshortWeekdayname}
660 % As above but start with a capital.
661 % \begin{macrocode}
662 \newcommand*{\DTMfrenchshortWeekdayname}[1]{%
663 \ifcase#1
664 Lun.%
665 \or
666 Mar.%
667 \or
668 Mer.%
669 \or
670 Jeu.%
671 \or
672 Ven.%
673 \or
674 Sam.%
675 \or
676 Dim.%
677 \fi
678 }
679 % \end{macrocode}
680 %\end{macro}
681 %
682 %\begin{macro}{\DTMfrenchmidnight}
683 % \begin{macrocode}
684 \newcommand*\DTMfrenchmidnight{minuit}%
685 % \end{macrocode}
686 %\end{macro}
687 %
688 %\begin{macro}{\DTMfrenchnoon}
689 % \begin{macrocode}
690 \newcommand*\DTMfrenchnoon{midi}%
691 % \end{macrocode}
692 %\end{macro}
693 %
694 %\begin{macro}{\DTMfrenchtimesymsep}
695 % \begin{macrocode}
696 \newcommand*\DTMfrenchtimesymsep{\,}%
697 % \end{macrocode}
698 %\end{macro}
699 %
700 %\begin{macro}{\DTMfrenchhoursym}
701 % \begin{macrocode}
702 \newcommand*\DTMfrenchhoursym{h}%
703 % \end{macrocode}
704 %\end{macro}
705 %
706 % This style ignores seconds.
707 %\changes{1.01}{2017-04-08}{Add frenchalpha time style}
708 % \begin{macrocode}
709 \DTMnewtimestyle
710 {frenchalpha}% label
711 {%
712 \renewcommand*\DTMdisplaytime[3]{%
713 \ifnum##2=0
714 \ifnum##1=12
715 \DTMfrenchnoon
716 \else
717 \ifnum##1=0
718 \DTMfrenchmidnight
719 \else
720 \ifnum##1=24
721 \DTMfrenchmidnight
722 \else
723 \number##1
724 \DTMfrenchtimesymsep\DTMfrenchhoursym
725 \fi
726 \fi
727 \fi
728 \else
729 \ifnum##1=24
730 0%
731 \else
732 \number##1
733 \fi
734 \DTMfrenchtimesymsep\DTMfrenchhoursym
735 \DTMfrenchtimesymsep\DTMtwodigits{##2}%
736 \fi
737 }%
738 }%
739 % \end{macrocode}
740 %
741 %\iffalse
742 % \begin{macrocode}
743 %</datetime2-french-ascii.ldf>
744 % \end{macrocode}
745 %\fi
746 %
747 %\subsection{Main French Module (\texttt{datetime2-french.ldf})}
748 %\changes{1.0}{2015-03-27}{Initial release}
749 %
750 %\iffalse
751 % \begin{macrocode}
752 %<*datetime2-french.ldf>
753 % \end{macrocode}
754 %\fi
755 %
756 % Identify Module
757 % \begin{macrocode}
758 \ProvidesDateTimeModule{french}[2020/09/21 v1.03]
759 % \end{macrocode}
760 % Need to find out if XeTeX or LuaTeX are being used.
761 % \begin{macrocode}
762 \RequirePackage{ifxetex,ifluatex}
763 % \end{macrocode}
764 % XeTeX and LuaTeX natively support UTF-8, so load
765 % \texttt{french-utf8} if either of those engines are used
766 % otherwise load \texttt{french-ascii}.
767 % \begin{macrocode}
768 \ifxetex
769 \RequireDateTimeModule{french-utf8}
770 \else
771 \ifluatex
772 \RequireDateTimeModule{french-utf8}
773 \else
774 \RequireDateTimeModule{french-ascii}
775 \fi
776 \fi
777 % \end{macrocode}
778 %
779 % Define the \texttt{french} style.
780 % The time style is the same as the "default" style
781 % provided by \sty{datetime2}. This may need correcting.
782 %
783 % Allow the user a way of configuring the "french" and
784 % "french-numeric" styles. This doesn't use the package wide
785 % separators such as
786 % \cs{dtm@datetimesep} in case other date formats are also required.
787 %
788 %\begin{macro}{\DTMfrenchdowdaysep}
789 % The separator between the day of week name and the day of month
790 % number for the text format.
791 %\changes{1.01}{2017-04-08}{Add support for showdow}
792 % \begin{macrocode}
793 \newcommand*{\DTMfrenchdowdaysep}{\space}
794 % \end{macrocode}
795 %\end{macro}
796 %
797 %\begin{macro}{\DTMfrenchdaymonthsep}
798 % The separator between the day and month for the text format.
799 %\changes{1.02}{2017-04-08}{Use non-breaking space}
800 % \begin{macrocode}
801 \newcommand*{\DTMfrenchdaymonthsep}{%
802 \DTMtexorpdfstring{\protect~}{\space}%
803 }
804 % \end{macrocode}
805 %\end{macro}
806 %
807 %\begin{macro}{\DTMfrenchmonthyearsep}
808 % The separator between the month and year for the text format.
809 % \begin{macrocode}
810 \newcommand*{\DTMfrenchmonthyearsep}{\space}
811 % \end{macrocode}
812 %\end{macro}
813 %
814 %\begin{macro}{\DTMfrenchdatetimesep}
815 % The separator between the date and time blocks in the full format
816 % (either text or numeric).
817 % \begin{macrocode}
818 \newcommand*{\DTMfrenchdatetimesep}{,\space}
819 % \end{macrocode}
820 %\end{macro}
821 %
822 %\begin{macro}{\DTMfrenchtimezonesep}
823 % The separator between the time and zone blocks in the full format
824 % (either text or numeric).
825 % \begin{macrocode}
826 \newcommand*{\DTMfrenchtimezonesep}{\space}
827 % \end{macrocode}
828 %\end{macro}
829 %
830 %\begin{macro}{\DTMfrenchdatesep}
831 % The separator for the numeric date format.
832 % \begin{macrocode}
833 \newcommand*{\DTMfrenchdatesep}{/}
834 % \end{macrocode}
835 %\end{macro}
836 %
837 %\begin{macro}{\DTMfrenchtimesep}
838 % The separator for the numeric time format.
839 % \begin{macrocode}
840 \newcommand*{\DTMfrenchtimesep}{:}
841 % \end{macrocode}
842 %\end{macro}
843 %
844 %Provide keys that can be used in \cs{DTMlangsetup} to set these
845 %separators.
846 % \begin{macrocode}
847 \DTMdefkey{french}{dowdaysep}{\renewcommand*{\DTMfrenchdowdaysep}{#1}}
848 \DTMdefkey{french}{daymonthsep}{\renewcommand*{\DTMfrenchdaymonthsep}{#1}}
849 \DTMdefkey{french}{monthyearsep}{\renewcommand*{\DTMfrenchmonthyearsep}{#1}}
850 \DTMdefkey{french}{datetimesep}{\renewcommand*{\DTMfrenchdatetimesep}{#1}}
851 \DTMdefkey{french}{timezonesep}{\renewcommand*{\DTMfrenchtimezonesep}{#1}}
852 \DTMdefkey{french}{datesep}{\renewcommand*{\DTMfrenchdatesep}{#1}}
853 \DTMdefkey{french}{timesep}{\renewcommand*{\DTMfrenchtimesep}{#1}}
854 % \end{macrocode}
855 %
856 % Define a boolean key that can switch between full and abbreviated
857 % formats for the month and day of week names in the text format.
858 %\changes{1.01}{2017-04-08}{Add support for abbr}
859 % \begin{macrocode}
860 \DTMdefboolkey{french}{abbr}[true]{}
861 % \end{macrocode}
862 % The default is the full name.
863 % \begin{macrocode}
864 \DTMsetbool{french}{abbr}{false}
865 % \end{macrocode}
866 %
867 % Define a boolean key that determines if the time zone mappings
868 % should be used.
869 % \begin{macrocode}
870 \DTMdefboolkey{french}{mapzone}[true]{}
871 % \end{macrocode}
872 % The default is to use mappings.
873 % \begin{macrocode}
874 \DTMsetbool{french}{mapzone}{true}
875 % \end{macrocode}
876 %
877 % Define a boolean key that determines if the day of month should be
878 % displayed.
879 % \begin{macrocode}
880 \DTMdefboolkey{french}{showdayofmonth}[true]{}
881 % \end{macrocode}
882 % The default is to show the day of month.
883 % \begin{macrocode}
884 \DTMsetbool{french}{showdayofmonth}{true}
885 % \end{macrocode}
886 %
887 % Define a boolean key that determines if the year should be
888 % displayed.
889 % \begin{macrocode}
890 \DTMdefboolkey{french}{showyear}[true]{}
891 % \end{macrocode}
892 % The default is to show the year.
893 % \begin{macrocode}
894 \DTMsetbool{french}{showyear}{true}
895 % \end{macrocode}
896 %
897 % Define the "french" style.
898 %\changes{1.01}{2017-04-08}{Add support for abbr and showdow}
899 % \begin{macrocode}
900 \DTMnewstyle
901 {french}% label
902 {% date style
903 \renewcommand*\DTMdisplaydate[4]{%
904 \ifDTMshowdow
905 \ifnum##4>-1
906 \DTMifbool{french}{abbr}%
907 {\DTMfrenchshortweekdayname{##4}}%
908 {\DTMfrenchweekdayname{##4}}%
909 \DTMfrenchdowdaysep
910 \fi
911 \fi
912 \DTMifbool{french}{showdayofmonth}%
913 {%
914 \DTMfrenchordinal{##3}%
915 \DTMfrenchdaymonthsep
916 }%
917 {}%
918 \DTMifbool{french}{abbr}%
919 {\DTMfrenchshortmonthname{##2}}%
920 {\DTMfrenchmonthname{##2}}%
921 \DTMifbool{french}{showyear}%
922 {%
923 \DTMfrenchmonthyearsep
924 \number##1 % space intended
925 }%
926 {}%
927 }%
928 \renewcommand*\DTMDisplaydate[4]{%
929 \ifDTMshowdow
930 \ifnum##4>-1
931 \DTMifbool{french}{abbr}%
932 {\DTMfrenchshortWeekdayname{##4}}%
933 {\DTMfrenchWeekdayname{##4}}%
934 \DTMfrenchdowdaysep
935 \DTMifbool{french}{showdayofmonth}%
936 {%
937 \DTMfrenchordinal{##3}%
938 \DTMfrenchdaymonthsep
939 }%
940 {}%
941 \DTMifbool{french}{abbr}%
942 {\DTMfrenchshortmonthname{##2}}%
943 {\DTMfrenchmonthname{##2}}%
944 \DTMifbool{french}{showyear}%
945 {%
946 \DTMfrenchmonthyearsep
947 \number##1 % space intended
948 }%
949 {}%
950 \else
951 \DTMifbool{french}{showdayofmonth}
952 {%
953 \DTMfrenchordinal{##3}%
954 \DTMfrenchdaymonthsep
955 \DTMifbool{french}{abbr}%
956 {\DTMfrenchshortmonthname{##2}}%
957 {\DTMfrenchmonthname{##2}}%
958 }%
959 {%
960 \DTMifbool{french}{abbr}%
961 {\DTMfrenchshortMonthname{##2}}%
962 {\DTMfrenchMonthname{##2}}%
963 }%
964 \DTMifbool{french}{showyear}%
965 {%
966 \DTMfrenchmonthyearsep
967 \number##1 % space intended
968 }%
969 {}%
970 \fi
971 \else
972 \DTMifbool{french}{showdayofmonth}
973 {%
974 \DTMfrenchordinal{##3}%
975 \DTMfrenchdaymonthsep
976 \DTMifbool{french}{abbr}%
977 {\DTMfrenchshortmonthname{##2}}%
978 {\DTMfrenchmonthname{##2}}%
979 }%
980 {%
981 \DTMifbool{french}{abbr}%
982 {\DTMfrenchshortMonthname{##2}}%
983 {\DTMfrenchMonthname{##2}}%
984 }%
985 \DTMifbool{french}{showyear}%
986 {%
987 \DTMfrenchmonthyearsep
988 \number##1 % space intended
989 }%
990 {}%
991 \fi
992 }%
993 }%
994 {% time style
995 \DTMsettimestyle{frenchalpha}%
996 }%
997 {% zone style
998 \DTMresetzones
999 \DTMfrenchzonemaps
1000 \renewcommand*{\DTMdisplayzone}[2]{%
1001 \DTMifbool{french}{mapzone}%
1002 {\DTMusezonemapordefault{##1}{##2}}%
1003 {%
1004 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
1005 \ifDTMshowzoneminutes\DTMfrenchtimesep\DTMtwodigits{##2}\fi
1006 }%
1007 }%
1008 }%
1009 {% full style
1010 \renewcommand*{\DTMdisplay}[9]{%
1011 \ifDTMshowdate
1012 \DTMdisplaydate{##1}{##2}{##3}{##4}%
1013 \DTMfrenchdatetimesep
1014 \fi
1015 \DTMdisplaytime{##5}{##6}{##7}%
1016 \ifDTMshowzone
1017 \DTMfrenchtimezonesep
1018 \DTMdisplayzone{##8}{##9}%
1019 \fi
1020 }%
1021 \renewcommand*{\DTMDisplay}[9]{%
1022 \ifDTMshowdate
1023 \DTMDisplaydate{##1}{##2}{##3}{##4}%
1024 \DTMfrenchdatetimesep
1025 \fi
1026 \DTMdisplaytime{##5}{##6}{##7}%
1027 \ifDTMshowzone
1028 \DTMfrenchtimezonesep
1029 \DTMdisplayzone{##8}{##9}%
1030 \fi
1031 }%
1032 }%
1033 % \end{macrocode}
1034 %
1035 % Define numeric style.
1036 % \begin{macrocode}
1037 \DTMnewstyle
1038 {french-numeric}% label
1039 {% date style
1040 \renewcommand*\DTMdisplaydate[4]{%
1041 \DTMifbool{french}{showdayofmonth}%
1042 {%
1043 \number##3 % space intended
1044 \DTMfrenchdatesep
1045 }%
1046 {}%
1047 \number##2 % space intended
1048 \DTMifbool{french}{showyear}%
1049 {%
1050 \DTMfrenchdatesep
1051 \number##1 % space intended
1052 }%
1053 {}%
1054 }%
1055 \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
1056 }%
1057 {% time style
1058 \renewcommand*\DTMdisplaytime[3]{%
1059 \number##1
1060 \DTMfrenchtimesep\DTMtwodigits{##2}%
1061 \ifDTMshowseconds\DTMfrenchtimesep\DTMtwodigits{##3}\fi
1062 }%
1063 }%
1064 {% zone style
1065 \DTMresetzones
1066 \DTMfrenchzonemaps
1067 \renewcommand*{\DTMdisplayzone}[2]{%
1068 \DTMifbool{french}{mapzone}%
1069 {\DTMusezonemapordefault{##1}{##2}}%
1070 {%
1071 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
1072 \ifDTMshowzoneminutes\DTMfrenchtimesep\DTMtwodigits{##2}\fi
1073 }%
1074 }%
1075 }%
1076 {% full style
1077 \renewcommand*{\DTMdisplay}[9]{%
1078 \ifDTMshowdate
1079 \DTMdisplaydate{##1}{##2}{##3}{##4}%
1080 \DTMfrenchdatetimesep
1081 \fi
1082 \DTMdisplaytime{##5}{##6}{##7}%
1083 \ifDTMshowzone
1084 \DTMfrenchtimezonesep
1085 \DTMdisplayzone{##8}{##9}%
1086 \fi
1087 }%
1088 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
1089 }
1090 % \end{macrocode}
1091 %
1092 %\begin{macro}{\DTMfrenchzonemaps}
1093 % The time zone mappings are set through this command, which can be
1094 % redefined if extra mappings are required or mappings need to be
1095 % removed.
1096 % \begin{macrocode}
1097 \newcommand*{\DTMfrenchzonemaps}{%
1098 \DTMdefzonemap{01}{00}{CET}%
1099 \DTMdefzonemap{02}{00}{CEST}%
1100 }
1101 % \end{macrocode}
1102 %\end{macro}
1103
1104 % Switch style according to the \opt{useregional} setting.
1105 % \begin{macrocode}
1106 \DTMifcaseregional
1107 {}% do nothing
1108 {\DTMsetstyle{french}}
1109 {\DTMsetstyle{french-numeric}}
1110 % \end{macrocode}
1111 %
1112 % Redefine \cs{datefrench} (or \cs{date}\meta{dialect}) to prevent
1113 % \sty{babel} from resetting \cs{today}. (For this to work,
1114 % \sty{babel} must already have been loaded if it's required.)
1115 %\changes{1.03}{2020-09-21}{removed spurious space}
1116 % \begin{macrocode}
1117 \ifcsundef{date\CurrentTrackedDialect}
1118 {%
1119 \ifundef\datefrench
1120 {% do nothing
1121 }%
1122 {%
1123 \def\datefrench{%
1124 \DTMifcaseregional
1125 {}% do nothing
1126 {\DTMsetstyle{french}}%
1127 {\DTMsetstyle{french-numeric}}%
1128 }%
1129 }%
1130 }%
1131 {%
1132 \csdef{date\CurrentTrackedDialect}{%
1133 \DTMifcaseregional
1134 {}% do nothing
1135 {\DTMsetstyle{french}}%
1136 {\DTMsetstyle{french-numeric}}%
1137 }%
1138 }%
1139 % \end{macrocode}
1140 %\iffalse
1141 % \begin{macrocode}
1142 %</datetime2-french.ldf>
1143 % \end{macrocode}
1144 %\fi
1145 %\Finale
1146 \endinput