Debian Codegraph @

texmf-dist/source/latex/datatool-regions/datatool-regions.dtx

raw
1 %\iffalse
2 % datatool-regions.dtx generated using makedtx version 1.2 (c) Nicola Talbot
3 % Command line args:
4 % -author "Nicola Talbot"
5 % -src "(datatool-[A-Z]{2}\.ldf)\Z=>\1"
6 % -doc "datatool-regions.tex"
7 % -section "chapter"
8 % datatool-regions
9 % Created on 2025/3/1 23:13
10 %\fi
11 %\iffalse
12 %<*package>
13 %% \CharacterTable
14 %% {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
15 %% 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
16 %% Digits \0\1\2\3\4\5\6\7\8\9
17 %% Exclamation \! Double quote \" Hash (number) \#
18 %% Dollar \$ Percent \% Ampersand \&
19 %% Acute accent \' Left paren \( Right paren \)
20 %% Asterisk \* Plus \+ Comma \,
21 %% Minus \- Point \. Solidus \/
22 %% Colon \: Semicolon \; Less than \<
23 %% Equals \= Greater than \> Question mark \?
24 %% Commercial at \@ Left bracket \[ Backslash \\
25 %% Right bracket \] Circumflex \^ Underscore \_
26 %% Grave accent \` Left brace \{ Vertical bar \|
27 %% Right brace \} Tilde \~}
28 %</package>
29 %\fi
30 % \iffalse
31 % Doc-Source file to use with LaTeX2e
32 % Copyright (C) 2025 Nicola Talbot, all rights reserved.
33 % \fi
34 % \iffalse
35 %<*driver>
36 % arara: lualatex
37 % arara: makeindex
38 % arara: lualatex
39 \listfiles
40 \documentclass[titlepage=false]{scrreport}
41 \usepackage{doc}
42
43 \usepackage{fontspec}
44 \usepackage{tcolorbox}
45 \usepackage{siunitx}
46 \usepackage[left=2.5cm,right=2.5cm]{geometry}
47
48 \usepackage
49 [
50 locales=
51 {
52 en-AU,
53 en-BE,
54 en-CA,
55 en-FK,
56 en-GB,
57 en-GG,
58 en-GI,
59 en-IE,
60 en-IM,
61 en-JE,
62 en-NZ,
63 en-US,
64 en-ZA
65 },
66 verbose
67 ]
68 {datatool-base}
69
70 \setromanfont{Noto Serif}
71 \setsansfont{Noto Sans}
72 \setmonofont{Noto Sans Mono}
73
74 \CheckSum{0}
75
76 \newcommand*{\sty}[1]{\textsf{#1}}
77 \newcommand*{\file}[1]{\texorpdfstring{\nolinkurl{#1}}{#1}}
78 \newcommand*{\ldf}[1]{\file{datatool-#1.ldf}}
79 \newcommand*{\csmeta}[3]{\texttt{\cs{#1}}\meta{#2}\texttt{#3}}
80 \newcommand*{\filemeta}[3]{%
81 \texorpdfstring
82 {\nolinkurl{#1}\meta{#2}\nolinkurl{#3}}%
83 {#1<#2>#3}%
84 }
85 \newcommand*{\filemetameta}[5]{%
86 \texorpdfstring
87 {\nolinkurl{#1}\meta{#2}\nolinkurl{#3}\meta{#4}\nolinkurl{#5}}%
88 {#1<#2>#3<#4>#5}%
89 }
90 \newcommand*{\opt}[1]{\textsf{#1}}
91 \newcommand*{\qt}[1]{“#1”}
92 \newcommand*{\setbaseopt}[1]{%
93 \cs{DTLsetup}\allowbreak
94 \texttt{\brackets{\allowbreak#1}}%
95 }
96 \newcommand*{\setlocaleopts}[1]{%
97 \cs{DTLsetLocaleOptions}\allowbreak
98 \texttt{\brackets{\strong{#1}}}\allowbreak
99 \marg{key=val list}%
100 }
101
102 \newcommand*{\setlocaleopt}[2]{%
103 \cs{DTLsetLocaleOptions}\allowbreak
104 \texttt{\brackets{#1}\allowbreak\brackets{\allowbreak#2}}%
105 }
106
107 \definecolor{defbackground}{rgb}{1,1,0.75}
108 \newtcolorbox{definition}{colback=defbackground}
109 \newtcolorbox{important}{colback=red!5!white,colframe=red}
110
111 \tcbuselibrary{documentation}
112 \tcbset{verbatim ignore percent}
113
114 \RecordChanges
115 \PageIndex
116
117 \appto\MacroFont{\footnotesize}
118
119 \title{Region (Numeric) Support for \sty{datatool} v3.0+ Package}
120 \author{Nicola L. C. Talbot}
121 \date{2025-03-01 version 1.0}
122
123 \begin{document}
124 \DocInput{datatool-regions.dtx}
125 \end{document}
126 %</driver>
127 %\fi
128 %\maketitle
129 %
130 %\begin{abstract}
131 %This is the region (numeric) support for the \sty{datatool} package (version
132 %3.0+). The supplied \file{ldf} files need to be installed in
133 %addition to \sty{datatool}. To ensure language support, you will
134 %also need to install the applicable language module (for example,
135 %\sty{datatool-english}).
136 %\end{abstract}
137 %
138 %\tableofcontents
139 %
140 %\chapter{Introduction}
141 %\label{sec:intro}
142 %
143 %This bundle provides language-independent region support files for
144 %\sty{datatool} v3.0+. The files simply need to be installed on \TeX's path.
145 %(They will be ignored if a pre-3.0 version of \sty{datatool} is installed.)
146 %The \sty{datatool-base} package (which is automatically loaded by
147 %\sty{datatool}) uses \sty{tracklang}'s interface for detecting
148 %localisation settings and finding the appropriate files.
149 %If you use \sty{babel} or \sty{polyglossia}, make sure that you
150 %specify the document dialects before the first package to load
151 %\sty{tracklang}.
152 %
153 %\begin{important}
154 %If the chosen document language does not have an associated region,
155 %no region support will be provided.
156 %\end{important}
157 %
158 %For example:
159 %\begin{dispListing}
160 %\usepackage[british]{babel}
161 %\usepackage{datatool-base}
162 %\end{dispListing}
163 %In this case, \opt{british} is associated with region \qt{GB} so
164 %\sty{datatool-base} will load \file{datatool-GB.ldf} if it's on
165 %\TeX's path.
166 %
167 %Alternatively, if you are not using a language package, simply use
168 %the \opt{locales} option. For example:
169 %\begin{dispListing}
170 %\usepackage[locales={en-GB}]{datatool-base}
171 %\end{dispListing}
172 %
173 %The \sty{tracklang} interface doesn't allow the language to be
174 %omitted, but \sty{datatool-base}'s \opt{locales} option will
175 %check for any item in the list that simply consists of two uppercase
176 %letters. If found, the region will be added to any tracked dialects
177 %that don't have a region set. If no dialects have been tracked,
178 %the region will be tracked with the language set to
179 %\opt{und} (undetermined). For example:
180 %\begin{dispListing}
181 %\documentclass{article}
182 %\usepackage[locales={GB}]{datatool-base}
183 %\end{dispListing}
184 %This is equivalent to:
185 %\begin{dispListing}
186 %\usepackage[locales={und-GB}]{datatool-base}
187 %\end{dispListing}
188 %(since no language has been specified). Whereas
189 %\begin{dispListing}
190 %\usepackage[afrikaans,english]{babel}
191 %\usepackage[locales={ZA}]{datatool-base}
192 %\end{dispListing}
193 %will add the region \opt{ZA} to \opt{afrikaans} and \opt{english}
194 %dialects.
195 %
196 %If the language already has a region, or if there are multiple
197 %regions for a particular language, then you will need to
198 %include the language in the tag. For example:
199 %\begin{dispListing}
200 %\usepackage[locales={en-GB,en-IE}]{datatool-base}
201 %\end{dispListing}
202 %
203 %\begin{important}
204 %Bear in mind that if \sty{tracklang} can't determine the
205 %applicable dialect label for the captions hook, the settings may not
206 %be applied when the language changes in multilingual documents.
207 %In this case, you can either load \sty{tracklang} before
208 %\sty{datatool-base} and set up the appropriate mappings or
209 %just add the applicable \texttt{\cs{DTL}\meta{tag}{LocaleHook}}
210 %command to the relevant captions hook.
211 %\end{important}
212 %
213 %Any option that can be passed to \sty{datatool-base} can also be
214 %passed to \sty{datatool} but if \sty{datatool-base} has already been
215 %loaded, it will be too late to use the \opt{locales} option.
216 %For example:
217 %\begin{dispListing}
218 %\usepackage[locales={en-GB}]{datatool}
219 %\end{dispListing}
220 %But not:
221 %\begin{dispListing*}{title={Incorrect!},colframe=red}
222 %\usepackage{datatool-base}
223 %\usepackage[locales={en-GB}]{datatool}
224 %\end{dispListing*}
225 %
226 %If another package that also loads \sty{tracklang} is loaded first,
227 %then \sty{datatool-base} can pick up the settings from that. For
228 %example:
229 %\begin{dispListing}
230 %\usepackage[en-GB]{datetime2}
231 %\usepackage{datatool}
232 %\end{dispListing}
233 %
234 %Supplementary packages provided with \sty{datatool} can also have
235 %the locales provided. For example:
236 %\begin{dispListing}
237 %\usepackage[locales={en-GB}]{datagidx}
238 %\end{dispListing}
239 %As with \sty{datatool}, these supplementary packages internally load
240 %\sty{datatool-base} so if that has already been loaded, then the
241 %localisation support should already have been set.
242 %
243 %\section{Non-Region Specific Settings}
244 %
245 %Some settings are not specific to regions, such as
246 %\opt{currency-symbol-style}. These should be set in \cs{DTLsetup}.
247 %All settings relating to numbers and currency are set within the
248 %\opt{numeric} option and all settings relating to dates and times
249 %are set within the \opt{datetime} option. These settings are
250 %described in the \sty{datatool} user guide.
251 %
252 %For example:
253 %\begin{dispListing}
254 %\DTLsetup{
255 % numeric = {
256 % region-currency-prefix = smallcaps ,
257 % currency-symbol-style = symbol
258 % },
259 % datetime = {
260 % parse = auto-reformat
261 % }
262 %}
263 %\end{dispListing}
264 %
265 %Note that scientific notation isn't governed by regional styles, but
266 %the value can be encapsulated with \cs{si} (if
267 %\sty{siunitx} has been loaded) with the \opt{auto-reformat} numeric option.
268 %\begin{dispExample}
269 %\DTLsetup{numeric={auto-reformat}}
270 %\DTLparse{\result}{1.5e+3}\result.
271 %(Value: \DTLdatumvalue{\result}.)
272 %\end{dispExample}
273 %
274 %\chapter{Supported Regions}
275 %
276 %Only a limited number of regions are currently supported.
277 %
278 %\section{Region \qt{AU}}
279 %\DTLenLocaleHook
280 %\DTLAULocaleHook
281 %
282 %The \file{datatool-AU.ldf} file provides support for region \qt{AU}
283 %(Australia). This defines the \qt{AUD} currency and sets it as
284 %the default currency. The default number group character is a
285 %comma, and the default decimal character is a dot.
286 %
287 %If there's no caption hook and you have multiple locales, you will
288 %need to set both the language and region hooks. For example, this
289 %document has:
290 %\begin{dispListing}
291 %\DTLenLocaleHook
292 %\DTLAULocaleHook
293 %\end{dispListing}
294 %
295 %\begin{dispExample*}{title={Default Numeric Styles}}
296 %\DTLdecimaltolocale{12345}{\result}\result.
297 %(Value: \DTLdatumvalue{\result}.)
298 %
299 %\DTLdecimaltolocale{12345.678}{\result}\result.
300 %(Value: \DTLdatumvalue{\result}.)
301 %
302 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
303 %(Value: \DTLdatumvalue{\result}.)
304 %
305 %\DTLmul\result{\result}{0.5}\result.
306 %(Value: \DTLdatumvalue{\result}.)
307 %\end{dispExample*}
308 %Remember that date-time parsing needs to be enabled, if required.
309 %\begin{dispExample*}{title={Default Date-Time Styles}}
310 %\DTLsetup{datetime={parse}}
311 %\DTLparse\result{28/2/2025 15:45 AEDT}
312 %String: \result.
313 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
314 %Numeric value: \DTLdatumvalue{\result}.
315 %
316 %\ExplSyntaxOn
317 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
318 %Time-stamp: ~ \l_tmpa_tl
319 %\ExplSyntaxOff
320 %\end{dispExample*}
321 %
322 %
323 %Options may be set with \setlocaleopts{AU}. Available options are
324 %listed below.
325 %
326 %\begin{docKey}[AU]{currency-symbol-prefix}{=\meta{boolean}}{initially \opt{false}}
327 %If true, shows the region prefix before the currency symbol if
328 %the \opt{numeric} setting \opt{currency-symbol-style} is not set to \qt{iso}.
329 %The prefix font may be changed to smallcaps or smaller with
330 %\setbaseopt{ numeric = \brackets{ region-currency-prefix = \meta{value} } }
331 %where \meta{value} is \opt{smallcaps} or \opt{smaller}.
332 %\end{docKey}
333 %
334 %\begin{dispExample}
335 %\DTLsetup{numeric={region-currency-prefix=smallcaps}}
336 %\DTLsetLocaleOptions{AU}{currency-symbol-prefix}
337 %\DTLdecimaltocurrency{12345.678}{\result}\result
338 %\end{dispExample}
339 %
340 %
341 %\begin{docKey}[AU]{currency-symbol-position}{=\meta{value}}{initially \opt{before}}
342 %Adjusts the formatting currency style. If \docValue{before}, the
343 %currency symbol is placed before the value. If \docValue{after}, the
344 %currency symbol is placed after the value.
345 %\end{docKey}
346 %
347 %\begin{dispExample}
348 %\DTLsetup{numeric={currency-symbol-style=iso}}
349 %\DTLsetLocaleOptions{AU}{currency-symbol-position=after}
350 %\DTLdecimaltocurrency{12345.678}{\result}\result
351 %\end{dispExample}
352 %
353 %\begin{docKey}[AU]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
354 %Sets the separator to use between the currency symbol (not code) and the value.
355 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
356 %(a thin space), \docValue{space} (a normal space), or
357 %\docValue{nbsp} (a non-breaking space).
358 %\end{docKey}
359 %
360 %\begin{dispExample}
361 %\DTLsetLocaleOptions{AU}{currency-symbol-sep=thin-space}
362 %\DTLdecimaltocurrency{12345.678}{\result}\result
363 %\end{dispExample}
364 %
365 %\begin{docKey}[AU]{number-style}{=\meta{setting}}{initially \opt{official}}
366 %Sets the number group and decimal characters. The value may be one
367 %of: \docValue{official} (comma number group and decimal point), or
368 %\docValue{unofficial} (thin space number group and decimal point).
369 %In the case of \docValue{unofficial}, a normal space may also be used
370 %when parsing.
371 %\end{docKey}
372 %
373 %\begin{dispExample}
374 %\DTLsetup{numeric={auto-reformat}}
375 %\DTLsetLocaleOptions{AU}{number-style=unofficial}
376 %\DTLdecimaltocurrency{12345.678}{\result}\result.
377 %(Value: \DTLdatumvalue{\result}.)
378 %
379 %\DTLparse{\result}{\$12 345.678}\result.
380 %(Value: \DTLdatumvalue{\result}.)
381 %\end{dispExample}
382 %
383 %The remaining options relate to dates and times, which are still
384 %experimental. You need to enable date and time parsing with
385 %\setbaseopt{ datetime = \brackets{parse} }.
386 %
387 %\begin{docKey}[AU]{date-style}{=\meta{style}}{initially \opt{mdyyyy}}
388 %Sets the current date style. The value may be one of:
389 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
390 %\docValue{yyyymd} (year month day),
391 %\docValue{dmyy} (day month 2-digit year),
392 %\docValue{mdyy} (month day 2-digit year), or
393 %\docValue{yymd} (2-digit year month day).
394 %\end{docKey}
395 %
396 %\begin{docKey}[AU]{date-variant}{=\meta{style}}{initially \opt{slash}}
397 %Sets the current numeric date separator.
398 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
399 %(\code{-}), \docValue{dot} (\code{.}) or
400 %\docValue{dialect} (if the language supports it).
401 %\end{docKey}
402 %
403 %\begin{docKey}[AU]{time-variant}{=\meta{style}}{initially \opt{colon}}
404 %Sets the current numeric time separator.
405 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
406 %\docValue{dialect} (if the language supports it),
407 %\docValue{dialect-colon} (if the language supports it), or
408 %\docValue{dialect-dot} (if the language supports it).
409 %\end{docKey}
410 %
411 %\begin{dispExample}
412 %\DTLsetup{datetime={parse}}
413 %\DTLsetLocaleOptions{AU}{
414 % date-style=mdyyyy,
415 % date-variant = dialect,
416 % time-variant = dot
417 %}
418 %\DTLparse\result{February 28, 2025 3.45pm AEDT}
419 %String: \result.
420 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
421 %Numeric value: \DTLdatumvalue{\result}.
422 %
423 %\ExplSyntaxOn
424 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
425 %Time-stamp: ~ \l_tmpa_tl
426 %\ExplSyntaxOff
427 %\end{dispExample}
428 %
429 %\begin{docCommand}{datatoolAUSetNumberChars}{}
430 %Hook to switch to AU number group and decimal characters.
431 %\end{docCommand}
432 %
433 %\begin{docCommand}{datatoolAUcurrencyfmt}{}
434 %Used to format the AUD currency. This supports the currency symbol
435 %prefix.
436 %\end{docCommand}
437 %
438 %\begin{docCommand}{DTLAULocaleHook}{}
439 %Hook to switch to AU settings. This may be added to the captions
440 %hook by \sty{datatool-base}, depending on the settings. Otherwise
441 %it can be explicitly used to switch to this region.
442 %\end{docCommand}
443 %
444 %\section{Region \qt{BE}}
445 %\DTLenLocaleHook
446 %\DTLBELocaleHook
447 %
448 %The \file{datatool-BE.ldf} file provides support for region \qt{BE}
449 %(Belgium). This sets \qt{EUR} as the default currency, but number
450 %formatting depends on the language. If no command called
451 %\csmeta{datatool}{lang}{BESetNumberChars} is defined (the applicable
452 %language module would need to provide
453 %\filemeta{datatool-}{lang}{-BE.ldf} that defines this), this will default to a dot
454 %number group separator and a decimal comma.
455 %
456 %For example, a French module would need to include the file
457 %\file{datatool-fr-BE.ldf} which defines
458 %\cs{datatoolfrBESetNumberChars}.
459 %(You can use \file{datatool-en-ZA.ldf} provided with
460 %\sty{datatool-english} as an example.)
461 %
462 %If there's no caption hook and you have multiple locales, you will
463 %need to set the region hook. For example, this document has:
464 %\begin{dispListing}
465 %\DTLBELocaleHook
466 %\end{dispListing}
467 %
468 %\begin{dispExample*}{title={Default Styles}}
469 %\DTLdecimaltolocale{12345}{\result}\result.
470 %(Value: \DTLdatumvalue{\result}.)
471 %
472 %\DTLdecimaltolocale{12345.678}{\result}\result.
473 %(Value: \DTLdatumvalue{\result}.)
474 %
475 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
476 %(Value: \DTLdatumvalue{\result}.)
477 %
478 %\DTLmul\result{\result}{0,5}\result.
479 %(Value: \DTLdatumvalue{\result}.)
480 %\end{dispExample*}
481 %Remember that date-time parsing needs to be enabled, if required.
482 %\begin{dispExample*}{title={Default Date-Time Styles}}
483 %\DTLsetup{datetime={parse}}
484 %\DTLparse\result{28.02.2025 15:45 CET}
485 %String: \result.
486 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
487 %Numeric value: \DTLdatumvalue{\result}.
488 %
489 %\ExplSyntaxOn
490 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
491 %Time-stamp: ~ \l_tmpa_tl
492 %\ExplSyntaxOff
493 %\end{dispExample*}
494 %
495 %Options may be set with \setlocaleopts{BE}. Available options are
496 %listed below.
497 %
498 %\begin{docKey}[BE]{currency-symbol-position}{=\meta{value}}{initially \opt{after}}
499 %Adjusts the formatting currency style. If \docValue{before}, the
500 %currency symbol is placed before the value. If \docValue{after}, the
501 %currency symbol is placed after the value.
502 %\end{docKey}
503 %
504 %\begin{dispExample}
505 %\DTLsetup{numeric={currency-symbol-style=iso}}
506 %\DTLsetLocaleOptions{BE}{currency-symbol-position=before}
507 %\DTLdecimaltocurrency{12345.678}{\result}\result
508 %\end{dispExample}
509 %
510 %\begin{docKey}[BE]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
511 %Sets the separator to use between the currency symbol (not code) and the value.
512 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
513 %(a thin space), \docValue{space} (a normal space), or
514 %\docValue{nbsp} (a non-breaking space).
515 %\end{docKey}
516 %
517 %\begin{dispExample}
518 %\DTLsetLocaleOptions{BE}{currency-symbol-sep=thin-space}
519 %\DTLdecimaltocurrency{12345.678}{\result}\result
520 %\end{dispExample}
521 %
522 %\begin{docKey}[BE]{number-style}{=\meta{style}}{initially \opt{dialect}}
523 %Sets the number group and decimal characters. The value may be one
524 %of: \docValue{default} (dot number group and decimal comma),
525 %\docValue{dialect} (attempt to use the number style for
526 %the module \meta{lang}-BE, if it's defined, where \meta{lang} is the
527 %current language tag, or fallback on \docValue{default}), or
528 %\docValue{thinspace} (thin space number group and decimal point).
529 %In the case of \docValue{thinspace}, a normal space may also be used
530 %when parsing.
531 %\end{docKey}
532 %
533 %\begin{dispExample}
534 %\DTLsetLocaleOptions{BE}{number-style=thinspace}
535 %\DTLdecimaltocurrency{12345.678}{\result}\result
536 %\end{dispExample}
537 %
538 %The remaining options relate to dates and times, which are still
539 %experimental. You need to enable date and time parsing with
540 %\setbaseopt{ datetime = \brackets{parse} }.
541 %
542 %\begin{docKey}[BE]{date-style}{=\meta{style}}{initially \opt{dmyyyy}}
543 %Sets the current date style. The value may be one of:
544 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
545 %\docValue{yyyymd} (year month day),
546 %\docValue{dmyy} (day month 2-digit year),
547 %\docValue{mdyy} (month day 2-digit year), or
548 %\docValue{yymd} (2-digit year month day).
549 %\end{docKey}
550 %
551 %\begin{docKey}[BE]{date-variant}{=\meta{style}}{initially \opt{dot}}
552 %Sets the current numeric date separator.
553 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
554 %(\code{-}), \docValue{dot} (\code{.}) or
555 %\docValue{dialect} (if the language supports it).
556 %\end{docKey}
557 %
558 %\begin{docKey}[BE]{time-variant}{=\meta{style}}{initially \opt{colon}}
559 %Sets the current numeric time separator.
560 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
561 %\docValue{dialect} (if the language supports it),
562 %\docValue{dialect-colon} (if the language supports it), or
563 %\docValue{dialect-dot} (if the language supports it).
564 %\end{docKey}
565 %
566 %\begin{dispExample}
567 %\DTLsetup{datetime={parse}}
568 %\DTLsetLocaleOptions{BE}{
569 % date-style=yyyymd,
570 % date-variant = hyphen
571 %}
572 %\DTLparse\result{2025-06-01 15:45 CEST}
573 %String: \result.
574 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
575 %Numeric value: \DTLdatumvalue{\result}.
576 %
577 %\ExplSyntaxOn
578 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
579 %Time-stamp: ~ \l_tmpa_tl
580 %\ExplSyntaxOff
581 %\end{dispExample}
582 %\begin{docCommand}{datatoolBESetNumberChars}{}
583 %Hook to switch to BE number group and decimal characters.
584 %\end{docCommand}
585 %
586 %\begin{docCommand}{datatoolBESetCurrency}{}
587 %Hook to switch to the EUR currency, rounding to 2 decimal places,
588 %and redefines \cs{DTLdefaultEURcurrencyfmt} to reflect the
589 %\opt{currency-symbol-position} setting.
590 %\end{docCommand}
591 %
592 %\begin{docCommand}{DTLBELocaleHook}{}
593 %Hook to switch to BE settings. This may be added to the captions
594 %hook by \sty{datatool-base}, depending on the settings. Otherwise
595 %it can be explicitly used to switch to this region.
596 %\end{docCommand}
597 %
598 %\section{Region \qt{CA}}
599 %\DTLenLocaleHook
600 %\DTLenCALocaleHook
601 %\DTLCALocaleHook
602 %
603 %The \file{datatool-CA.ldf} file provides support for region \qt{CA}
604 %(Canada). This supplies the currency (CAD) but number formatting
605 %depends on the language, so this requires specific language \&
606 %region files, which should be provided by the applicable language
607 %module. For example, \sty{datatool-english} provides
608 %\file{datatool-en-CA.ldf}.
609 %
610 %If there's no caption hook and you have multiple locales, you will
611 %need to set both the language and region hooks. For example, this
612 %document has:
613 %\begin{dispListing}
614 %\DTLenLocaleHook
615 %\DTLenCALocaleHook
616 %\DTLCALocaleHook
617 %\end{dispListing}
618 %
619 %\begin{dispExample*}{title={Default Numeric Styles (with English)}}
620 %\DTLdecimaltolocale{12345}{\result}\result.
621 %(Value: \DTLdatumvalue{\result}.)
622 %
623 %\DTLdecimaltolocale{12345.678}{\result}\result.
624 %(Value: \DTLdatumvalue{\result}.)
625 %
626 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
627 %(Value: \DTLdatumvalue{\result}.)
628 %
629 %\DTLmul\result{\result}{0.5}\result.
630 %(Value: \DTLdatumvalue{\result}.)
631 %\end{dispExample*}
632 %Remember that date-time parsing needs to be enabled, if required.
633 %\begin{dispExample*}{title={Default Date-Time Styles}}
634 %\DTLsetup{datetime={parse}}
635 %\DTLparse\result{28/2/2025 15:45 PST}
636 %String: \result.
637 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
638 %Numeric value: \DTLdatumvalue{\result}.
639 %
640 %\ExplSyntaxOn
641 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
642 %Time-stamp: ~ \l_tmpa_tl
643 %\ExplSyntaxOff
644 %\end{dispExample*}
645 %
646 %
647 %Options may be set with \setlocaleopts{CA}. Available options are
648 %listed below.
649 %
650 %\begin{docKey}[CA]{currency-symbol-prefix}{=\meta{boolean}}{initially \opt{false}}
651 %If true, shows the region prefix before the currency symbol if
652 %the \opt{numeric} setting \opt{currency-symbol-style} is not set to \qt{iso}.
653 %The prefix font may be changed to smallcaps or smaller with
654 %the base \opt{numeric} option \opt{region-currency-prefix} setting.
655 %\end{docKey}
656 %
657 %For example:
658 %\begin{dispExample}
659 %\DTLsetup{numeric={region-currency-prefix=smallcaps}}
660 %\DTLsetLocaleOptions{CA}{currency-symbol-prefix}
661 %\DTLdecimaltocurrency{12345.678}{\result}\result
662 %\end{dispExample}
663 %
664 %\begin{docKey}[CA]{currency-symbol-position}{=\meta{value}}{initially \opt{before}}
665 %Adjusts the formatting currency style. If \docValue{before}, the
666 %currency symbol is placed before the value. If \docValue{after}, the
667 %currency symbol is placed after the value.
668 %\end{docKey}
669 %
670 %\begin{dispExample}
671 %\DTLsetup{numeric={currency-symbol-style=iso}}
672 %\DTLsetLocaleOptions{CA}{currency-symbol-position=after}
673 %\DTLdecimaltocurrency{12345.678}{\result}\result
674 %\end{dispExample}
675 %
676 %\begin{docKey}[CA]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
677 %Sets the separator to use between the currency symbol (not code) and the value.
678 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
679 %(a thin space), \docValue{space} (a normal space), or
680 %\docValue{nbsp} (a non-breaking space).
681 %\end{docKey}
682 %
683 %\begin{dispExample}
684 %\DTLsetLocaleOptions{CA}{currency-symbol-sep=thin-space}
685 %\DTLdecimaltocurrency{12345.678}{\result}\result
686 %\end{dispExample}
687 %
688 %\begin{docKey}[CA]{number-style}{=\meta{style}}{}
689 %This option will attempt to set \opt{number-style}=\meta{style} for
690 %the module \meta{lang}-CA, if it's defined. Where \meta{lang} is the
691 %current language tag. For example, if the current language tag is
692 %\qt{en}, then this will be equivalent to
693 %\setlocaleopt{en-CA}{number-style=\meta{style}}.
694 %\end{docKey}
695 %
696 %For example, if \ldf{en-CA} has been loaded and the current locale
697 %is en-GB:
698 %\begin{dispExample}
699 %\DTLsetLocaleOptions{CA}{number-style=unofficial}
700 %\DTLdecimaltocurrency{12345.678}{\result}\result
701 %\end{dispExample}
702 %
703 %The remaining options relate to dates and times, which are still
704 %experimental. You need to enable date and time parsing with
705 %\setbaseopt{ datetime = \brackets{parse} }.
706 %
707 %\begin{docKey}[CA]{date-style}{=\meta{style}}{initially \opt{yyyymd}}
708 %Sets the current date style. The value may be one of:
709 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
710 %\docValue{yyyymd} (year month day),
711 %\docValue{dmyy} (day month 2-digit year),
712 %\docValue{mdyy} (month day 2-digit year), or
713 %\docValue{yymd} (2-digit year month day).
714 %\end{docKey}
715 %
716 %\begin{docKey}[CA]{date-variant}{=\meta{style}}{initially \opt{hyphen}}
717 %Sets the current numeric date separator.
718 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
719 %(\code{-}), \docValue{dot} (\code{.}) or
720 %\docValue{dialect} (if the language supports it).
721 %\end{docKey}
722 %
723 %\begin{docKey}[CA]{time-variant}{=\meta{style}}{initially \opt{colon}}
724 %Sets the current numeric time separator.
725 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
726 %\docValue{dialect} (if the language supports it),
727 %\docValue{dialect-colon} (if the language supports it), or
728 %\docValue{dialect-dot} (if the language supports it).
729 %\end{docKey}
730 %
731 %\begin{dispExample}
732 %\DTLsetup{datetime={parse}}
733 %\DTLsetLocaleOptions{CA}{
734 % date-style=dmyyyy,
735 % date-variant = dialect,
736 % time-variant = dot
737 %}
738 %\DTLparse\result{Fri 28th Feb 2025 3.45pm PST}
739 %String: \result.
740 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
741 %Numeric value: \DTLdatumvalue{\result}.
742 %
743 %\ExplSyntaxOn
744 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
745 %Time-stamp: ~ \l_tmpa_tl
746 %\ExplSyntaxOff
747 %\end{dispExample}
748 %
749 %\begin{docCommand}{datatoolCASetNumberChars}{}
750 %Hook to switch to CA number group and decimal characters but
751 %requires language support to be enabled as well otherwise it will
752 %simply trigger a warning.
753 %\end{docCommand}
754 %
755 %\begin{docCommand}{datatoolCAcurrencyfmt}{}
756 %Used to format the CAD currency. This supports the currency symbol
757 %prefix.
758 %\end{docCommand}
759 %
760 %\begin{docCommand}{DTLCALocaleHook}{}
761 %Hook to switch to CA settings. This may be added to the captions
762 %hook by \sty{datatool-base}, depending on the settings. Otherwise
763 %it can be explicitly used to switch to this region.
764 %\end{docCommand}
765 %
766 %\section{Region \qt{FK}}
767 %\DTLenLocaleHook
768 %\DTLFKLocaleHook
769 %
770 %The \file{datatool-FK.ldf} file provides support for region \qt{FK}
771 %(Falkland Islands). This defines the \qt{FKP} currency and sets it as
772 %the default currency. The default number group character is a
773 %comma, and the default decimal character is a dot.
774 %
775 %If there's no caption hook and you have multiple locales, you will
776 %need to set both the language and region hooks. For example, this
777 %document has:
778 %\begin{dispListing}
779 %\DTLenLocaleHook
780 %\DTLFKLocaleHook
781 %\end{dispListing}
782 %
783 %\begin{dispExample*}{title={Default Numeric Styles}}
784 %\DTLdecimaltolocale{12345}{\result}\result.
785 %(Value: \DTLdatumvalue{\result}.)
786 %
787 %\DTLdecimaltolocale{12345.678}{\result}\result.
788 %(Value: \DTLdatumvalue{\result}.)
789 %
790 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
791 %(Value: \DTLdatumvalue{\result}.)
792 %
793 %\DTLmul\result{\result}{0.5}\result.
794 %(Value: \DTLdatumvalue{\result}.)
795 %\end{dispExample*}
796 %Remember that date-time parsing needs to be enabled, if required.
797 %\begin{dispExample*}{title={Default Date-Time Styles}}
798 %\DTLsetup{datetime={parse}}
799 %\DTLparse\result{28/2/2025 15:45 PST}
800 %String: \result.
801 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
802 %Numeric value: \DTLdatumvalue{\result}.
803 %
804 %\ExplSyntaxOn
805 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
806 %Time-stamp: ~ \l_tmpa_tl
807 %\ExplSyntaxOff
808 %\end{dispExample*}
809 %
810 %Options may be set with \setlocaleopts{FK}. Available options are
811 %listed below.
812 %
813 %\begin{docKey}[FK]{currency-symbol-prefix}{=\meta{boolean}}{initially \opt{false}}
814 %If true, shows the region prefix before the currency symbol if
815 %the \opt{numeric} setting \opt{currency-symbol-style} is not set to \qt{iso}.
816 %The prefix font may be changed to smallcaps or smaller with
817 %\setbaseopt{ numeric = \brackets{ region-currency-prefix = \meta{value} } }
818 %where \meta{value} is \opt{smallcaps} or \opt{smaller}.
819 %\end{docKey}
820 %
821 %\begin{dispExample}
822 %\DTLsetup{numeric={region-currency-prefix=smallcaps}}
823 %\DTLsetLocaleOptions{FK}{currency-symbol-prefix}
824 %\DTLdecimaltocurrency{12345.678}{\result}\result
825 %\end{dispExample}
826 %
827 %
828 %\begin{docKey}[FK]{currency-symbol-position}{=\meta{value}}{initially \opt{before}}
829 %Adjusts the formatting currency style. If \docValue{before}, the
830 %currency symbol is placed before the value. If \docValue{after}, the
831 %currency symbol is placed after the value.
832 %\end{docKey}
833 %
834 %\begin{dispExample}
835 %\DTLsetup{numeric={currency-symbol-style=iso}}
836 %\DTLsetLocaleOptions{FK}{currency-symbol-position=after}
837 %\DTLdecimaltocurrency{12345.678}{\result}\result
838 %\end{dispExample}
839 %
840 %\begin{docKey}[FK]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
841 %Sets the separator to use between the currency symbol (not code) and the value.
842 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
843 %(a thin space), \docValue{space} (a normal space), or
844 %\docValue{nbsp} (a non-breaking space).
845 %\end{docKey}
846 %
847 %\begin{dispExample}
848 %\DTLsetLocaleOptions{FK}{currency-symbol-sep=thin-space}
849 %\DTLdecimaltocurrency{12345.678}{\result}\result
850 %\end{dispExample}
851 %
852 %\begin{docKey}[FK]{number-style}{=\meta{setting}}{initially \opt{official}}
853 %Sets the number group and decimal characters. The value may be one
854 %of: \docValue{official} (comma number group and decimal point) or
855 %\docValue{unofficial} (thin space number group and decimal point).
856 %In the case of \docValue{unofficial}, a normal space may also be used
857 %when parsing.
858 %\end{docKey}
859 %
860 %\begin{dispExample}
861 %\DTLsetup{numeric={auto-reformat}}
862 %\DTLsetLocaleOptions{FK}{number-style=unofficial}
863 %\DTLdecimaltocurrency{12345.678}{\result}\result.
864 %(Value: \DTLdatumvalue{\result}.)
865 %
866 %\DTLparse{\result}{£12 345.678}\result.
867 %(Value: \DTLdatumvalue{\result}.)
868 %\end{dispExample}
869 %
870 %The remaining options relate to dates and times, which are still
871 %experimental. You need to enable date and time parsing with
872 %\setbaseopt{ datetime = \brackets{parse} }.
873 %
874 %\begin{docKey}[FK]{date-style}{=\meta{style}}{initially \opt{dmyyyy}}
875 %Sets the current date style. The value may be one of:
876 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
877 %\docValue{yyyymd} (year month day),
878 %\docValue{dmyy} (day month 2-digit year),
879 %\docValue{mdyy} (month day 2-digit year), or
880 %\docValue{yymd} (2-digit year month day).
881 %\end{docKey}
882 %
883 %\begin{docKey}[FK]{date-variant}{=\meta{style}}{initially \opt{slash}}
884 %Sets the current numeric date separator.
885 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
886 %(\code{-}), \docValue{dot} (\code{.}) or
887 %\docValue{dialect} (if the language supports it).
888 %\end{docKey}
889 %
890 %\begin{docKey}[FK]{time-variant}{=\meta{style}}{initially \opt{colon}}
891 %Sets the current numeric time separator.
892 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
893 %\docValue{dialect} (if the language supports it),
894 %\docValue{dialect-colon} (if the language supports it), or
895 %\docValue{dialect-dot} (if the language supports it).
896 %\end{docKey}
897 %
898 %\begin{dispExample}
899 %\DTLsetup{datetime={parse}}
900 %\DTLsetLocaleOptions{FK}{
901 % date-style=dmyyyy,
902 % date-variant = dialect,
903 % time-variant = dot
904 %}
905 %\DTLparse\result{Fri 28th Feb 2025 3.45pm FKST}
906 %String: \result.
907 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
908 %Numeric value: \DTLdatumvalue{\result}.
909 %
910 %\ExplSyntaxOn
911 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
912 %Time-stamp: ~ \l_tmpa_tl
913 %\ExplSyntaxOff
914 %\end{dispExample}
915 %
916 %\begin{docCommand}{datatoolFKSetNumberChars}{}
917 %Hook to switch to FK number group and decimal characters.
918 %\end{docCommand}
919 %
920 %\begin{docCommand}{datatoolFKcurrencyfmt}{}
921 %Used to format the FKP currency. This supports the currency symbol
922 %prefix.
923 %\end{docCommand}
924 %
925 %\begin{docCommand}{DTLFKLocaleHook}{}
926 %Hook to switch to FK settings. This may be added to the captions
927 %hook by \sty{datatool-base}, depending on the settings. Otherwise
928 %it can be explicitly used to switch to this region.
929 %\end{docCommand}
930 %
931 %\section{Region \qt{GB}}
932 %\DTLenLocaleHook
933 %\DTLGBLocaleHook
934 %
935 %The \file{datatool-GB.ldf} file provides support for region \qt{GB}
936 %(United Kingdom). This defines the \qt{GBP} currency and sets it as
937 %the default currency. The default number group character is a
938 %comma, and the default decimal character is a dot.
939 %
940 %If there's no caption hook and you have multiple locales, you will
941 %need to set both the language and region hooks. For example, this
942 %document has:
943 %\begin{dispListing}
944 %\DTLenLocaleHook
945 %\DTLGBLocaleHook
946 %\end{dispListing}
947 %
948 %\begin{dispExample*}{title={Default Numeric Styles}}
949 %\DTLdecimaltolocale{12345}{\result}\result.
950 %(Value: \DTLdatumvalue{\result}.)
951 %
952 %\DTLdecimaltolocale{12345.678}{\result}\result.
953 %(Value: \DTLdatumvalue{\result}.)
954 %
955 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
956 %(Value: \DTLdatumvalue{\result}.)
957 %
958 %\DTLmul\result{\result}{0.5}\result.
959 %(Value: \DTLdatumvalue{\result}.)
960 %\end{dispExample*}
961 %Remember that date-time parsing needs to be enabled, if required.
962 %\begin{dispExample*}{title={Default Date-Time Styles}}
963 %\DTLsetup{datetime={parse}}
964 %\DTLparse\result{28/2/2025 15:45 GMT}
965 %String: \result.
966 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
967 %Numeric value: \DTLdatumvalue{\result}.
968 %
969 %\ExplSyntaxOn
970 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
971 %Time-stamp: ~ \l_tmpa_tl
972 %\ExplSyntaxOff
973 %\end{dispExample*}
974 %
975 %Options may be set with \setlocaleopts{GB}. Available options are
976 %listed below.
977 %
978 %\begin{docKey}[GB]{currency-symbol-prefix}{=\meta{boolean}}{initially \opt{false}}
979 %If true, shows the region prefix before the currency symbol if
980 %the \opt{numeric} setting \opt{currency-symbol-style} is not set to \qt{iso}.
981 %The prefix font may be changed to smallcaps or smaller with
982 %\setbaseopt{ numeric = \brackets{ region-currency-prefix = \meta{value} } }
983 %where \meta{value} is \opt{smallcaps} or \opt{smaller}.
984 %\end{docKey}
985 %
986 %\begin{dispExample}
987 %\DTLsetup{numeric={region-currency-prefix=smallcaps}}
988 %\DTLsetLocaleOptions{GB}{currency-symbol-prefix}
989 %\DTLdecimaltocurrency{12345.678}{\result}\result
990 %\end{dispExample}
991 %
992 %
993 %\begin{docKey}[GB]{currency-symbol-position}{=\meta{value}}{initially \opt{before}}
994 %Adjusts the formatting currency style. If \docValue{before}, the
995 %currency symbol is placed before the value. If \docValue{after}, the
996 %currency symbol is placed after the value.
997 %\end{docKey}
998 %
999 %\begin{dispExample}
1000 %\DTLsetup{numeric={currency-symbol-style=iso}}
1001 %\DTLsetLocaleOptions{GB}{currency-symbol-position=after}
1002 %\DTLdecimaltocurrency{12345.678}{\result}\result
1003 %\end{dispExample}
1004 %
1005 %\begin{docKey}[GB]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
1006 %Sets the separator to use between the currency symbol (not code) and the value.
1007 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
1008 %(a thin space), \docValue{space} (a normal space), or
1009 %\docValue{nbsp} (a non-breaking space).
1010 %\end{docKey}
1011 %
1012 %\begin{dispExample}
1013 %\DTLsetLocaleOptions{GB}{currency-symbol-sep=thin-space}
1014 %\DTLdecimaltocurrency{12345.678}{\result}\result
1015 %\end{dispExample}
1016 %
1017 %\begin{docKey}[GB]{number-style}{=\meta{setting}}{initially \opt{official}}
1018 %Sets the number group and decimal characters. The value may be one
1019 %of: \docValue{official} (comma number group and decimal point),
1020 %\docValue{education} (thin space number group and decimal point), or
1021 %\docValue{old} (comma number group and mid dot decimal).
1022 %In the case of \docValue{education}, a normal space may also be used
1023 %when parsing.
1024 %In the case of \docValue{old}, a normal dot may also be used
1025 %when parsing.
1026 %\end{docKey}
1027 %
1028 %\begin{dispExample}
1029 %\DTLsetup{numeric={auto-reformat}}
1030 %\DTLsetLocaleOptions{GB}{number-style=education}
1031 %\DTLdecimaltocurrency{12345.678}{\result}\result.
1032 %(Value: \DTLdatumvalue{\result}.)
1033 %
1034 %\DTLparse{\result}{£12 345.678}\result.
1035 %(Value: \DTLdatumvalue{\result}.)
1036 %
1037 %\DTLsetLocaleOptions{GB}{number-style=old}
1038 %\DTLdecimaltocurrency{12345.678}{\result}\result.
1039 %(Value: \DTLdatumvalue{\result}.)
1040 %
1041 %\DTLparse{\result}{£12,345.678}\result.
1042 %(Value: \DTLdatumvalue{\result}.)
1043 %\end{dispExample}
1044 %
1045 %The remaining options relate to dates and times, which are still
1046 %experimental. You need to enable date and time parsing with
1047 %\setbaseopt{ datetime = \brackets{parse} }.
1048 %
1049 %\begin{docKey}[GB]{date-style}{=\meta{style}}{initially \opt{dmyyyy}}
1050 %Sets the current date style. The value may be one of:
1051 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
1052 %\docValue{yyyymd} (year month day),
1053 %\docValue{dmyy} (day month 2-digit year),
1054 %\docValue{mdyy} (month day 2-digit year), or
1055 %\docValue{yymd} (2-digit year month day).
1056 %\end{docKey}
1057 %
1058 %\begin{docKey}[GB]{date-variant}{=\meta{style}}{initially \opt{slash}}
1059 %Sets the current numeric date separator.
1060 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
1061 %(\code{-}), \docValue{dot} (\code{.}) or
1062 %\docValue{dialect} (if the language supports it).
1063 %\end{docKey}
1064 %
1065 %\begin{docKey}[GB]{time-variant}{=\meta{style}}{initially \opt{colon}}
1066 %Sets the current numeric time separator.
1067 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
1068 %\docValue{dialect} (if the language supports it),
1069 %\docValue{dialect-colon} (if the language supports it), or
1070 %\docValue{dialect-dot} (if the language supports it).
1071 %\end{docKey}
1072 %
1073 %\begin{dispExample}
1074 %\DTLsetup{datetime={parse}}
1075 %\DTLsetLocaleOptions{GB}{
1076 % date-style=dmyyyy,
1077 % date-variant = dialect,
1078 % time-variant = dot
1079 %}
1080 %\DTLparse\result{Fri 28th Feb 2025 3.45pm GMT}
1081 %String: \result.
1082 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
1083 %Numeric value: \DTLdatumvalue{\result}.
1084 %
1085 %\ExplSyntaxOn
1086 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
1087 %Time-stamp: ~ \l_tmpa_tl
1088 %\ExplSyntaxOff
1089 %\end{dispExample}
1090 %
1091 %\begin{docCommand}{datatoolGBSetNumberChars}{}
1092 %Hook to switch to GB number group and decimal characters.
1093 %\end{docCommand}
1094 %
1095 %\begin{docCommand}{datatoolGBcurrencyfmt}{}
1096 %Used to format the GBP currency. This supports the currency symbol
1097 %prefix.
1098 %\end{docCommand}
1099 %
1100 %\begin{docCommand}{DTLGBLocaleHook}{}
1101 %Hook to switch to GB settings. This may be added to the captions
1102 %hook by \sty{datatool-base}, depending on the settings. Otherwise
1103 %it can be explicitly used to switch to this region.
1104 %\end{docCommand}
1105 %
1106 %\section{Region \qt{GG}}
1107 %\DTLenLocaleHook
1108 %\DTLGGLocaleHook
1109 %
1110 %The \file{datatool-GG.ldf} file provides support for region \qt{GG}
1111 %(Guernsey). This defines the \qt{GGP} currency and sets it as
1112 %the default currency. The default number group character is a
1113 %comma, and the default decimal character is a dot.
1114 %
1115 %If there's no caption hook and you have multiple locales, you will
1116 %need to set both the language and region hooks. For example, this
1117 %document has:
1118 %\begin{dispListing}
1119 %\DTLenLocaleHook
1120 %\DTLGGLocaleHook
1121 %\end{dispListing}
1122 %
1123 %\begin{dispExample*}{title={Default Numeric Styles}}
1124 %\DTLdecimaltolocale{12345}{\result}\result.
1125 %(Value: \DTLdatumvalue{\result}.)
1126 %
1127 %\DTLdecimaltolocale{12345.678}{\result}\result.
1128 %(Value: \DTLdatumvalue{\result}.)
1129 %
1130 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
1131 %(Value: \DTLdatumvalue{\result}.)
1132 %
1133 %\DTLmul\result{\result}{0.5}\result.
1134 %(Value: \DTLdatumvalue{\result}.)
1135 %\end{dispExample*}
1136 %Remember that date-time parsing needs to be enabled, if required.
1137 %\begin{dispExample*}{title={Default Date-Time Styles}}
1138 %\DTLsetup{datetime={parse}}
1139 %\DTLparse\result{28/2/2025 15:45 GMT}
1140 %String: \result.
1141 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
1142 %Numeric value: \DTLdatumvalue{\result}.
1143 %
1144 %\ExplSyntaxOn
1145 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
1146 %Time-stamp: ~ \l_tmpa_tl
1147 %\ExplSyntaxOff
1148 %\end{dispExample*}
1149 %
1150 %Options may be set with \setlocaleopts{GG}. Available options are
1151 %listed below.
1152 %
1153 %\begin{docKey}[GG]{currency-symbol-prefix}{=\meta{boolean}}{initially \opt{false}}
1154 %If true, shows the region prefix before the currency symbol if
1155 %the \opt{numeric} setting \opt{currency-symbol-style} is not set to \qt{iso}.
1156 %The prefix font may be changed to smallcaps or smaller with
1157 %\setbaseopt{ numeric = \brackets{ region-currency-prefix = \meta{value} } }
1158 %where \meta{value} is \opt{smallcaps} or \opt{smaller}.
1159 %\end{docKey}
1160 %
1161 %\begin{dispExample}
1162 %\DTLsetup{numeric={region-currency-prefix=smallcaps}}
1163 %\DTLsetLocaleOptions{GG}{currency-symbol-prefix}
1164 %\DTLdecimaltocurrency{12345.678}{\result}\result
1165 %\end{dispExample}
1166 %
1167 %
1168 %\begin{docKey}[GG]{currency-symbol-position}{=\meta{value}}{initially \opt{before}}
1169 %Adjusts the formatting currency style. If \docValue{before}, the
1170 %currency symbol is placed before the value. If \docValue{after}, the
1171 %currency symbol is placed after the value.
1172 %\end{docKey}
1173 %
1174 %\begin{dispExample}
1175 %\DTLsetup{numeric={currency-symbol-style=iso}}
1176 %\DTLsetLocaleOptions{GG}{currency-symbol-position=after}
1177 %\DTLdecimaltocurrency{12345.678}{\result}\result
1178 %\end{dispExample}
1179 %
1180 %\begin{docKey}[GG]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
1181 %Sets the separator to use between the currency symbol (not code) and the value.
1182 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
1183 %(a thin space), \docValue{space} (a normal space), or
1184 %\docValue{nbsp} (a non-breaking space).
1185 %\end{docKey}
1186 %
1187 %\begin{dispExample}
1188 %\DTLsetLocaleOptions{GG}{currency-symbol-sep=thin-space}
1189 %\DTLdecimaltocurrency{12345.678}{\result}\result
1190 %\end{dispExample}
1191 %
1192 %\begin{docKey}[GG]{number-style}{=\meta{setting}}{initially \opt{official}}
1193 %Sets the number group and decimal characters. The value may be one
1194 %of: \docValue{official} (comma number group and decimal point) or
1195 %\docValue{unofficial} (thin space number group and decimal point).
1196 %In the case of \docValue{unofficial}, a normal space may also be used
1197 %when parsing.
1198 %\end{docKey}
1199 %
1200 %\begin{dispExample}
1201 %\DTLsetup{numeric={auto-reformat}}
1202 %\DTLsetLocaleOptions{GG}{number-style=unofficial}
1203 %\DTLdecimaltocurrency{12345.678}{\result}\result.
1204 %(Value: \DTLdatumvalue{\result}.)
1205 %
1206 %\DTLparse{\result}{£12 345.678}\result.
1207 %(Value: \DTLdatumvalue{\result}.)
1208 %\end{dispExample}
1209 %
1210 %The remaining options relate to dates and times, which are still
1211 %experimental. You need to enable date and time parsing with
1212 %\setbaseopt{ datetime = \brackets{parse} }.
1213 %
1214 %\begin{docKey}[GG]{date-style}{=\meta{style}}{initially \opt{dmyyyy}}
1215 %Sets the current date style. The value may be one of:
1216 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
1217 %\docValue{yyyymd} (year month day),
1218 %\docValue{dmyy} (day month 2-digit year),
1219 %\docValue{mdyy} (month day 2-digit year), or
1220 %\docValue{yymd} (2-digit year month day).
1221 %\end{docKey}
1222 %
1223 %\begin{docKey}[GG]{date-variant}{=\meta{style}}{initially \opt{slash}}
1224 %Sets the current numeric date separator.
1225 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
1226 %(\code{-}), \docValue{dot} (\code{.}) or
1227 %\docValue{dialect} (if the language supports it).
1228 %\end{docKey}
1229 %
1230 %\begin{docKey}[GG]{time-variant}{=\meta{style}}{initially \opt{colon}}
1231 %Sets the current numeric time separator.
1232 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
1233 %\docValue{dialect} (if the language supports it),
1234 %\docValue{dialect-colon} (if the language supports it), or
1235 %\docValue{dialect-dot} (if the language supports it).
1236 %\end{docKey}
1237 %
1238 %\begin{dispExample}
1239 %\DTLsetup{datetime={parse}}
1240 %\DTLsetLocaleOptions{GG}{
1241 % date-style=dmyyyy,
1242 % date-variant = dialect,
1243 % time-variant = dot
1244 %}
1245 %\DTLparse\result{Fri 28th Feb 2025 3.45pm GMT}
1246 %String: \result.
1247 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
1248 %Numeric value: \DTLdatumvalue{\result}.
1249 %
1250 %\ExplSyntaxOn
1251 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
1252 %Time-stamp: ~ \l_tmpa_tl
1253 %\ExplSyntaxOff
1254 %\end{dispExample}
1255 %
1256 %\begin{docCommand}{datatoolGGSetNumberChars}{}
1257 %Hook to switch to GG number group and decimal characters.
1258 %\end{docCommand}
1259 %
1260 %\begin{docCommand}{datatoolGGcurrencyfmt}{}
1261 %Used to format the GGP currency. This supports the currency symbol
1262 %prefix.
1263 %\end{docCommand}
1264 %
1265 %\begin{docCommand}{DTLGGLocaleHook}{}
1266 %Hook to switch to GG settings. This may be added to the captions
1267 %hook by \sty{datatool-base}, depending on the settings. Otherwise
1268 %it can be explicitly used to switch to this region.
1269 %\end{docCommand}
1270 %
1271 %\section{Region \qt{GI}}
1272 %\DTLenLocaleHook
1273 %\DTLGILocaleHook
1274 %
1275 %The \file{datatool-GI.ldf} file provides support for region \qt{GI}
1276 %(Gibraltar). This defines the \qt{GIP} currency and sets it as
1277 %the default currency. The default number group character is a
1278 %comma, and the default decimal character is a dot.
1279 %
1280 %If there's no caption hook and you have multiple locales, you will
1281 %need to set both the language and region hooks. For example, this
1282 %document has:
1283 %\begin{dispListing}
1284 %\DTLenLocaleHook
1285 %\DTLGILocaleHook
1286 %\end{dispListing}
1287 %
1288 %\begin{dispExample*}{title={Default Numeric Styles}}
1289 %\DTLdecimaltolocale{12345}{\result}\result.
1290 %(Value: \DTLdatumvalue{\result}.)
1291 %
1292 %\DTLdecimaltolocale{12345.678}{\result}\result.
1293 %(Value: \DTLdatumvalue{\result}.)
1294 %
1295 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
1296 %(Value: \DTLdatumvalue{\result}.)
1297 %
1298 %\DTLmul\result{\result}{0.5}\result.
1299 %(Value: \DTLdatumvalue{\result}.)
1300 %\end{dispExample*}
1301 %Remember that date-time parsing needs to be enabled, if required.
1302 %\begin{dispExample*}{title={Default Date-Time Styles}}
1303 %\DTLsetup{datetime={parse}}
1304 %\DTLparse\result{28/2/2025 15:45 GMT}
1305 %String: \result.
1306 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
1307 %Numeric value: \DTLdatumvalue{\result}.
1308 %
1309 %\ExplSyntaxOn
1310 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
1311 %Time-stamp: ~ \l_tmpa_tl
1312 %\ExplSyntaxOff
1313 %\end{dispExample*}
1314 %
1315 %Options may be set with \setlocaleopts{GI}. Available options are
1316 %listed below.
1317 %
1318 %\begin{docKey}[GI]{currency-symbol-prefix}{=\meta{boolean}}{initially \opt{false}}
1319 %If true, shows the region prefix before the currency symbol if
1320 %the \opt{numeric} setting \opt{currency-symbol-style} is not set to \qt{iso}.
1321 %The prefix font may be changed to smallcaps or smaller with
1322 %\setbaseopt{ numeric = \brackets{ region-currency-prefix = \meta{value} } }
1323 %where \meta{value} is \opt{smallcaps} or \opt{smaller}.
1324 %\end{docKey}
1325 %
1326 %\begin{dispExample}
1327 %\DTLsetup{numeric={region-currency-prefix=smallcaps}}
1328 %\DTLsetLocaleOptions{GI}{currency-symbol-prefix}
1329 %\DTLdecimaltocurrency{12345.678}{\result}\result
1330 %\end{dispExample}
1331 %
1332 %
1333 %\begin{docKey}[GI]{currency-symbol-position}{=\meta{value}}{initially \opt{before}}
1334 %Adjusts the formatting currency style. If \docValue{before}, the
1335 %currency symbol is placed before the value. If \docValue{after}, the
1336 %currency symbol is placed after the value.
1337 %\end{docKey}
1338 %
1339 %\begin{dispExample}
1340 %\DTLsetup{numeric={currency-symbol-style=iso}}
1341 %\DTLsetLocaleOptions{GI}{currency-symbol-position=after}
1342 %\DTLdecimaltocurrency{12345.678}{\result}\result
1343 %\end{dispExample}
1344 %
1345 %\begin{docKey}[GI]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
1346 %Sets the separator to use between the currency symbol (not code) and the value.
1347 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
1348 %(a thin space), \docValue{space} (a normal space), or
1349 %\docValue{nbsp} (a non-breaking space).
1350 %\end{docKey}
1351 %
1352 %\begin{dispExample}
1353 %\DTLsetLocaleOptions{GI}{currency-symbol-sep=thin-space}
1354 %\DTLdecimaltocurrency{12345.678}{\result}\result
1355 %\end{dispExample}
1356 %
1357 %\begin{docKey}[GI]{number-style}{=\meta{setting}}{initially \opt{official}}
1358 %Sets the number group and decimal characters. The value may be one
1359 %of: \docValue{official} (comma number group and decimal point) or
1360 %\docValue{unofficial} (thin space number group and decimal point).
1361 %In the case of \docValue{unofficial}, a normal space may also be used
1362 %when parsing.
1363 %\end{docKey}
1364 %
1365 %\begin{dispExample}
1366 %\DTLsetup{numeric={auto-reformat}}
1367 %\DTLsetLocaleOptions{GI}{number-style=unofficial}
1368 %\DTLdecimaltocurrency{12345.678}{\result}\result.
1369 %(Value: \DTLdatumvalue{\result}.)
1370 %
1371 %\DTLparse{\result}{£12 345.678}\result.
1372 %(Value: \DTLdatumvalue{\result}.)
1373 %\end{dispExample}
1374 %
1375 %The remaining options relate to dates and times, which are still
1376 %experimental. You need to enable date and time parsing with
1377 %\setbaseopt{ datetime = \brackets{parse} }.
1378 %
1379 %\begin{docKey}[GI]{date-style}{=\meta{style}}{initially \opt{dmyyyy}}
1380 %Sets the current date style. The value may be one of:
1381 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
1382 %\docValue{yyyymd} (year month day),
1383 %\docValue{dmyy} (day month 2-digit year),
1384 %\docValue{mdyy} (month day 2-digit year), or
1385 %\docValue{yymd} (2-digit year month day).
1386 %\end{docKey}
1387 %
1388 %\begin{docKey}[GI]{date-variant}{=\meta{style}}{initially \opt{slash}}
1389 %Sets the current numeric date separator.
1390 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
1391 %(\code{-}), \docValue{dot} (\code{.}) or
1392 %\docValue{dialect} (if the language supports it).
1393 %\end{docKey}
1394 %
1395 %\begin{docKey}[GI]{time-variant}{=\meta{style}}{initially \opt{colon}}
1396 %Sets the current numeric time separator.
1397 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
1398 %\docValue{dialect} (if the language supports it),
1399 %\docValue{dialect-colon} (if the language supports it), or
1400 %\docValue{dialect-dot} (if the language supports it).
1401 %\end{docKey}
1402 %
1403 %\begin{dispExample}
1404 %\DTLsetup{datetime={parse}}
1405 %\DTLsetLocaleOptions{GI}{
1406 % date-style=dmyyyy,
1407 % date-variant = dialect,
1408 % time-variant = dot
1409 %}
1410 %\DTLparse\result{Fri 28th Feb 2025 3.45pm GMT}
1411 %String: \result.
1412 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
1413 %Numeric value: \DTLdatumvalue{\result}.
1414 %
1415 %\ExplSyntaxOn
1416 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
1417 %Time-stamp: ~ \l_tmpa_tl
1418 %\ExplSyntaxOff
1419 %\end{dispExample}
1420 %
1421 %\begin{docCommand}{datatoolGISetNumberChars}{}
1422 %Hook to switch to GI number group and decimal characters.
1423 %\end{docCommand}
1424 %
1425 %\begin{docCommand}{datatoolGIcurrencyfmt}{}
1426 %Used to format the GIP currency. This supports the currency symbol
1427 %prefix.
1428 %\end{docCommand}
1429 %
1430 %\begin{docCommand}{DTLGILocaleHook}{}
1431 %Hook to switch to GI settings. This may be added to the captions
1432 %hook by \sty{datatool-base}, depending on the settings. Otherwise
1433 %it can be explicitly used to switch to this region.
1434 %\end{docCommand}
1435 %
1436 %\section{Region \qt{IE}}
1437 %\DTLenLocaleHook
1438 %\DTLIELocaleHook
1439 %
1440 %The \file{datatool-IE.ldf} file provides support for region \qt{IE}
1441 %(Republic of Ireland). This sets \qt{EUR} as the default currency.
1442 %
1443 %If there's no caption hook and you have multiple locales, you will
1444 %need to set both the language and region hooks. For example, this
1445 %document has:
1446 %\begin{dispListing}
1447 %\DTLenLocaleHook
1448 %\DTLIELocaleHook
1449 %\end{dispListing}
1450 %
1451 %\begin{dispExample*}{title={Default Numeric Styles}}
1452 %\DTLdecimaltolocale{12345}{\result}\result.
1453 %(Value: \DTLdatumvalue{\result}.)
1454 %
1455 %\DTLdecimaltolocale{12345.678}{\result}\result.
1456 %(Value: \DTLdatumvalue{\result}.)
1457 %
1458 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
1459 %(Value: \DTLdatumvalue{\result}.)
1460 %
1461 %\DTLmul\result{\result}{0.5}\result.
1462 %(Value: \DTLdatumvalue{\result}.)
1463 %\end{dispExample*}
1464 %Remember that date-time parsing needs to be enabled, if required.
1465 %\begin{dispExample*}{title={Default Date-Time Styles}}
1466 %\DTLsetup{datetime={parse}}
1467 %\DTLparse\result{1/6/2025 15:45 IST}
1468 %String: \result.
1469 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
1470 %Numeric value: \DTLdatumvalue{\result}.
1471 %
1472 %\ExplSyntaxOn
1473 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
1474 %Time-stamp: ~ \l_tmpa_tl
1475 %\ExplSyntaxOff
1476 %\end{dispExample*}
1477 %
1478 %
1479 %Options may be set with \setlocaleopts{IE}. Available options are
1480 %listed below.
1481 %
1482 %\begin{docKey}[IE]{currency-symbol-position}{=\meta{value}}{initially \opt{before}}
1483 %Adjusts the formatting currency style. If \docValue{before}, the
1484 %currency symbol is placed before the value. If \docValue{after}, the
1485 %currency symbol is placed after the value.
1486 %\end{docKey}
1487 %
1488 %\begin{dispExample}
1489 %\DTLsetup{numeric={currency-symbol-style=iso}}
1490 %\DTLsetLocaleOptions{IE}{currency-symbol-position=after}
1491 %\DTLdecimaltocurrency{12345.678}{\result}\result
1492 %\end{dispExample}
1493 %
1494 %\begin{docKey}[IE]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
1495 %Sets the separator to use between the currency symbol (not code) and the value.
1496 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
1497 %(a thin space), \docValue{space} (a normal space), or
1498 %\docValue{nbsp} (a non-breaking space).
1499 %\end{docKey}
1500 %
1501 %\begin{dispExample}
1502 %\DTLsetLocaleOptions{IE}{currency-symbol-sep=thin-space}
1503 %\DTLdecimaltocurrency{12345.678}{\result}\result
1504 %\end{dispExample}
1505 %
1506 %\begin{docKey}[IE]{number-style}{=\meta{setting}}{initially \opt{official}}
1507 %Sets the number group and decimal characters. The value may be one
1508 %of: \docValue{official} (comma number group and decimal point) or
1509 %\docValue{unofficial} (thin space number group and decimal point).
1510 %In the case of \docValue{unofficial}, a normal space may also be used
1511 %when parsing.
1512 %\end{docKey}
1513 %
1514 %\begin{dispExample}
1515 %\DTLsetup{numeric={auto-reformat}}
1516 %\DTLsetLocaleOptions{IE}{number-style=unofficial}
1517 %\DTLdecimaltocurrency{12345.678}{\result}\result.
1518 %(Value: \DTLdatumvalue{\result}.)
1519 %
1520 %\DTLparse{\result}{\texteuro 12 345.678}\result.
1521 %(Value: \DTLdatumvalue{\result}.)
1522 %\end{dispExample}
1523 %
1524 %The remaining options relate to dates and times, which are still
1525 %experimental. You need to enable date and time parsing with
1526 %\setbaseopt{ datetime = \brackets{ parse } }.
1527 %
1528 %\begin{docKey}[IE]{date-style}{=\meta{style}}{initially \opt{dmyyyy}}
1529 %Sets the current date style. The value may be one of:
1530 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
1531 %\docValue{yyyymd} (year month day),
1532 %\docValue{dmyy} (day month 2-digit year),
1533 %\docValue{mdyy} (month day 2-digit year), or
1534 %\docValue{yymd} (2-digit year month day).
1535 %\end{docKey}
1536 %
1537 %\begin{docKey}[IE]{date-variant}{=\meta{style}}{initially \opt{slash}}
1538 %Sets the current numeric date separator.
1539 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
1540 %(\code{-}), \docValue{dot} (\code{.}) or
1541 %\docValue{dialect} (if the language supports it).
1542 %\end{docKey}
1543 %
1544 %\begin{docKey}[IE]{time-variant}{=\meta{style}}{initially \opt{colon}}
1545 %Sets the current numeric time separator.
1546 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
1547 %\docValue{dialect} (if the language supports it),
1548 %\docValue{dialect-colon} (if the language supports it), or
1549 %\docValue{dialect-dot} (if the language supports it).
1550 %\end{docKey}
1551 %
1552 %\begin{dispExample}
1553 %\DTLsetup{datetime={parse}}
1554 %\DTLsetLocaleOptions{IE}{
1555 % date-style=dmyyyy,
1556 % date-variant = dialect,
1557 % time-variant = dot
1558 %}
1559 %\DTLparse\result{1st June 2025 3.45pm IST}
1560 %String: \result.
1561 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
1562 %Numeric value: \DTLdatumvalue{\result}.
1563 %
1564 %\ExplSyntaxOn
1565 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
1566 %Time-stamp: ~ \l_tmpa_tl
1567 %\ExplSyntaxOff
1568 %\end{dispExample}
1569 %
1570 %\begin{docCommand}{datatoolIESetNumberChars}{}
1571 %Hook to switch to IE number group and decimal characters.
1572 %\end{docCommand}
1573 %
1574 %\begin{docCommand}{datatoolIESetCurrency}{}
1575 %Hook to switch to the EUR currency, rounding to 2 decimal places,
1576 %and redefines \cs{DTLdefaultEURcurrencyfmt} to reflect the
1577 %\opt{currency-symbol-position} setting.
1578 %\end{docCommand}
1579 %
1580 %\begin{docCommand}{DTLIELocaleHook}{}
1581 %Hook to switch to IE settings. This may be added to the captions
1582 %hook by \sty{datatool-base}, depending on the settings. Otherwise
1583 %it can be explicitly used to switch to this region.
1584 %\end{docCommand}
1585 %
1586 %\section{Region \qt{IM}}
1587 %\DTLenLocaleHook
1588 %\DTLIMLocaleHook
1589 %
1590 %The \file{datatool-IM.ldf} file provides support for region \qt{IM}
1591 %(Isle of Man). This defines the \qt{IMP} currency and sets it as
1592 %the default currency. The default number group character is a
1593 %comma, and the default decimal character is a dot.
1594 %
1595 %If there's no caption hook and you have multiple locales, you will
1596 %need to set both the language and region hooks. For example, this
1597 %document has:
1598 %\begin{dispListing}
1599 %\DTLenLocaleHook
1600 %\DTLIMLocaleHook
1601 %\end{dispListing}
1602 %
1603 %\begin{dispExample*}{title={Default Numeric Styles}}
1604 %\DTLdecimaltolocale{12345}{\result}\result.
1605 %(Value: \DTLdatumvalue{\result}.)
1606 %
1607 %\DTLdecimaltolocale{12345.678}{\result}\result.
1608 %(Value: \DTLdatumvalue{\result}.)
1609 %
1610 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
1611 %(Value: \DTLdatumvalue{\result}.)
1612 %
1613 %\DTLmul\result{\result}{0.5}\result.
1614 %(Value: \DTLdatumvalue{\result}.)
1615 %\end{dispExample*}
1616 %Remember that date-time parsing needs to be enabled, if required.
1617 %\begin{dispExample*}{title={Default Date-Time Styles}}
1618 %\DTLsetup{datetime={parse}}
1619 %\DTLparse\result{28/2/2025 15:45 GMT}
1620 %String: \result.
1621 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
1622 %Numeric value: \DTLdatumvalue{\result}.
1623 %
1624 %\ExplSyntaxOn
1625 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
1626 %Time-stamp: ~ \l_tmpa_tl
1627 %\ExplSyntaxOff
1628 %\end{dispExample*}
1629 %
1630 %Options may be set with \setlocaleopts{IM}. Available options are
1631 %listed below.
1632 %
1633 %\begin{docKey}[IM]{currency-symbol-prefix}{=\meta{boolean}}{initially \opt{false}}
1634 %If true, shows the region prefix before the currency symbol if
1635 %the \opt{numeric} setting \opt{currency-symbol-style} is not set to \qt{iso}.
1636 %The prefix font may be changed to smallcaps or smaller with
1637 %\setbaseopt{ numeric = \brackets{ region-currency-prefix = \meta{value} } }
1638 %where \meta{value} is \opt{smallcaps} or \opt{smaller}.
1639 %\end{docKey}
1640 %
1641 %\begin{dispExample}
1642 %\DTLsetup{numeric={region-currency-prefix=smallcaps}}
1643 %\DTLsetLocaleOptions{IM}{currency-symbol-prefix}
1644 %\DTLdecimaltocurrency{12345.678}{\result}\result
1645 %\end{dispExample}
1646 %
1647 %
1648 %\begin{docKey}[IM]{currency-symbol-position}{=\meta{value}}{initially \opt{before}}
1649 %Adjusts the formatting currency style. If \docValue{before}, the
1650 %currency symbol is placed before the value. If \docValue{after}, the
1651 %currency symbol is placed after the value.
1652 %\end{docKey}
1653 %
1654 %\begin{dispExample}
1655 %\DTLsetup{numeric={currency-symbol-style=iso}}
1656 %\DTLsetLocaleOptions{IM}{currency-symbol-position=after}
1657 %\DTLdecimaltocurrency{12345.678}{\result}\result
1658 %\end{dispExample}
1659 %
1660 %\begin{docKey}[IM]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
1661 %Sets the separator to use between the currency symbol (not code) and the value.
1662 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
1663 %(a thin space), \docValue{space} (a normal space), or
1664 %\docValue{nbsp} (a non-breaking space).
1665 %\end{docKey}
1666 %
1667 %\begin{dispExample}
1668 %\DTLsetLocaleOptions{IM}{currency-symbol-sep=thin-space}
1669 %\DTLdecimaltocurrency{12345.678}{\result}\result
1670 %\end{dispExample}
1671 %
1672 %\begin{docKey}[IM]{number-style}{=\meta{setting}}{initially \opt{official}}
1673 %Sets the number group and decimal characters. The value may be one
1674 %of: \docValue{official} (comma number group and decimal point) or
1675 %\docValue{unofficial} (thin space number group and decimal point).
1676 %In the case of \docValue{unofficial}, a normal space may also be used
1677 %when parsing.
1678 %\end{docKey}
1679 %
1680 %\begin{dispExample}
1681 %\DTLsetup{numeric={auto-reformat}}
1682 %\DTLsetLocaleOptions{IM}{number-style=unofficial}
1683 %\DTLdecimaltocurrency{12345.678}{\result}\result.
1684 %(Value: \DTLdatumvalue{\result}.)
1685 %
1686 %\DTLparse{\result}{£12 345.678}\result.
1687 %(Value: \DTLdatumvalue{\result}.)
1688 %\end{dispExample}
1689 %
1690 %The remaining options relate to dates and times, which are still
1691 %experimental. You need to enable date and time parsing with
1692 %\setbaseopt{ datetime = \brackets{parse} }.
1693 %
1694 %\begin{docKey}[IM]{date-style}{=\meta{style}}{initially \opt{dmyyyy}}
1695 %Sets the current date style. The value may be one of:
1696 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
1697 %\docValue{yyyymd} (year month day),
1698 %\docValue{dmyy} (day month 2-digit year),
1699 %\docValue{mdyy} (month day 2-digit year), or
1700 %\docValue{yymd} (2-digit year month day).
1701 %\end{docKey}
1702 %
1703 %\begin{docKey}[IM]{date-variant}{=\meta{style}}{initially \opt{slash}}
1704 %Sets the current numeric date separator.
1705 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
1706 %(\code{-}), \docValue{dot} (\code{.}) or
1707 %\docValue{dialect} (if the language supports it).
1708 %\end{docKey}
1709 %
1710 %\begin{docKey}[IM]{time-variant}{=\meta{style}}{initially \opt{colon}}
1711 %Sets the current numeric time separator.
1712 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
1713 %\docValue{dialect} (if the language supports it),
1714 %\docValue{dialect-colon} (if the language supports it), or
1715 %\docValue{dialect-dot} (if the language supports it).
1716 %\end{docKey}
1717 %
1718 %\begin{dispExample}
1719 %\DTLsetup{datetime={parse}}
1720 %\DTLsetLocaleOptions{IM}{
1721 % date-style=dmyyyy,
1722 % date-variant = dialect,
1723 % time-variant = dot
1724 %}
1725 %\DTLparse\result{Fri 28th Feb 2025 3.45pm GMT}
1726 %String: \result.
1727 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
1728 %Numeric value: \DTLdatumvalue{\result}.
1729 %
1730 %\ExplSyntaxOn
1731 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
1732 %Time-stamp: ~ \l_tmpa_tl
1733 %\ExplSyntaxOff
1734 %\end{dispExample}
1735 %
1736 %\begin{docCommand}{datatoolIMSetNumberChars}{}
1737 %Hook to switch to IM number group and decimal characters.
1738 %\end{docCommand}
1739 %
1740 %\begin{docCommand}{datatoolIMcurrencyfmt}{}
1741 %Used to format the IMP currency. This supports the currency symbol
1742 %prefix.
1743 %\end{docCommand}
1744 %
1745 %\begin{docCommand}{DTLIMLocaleHook}{}
1746 %Hook to switch to IM settings. This may be added to the captions
1747 %hook by \sty{datatool-base}, depending on the settings. Otherwise
1748 %it can be explicitly used to switch to this region.
1749 %\end{docCommand}
1750 %
1751 %\section{Region \qt{JE}}
1752 %\DTLenLocaleHook
1753 %\DTLJELocaleHook
1754 %
1755 %The \file{datatool-JE.ldf} file provides support for region \qt{JE}
1756 %(Jersey). This defines the \qt{JEP} currency and sets it as
1757 %the default currency. The default number group character is a
1758 %comma, and the default decimal character is a dot.
1759 %
1760 %If there's no caption hook and you have multiple locales, you will
1761 %need to set both the language and region hooks. For example, this
1762 %document has:
1763 %\begin{dispListing}
1764 %\DTLenLocaleHook
1765 %\DTLJELocaleHook
1766 %\end{dispListing}
1767 %
1768 %\begin{dispExample*}{title={Default Numeric Styles}}
1769 %\DTLdecimaltolocale{12345}{\result}\result.
1770 %(Value: \DTLdatumvalue{\result}.)
1771 %
1772 %\DTLdecimaltolocale{12345.678}{\result}\result.
1773 %(Value: \DTLdatumvalue{\result}.)
1774 %
1775 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
1776 %(Value: \DTLdatumvalue{\result}.)
1777 %
1778 %\DTLmul\result{\result}{0.5}\result.
1779 %(Value: \DTLdatumvalue{\result}.)
1780 %\end{dispExample*}
1781 %Remember that date-time parsing needs to be enabled, if required.
1782 %\begin{dispExample*}{title={Default Date-Time Styles}}
1783 %\DTLsetup{datetime={parse}}
1784 %\DTLparse\result{28/2/2025 15:45 GMT}
1785 %String: \result.
1786 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
1787 %Numeric value: \DTLdatumvalue{\result}.
1788 %
1789 %\ExplSyntaxOn
1790 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
1791 %Time-stamp: ~ \l_tmpa_tl
1792 %\ExplSyntaxOff
1793 %\end{dispExample*}
1794 %
1795 %
1796 %Options may be set with \setlocaleopts{JE}. Available options are
1797 %listed below.
1798 %
1799 %\begin{docKey}[JE]{currency-symbol-prefix}{=\meta{boolean}}{initially \opt{false}}
1800 %If true, shows the region prefix before the currency symbol if
1801 %the \opt{numeric} setting \opt{currency-symbol-style} is not set to \qt{iso}.
1802 %The prefix font may be changed to smallcaps or smaller with
1803 %\setbaseopt{ numeric = \brackets{ region-currency-prefix = \meta{value} } }
1804 %where \meta{value} is \opt{smallcaps} or \opt{smaller}.
1805 %\end{docKey}
1806 %
1807 %\begin{dispExample}
1808 %\DTLsetup{numeric={region-currency-prefix=smallcaps}}
1809 %\DTLsetLocaleOptions{JE}{currency-symbol-prefix}
1810 %\DTLdecimaltocurrency{12345.678}{\result}\result
1811 %\end{dispExample}
1812 %
1813 %
1814 %\begin{docKey}[JE]{currency-symbol-position}{=\meta{value}}{initially \opt{before}}
1815 %Adjusts the formatting currency style. If \docValue{before}, the
1816 %currency symbol is placed before the value. If \docValue{after}, the
1817 %currency symbol is placed after the value.
1818 %\end{docKey}
1819 %
1820 %\begin{dispExample}
1821 %\DTLsetup{numeric={currency-symbol-style=iso}}
1822 %\DTLsetLocaleOptions{JE}{currency-symbol-position=after}
1823 %\DTLdecimaltocurrency{12345.678}{\result}\result
1824 %\end{dispExample}
1825 %
1826 %\begin{docKey}[JE]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
1827 %Sets the separator to use between the currency symbol (not code) and the value.
1828 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
1829 %(a thin space), \docValue{space} (a normal space), or
1830 %\docValue{nbsp} (a non-breaking space).
1831 %\end{docKey}
1832 %
1833 %\begin{dispExample}
1834 %\DTLsetLocaleOptions{JE}{currency-symbol-sep=thin-space}
1835 %\DTLdecimaltocurrency{12345.678}{\result}\result
1836 %\end{dispExample}
1837 %
1838 %\begin{docKey}[JE]{number-style}{=\meta{setting}}{initially \opt{official}}
1839 %Sets the number group and decimal characters. The value may be one
1840 %of: \docValue{official} (comma number group and decimal point) or
1841 %\docValue{unofficial} (thin space number group and decimal point).
1842 %In the case of \docValue{unofficial}, a normal space may also be used
1843 %when parsing.
1844 %\end{docKey}
1845 %
1846 %\begin{dispExample}
1847 %\DTLsetup{numeric={auto-reformat}}
1848 %\DTLsetLocaleOptions{JE}{number-style=unofficial}
1849 %\DTLdecimaltocurrency{12345.678}{\result}\result.
1850 %(Value: \DTLdatumvalue{\result}.)
1851 %
1852 %\DTLparse{\result}{£12 345.678}\result.
1853 %(Value: \DTLdatumvalue{\result}.)
1854 %\end{dispExample}
1855 %
1856 %The remaining options relate to dates and times, which are still
1857 %experimental. You need to enable date and time parsing with
1858 %\setbaseopt{ datetime = \brackets{parse} }.
1859 %
1860 %\begin{docKey}[JE]{date-style}{=\meta{style}}{initially \opt{dmyyyy}}
1861 %Sets the current date style. The value may be one of:
1862 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
1863 %\docValue{yyyymd} (year month day),
1864 %\docValue{dmyy} (day month 2-digit year),
1865 %\docValue{mdyy} (month day 2-digit year), or
1866 %\docValue{yymd} (2-digit year month day).
1867 %\end{docKey}
1868 %
1869 %\begin{docKey}[JE]{date-variant}{=\meta{style}}{initially \opt{slash}}
1870 %Sets the current numeric date separator.
1871 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
1872 %(\code{-}), \docValue{dot} (\code{.}) or
1873 %\docValue{dialect} (if the language supports it).
1874 %\end{docKey}
1875 %
1876 %\begin{docKey}[JE]{time-variant}{=\meta{style}}{initially \opt{colon}}
1877 %Sets the current numeric time separator.
1878 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
1879 %\docValue{dialect} (if the language supports it),
1880 %\docValue{dialect-colon} (if the language supports it), or
1881 %\docValue{dialect-dot} (if the language supports it).
1882 %\end{docKey}
1883 %
1884 %\begin{dispExample}
1885 %\DTLsetup{datetime={parse}}
1886 %\DTLsetLocaleOptions{JE}{
1887 % date-style=dmyyyy,
1888 % date-variant = dialect,
1889 % time-variant = dot
1890 %}
1891 %\DTLparse\result{Fri 28th Feb 2025 3.45pm GMT}
1892 %String: \result.
1893 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
1894 %Numeric value: \DTLdatumvalue{\result}.
1895 %
1896 %\ExplSyntaxOn
1897 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
1898 %Time-stamp: ~ \l_tmpa_tl
1899 %\ExplSyntaxOff
1900 %\end{dispExample}
1901 %
1902 %\begin{docCommand}{datatoolJESetNumberChars}{}
1903 %Hook to switch to JE number group and decimal characters.
1904 %\end{docCommand}
1905 %
1906 %\begin{docCommand}{datatoolJEcurrencyfmt}{}
1907 %Used to format the JEP currency. This supports the currency symbol
1908 %prefix.
1909 %\end{docCommand}
1910 %
1911 %\begin{docCommand}{DTLJELocaleHook}{}
1912 %Hook to switch to JE settings. This may be added to the captions
1913 %hook by \sty{datatool-base}, depending on the settings. Otherwise
1914 %it can be explicitly used to switch to this region.
1915 %\end{docCommand}
1916 %
1917 %\section{Region \qt{NZ}}
1918 %\DTLenLocaleHook
1919 %\DTLNZLocaleHook
1920 %
1921 %The \file{datatool-NZ.ldf} file provides support for region \qt{NZ}
1922 %(New Zealand). This defines the \qt{NZD} currency and sets it as
1923 %the default currency. The default number group character is a
1924 %comma, and the default decimal character is a dot.
1925 %
1926 %If there's no caption hook and you have multiple locales, you will
1927 %need to set both the language and region hooks. For example, this
1928 %document has:
1929 %\begin{dispListing}
1930 %\DTLenLocaleHook
1931 %\DTLNZLocaleHook
1932 %\end{dispListing}
1933 %
1934 %\begin{dispExample*}{title={Default Numeric Styles}}
1935 %\DTLdecimaltolocale{12345}{\result}\result.
1936 %(Value: \DTLdatumvalue{\result}.)
1937 %
1938 %\DTLdecimaltolocale{12345.678}{\result}\result.
1939 %(Value: \DTLdatumvalue{\result}.)
1940 %
1941 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
1942 %(Value: \DTLdatumvalue{\result}.)
1943 %
1944 %\DTLmul\result{\result}{0.5}\result.
1945 %(Value: \DTLdatumvalue{\result}.)
1946 %\end{dispExample*}
1947 %Remember that date-time parsing needs to be enabled, if required.
1948 %\begin{dispExample*}{title={Default Date-Time Styles}}
1949 %\DTLsetup{datetime={parse}}
1950 %\DTLparse\result{28/2/2025 15:45 NZDT}
1951 %String: \result.
1952 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
1953 %Numeric value: \DTLdatumvalue{\result}.
1954 %
1955 %\ExplSyntaxOn
1956 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
1957 %Time-stamp: ~ \l_tmpa_tl
1958 %\ExplSyntaxOff
1959 %\end{dispExample*}
1960 %
1961 %
1962 %Options may be set with \setlocaleopts{NZ}. Available options are
1963 %listed below.
1964 %
1965 %\begin{docKey}[NZ]{currency-symbol-prefix}{=\meta{boolean}}{initially \opt{false}}
1966 %If true, shows the region prefix before the currency symbol if
1967 %the \opt{numeric} setting \opt{currency-symbol-style} is not set to \qt{iso}.
1968 %The prefix font may be changed to smallcaps or smaller with
1969 %\setbaseopt{ numeric = \brackets{ region-currency-prefix = \meta{value} } }
1970 %where \meta{value} is \opt{smallcaps} or \opt{smaller}.
1971 %\end{docKey}
1972 %
1973 %\begin{dispExample}
1974 %\DTLsetup{numeric={region-currency-prefix=smallcaps}}
1975 %\DTLsetLocaleOptions{NZ}{currency-symbol-prefix}
1976 %\DTLdecimaltocurrency{12345.678}{\result}\result
1977 %\end{dispExample}
1978 %
1979 %
1980 %\begin{docKey}[NZ]{currency-symbol-position}{=\meta{value}}{initially \opt{before}}
1981 %Adjusts the formatting currency style. If \docValue{before}, the
1982 %currency symbol is placed before the value. If \docValue{after}, the
1983 %currency symbol is placed after the value.
1984 %\end{docKey}
1985 %
1986 %\begin{dispExample}
1987 %\DTLsetup{numeric={currency-symbol-style=iso}}
1988 %\DTLsetLocaleOptions{NZ}{currency-symbol-position=after}
1989 %\DTLdecimaltocurrency{12345.678}{\result}\result
1990 %\end{dispExample}
1991 %
1992 %\begin{docKey}[NZ]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
1993 %Sets the separator to use between the currency symbol (not code) and the value.
1994 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
1995 %(a thin space), \docValue{space} (a normal space), or
1996 %\docValue{nbsp} (a non-breaking space).
1997 %\end{docKey}
1998 %
1999 %\begin{dispExample}
2000 %\DTLsetLocaleOptions{NZ}{currency-symbol-sep=thin-space}
2001 %\DTLdecimaltocurrency{12345.678}{\result}\result
2002 %\end{dispExample}
2003 %
2004 %\begin{docKey}[NZ]{number-style}{=\meta{setting}}{initially \opt{official}}
2005 %Sets the number group and decimal characters. The value may be one
2006 %of: \docValue{official} (comma number group and decimal point), or
2007 %\docValue{unofficial} (thin space number group and decimal point).
2008 %In the case of \docValue{unofficial}, a normal space may also be used
2009 %when parsing.
2010 %\end{docKey}
2011 %
2012 %\begin{dispExample}
2013 %\DTLsetup{numeric={auto-reformat}}
2014 %\DTLsetLocaleOptions{NZ}{number-style=unofficial}
2015 %\DTLdecimaltocurrency{12345.678}{\result}\result.
2016 %(Value: \DTLdatumvalue{\result}.)
2017 %
2018 %\DTLparse{\result}{\$12 345.678}\result.
2019 %(Value: \DTLdatumvalue{\result}.)
2020 %\end{dispExample}
2021 %
2022 %The remaining options relate to dates and times, which are still
2023 %experimental. You need to enable date and time parsing with
2024 %\setbaseopt{ datetime = \brackets{parse} }.
2025 %
2026 %\begin{docKey}[NZ]{date-style}{=\meta{style}}{initially \opt{mdyyyy}}
2027 %Sets the current date style. The value may be one of:
2028 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
2029 %\docValue{yyyymd} (year month day),
2030 %\docValue{dmyy} (day month 2-digit year),
2031 %\docValue{mdyy} (month day 2-digit year), or
2032 %\docValue{yymd} (2-digit year month day).
2033 %\end{docKey}
2034 %
2035 %\begin{docKey}[NZ]{date-variant}{=\meta{style}}{initially \opt{slash}}
2036 %Sets the current numeric date separator.
2037 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
2038 %(\code{-}), \docValue{dot} (\code{.}) or
2039 %\docValue{dialect} (if the language supports it).
2040 %\end{docKey}
2041 %
2042 %\begin{docKey}[NZ]{time-variant}{=\meta{style}}{initially \opt{colon}}
2043 %Sets the current numeric time separator.
2044 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
2045 %\docValue{dialect} (if the language supports it),
2046 %\docValue{dialect-colon} (if the language supports it), or
2047 %\docValue{dialect-dot} (if the language supports it).
2048 %\end{docKey}
2049 %
2050 %\begin{dispExample}
2051 %\DTLsetup{datetime={parse}}
2052 %\DTLsetLocaleOptions{NZ}{
2053 % date-style=mdyyyy,
2054 % date-variant = dialect,
2055 % time-variant = dot
2056 %}
2057 %\DTLparse\result{February 28, 2025 3.45pm AEDT}
2058 %String: \result.
2059 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
2060 %Numeric value: \DTLdatumvalue{\result}.
2061 %
2062 %\ExplSyntaxOn
2063 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
2064 %Time-stamp: ~ \l_tmpa_tl
2065 %\ExplSyntaxOff
2066 %\end{dispExample}
2067 %
2068 %\begin{docCommand}{datatoolNZSetNumberChars}{}
2069 %Hook to switch to NZ number group and decimal characters.
2070 %\end{docCommand}
2071 %
2072 %\begin{docCommand}{datatoolNZcurrencyfmt}{}
2073 %Used to format the NZD currency. This supports the currency symbol
2074 %prefix.
2075 %\end{docCommand}
2076 %
2077 %\begin{docCommand}{DTLNZLocaleHook}{}
2078 %Hook to switch to NZ settings. This may be added to the captions
2079 %hook by \sty{datatool-base}, depending on the settings. Otherwise
2080 %it can be explicitly used to switch to this region.
2081 %\end{docCommand}
2082 %
2083 %\section{Region \qt{US}}
2084 %\DTLenLocaleHook
2085 %\DTLUSLocaleHook
2086 %
2087 %The \file{datatool-US.ldf} file provides support for region \qt{US}
2088 %(United States). This defines the \qt{USD} currency and sets it as
2089 %the default currency. The default number group character is a
2090 %comma, and the default decimal character is a dot.
2091 %
2092 %If there's no caption hook and you have multiple locales, you will
2093 %need to set both the language and region hooks. For example, this
2094 %document has:
2095 %\begin{dispListing}
2096 %\DTLenLocaleHook
2097 %\DTLUSLocaleHook
2098 %\end{dispListing}
2099 %
2100 %\begin{dispExample*}{title={Default Styles}}
2101 %\DTLdecimaltolocale{12345}{\result}\result.
2102 %(Value: \DTLdatumvalue{\result}.)
2103 %
2104 %\DTLdecimaltolocale{12345.678}{\result}\result.
2105 %(Value: \DTLdatumvalue{\result}.)
2106 %
2107 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
2108 %(Value: \DTLdatumvalue{\result}.)
2109 %
2110 %\DTLmul\result{\result}{0.5}\result.
2111 %(Value: \DTLdatumvalue{\result}.)
2112 %\end{dispExample*}
2113 %Remember that date-time parsing needs to be enabled, if required.
2114 %\begin{dispExample*}{title={Default Date-Time Styles}}
2115 %\DTLsetup{datetime={parse}}
2116 %\DTLparse\result{2/28/2025 15:45 PST}
2117 %String: \result.
2118 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
2119 %Numeric value: \DTLdatumvalue{\result}.
2120 %
2121 %\ExplSyntaxOn
2122 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
2123 %Time-stamp: ~ \l_tmpa_tl
2124 %\ExplSyntaxOff
2125 %\end{dispExample*}
2126 %
2127 %Options may be set with \setlocaleopts{US}. Available options are
2128 %listed below.
2129 %
2130 %\begin{docKey}[US]{currency-symbol-prefix}{=\meta{boolean}}{initially \opt{false}}
2131 %If true, shows the region prefix before the currency symbol if
2132 %the \opt{numeric} setting \opt{currency-symbol-style} is not set to \qt{iso}.
2133 %The prefix font may be changed to smallcaps or smaller with
2134 %\setbaseopt{ numeric = \brackets{ region-currency-prefix = \meta{value} } }
2135 %where \meta{value} is \opt{smallcaps} or \opt{smaller}.
2136 %\end{docKey}
2137 %
2138 %\begin{dispExample}
2139 %\DTLsetup{numeric={region-currency-prefix=smallcaps}}
2140 %\DTLsetLocaleOptions{US}{currency-symbol-prefix}
2141 %\DTLdecimaltocurrency{12345.678}{\result}\result
2142 %\end{dispExample}
2143 %
2144 %
2145 %\begin{docKey}[US]{currency-symbol-position}{=\meta{value}}{initially \opt{before}}
2146 %Adjusts the formatting currency style. If \docValue{before}, the
2147 %currency symbol is placed before the value. If \docValue{after}, the
2148 %currency symbol is placed after the value.
2149 %\end{docKey}
2150 %
2151 %\begin{dispExample}
2152 %\DTLsetup{numeric={currency-symbol-style=iso}}
2153 %\DTLsetLocaleOptions{US}{currency-symbol-position=after}
2154 %\DTLdecimaltocurrency{12345.678}{\result}\result
2155 %\end{dispExample}
2156 %
2157 %\begin{docKey}[US]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
2158 %Sets the separator to use between the currency symbol (not code) and the value.
2159 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
2160 %(a thin space), \docValue{space} (a normal space), or
2161 %\docValue{nbsp} (a non-breaking space).
2162 %\end{docKey}
2163 %
2164 %\begin{dispExample}
2165 %\DTLsetLocaleOptions{US}{currency-symbol-sep=thin-space}
2166 %\DTLdecimaltocurrency{12345.678}{\result}\result
2167 %\end{dispExample}
2168 %
2169 %\begin{docKey}[US]{number-style}{=\meta{setting}}{initially \opt{official}}
2170 %Sets the number group and decimal characters. The value may be one
2171 %of: \docValue{official} (comma number group and decimal point), or
2172 %\docValue{unofficial} (thin space number group and decimal point).
2173 %In the case of \docValue{unofficial}, a normal space may also be used
2174 %when parsing.
2175 %\end{docKey}
2176 %
2177 %\begin{dispExample}
2178 %\DTLsetup{numeric={auto-reformat}}
2179 %\DTLsetLocaleOptions{US}{number-style=unofficial}
2180 %\DTLdecimaltocurrency{12345.678}{\result}\result.
2181 %(Value: \DTLdatumvalue{\result}.)
2182 %
2183 %\DTLparse{\result}{\$12 345.678}\result.
2184 %(Value: \DTLdatumvalue{\result}.)
2185 %\end{dispExample}
2186 %
2187 %The remaining options relate to dates and times, which are still
2188 %experimental. You need to enable date and time parsing with
2189 %\setbaseopt{ datetime = \brackets{parse} }.
2190 %
2191 %\begin{docKey}[US]{date-style}{=\meta{style}}{initially \opt{mdyyyy}}
2192 %Sets the current date style. The value may be one of:
2193 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
2194 %\docValue{yyyymd} (year month day),
2195 %\docValue{dmyy} (day month 2-digit year),
2196 %\docValue{mdyy} (month day 2-digit year), or
2197 %\docValue{yymd} (2-digit year month day).
2198 %\end{docKey}
2199 %
2200 %\begin{docKey}[US]{date-variant}{=\meta{style}}{initially \opt{slash}}
2201 %Sets the current numeric date separator.
2202 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
2203 %(\code{-}), \docValue{dot} (\code{.}) or
2204 %\docValue{dialect} (if the language supports it).
2205 %\end{docKey}
2206 %
2207 %\begin{docKey}[US]{time-variant}{=\meta{style}}{initially \opt{colon}}
2208 %Sets the current numeric time separator.
2209 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
2210 %\docValue{dialect} (if the language supports it),
2211 %\docValue{dialect-colon} (if the language supports it), or
2212 %\docValue{dialect-dot} (if the language supports it).
2213 %\end{docKey}
2214 %
2215 %\begin{dispExample}
2216 %\DTLsetup{datetime={parse}}
2217 %\DTLsetLocaleOptions{US}{
2218 % date-style=mdyyyy,
2219 % date-variant = dialect,
2220 % time-variant = dot
2221 %}
2222 %\DTLparse\result{February 28, 2025 3.45pm EST}
2223 %String: \result.
2224 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
2225 %Numeric value: \DTLdatumvalue{\result}.
2226 %
2227 %\ExplSyntaxOn
2228 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
2229 %Time-stamp: ~ \l_tmpa_tl
2230 %\ExplSyntaxOff
2231 %\end{dispExample}
2232 %
2233 %\begin{docCommand}{datatoolUSSetNumberChars}{}
2234 %Hook to switch to US number group and decimal characters.
2235 %\end{docCommand}
2236 %
2237 %\begin{docCommand}{datatoolUScurrencyfmt}{}
2238 %Used to format the USD currency. This supports the currency symbol
2239 %prefix.
2240 %\end{docCommand}
2241 %
2242 %\begin{docCommand}{DTLUSLocaleHook}{}
2243 %Hook to switch to US settings. This may be added to the captions
2244 %hook by \sty{datatool-base}, depending on the settings. Otherwise
2245 %it can be explicitly used to switch to this region.
2246 %\end{docCommand}
2247 %
2248 %\section{Region \qt{ZA}}
2249 %\DTLenLocaleHook
2250 %\DTLenZALocaleHook
2251 %\DTLZALocaleHook
2252 %
2253 %The \file{datatool-ZA.ldf} file provides support for region \qt{ZA}
2254 %(South Africa). This supplies the currency (ZAR) but number formatting
2255 %depends on the language, so this requires specific language \&
2256 %region files, which should be provided by the applicable language
2257 %module. For example, \sty{datatool-english} provides
2258 %\file{datatool-en-ZA.ldf}.
2259 %
2260 %If there's no caption hook and you have multiple locales, you will
2261 %need to set both the language and region hooks. For example, this
2262 %document has:
2263 %\begin{dispListing}
2264 %\DTLenLocaleHook
2265 %\DTLenZALocaleHook
2266 %\DTLZALocaleHook
2267 %\end{dispListing}
2268 %
2269 %\begin{dispExample*}{title={Default Styles (with English)}}
2270 %\DTLdecimaltolocale{12345}{\result}\result.
2271 %(Value: \DTLdatumvalue{\result}.)
2272 %
2273 %\DTLdecimaltolocale{12345.678}{\result}\result.
2274 %(Value: \DTLdatumvalue{\result}.)
2275 %
2276 %\DTLdecimaltocurrency{-12345.678}{\result}\result.
2277 %(Value: \DTLdatumvalue{\result}.)
2278 %
2279 %\DTLmul\result{\result}{0,5}\result.
2280 %(Value: \DTLdatumvalue{\result}.)
2281 %\end{dispExample*}
2282 %Remember that date-time parsing needs to be enabled, if required.
2283 %\begin{dispExample*}{title={Default Date-Time Styles}}
2284 %\DTLsetup{datetime={parse}}
2285 %\DTLparse\result{2025-2-28 15:45 SAST}
2286 %String: \result.
2287 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
2288 %Numeric value: \DTLdatumvalue{\result}.
2289 %
2290 %\ExplSyntaxOn
2291 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
2292 %Time-stamp: ~ \l_tmpa_tl
2293 %\ExplSyntaxOff
2294 %\end{dispExample*}
2295 %
2296 %Options may be set with \setlocaleopts{ZA}. Available options are
2297 %listed below.
2298 %
2299 %\begin{docKey}[ZA]{currency-symbol-position}{=\meta{value}}{initially \opt{before}}
2300 %Adjusts the formatting currency style. If \docValue{before}, the
2301 %currency symbol is placed before the value. If \docValue{after}, the
2302 %currency symbol is placed after the value.
2303 %\end{docKey}
2304 %
2305 %\begin{dispExample}
2306 %\DTLsetup{numeric={currency-symbol-style=iso}}
2307 %\DTLsetLocaleOptions{ZA}{currency-symbol-position=after}
2308 %\DTLdecimaltocurrency{12345.678}{\result}\result
2309 %\end{dispExample}
2310 %
2311 %\begin{docKey}[ZA]{currency-symbol-sep}{=\meta{value}}{initially \opt{none}}
2312 %Sets the separator to use between the currency symbol (not code) and the value.
2313 %Permitted values: \docValue{none} (no space), \docValue{thin-space}
2314 %(a thin space), \docValue{space} (a normal space), or
2315 %\docValue{nbsp} (a non-breaking space).
2316 %\end{docKey}
2317 %
2318 %\begin{dispExample}
2319 %\DTLsetLocaleOptions{ZA}{currency-symbol-sep=thin-space}
2320 %\DTLdecimaltocurrency{12345.678}{\result}\result
2321 %\end{dispExample}
2322 %
2323 %\begin{docKey}[ZA]{number-style}{=\meta{style}}{initially \opt{official}}
2324 %Sets the number group and decimal characters. The value may be one
2325 %of: \docValue{official} (dot number group and decimal comma) or
2326 %\docValue{dialect} (attempt to use the number style for
2327 %the module \meta{lang}-ZA, if it's defined, where \meta{lang} is the
2328 %current language tag).
2329 %\end{docKey}
2330 %
2331 %\begin{dispExample}
2332 %\DTLsetLocaleOptions{ZA}{number-style=official}
2333 %\DTLdecimaltocurrency{12345.678}{\result}\result
2334 %\end{dispExample}
2335 %Or if \ldf{en-ZA} has been loaded and the current language is
2336 %English:
2337 %\begin{dispExample}
2338 %\DTLsetLocaleOptions{ZA}{number-style=dialect}
2339 %\DTLdecimaltocurrency{12345.678}{\result}\result
2340 %\end{dispExample}
2341 %
2342 %The remaining options relate to dates and times, which are still
2343 %experimental. You need to enable date and time parsing with
2344 %\setbaseopt{ datetime = \brackets{parse} }.
2345 %
2346 %\begin{docKey}[ZA]{date-style}{=\meta{style}}{initially \opt{yyyymd}}
2347 %Sets the current date style. The value may be one of:
2348 %\docValue{dmyyyy} (day month year), \docValue{mdyyyy} (month day year),
2349 %\docValue{yyyymd} (year month day),
2350 %\docValue{dmyy} (day month 2-digit year),
2351 %\docValue{mdyy} (month day 2-digit year), or
2352 %\docValue{yymd} (2-digit year month day).
2353 %\end{docKey}
2354 %
2355 %\begin{docKey}[ZA]{date-variant}{=\meta{style}}{initially \opt{hyphen}}
2356 %Sets the current numeric date separator.
2357 %Allowed values: \docValue{slash} (\code{/}), \docValue{hyphen}
2358 %(\code{-}), \docValue{dot} (\code{.}) or
2359 %\docValue{dialect} (if the language supports it).
2360 %\end{docKey}
2361 %
2362 %\begin{docKey}[ZA]{time-variant}{=\meta{style}}{initially \opt{colon}}
2363 %Sets the current numeric time separator.
2364 %Allowed values: \docValue{colon} (\code{:}), \docValue{dot} (\code{.}) or
2365 %\docValue{dialect} (if the language supports it),
2366 %\docValue{dialect-colon} (if the language supports it), or
2367 %\docValue{dialect-dot} (if the language supports it).
2368 %\end{docKey}
2369 %
2370 %\begin{dispExample}
2371 %\DTLsetup{datetime={parse}}
2372 %\DTLsetLocaleOptions{ZA}{
2373 % date-style=mdyyyy,
2374 % date-variant = dialect,
2375 % time-variant = dot
2376 %}
2377 %\DTLparse\result{June 1, 2025 3.45pm SAST}
2378 %String: \result.
2379 %Data type: \DTLgetDataTypeName{\DTLdatumtype{\result}}.
2380 %Numeric value: \DTLdatumvalue{\result}.
2381 %
2382 %\ExplSyntaxOn
2383 %\datatool_extract_timestamp:NN \result \l_tmpa_tl
2384 %Time-stamp: ~ \l_tmpa_tl
2385 %\ExplSyntaxOff
2386 %\end{dispExample}
2387 %\begin{docCommand}{datatoolZASetNumberChars}{}
2388 %Hook to switch to ZA number group and decimal characters.
2389 %\end{docCommand}
2390 %
2391 %\begin{docCommand}{datatoolZAcurrencyfmt}{}
2392 %Used to format the ZAR currency.
2393 %\end{docCommand}
2394 %
2395 %\begin{docCommand}{DTLZALocaleHook}{}
2396 %Hook to switch to ZA settings. This may be added to the captions
2397 %hook by \sty{datatool-base}, depending on the settings. Otherwise
2398 %it can be explicitly used to switch to this region.
2399 %\end{docCommand}
2400 %
2401 %\StopEventually{%
2402 % \PrintChanges
2403 % \PrintIndex
2404 %}
2405 %
2406 %
2407 %\chapter{The Code}
2408 %\iffalse
2409 % \begin{macrocode}
2410 %<*datatool-AU.ldf>
2411 % \end{macrocode}
2412 %\fi
2413 %\section{datatool-AU.ldf}\label{sec:datatool-AU}
2414 % Support for region AU.
2415 % \begin{macrocode}
2416 \TrackLangProvidesResource{AU}[2025/03/01 v1.0]
2417 % \end{macrocode}
2418 % Switch on \LaTeX3 syntax:
2419 % \begin{macrocode}
2420 \ExplSyntaxOn
2421 % \end{macrocode}
2422 %
2423 %\subsection{Numbers and Currency}
2424 %Set the number group and decimal symbols for this region.
2425 % \begin{macrocode}
2426 \cs_new:Nn \datatool_AU_set_numberchars_official:
2427 {
2428 \datatool_set_numberchars:nn { , } { . }
2429 }
2430 % \end{macrocode}
2431 %Unofficial style.
2432 % \begin{macrocode}
2433 \cs_new:Nn \datatool_AU_set_numberchars_unofficial:
2434 {
2435 \datatool_set_thinspace_group_decimal_char:n { . }
2436 }
2437 % \end{macrocode}
2438 %Hook to set the number group and decimal characters for the region:
2439 % \begin{macrocode}
2440 \newcommand \datatoolAUSetNumberChars
2441 {
2442 \bool_if:NT \l_datatool_region_set_numberchars_bool
2443 {
2444 \datatool_AU_set_numberchars_official:
2445 }
2446 }
2447 % \end{macrocode}
2448 %How to format the position of the currency symbol in relation to the value.
2449 % \begin{macrocode}
2450 \cs_new:Nn \datatool_AU_currency_position:nn
2451 {
2452 \dtlcurrprefixfmt { #1 } { #2 }
2453 }
2454 % \end{macrocode}
2455 %Separator between currency symbol and value.
2456 % \begin{macrocode}
2457 \tl_new:N \l_datatool_AU_sym_sep_tl
2458 % \end{macrocode}
2459 % Set the currency format for this region.
2460 % \begin{macrocode}
2461 \newcommand \datatoolAUcurrencyfmt [ 2 ]
2462 {
2463 \datatool_AU_currency_position:nn
2464 {
2465 \datatoolAUsymbolprefix { AU }
2466 #1
2467 }
2468 { #2 }
2469 }
2470 % \end{macrocode}
2471 %Prefix for symbol, if required.
2472 % \begin{macrocode}
2473 \newcommand \datatoolAUsymbolprefix [ 1 ] { }
2474 % \end{macrocode}
2475 % Define the currency symbols for this region.
2476 % \begin{macrocode}
2477 \datatool_def_currency:nnnV
2478 { \datatoolAUcurrencyfmt }
2479 { AUD }
2480 { \$ }
2481 \c_dollar_str
2482 % \end{macrocode}
2483 % Register the currency code with this region:
2484 % \begin{macrocode}
2485 \datatool_register_regional_currency_code:nn { AU } { AUD }
2486 % \end{macrocode}
2487 % Provide a command to set the currency for this region (for use
2488 % with any hook used when the locale changes).
2489 % NB this should do nothing with
2490 % \verb|\DTLsetup{region-currency=false}|
2491 % \begin{macrocode}
2492 \newcommand \datatoolAUSetCurrency
2493 {
2494 \bool_if:NT \l_datatool_region_set_currency_bool
2495 {
2496 \DTLsetdefaultcurrency { AUD }
2497 % \end{macrocode}
2498 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
2499 % \begin{macrocode}
2500 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
2501 % \end{macrocode}
2502 %Separator between symbol and value:
2503 % \begin{macrocode}
2504 \renewcommand \dtlcurrfmtsymsep { \l_datatool_AU_sym_sep_tl }
2505 }
2506 }
2507 % \end{macrocode}
2508 %
2509 %\subsection{Date and Time Parsing}
2510 % This defaults to day/month/year but may be changed with \cs{DTLsetLocaleOptions}. For example:
2511 %\begin{dispListing}
2512 %\DTLsetLocaleOptions{AU}{date-style=dmyyyy, date-variant=slash}
2513 %\end{dispListing}
2514 %An appropriate language file will need to also be installed to
2515 %parse dates containing month names or day of week names.
2516 %
2517 %Provide a way to configure parsing style.
2518 % \begin{macrocode}
2519 \tl_new:N \l__datatool_AU_datevariant_tl
2520 \tl_set:Nn \l__datatool_AU_datevariant_tl { slash }
2521 % \end{macrocode}
2522 %NB These token lists are used to form command names. The following is not
2523 %a format string.
2524 % \begin{macrocode}
2525 \tl_new:N \l__datatool_AU_datestyle_tl
2526 \tl_set:Nn \l__datatool_AU_datestyle_tl { ddmmyyyy }
2527 \tl_new:N \l__datatool_AU_timevariant_tl
2528 \tl_set:Nn \l__datatool_AU_timevariant_tl { colon }
2529 % \end{macrocode}
2530 %
2531 %Each parsing command defined below has final \marg{true} and \marg{false}
2532 %arguments (\code{TF}). These are used if parsing was successful (true) or if
2533 %parsing failed (false). The internal commands used by
2534 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
2535 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
2536 %not as conditionals.
2537 %
2538 %\subsubsection{Time Stamp Parsing}
2539 %Use command
2540 %\begin{definition}
2541 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
2542 %\end{definition}
2543 %with date regular expression
2544 %\begin{definition}
2545 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
2546 %\end{definition}
2547 %and time regular expression
2548 %\begin{definition}
2549 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
2550 %\end{definition}
2551 % \begin{macrocode}
2552 \cs_new:Nn \datatool_AU_parse_timestamp:NnTF
2553 {
2554 \cs_if_exist:cTF
2555 {
2556 datatool_
2557 \l__datatool_AU_datestyle_tl
2558 _hhmmss_tz_parse_timestamp:ccNnTF
2559 }
2560 {
2561 \cs_if_exist:cTF
2562 {
2563 c_datatool_
2564 \l__datatool_AU_datevariant_tl
2565 _
2566 \l__datatool_AU_datestyle_tl
2567 _date_regex
2568 }
2569 {
2570 \cs_if_exist:cTF
2571 {
2572 c_datatool_
2573 \l__datatool_AU_timevariant_tl
2574 _hhmmss_time_regex
2575 }
2576 {
2577 \use:c
2578 {
2579 datatool_
2580 \l__datatool_AU_datestyle_tl
2581 _hhmmss_tz_parse_timestamp:ccNnTF
2582 }
2583 {
2584 c_datatool_
2585 \l__datatool_AU_datevariant_tl
2586 _
2587 \l__datatool_AU_datestyle_tl
2588 _date_regex
2589 }
2590 {
2591 c_datatool_
2592 \l__datatool_AU_timevariant_tl
2593 _hhmmss_time_regex
2594 }
2595 #1 { #2 } { #3 } { #4 }
2596 }
2597 {
2598 \datatool_warn_check_head_language_empty:Vnnn
2599 \l__datatool_AU_timevariant_tl
2600 { datatool-AU }
2601 {
2602 No ~ language ~ support ~ for ~ time ~ variant ~
2603 ` \exp_args:Ne \tl_tail:n { \l__datatool_AU_timevariant_tl } '
2604 }
2605 {
2606 No ~ support ~ for ~ time ~ variant ~
2607 ` \l__datatool_AU_timevariant_tl '
2608 }
2609 #4
2610 }
2611 }
2612 {
2613 \datatool_warn_check_head_language_empty:Vnnn
2614 \l__datatool_AU_datevariant_tl
2615 { datatool-AU }
2616 {
2617 No ~ language ~ support ~ for ~ date ~ style ~
2618 ` \l__datatool_AU_datestyle_tl '
2619 }
2620 {
2621 No ~ support ~ for ~ date ~ style ~
2622 ` \l__datatool_AU_datestyle_tl ' ~ with ~
2623 variant ~
2624 ` \l__datatool_AU_datevariant_tl '
2625 }
2626 #4
2627 }
2628 }
2629 {
2630 \datatool_locale_warn:nn { datatool-AU }
2631 {
2632 No ~ support ~ for ~ date ~ style ~
2633 ` \l__datatool_AU_datestyle_tl '
2634 }
2635 #4
2636 }
2637 }
2638 % \end{macrocode}
2639 %
2640 %\subsubsection{Date Parsing}
2641 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
2642 %with regular expression
2643 %\begin{definition}
2644 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
2645 %\end{definition}
2646 % \begin{macrocode}
2647 \cs_new:Nn \datatool_AU_parse_date:NnTF
2648 {
2649 \cs_if_exist:cTF
2650 {
2651 datatool_
2652 \l__datatool_AU_datestyle_tl
2653 _parse_date:NNnTF
2654 }
2655 {
2656 \cs_if_exist:cTF
2657 {
2658 c_datatool_
2659 \l__datatool_AU_datevariant_tl
2660 _anchored_
2661 \l__datatool_AU_datestyle_tl
2662 _date_regex
2663 }
2664 {
2665 \exp_args:cc
2666 {
2667 datatool_
2668 \l__datatool_AU_datestyle_tl
2669 _parse_date:NNnTF
2670 }
2671 {
2672 c_datatool_
2673 \l__datatool_AU_datevariant_tl
2674 _anchored_
2675 \l__datatool_AU_datestyle_tl
2676 _date_regex
2677 }
2678 #1 { #2 } { #3 } { #4 }
2679 }
2680 {
2681 \datatool_warn_check_head_language_empty:Vnnn
2682 \l__datatool_AU_datevariant_tl
2683 { datatool-AU }
2684 {
2685 No ~ language ~ support ~ for ~ date ~ style ~
2686 ` \l__datatool_AU_datestyle_tl '
2687 }
2688 {
2689 No ~ support ~ for ~ date ~ style ~
2690 ` \l__datatool_AU_datestyle_tl ' ~ with ~
2691 variant ~
2692 ` \l__datatool_AU_datevariant_tl '
2693 }
2694 #4
2695 }
2696 }
2697 {
2698 \datatool_locale_warn:nn { datatool-AU }
2699 {
2700 No ~ support ~ for ~ date ~ style ~
2701 ` \l__datatool_AU_datestyle_tl '
2702 }
2703 #4
2704 }
2705 }
2706 % \end{macrocode}
2707 %
2708 %\subsubsection{Time Parsing}
2709 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
2710 %with regular expression
2711 %\begin{definition}
2712 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
2713 %\end{definition}
2714 % \begin{macrocode}
2715 \cs_new:Nn \datatool_AU_parse_time:NnTF
2716 {
2717 \cs_if_exist:cTF
2718 {
2719 c_datatool_
2720 \l__datatool_AU_timevariant_tl
2721 _anchored_hhmmss_time_regex
2722 }
2723 {
2724 \datatool_hhmmss_parse_time:cNnTF
2725 {
2726 c_datatool_
2727 \l__datatool_AU_timevariant_tl
2728 _anchored_hhmmss_time_regex
2729 }
2730 #1 { #2 } { #3 } { #4 }
2731 }
2732 {
2733 \datatool_warn_check_head_language_empty:Vnnn
2734 \l__datatool_AU_timevariant_tl
2735 { datatool-AU }
2736 {
2737 No ~ language ~ support ~ for ~ time ~ variant ~
2738 ` \exp_args:Ne \tl_tail:n { \l__datatool_AU_timevariant_tl } '
2739 }
2740 {
2741 No ~ support ~ for ~ time ~ variant ~
2742 ` \l__datatool_AU_timevariant_tl '
2743 }
2744 #4
2745 }
2746 }
2747 % \end{macrocode}
2748 %
2749 %\subsubsection{Time Zone Mappings}
2750 %Define time zone mapping command for this region:
2751 % \begin{macrocode}
2752 \cs_new:Nn \datatool_AU_get_timezone_map:n
2753 {
2754 \datatool_region_get_timezone_map:n { AU / #1 }
2755 }
2756 % \end{macrocode}
2757 %Define time zone IDs for this region (one-way map from ID to offset):
2758 % \begin{macrocode}
2759 \datatool_region_set_timezone_map:nn { AU / ACST } { +09:30 }
2760 \datatool_region_set_timezone_map:nn { AU / ACDT } { +10:30 }
2761 \datatool_region_set_timezone_map:nn { AU / ACWST } { +08:45 }
2762 \datatool_region_set_timezone_map:nn { AU / ACWDT } { +09:00 }
2763 \datatool_region_set_timezone_map:nn { AU / AEST } { +10:00 }
2764 \datatool_region_set_timezone_map:nn { AU / AEDT } { +11:00 }
2765 \datatool_region_set_timezone_map:nn { AU / CXT } { +07:00 }
2766 \datatool_region_set_timezone_map:nn { AU / NFT } { +11:00 }
2767 \datatool_region_set_timezone_map:nn { AU / NFDT } { +12:00 }
2768 \datatool_region_set_timezone_map:nn { AU / LHST } { +10:30 }
2769 \datatool_region_set_timezone_map:nn { AU / LHDT } { +11:00 }
2770 \datatool_region_set_timezone_map:nn { AU / CCT } { +06:30 }
2771 % \end{macrocode}
2772 %
2773 %\subsection{Options}
2774 %Define options for this region:
2775 % \begin{macrocode}
2776 \datatool_locale_define_keys:nn { AU }
2777 {
2778 number-style .choices:nn =
2779 { official, unofficial }
2780 {
2781 \exp_args:NNe \renewcommand
2782 \datatoolAUSetNumberChars
2783 {
2784 \exp_not:N \bool_if:NT
2785 \exp_not:N \l_datatool_region_set_numberchars_bool
2786 {
2787 \exp_not:c { datatool_AU_set_numberchars_ \l_keys_choice_tl : }
2788 }
2789 }
2790 \tl_if_eq:NnT \l_datatool_current_region_tl { AU }
2791 {
2792 \datatoolAUSetNumberChars
2793 }
2794 } ,
2795 % \end{macrocode}
2796 % Currency symbol before or after value:
2797 % \begin{macrocode}
2798 currency-symbol-position .choice: ,
2799 currency-symbol-position / before .code:n =
2800 {
2801 \cs_set_eq:NN \datatool_AU_currency_position:nn \dtlcurrprefixfmt
2802 } ,
2803 currency-symbol-position / after .code:n =
2804 {
2805 \cs_set_eq:NN \datatool_AU_currency_position:nn \dtlcurrsuffixfmt
2806 } ,
2807 % \end{macrocode}
2808 % Should the currency symbol be prefixed with the region code:
2809 % \begin{macrocode}
2810 currency-symbol-prefix .choice: ,
2811 currency-symbol-prefix / false .code:n =
2812 {
2813 \cs_set_eq:NN \datatoolAUsymbolprefix \use_none:n
2814 } ,
2815 currency-symbol-prefix / true .code:n =
2816 {
2817 \cs_set_eq:NN
2818 \datatoolAUsymbolprefix
2819 \datatool_currency_symbol_region_prefix:n
2820 } ,
2821 currency-symbol-prefix .default:n = { true } ,
2822 % \end{macrocode}
2823 % Separator between currency symbol (not code) and value:
2824 % \begin{macrocode}
2825 currency-symbol-sep .choice: ,
2826 currency-symbol-sep / none .code:n =
2827 {
2828 \tl_clear:N \l_datatool_AU_sym_sep_tl
2829 } ,
2830 currency-symbol-sep / thin-space .code:n =
2831 {
2832 \tl_set:Nn \l_datatool_AU_sym_sep_tl { \, }
2833 } ,
2834 currency-symbol-sep / space .code:n =
2835 {
2836 \tl_set:Nn \l_datatool_AU_sym_sep_tl { ~ }
2837 } ,
2838 currency-symbol-sep / nbsp .code:n =
2839 {
2840 \tl_set:Nn \l_datatool_AU_sym_sep_tl { \nobreakspace }
2841 } ,
2842 currency-symbol-sep . initial:n = { none } ,
2843 % \end{macrocode}
2844 % Date and time styles:
2845 % \begin{macrocode}
2846 date-style .choice: ,
2847 date-style / dmyyyy .code: n =
2848 {
2849 \tl_set:Nn \l__datatool_AU_datestyle_tl { ddmmyyyy }
2850 } ,
2851 date-style / mdyyyy .code: n =
2852 {
2853 \tl_set:Nn \l__datatool_AU_datestyle_tl { mmddyyyy }
2854 } ,
2855 date-style / yyyymd .code: n =
2856 {
2857 \tl_set:Nn \l__datatool_AU_datestyle_tl { yyyymmdd }
2858 } ,
2859 date-style / dmyy .code: n =
2860 {
2861 \tl_set:Nn \l__datatool_AU_datestyle_tl { ddmmyy }
2862 } ,
2863 date-style / mdyy .code: n =
2864 {
2865 \tl_set:Nn \l__datatool_AU_datestyle_tl { mmddyy }
2866 } ,
2867 date-style / yymd .code: n =
2868 {
2869 \tl_set:Nn \l__datatool_AU_datestyle_tl { yymmdd }
2870 } ,
2871 date-variant .choice: ,
2872 date-variant / slash .code:n =
2873 {
2874 \tl_set:Nn \l__datatool_AU_datevariant_tl { slash }
2875 } ,
2876 date-variant / hyphen .code:n =
2877 {
2878 \tl_set:Nn \l__datatool_AU_datevariant_tl { hyphen }
2879 } ,
2880 date-variant / dot .code:n =
2881 {
2882 \tl_set:Nn \l__datatool_AU_datevariant_tl { dot }
2883 } ,
2884 date-variant / dialect .code:n =
2885 {
2886 \tl_set:Nn \l__datatool_AU_datevariant_tl
2887 { \l_datatool_current_language_tl }
2888 } ,
2889 time-variant .choice: ,
2890 time-variant / colon .code:n =
2891 {
2892 \tl_set:Nn \l__datatool_AU_timevariant_tl { colon }
2893 } ,
2894 time-variant / dot .code:n =
2895 {
2896 \tl_set:Nn \l__datatool_AU_timevariant_tl { dot }
2897 } ,
2898 time-variant / dialect .code:n =
2899 {
2900 \tl_if_eq:NnTF \l__datatool_AU_timevariant_tl { dot }
2901 {
2902 \tl_set:Nn \l__datatool_AU_timevariant_tl
2903 { \l_datatool_current_language_tl _dot }
2904 }
2905 {
2906 \tl_if_in:NnF
2907 \l__datatool_AU_timevariant_tl
2908 { \l_datatool_current_language_tl }
2909 {
2910 \tl_set:Nn \l__datatool_AU_timevariant_tl
2911 { \l_datatool_current_language_tl _colon }
2912 }
2913 }
2914 } ,
2915 time-variant / dialect-colon .code:n =
2916 {
2917 \tl_set:Nn \l__datatool_AU_timevariant_tl
2918 { \l_datatool_current_language_tl _colon }
2919 } ,
2920 time-variant / dialect-dot .code:n =
2921 {
2922 \tl_set:Nn \l__datatool_AU_timevariant_tl
2923 { \l_datatool_current_language_tl _dot }
2924 } ,
2925 }
2926 % \end{macrocode}
2927 %
2928 %\subsection{Hooks}
2929 %Command to update temporal parsing commands for this region:
2930 % \begin{macrocode}
2931 \newcommand \datatoolAUSetTemporalParsers
2932 {
2933 \renewcommand \DTLCurrentLocaleParseTimeStamp
2934 { \datatool_AU_parse_timestamp:NnTF }
2935 \renewcommand \DTLCurrentLocaleParseDate
2936 { \datatool_AU_parse_date:NnTF }
2937 \renewcommand \DTLCurrentLocaleParseTime
2938 { \datatool_AU_parse_time:NnTF }
2939 \let
2940 \DTLCurrentLocaleGetTimeZoneMap
2941 \datatool_AU_get_timezone_map:n
2942 }
2943 % \end{macrocode}
2944 %Set temporal formatting commands for this region. Currently this
2945 %just resets to the default, but may change in future.
2946 %Note that the defaults test if the applicable \sty{datetime2}
2947 %command is available and will fallback on ISO if not defined.
2948 %Bear in mind that the default style for \sty{datetime2} is
2949 %\texttt{iso} so there won't be a noticeable difference unless the
2950 %\sty{datetime2} regional setting is on.
2951 % \begin{macrocode}
2952 \newcommand \datatoolAUSetTemporalFormatters
2953 {
2954 \let
2955 \DTLCurrentLocaleFormatDate
2956 \datatool_default_date_fmt:nnnn
2957 \let
2958 \DTLCurrentLocaleFormatTime
2959 \datatool_default_time_fmt:nnn
2960 \let
2961 \DTLCurrentLocaleFormatTimeZone
2962 \datatool_default_timezone_fmt:nn
2963 \let
2964 \DTLCurrentLocaleFormatTimeStampNoZone
2965 \datatool_default_timestamp_fmt:nnnnnnn
2966 \let
2967 \DTLCurrentLocaleFormatTimeStampWithZone
2968 \datatool_default_timestamp_fmt:nnnnnnnnn
2969 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
2970 }
2971 % \end{macrocode}
2972 %
2973 %
2974 %Command to update currency and temporal parsing commands for this region:
2975 % \begin{macrocode}
2976 \newcommand \DTLAULocaleHook
2977 {
2978 \datatoolAUSetNumberChars
2979 \datatoolAUSetCurrency
2980 \datatoolAUSetTemporalParsers
2981 \datatoolAUSetTemporalFormatters
2982 % \end{macrocode}
2983 %Allow language files to reference the region:
2984 % \begin{macrocode}
2985 \tl_set:Nn \l_datatool_current_region_tl { AU }
2986 }
2987 % \end{macrocode}
2988 %
2989 % Finished with \LaTeX3 syntax.
2990 % \begin{macrocode}
2991 \ExplSyntaxOff
2992 % \end{macrocode}
2993 %Note that the hook is added to the captions by \sty{datatool-base}
2994 %not by the region file.
2995 %\iffalse
2996 % \begin{macrocode}
2997 %</datatool-AU.ldf>
2998 % \end{macrocode}
2999 %\fi
3000 %\iffalse
3001 % \begin{macrocode}
3002 %<*datatool-BE.ldf>
3003 % \end{macrocode}
3004 %\fi
3005 %\section{datatool-BE.ldf}\label{sec:code:datatool-BE}
3006 % Support for region BE.
3007 % \begin{macrocode}
3008 \TrackLangProvidesResource{BE}[2025/03/01 v1.0]
3009 % \end{macrocode}
3010 % Switch on \LaTeX3 syntax:
3011 % \begin{macrocode}
3012 \ExplSyntaxOn
3013 % \end{macrocode}
3014 %
3015 %\subsection{Numbers and Currency}
3016 %Default style is to use dot separator and decimal dot.
3017 %If a French language module is developed, it will need to
3018 %provide a file called \file{datatool-fr-BE.ldf} which
3019 %should define a command called
3020 %\cs{datatoolfrBESetNumberChars} to set the
3021 %number group separator to a space.
3022 %(See \file{datatool-en-ZA.ldf} provided with \sty{datatool-english}
3023 %as an example.)
3024 % \begin{macrocode}
3025 \cs_new:Nn \datatool_BE_set_numberchars_default:
3026 {
3027 \DTLsetnumberchars { . } { , }
3028 }
3029 % \end{macrocode}
3030 %Thin-space style.
3031 % \begin{macrocode}
3032 \cs_new:Nn \datatool_BE_set_numberchars_thinspace:
3033 {
3034 \datatool_set_thinspace_group_decimal_char:n { . }
3035 }
3036 % \end{macrocode}
3037 %Check if the dialect has provided a style. If so, use that,
3038 %otherwise use the default.
3039 % \begin{macrocode}
3040 \cs_new:Nn \datatool_BE_set_numberchars_dialect:
3041 {
3042 \tl_if_empty:NTF \l_datatool_current_language_tl
3043 {
3044 \datatool_BE_set_numberchars_default:
3045 }
3046 {
3047 \cs_if_exist_use:cF
3048 { datatool \l_datatool_current_language_tl BESetNumberChars }
3049 {
3050 \datatool_BE_set_numberchars_default:
3051 }
3052 }
3053 }
3054 % \end{macrocode}
3055 %Hook to set the number group and decimal characters for the region:
3056 % \begin{macrocode}
3057 \newcommand \datatoolBESetNumberChars
3058 {
3059 \bool_if:NT \l_datatool_region_set_numberchars_bool
3060 {
3061 \datatool_BE_set_numberchars_dialect:
3062 }
3063 }
3064 % \end{macrocode}
3065 % The EUR currency is already defined by \sty{datatool-base}, but we
3066 % need to register the currency code with this region:
3067 % \begin{macrocode}
3068 \datatool_register_regional_currency_code:nn { BE } { EUR }
3069 % \end{macrocode}
3070 %How to format the position of the currency symbol in relation to the value.
3071 % \begin{macrocode}
3072 \cs_new:Nn \datatool_BE_currency_position:nn
3073 {
3074 \dtlcurrsuffixfmt { #1 } { #2 }
3075 }
3076 % \end{macrocode}
3077 %Separator between currency symbol and value.
3078 % \begin{macrocode}
3079 \tl_new:N \l_datatool_BE_sym_sep_tl
3080 % \end{macrocode}
3081 %
3082 % Provide a command to set the currency for this region (for use
3083 % with any hook used when the locale changes).
3084 % \begin{macrocode}
3085 \newcommand \datatoolBESetCurrency
3086 {
3087 \bool_if:NT \l_datatool_region_set_currency_bool
3088 {
3089 \DTLsetdefaultcurrency { EUR }
3090 % \end{macrocode}
3091 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
3092 % \begin{macrocode}
3093 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
3094 % \end{macrocode}
3095 %Update EUR format to reflect current region style:
3096 % \begin{macrocode}
3097 \renewcommand \DTLdefaultEURcurrencyfmt
3098 { \datatool_BE_currency_position:nn }
3099 % \end{macrocode}
3100 %Separator between symbol and value:
3101 % \begin{macrocode}
3102 \renewcommand \dtlcurrfmtsymsep { \l_datatool_BE_sym_sep_tl }
3103 }
3104 }
3105 % \end{macrocode}
3106 %
3107 %\subsection{Date and Time Parsing}
3108 % Date parsing is more complicated as there seems to be a confusing
3109 % mixture of ISO, day/month/year and month/day/year formats.
3110 % The default is year-month-day but may be changed with
3111 % \cs{DTLsetLocaleOptions}. For example:
3112 %\begin{dispListing}
3113 %\DTLsetLocaleOptions{BE}{date-style=dmyyyy, date-variant=slash}
3114 %\end{dispListing}
3115 %An appropriate language file will need to also be installed to
3116 %parse dates containing month names or day of week names.
3117 %
3118 % \begin{macrocode}
3119 \tl_new:N \l__datatool_BE_datevariant_tl
3120 \tl_set:Nn \l__datatool_BE_datevariant_tl { dot }
3121 % \end{macrocode}
3122 %NB These token lists are used to form command names. The following is not
3123 %a format string.
3124 % \begin{macrocode}
3125 \tl_new:N \l__datatool_BE_datestyle_tl
3126 \tl_set:Nn \l__datatool_BE_datestyle_tl { ddmmyyyy }
3127 \tl_new:N \l__datatool_BE_timevariant_tl
3128 \tl_set:Nn \l__datatool_BE_timevariant_tl { colon }
3129 % \end{macrocode}
3130 %
3131 %Each parsing command defined below has final \marg{true} and \marg{false}
3132 %arguments (\code{TF}). These are used if parsing was successful (true) or if
3133 %parsing failed (false). The internal commands used by
3134 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
3135 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
3136 %not as conditionals.
3137 %
3138 %\subsubsection{Time Stamp Parsing}
3139 %Use command
3140 %\begin{definition}
3141 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
3142 %\end{definition}
3143 %with date regular expression
3144 %\begin{definition}
3145 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
3146 %\end{definition}
3147 %and time regular expression
3148 %\begin{definition}
3149 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
3150 %\end{definition}
3151 % \begin{macrocode}
3152 \cs_new:Nn \datatool_BE_parse_timestamp:NnTF
3153 {
3154 \cs_if_exist:cTF
3155 {
3156 datatool_
3157 \l__datatool_BE_datestyle_tl
3158 _hhmmss_tz_parse_timestamp:ccNnTF
3159 }
3160 {
3161 \cs_if_exist:cTF
3162 {
3163 c_datatool_
3164 \l__datatool_BE_datevariant_tl
3165 _
3166 \l__datatool_BE_datestyle_tl
3167 _date_regex
3168 }
3169 {
3170 \cs_if_exist:cTF
3171 {
3172 c_datatool_
3173 \l__datatool_BE_timevariant_tl
3174 _hhmmss_time_regex
3175 }
3176 {
3177 \use:c
3178 {
3179 datatool_
3180 \l__datatool_BE_datestyle_tl
3181 _hhmmss_tz_parse_timestamp:ccNnTF
3182 }
3183 {
3184 c_datatool_
3185 \l__datatool_BE_datevariant_tl
3186 _
3187 \l__datatool_BE_datestyle_tl
3188 _date_regex
3189 }
3190 {
3191 c_datatool_
3192 \l__datatool_BE_timevariant_tl
3193 _hhmmss_time_regex
3194 }
3195 #1 { #2 } { #3 } { #4 }
3196 }
3197 {
3198 \datatool_locale_warn:nn { datatool-BE }
3199 {
3200 No ~ support ~ for ~ time ~ variant ~
3201 ` \l__datatool_BE_timevariant_tl '
3202 }
3203 #4
3204 }
3205 }
3206 {
3207 \datatool_locale_warn:nn { datatool-BE }
3208 {
3209 No ~ support ~ for ~ date ~ style ~
3210 ` \l__datatool_BE_datestyle_tl ' ~ with ~
3211 variant ~
3212 ` \l__datatool_BE_datevariant_tl '
3213 }
3214 #4
3215 }
3216 }
3217 {
3218 \datatool_locale_warn:nn { datatool-BE }
3219 {
3220 No ~ support ~ for ~ date ~ style ~
3221 ` \l__datatool_BE_datestyle_tl '
3222 }
3223 #4
3224 }
3225 }
3226 % \end{macrocode}
3227 %
3228 %\subsubsection{Date Parsing}
3229 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
3230 %with regular expression
3231 %\begin{definition}
3232 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
3233 %\end{definition}
3234 % \begin{macrocode}
3235 \cs_new:Nn \datatool_BE_parse_date:NnTF
3236 {
3237 \cs_if_exist:cTF
3238 {
3239 datatool_
3240 \l__datatool_BE_datestyle_tl
3241 _parse_date:NNnTF
3242 }
3243 {
3244 \cs_if_exist:cTF
3245 {
3246 c_datatool_
3247 \l__datatool_BE_datevariant_tl
3248 _anchored_
3249 \l__datatool_BE_datestyle_tl
3250 _date_regex
3251 }
3252 {
3253 \exp_args:cc
3254 {
3255 datatool_
3256 \l__datatool_BE_datestyle_tl
3257 _parse_date:NNnTF
3258 }
3259 {
3260 c_datatool_
3261 \l__datatool_BE_datevariant_tl
3262 _anchored_
3263 \l__datatool_BE_datestyle_tl
3264 _date_regex
3265 }
3266 #1 { #2 } { #3 } { #4 }
3267 }
3268 {
3269 \datatool_locale_warn:nn { datatool-BE }
3270 {
3271 No ~ support ~ for ~ date ~ style ~
3272 ` \l__datatool_BE_datestyle_tl ' ~ with ~
3273 variant ~
3274 ` \l__datatool_BE_datevariant_tl '
3275 }
3276 #4
3277 }
3278 }
3279 {
3280 \datatool_locale_warn:nn { datatool-BE }
3281 {
3282 No ~ support ~ for ~ date ~ style ~
3283 ` \l__datatool_BE_datestyle_tl '
3284 }
3285 #4
3286 }
3287 }
3288 % \end{macrocode}
3289 %
3290 %\subsubsection{Time Parsing}
3291 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
3292 %with regular expression
3293 %\begin{definition}
3294 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
3295 %\end{definition}
3296 % \begin{macrocode}
3297 \cs_new:Nn \datatool_BE_parse_time:NnTF
3298 {
3299 \cs_if_exist:cTF
3300 {
3301 c_datatool_
3302 \l__datatool_BE_timevariant_tl
3303 _anchored_hhmmss_time_regex
3304 }
3305 {
3306 \datatool_hhmmss_parse_time:cNnTF
3307 {
3308 c_datatool_
3309 \l__datatool_BE_timevariant_tl
3310 _anchored_hhmmss_time_regex
3311 }
3312 #1 { #2 } { #3 } { #4 }
3313 }
3314 {
3315 \datatool_locale_warn:nn { datatool-BE }
3316 {
3317 No ~ support ~ for ~ time ~ variant ~
3318 ` \l__datatool_BE_timevariant_tl '
3319 }
3320 #4
3321 }
3322 }
3323 % \end{macrocode}
3324 %
3325 %\subsubsection{Time Zone Mapping}
3326 %Define time zone mapping command for this region:
3327 % \begin{macrocode}
3328 \cs_new:Nn \datatool_BE_get_timezone_map:n
3329 {
3330 \datatool_region_get_timezone_map:n { BE / #1 }
3331 }
3332 % \end{macrocode}
3333 %Define time zone IDs for this region (one-way map from ID to offset):
3334 % \begin{macrocode}
3335 \datatool_region_set_timezone_map:nn { BE / WEST } { +01:00 }
3336 \datatool_region_set_timezone_map:nn { BE / WET } { +00:00 }
3337 \datatool_region_set_timezone_map:nn { BE / EEST } { +03:00 }
3338 \datatool_region_set_timezone_map:nn { BE / EET } { +02:00 }
3339 \datatool_region_set_timezone_map:nn { BE / CEST } { +02:00 }
3340 \datatool_region_set_timezone_map:nn { BE / CET } { +01:00 }
3341 \datatool_region_set_timezone_map:nn { BE / GMT } { +00:00 }
3342 % \end{macrocode}
3343 %
3344 %\subsection{Options}
3345 %Define options for this region:
3346 % \begin{macrocode}
3347 \datatool_locale_define_keys:nn { BE }
3348 {
3349 number-style .choices:nn =
3350 { default , dialect , thinspace }
3351 {
3352 \exp_args:NNe \renewcommand
3353 \datatoolBESetNumberChars
3354 {
3355 \exp_not:N \bool_if:NT
3356 \exp_not:N \l_datatool_region_set_numberchars_bool
3357 {
3358 \exp_not:c { datatool_BE_set_numberchars_ \l_keys_choice_tl : }
3359 }
3360 }
3361 \tl_if_eq:NnT \l_datatool_current_region_tl { BE }
3362 {
3363 \datatoolBESetNumberChars
3364 }
3365 } ,
3366 % \end{macrocode}
3367 % Currency symbol before or after value:
3368 % \begin{macrocode}
3369 currency-symbol-position .choice: ,
3370 currency-symbol-position / before .code:n =
3371 {
3372 \cs_set_eq:NN \datatool_BE_currency_position:nn \dtlcurrprefixfmt
3373 } ,
3374 currency-symbol-position / after .code:n =
3375 {
3376 \cs_set_eq:NN \datatool_BE_currency_position:nn \dtlcurrsuffixfmt
3377 } ,
3378 % \end{macrocode}
3379 % Separator between currency symbol (not code) and value:
3380 % \begin{macrocode}
3381 currency-symbol-sep .choice: ,
3382 currency-symbol-sep / none .code:n =
3383 {
3384 \tl_clear:N \l_datatool_BE_sym_sep_tl
3385 } ,
3386 currency-symbol-sep / thin-space .code:n =
3387 {
3388 \tl_set:Nn \l_datatool_BE_sym_sep_tl { \, }
3389 } ,
3390 currency-symbol-sep / space .code:n =
3391 {
3392 \tl_set:Nn \l_datatool_BE_sym_sep_tl { ~ }
3393 } ,
3394 currency-symbol-sep / nbsp .code:n =
3395 {
3396 \tl_set:Nn \l_datatool_BE_sym_sep_tl { \nobreakspace }
3397 } ,
3398 currency-symbol-sep .initial:n = { none } ,
3399 % \end{macrocode}
3400 % Date and time styles:
3401 % \begin{macrocode}
3402 date-style .choice: ,
3403 date-style / dmyyyy .code: n =
3404 {
3405 \tl_set:Nn \l__datatool_BE_datestyle_tl { ddmmyyyy }
3406 } ,
3407 date-style / mdyyyy .code: n =
3408 {
3409 \tl_set:Nn \l__datatool_BE_datestyle_tl { mmddyyyy }
3410 } ,
3411 date-style / yyyymd .code: n =
3412 {
3413 \tl_set:Nn \l__datatool_BE_datestyle_tl { yyyymmdd }
3414 } ,
3415 date-style / dmyy .code: n =
3416 {
3417 \tl_set:Nn \l__datatool_BE_datestyle_tl { ddmmyy }
3418 } ,
3419 date-style / mdyy .code: n =
3420 {
3421 \tl_set:Nn \l__datatool_BE_datestyle_tl { mmddyy }
3422 } ,
3423 date-style / yymd .code: n =
3424 {
3425 \tl_set:Nn \l__datatool_BE_datestyle_tl { yymmdd }
3426 } ,
3427 date-variant .choice: ,
3428 date-variant / slash .code:n =
3429 {
3430 \tl_set:Nn \l__datatool_BE_datevariant_tl { slash }
3431 } ,
3432 date-variant / hyphen .code:n =
3433 {
3434 \tl_set:Nn \l__datatool_BE_datevariant_tl { hyphen }
3435 } ,
3436 date-variant / dot .code:n =
3437 {
3438 \tl_set:Nn \l__datatool_BE_datevariant_tl { dot }
3439 } ,
3440 date-variant / dialect .code:n =
3441 {
3442 \tl_set:Nn \l__datatool_BE_datevariant_tl
3443 { \l_datatool_current_language_tl }
3444 } ,
3445 time-variant .choice: ,
3446 time-variant / colon .code:n =
3447 {
3448 \tl_set:Nn \l__datatool_BE_timevariant_tl { colon }
3449 } ,
3450 time-variant / dot .code:n =
3451 {
3452 \tl_set:Nn \l__datatool_BE_timevariant_tl { dot }
3453 } ,
3454 time-variant / dialect .code:n =
3455 {
3456 \tl_if_eq:NnTF \l__datatool_BE_timevariant_tl { dot }
3457 {
3458 \tl_set:Nn \l__datatool_BE_timevariant_tl
3459 { \l_datatool_current_language_tl _dot }
3460 }
3461 {
3462 \tl_if_in:NnF
3463 \l__datatool_BE_timevariant_tl
3464 { \l_datatool_current_language_tl }
3465 {
3466 \tl_set:Nn \l__datatool_BE_timevariant_tl
3467 { \l_datatool_current_language_tl _colon }
3468 }
3469 }
3470 } ,
3471 time-variant / dialect-colon .code:n =
3472 {
3473 \tl_set:Nn \l__datatool_BE_timevariant_tl
3474 { \l_datatool_current_language_tl _colon }
3475 } ,
3476 time-variant / dialect-dot .code:n =
3477 {
3478 \tl_set:Nn \l__datatool_BE_timevariant_tl
3479 { \l_datatool_current_language_tl _dot }
3480 } ,
3481 }
3482 % \end{macrocode}
3483 %
3484 %\subsection{Hooks}
3485 %Command to update temporal parsing commands for this region:
3486 % \begin{macrocode}
3487 \newcommand \datatoolBESetTemporalParsers
3488 {
3489 \renewcommand \DTLCurrentLocaleParseTimeStamp
3490 { \datatool_BE_parse_timestamp:NnTF }
3491 \renewcommand \DTLCurrentLocaleParseDate
3492 { \datatool_BE_parse_date:NnTF }
3493 \renewcommand \DTLCurrentLocaleParseTime
3494 { \datatool_BE_parse_time:NnTF }
3495 \let
3496 \DTLCurrentLocaleGetTimeZoneMap
3497 \datatool_BE_get_timezone_map:n
3498 }
3499 % \end{macrocode}
3500 %Set temporal formatting commands for this region. Currently this
3501 %just resets to the default, but may change in future.
3502 %Note that the defaults test if the applicable \sty{datetime2}
3503 %command is available and will fallback on ISO if not defined.
3504 %Bear in mind that the default style for \sty{datetime2} is
3505 %\texttt{iso} so there won't be a noticeable difference unless the
3506 %\sty{datetime2} regional setting is on.
3507 % \begin{macrocode}
3508 \newcommand \datatoolBESetTemporalFormatters
3509 {
3510 \let
3511 \DTLCurrentLocaleFormatDate
3512 \datatool_default_date_fmt:nnnn
3513 \let
3514 \DTLCurrentLocaleFormatTime
3515 \datatool_default_time_fmt:nnn
3516 \let
3517 \DTLCurrentLocaleFormatTimeZone
3518 \datatool_default_timezone_fmt:nn
3519 \let
3520 \DTLCurrentLocaleFormatTimeStampNoZone
3521 \datatool_default_timestamp_fmt:nnnnnnn
3522 \let
3523 \DTLCurrentLocaleFormatTimeStampWithZone
3524 \datatool_default_timestamp_fmt:nnnnnnnnn
3525 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
3526 }
3527 % \end{macrocode}
3528 %Command to update currency and temporal parsing commands for this region:
3529 % \begin{macrocode}
3530 \newcommand \DTLBELocaleHook
3531 {
3532 \datatoolBESetNumberChars
3533 \datatoolBESetCurrency
3534 \datatoolBESetTemporalParsers
3535 \datatoolBESetTemporalFormatters
3536 % \end{macrocode}
3537 %Allow language files to reference the region:
3538 % \begin{macrocode}
3539 \tl_set:Nn \l_datatool_current_region_tl { BE }
3540 }
3541 % \end{macrocode}
3542 %
3543 % Finished with \LaTeX3 syntax.
3544 % \begin{macrocode}
3545 \ExplSyntaxOff
3546 % \end{macrocode}
3547 %Note that the hook is added to the captions by \sty{datatool-base}
3548 %not by the region file.
3549 %\iffalse
3550 % \begin{macrocode}
3551 %</datatool-BE.ldf>
3552 % \end{macrocode}
3553 %\fi
3554 %\iffalse
3555 % \begin{macrocode}
3556 %<*datatool-CA.ldf>
3557 % \end{macrocode}
3558 %\fi
3559 %\section{datatool-CA.ldf}\label{sec:code:datatool-CA}
3560 % Support for region CA.
3561 % \begin{macrocode}
3562 \TrackLangProvidesResource{CA}[2025/03/01 v1.0]
3563 % \end{macrocode}
3564 % Switch on \LaTeX3 syntax:
3565 % \begin{macrocode}
3566 \ExplSyntaxOn
3567 % \end{macrocode}
3568 %
3569 %\subsection{Numbers and Currency}
3570 % NB the number group and decimal symbols for this region should be
3571 % set in the files \file{datatool-en-CA.ldf} and
3572 % \file{datatool-fr-CA.ldf} as they depend on both the language
3573 % and region. Those files should be included in the applicable
3574 % \sty{datatool} language module. For example,
3575 % \file{datatool-en-CA.ldf} is provided with
3576 % \file{datatool-english}.
3577 % However, a region hook is still needed to support
3578 %\verb|\DTLsetup{numeric={region-number-chars}}| although it's not
3579 %added to the language hook:
3580 % \begin{macrocode}
3581 \newcommand \datatoolCASetNumberChars
3582 {
3583 \bool_if:NT \l_datatool_region_set_numberchars_bool
3584 {
3585 \tl_if_empty:NTF \l_datatool_current_language_tl
3586 {
3587 \datatool_locale_warn:nn { datatool-CA }
3588 {
3589 No ~ current ~ language: ~ can't ~ set ~
3590 number ~ group ~ and ~ decimal ~ characters
3591 }
3592 }
3593 {
3594 \cs_if_exist_use:cF
3595 { datatool \l_datatool_current_language_tl CASetNumberChars }
3596 {
3597 \datatool_locale_warn:nn { datatool-CA }
3598 {
3599 No ~ support ~ for ~ locale ~
3600 ` \l_datatool_current_language_tl - CA': ~ can't ~ set ~
3601 number ~ group ~ and ~ decimal ~ characters
3602 }
3603 }
3604 }
3605 }
3606 }
3607 % \end{macrocode}
3608 %How to format the position of the currency symbol in relation to the value.
3609 % \begin{macrocode}
3610 \cs_new:Nn \datatool_CA_currency_position:nn
3611 {
3612 \dtlcurrprefixfmt { #1 } { #2 }
3613 }
3614 % \end{macrocode}
3615 %Separator between currency symbol and value.
3616 % \begin{macrocode}
3617 \tl_new:N \l_datatool_CA_sym_sep_tl
3618 % \end{macrocode}
3619 % Set the currency format for this region.
3620 % \begin{macrocode}
3621 \newcommand \datatoolCAcurrencyfmt [ 2 ]
3622 {
3623 \datatool_CA_currency_position:nn
3624 {
3625 \datatoolCAsymbolprefix { CA }
3626 #1
3627 }
3628 { #2 }
3629 }
3630 % \end{macrocode}
3631 %Prefix for symbol, if required.
3632 % \begin{macrocode}
3633 \newcommand \datatoolCAsymbolprefix [ 1 ] { }
3634 % \end{macrocode}
3635 % Define the currency symbols for this region.
3636 % \begin{macrocode}
3637 \datatool_def_currency:nnnV
3638 { \datatoolCAcurrencyfmt }
3639 { CAD }
3640 { \$ }
3641 \c_dollar_str
3642 % \end{macrocode}
3643 %Register the currency code with this region:
3644 % \begin{macrocode}
3645 \datatool_register_regional_currency_code:nn { CA } { CAD }
3646 % \end{macrocode}
3647 % Provide a command to set the currency for this region (for use
3648 % with any hook used when the locale changes).
3649 % NB this should do nothing with
3650 % \verb|\DTLsetup{region-currency=false}|
3651 % \begin{macrocode}
3652 \newcommand \datatoolCASetCurrency
3653 {
3654 \bool_if:NT \l_datatool_region_set_currency_bool
3655 {
3656 \DTLsetdefaultcurrency { CAD }
3657 % \end{macrocode}
3658 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
3659 % \begin{macrocode}
3660 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
3661 % \end{macrocode}
3662 %Separator between symbol and value:
3663 % \begin{macrocode}
3664 \renewcommand \dtlcurrfmtsymsep { \l_datatool_CA_sym_sep_tl }
3665 }
3666 }
3667 % \end{macrocode}
3668 %\subsection{Date and Time Parsing}
3669 % Date parsing is more complicated as there seems to be a confusing
3670 % mixture of ISO, day/month/year and month/day/year formats.
3671 % This defaults to year-month-day and should be changed as
3672 % appropriate using \cs{DTLsetLocaleOptions}. For example:
3673 %\begin{dispListing}
3674 %\DTLsetLocaleOptions{CA}{date-style=dmyyyy, date-variant=slash}
3675 %\end{dispListing}
3676 %An appropriate language file will need to also be installed to
3677 %parse dates containing month names or day of week names.
3678 %
3679 % Provide a way to configure parsing style.
3680 % \begin{macrocode}
3681 \tl_new:N \l__datatool_CA_datevariant_tl
3682 \tl_set:Nn \l__datatool_CA_datevariant_tl { hyphen }
3683 % \end{macrocode}
3684 %NB These token lists are used to form command names. The following is not
3685 %a format string.
3686 % \begin{macrocode}
3687 \tl_new:N \l__datatool_CA_datestyle_tl
3688 \tl_set:Nn \l__datatool_CA_datestyle_tl { yyyymmdd }
3689 \tl_new:N \l__datatool_CA_timevariant_tl
3690 \tl_set:Nn \l__datatool_CA_timevariant_tl { colon }
3691 % \end{macrocode}
3692 %
3693 %Each parsing command defined below has final \marg{true} and \marg{false}
3694 %arguments (\code{TF}). These are used if parsing was successful (true) or if
3695 %parsing failed (false). The internal commands used by
3696 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
3697 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
3698 %not as conditionals.
3699 %
3700 %\subsubsection{Time Stamp Parsing}
3701 %Use command
3702 %\begin{definition}
3703 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
3704 %\end{definition}
3705 %with date regular expression
3706 %\begin{definition}
3707 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
3708 %\end{definition}
3709 %and time regular expression
3710 %\begin{definition}
3711 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
3712 %\end{definition}
3713 % \begin{macrocode}
3714 \cs_new:Nn \datatool_CA_parse_timestamp:NnTF
3715 {
3716 \cs_if_exist:cTF
3717 {
3718 datatool_
3719 \l__datatool_CA_datestyle_tl
3720 _hhmmss_tz_parse_timestamp:ccNnTF
3721 }
3722 {
3723 \cs_if_exist:cTF
3724 {
3725 c_datatool_
3726 \l__datatool_CA_datevariant_tl
3727 _
3728 \l__datatool_CA_datestyle_tl
3729 _date_regex
3730 }
3731 {
3732 \cs_if_exist:cTF
3733 {
3734 c_datatool_
3735 \l__datatool_CA_timevariant_tl
3736 _hhmmss_time_regex
3737 }
3738 {
3739 \use:c
3740 {
3741 datatool_
3742 \l__datatool_CA_datestyle_tl
3743 _hhmmss_tz_parse_timestamp:ccNnTF
3744 }
3745 {
3746 c_datatool_
3747 \l__datatool_CA_datevariant_tl
3748 _
3749 \l__datatool_CA_datestyle_tl
3750 _date_regex
3751 }
3752 {
3753 c_datatool_
3754 \l__datatool_CA_timevariant_tl
3755 _hhmmss_time_regex
3756 }
3757 #1 { #2 } { #3 } { #4 }
3758 }
3759 {
3760 \datatool_locale_warn:nn { datatool-CA }
3761 {
3762 No ~ support ~ for ~ time ~ variant ~
3763 ` \l__datatool_CA_timevariant_tl '
3764 }
3765 #4
3766 }
3767 }
3768 {
3769 \datatool_locale_warn:nn { datatool-CA }
3770 {
3771 No ~ support ~ for ~ date ~ style ~
3772 ` \l__datatool_CA_datestyle_tl ' ~ with ~
3773 variant ~
3774 ` \l__datatool_CA_datevariant_tl '
3775 }
3776 #4
3777 }
3778 }
3779 {
3780 \datatool_locale_warn:nn { datatool-CA }
3781 {
3782 No ~ support ~ for ~ date ~ style ~
3783 ` \l__datatool_CA_datestyle_tl '
3784 }
3785 #4
3786 }
3787 }
3788 % \end{macrocode}
3789 %\subsubsection{Date Parsing}
3790 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
3791 %with regular expression
3792 %\begin{definition}
3793 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
3794 %\end{definition}
3795 % \begin{macrocode}
3796 \cs_new:Nn \datatool_CA_parse_date:NnTF
3797 {
3798 \cs_if_exist:cTF
3799 {
3800 datatool_
3801 \l__datatool_CA_datestyle_tl
3802 _parse_date:NNnTF
3803 }
3804 {
3805 \cs_if_exist:cTF
3806 {
3807 c_datatool_
3808 \l__datatool_CA_datevariant_tl
3809 _anchored_
3810 \l__datatool_CA_datestyle_tl
3811 _date_regex
3812 }
3813 {
3814 \exp_args:cc
3815 {
3816 datatool_
3817 \l__datatool_CA_datestyle_tl
3818 _parse_date:NNnTF
3819 }
3820 {
3821 c_datatool_
3822 \l__datatool_CA_datevariant_tl
3823 _anchored_
3824 \l__datatool_CA_datestyle_tl
3825 _date_regex
3826 }
3827 #1 { #2 } { #3 } { #4 }
3828 }
3829 {
3830 \datatool_locale_warn:nn { datatool-CA }
3831 {
3832 No ~ support ~ for ~ date ~ style ~
3833 ` \l__datatool_CA_datestyle_tl ' ~ with ~
3834 variant ~
3835 ` \l__datatool_CA_datevariant_tl '
3836 }
3837 #4
3838 }
3839 }
3840 {
3841 \datatool_locale_warn:nn { datatool-CA }
3842 {
3843 No ~ support ~ for ~ date ~ style ~
3844 ` \l__datatool_CA_datestyle_tl '
3845 }
3846 #4
3847 }
3848 }
3849 % \end{macrocode}
3850 %\subsubsection{Time Parsing}
3851 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
3852 %with regular expression
3853 %\begin{definition}
3854 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
3855 %\end{definition}
3856 % \begin{macrocode}
3857 \cs_new:Nn \datatool_CA_parse_time:NnTF
3858 {
3859 \cs_if_exist:cTF
3860 {
3861 c_datatool_
3862 \l__datatool_CA_timevariant_tl
3863 _anchored_hhmmss_time_regex
3864 }
3865 {
3866 \datatool_hhmmss_parse_time:cNnTF
3867 {
3868 c_datatool_
3869 \l__datatool_CA_timevariant_tl
3870 _anchored_hhmmss_time_regex
3871 }
3872 #1 { #2 } { #3 } { #4 }
3873 }
3874 {
3875 \datatool_locale_warn:nn { datatool-CA }
3876 {
3877 No ~ support ~ for ~ time ~ variant ~
3878 ` \l__datatool_CA_timevariant_tl '
3879 }
3880 #4
3881 }
3882 }
3883 % \end{macrocode}
3884 %\subsubsection{Time Zone Mappings}
3885 %Define time zone mapping command for this region:
3886 % \begin{macrocode}
3887 \cs_new:Nn \datatool_CA_get_timezone_map:n
3888 {
3889 \datatool_region_get_timezone_map:n { CA / #1 }
3890 }
3891 % \end{macrocode}
3892 %Define time zone IDs for this region (one-way map from ID to offset):
3893 % \begin{macrocode}
3894 \datatool_region_set_timezone_map:nn { CA / NDT } { -02:30 }
3895 \datatool_region_set_timezone_map:nn { CA / NST } { -03:30 }
3896 \datatool_region_set_timezone_map:nn { CA / AST } { -04:00 }
3897 \datatool_region_set_timezone_map:nn { CA / ADT } { -03:00 }
3898 \datatool_region_set_timezone_map:nn { CA / EST } { -05:00 }
3899 \datatool_region_set_timezone_map:nn { CA / EDT } { -04:00 }
3900 \datatool_region_set_timezone_map:nn { CA / CST } { -06:00 }
3901 \datatool_region_set_timezone_map:nn { CA / CDT } { -05:00 }
3902 \datatool_region_set_timezone_map:nn { CA / MST } { -07:00 }
3903 \datatool_region_set_timezone_map:nn { CA / MDT } { -06:00 }
3904 \datatool_region_set_timezone_map:nn { CA / PST } { -08:00 }
3905 \datatool_region_set_timezone_map:nn { CA / PDT } { -07:00 }
3906 % \end{macrocode}
3907 %\subsection{Options}
3908 %Define options for this region:
3909 % \begin{macrocode}
3910 \datatool_locale_define_keys:nn { CA }
3911 {
3912 number-style .code:n =
3913 {
3914 \exp_args:Ne \keys_if_exist:nnTF
3915 { datatool / locale / \l_datatool_current_language_tl - CA }
3916 { number-style }
3917 {
3918 \exp_args:Ne \keys_set:nn
3919 { datatool / locale / \l_datatool_current_language_tl - CA }
3920 { number-style = { #1 } }
3921 }
3922 {
3923 \datatool_locale_warn:nn { datatool-CA }
3924 {
3925 No ~ number-style ~ available ~ for ~ current ~ language ~
3926 ` \l_datatool_current_language_tl ' ~
3927 (additional ~ language ~ module ~ may ~ need ~ installing)
3928 }
3929 }
3930 } ,
3931 % \end{macrocode}
3932 % Currency symbol before or after value:
3933 % \begin{macrocode}
3934 currency-symbol-position .choice: ,
3935 currency-symbol-position / before .code:n =
3936 {
3937 \cs_set_eq:NN \datatool_CA_currency_position:nn \dtlcurrprefixfmt
3938 } ,
3939 currency-symbol-position / after .code:n =
3940 {
3941 \cs_set_eq:NN \datatool_CA_currency_position:nn \dtlcurrsuffixfmt
3942 } ,
3943 % \end{macrocode}
3944 % Should the currency symbol be prefixed with the region code:
3945 % \begin{macrocode}
3946 currency-symbol-prefix .choice: ,
3947 currency-symbol-prefix / false .code:n =
3948 {
3949 \cs_set_eq:NN \datatoolCAsymbolprefix \use_none:n
3950 } ,
3951 currency-symbol-prefix / true .code:n =
3952 {
3953 \cs_set_eq:NN
3954 \datatoolCAsymbolprefix
3955 \datatool_currency_symbol_region_prefix:n
3956 } ,
3957 currency-symbol-prefix .default:n = { true } ,
3958 % \end{macrocode}
3959 % Separator between currency symbol (not code) and value:
3960 % \begin{macrocode}
3961 currency-symbol-sep .choice: ,
3962 currency-symbol-sep / none .code:n =
3963 {
3964 \tl_clear:N \l_datatool_CA_sym_sep_tl
3965 } ,
3966 currency-symbol-sep / thin-space .code:n =
3967 {
3968 \tl_set:Nn \l_datatool_CA_sym_sep_tl { \, }
3969 } ,
3970 currency-symbol-sep / space .code:n =
3971 {
3972 \tl_set:Nn \l_datatool_CA_sym_sep_tl { ~ }
3973 } ,
3974 currency-symbol-sep / nbsp .code:n =
3975 {
3976 \tl_set:Nn \l_datatool_CA_sym_sep_tl { \nobreakspace }
3977 } ,
3978 currency-symbol-sep .initial:n = { none } ,
3979 % \end{macrocode}
3980 % Date and time styles:
3981 % \begin{macrocode}
3982 date-style .choice: ,
3983 date-style / dmyyyy .code: n =
3984 {
3985 \tl_set:Nn \l__datatool_CA_datestyle_tl { ddmmyyyy }
3986 } ,
3987 date-style / mdyyyy .code: n =
3988 {
3989 \tl_set:Nn \l__datatool_CA_datestyle_tl { mmddyyyy }
3990 } ,
3991 date-style / yyyymd .code: n =
3992 {
3993 \tl_set:Nn \l__datatool_CA_datestyle_tl { yyyymmdd }
3994 } ,
3995 date-style / dmyy .code: n =
3996 {
3997 \tl_set:Nn \l__datatool_CA_datestyle_tl { ddmmyy }
3998 } ,
3999 date-style / mdyy .code: n =
4000 {
4001 \tl_set:Nn \l__datatool_CA_datestyle_tl { mmddyy }
4002 } ,
4003 date-style / yymd .code: n =
4004 {
4005 \tl_set:Nn \l__datatool_CA_datestyle_tl { yymmdd }
4006 } ,
4007 date-variant .choice: ,
4008 date-variant / slash .code:n =
4009 {
4010 \tl_set:Nn \l__datatool_CA_datevariant_tl { slash }
4011 } ,
4012 date-variant / hyphen .code:n =
4013 {
4014 \tl_set:Nn \l__datatool_CA_datevariant_tl { hyphen }
4015 } ,
4016 date-variant / dot .code:n =
4017 {
4018 \tl_set:Nn \l__datatool_CA_datevariant_tl { dot }
4019 } ,
4020 date-variant / dialect .code:n =
4021 {
4022 \tl_set:Nn \l__datatool_CA_datevariant_tl
4023 { \l_datatool_current_language_tl }
4024 } ,
4025 time-variant .choice: ,
4026 time-variant / colon .code:n =
4027 {
4028 \tl_set:Nn \l__datatool_CA_timevariant_tl { colon }
4029 } ,
4030 time-variant / dot .code:n =
4031 {
4032 \tl_set:Nn \l__datatool_CA_timevariant_tl { dot }
4033 } ,
4034 time-variant / dialect .code:n =
4035 {
4036 \tl_if_eq:NnTF \l__datatool_CA_timevariant_tl { dot }
4037 {
4038 \tl_set:Nn \l__datatool_CA_timevariant_tl
4039 { \l_datatool_current_language_tl _dot }
4040 }
4041 {
4042 \tl_if_in:NnF
4043 \l__datatool_CA_timevariant_tl
4044 { \l_datatool_current_language_tl }
4045 {
4046 \tl_set:Nn \l__datatool_CA_timevariant_tl
4047 { \l_datatool_current_language_tl _colon }
4048 }
4049 }
4050 } ,
4051 time-variant / dialect-colon .code:n =
4052 {
4053 \tl_set:Nn \l__datatool_CA_timevariant_tl
4054 { \l_datatool_current_language_tl _colon }
4055 } ,
4056 time-variant / dialect-dot .code:n =
4057 {
4058 \tl_set:Nn \l__datatool_CA_timevariant_tl
4059 { \l_datatool_current_language_tl _dot }
4060 } ,
4061 }
4062 % \end{macrocode}
4063 %
4064 %\subsection{Hooks}
4065 %Command to update temporal parsing commands for this region:
4066 % \begin{macrocode}
4067 \newcommand \datatoolCASetTemporalParsers
4068 {
4069 \renewcommand \DTLCurrentLocaleParseTimeStamp
4070 { \datatool_CA_parse_timestamp:NnTF }
4071 \renewcommand \DTLCurrentLocaleParseDate
4072 { \datatool_CA_parse_date:NnTF }
4073 \renewcommand \DTLCurrentLocaleParseTime
4074 { \datatool_CA_parse_time:NnTF }
4075 \let
4076 \DTLCurrentLocaleGetTimeZoneMap
4077 \datatool_CA_get_timezone_map:n
4078 }
4079 % \end{macrocode}
4080 %Set temporal formatting commands for this region. Currently this
4081 %just resets to the default, but may change in future.
4082 %Note that the defaults test if the applicable \sty{datetime2}
4083 %command is available and will fallback on ISO if not defined.
4084 %Bear in mind that the default style for \sty{datetime2} is
4085 %\texttt{iso} so there won't be a noticeable difference unless the
4086 %\sty{datetime2} regional setting is on.
4087 % \begin{macrocode}
4088 \newcommand \datatoolCASetTemporalFormatters
4089 {
4090 \let
4091 \DTLCurrentLocaleFormatDate
4092 \datatool_default_date_fmt:nnnn
4093 \let
4094 \DTLCurrentLocaleFormatTime
4095 \datatool_default_time_fmt:nnn
4096 \let
4097 \DTLCurrentLocaleFormatTimeZone
4098 \datatool_default_timezone_fmt:nn
4099 \let
4100 \DTLCurrentLocaleFormatTimeStampNoZone
4101 \datatool_default_timestamp_fmt:nnnnnnn
4102 \let
4103 \DTLCurrentLocaleFormatTimeStampWithZone
4104 \datatool_default_timestamp_fmt:nnnnnnnnn
4105 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
4106 }
4107 % \end{macrocode}
4108 %
4109 %Command to update currency and temporal parsing commands for this region:
4110 % \begin{macrocode}
4111 \newcommand \DTLCALocaleHook
4112 {
4113 \datatoolCASetCurrency
4114 \datatoolCASetTemporalParsers
4115 \datatoolCASetTemporalFormatters
4116 % \end{macrocode}
4117 %Allow language files to reference the region:
4118 % \begin{macrocode}
4119 \tl_set:Nn \l_datatool_current_region_tl { CA }
4120 }
4121 % \end{macrocode}
4122 %
4123 % Finished with \LaTeX3 syntax.
4124 % \begin{macrocode}
4125 \ExplSyntaxOff
4126 % \end{macrocode}
4127 %Note that the hook is added to the captions by \sty{datatool-base}
4128 %not by the region file.
4129 %\iffalse
4130 % \begin{macrocode}
4131 %</datatool-CA.ldf>
4132 % \end{macrocode}
4133 %\fi
4134 %\iffalse
4135 % \begin{macrocode}
4136 %<*datatool-FK.ldf>
4137 % \end{macrocode}
4138 %\fi
4139 %\section{datatool-FK.ldf}\label{sec:datatool-FK}
4140 % Support for region FK.
4141 % \begin{macrocode}
4142 \TrackLangProvidesResource{FK}[2025/03/01 v1.0]
4143 % \end{macrocode}
4144 % Switch on \LaTeX3 syntax:
4145 % \begin{macrocode}
4146 \ExplSyntaxOn
4147 % \end{macrocode}
4148 %
4149 %\subsection{Numbers and Currency}
4150 %Set the number group and decimal symbols for this region.
4151 % \begin{macrocode}
4152 \cs_new:Nn \datatool_FK_set_numberchars_official:
4153 {
4154 \datatool_set_numberchars:nn { , } { . }
4155 }
4156 % \end{macrocode}
4157 %Unofficial style.
4158 % \begin{macrocode}
4159 \cs_new:Nn \datatool_FK_set_numberchars_unofficial:
4160 {
4161 \datatool_set_thinspace_group_decimal_char:n { . }
4162 }
4163 % \end{macrocode}
4164 %Hook to set the number group and decimal characters for the region:
4165 % \begin{macrocode}
4166 \newcommand \datatoolFKSetNumberChars
4167 {
4168 \bool_if:NT \l_datatool_region_set_numberchars_bool
4169 {
4170 \datatool_FK_set_numberchars_official:
4171 }
4172 }
4173 % \end{macrocode}
4174 %How to format the position of the currency symbol in relation to the value.
4175 % \begin{macrocode}
4176 \cs_new:Nn \datatool_FK_currency_position:nn
4177 {
4178 \dtlcurrprefixfmt { #1 } { #2 }
4179 }
4180 % \end{macrocode}
4181 %Separator between currency symbol and value.
4182 % \begin{macrocode}
4183 \tl_new:N \l_datatool_FK_sym_sep_tl
4184 % \end{macrocode}
4185 % Set the currency format for this region.
4186 % \begin{macrocode}
4187 \newcommand \datatoolFKcurrencyfmt [ 2 ]
4188 {
4189 \datatool_FK_currency_position:nn
4190 {
4191 \datatoolFKsymbolprefix { FK }
4192 #1
4193 }
4194 { #2 }
4195 }
4196 % \end{macrocode}
4197 %Prefix for symbol, if required.
4198 % \begin{macrocode}
4199 \newcommand \datatoolFKsymbolprefix [ 1 ] { }
4200 % \end{macrocode}
4201 % Define the currency symbols for this region.
4202 % \begin{macrocode}
4203 \datatool_def_currency:nnnV
4204 { \datatoolFKcurrencyfmt }
4205 { FKP }
4206 { \pounds }
4207 \l_datatool_pound_tl
4208 % \end{macrocode}
4209 % Register the currency code with this region:
4210 % \begin{macrocode}
4211 \datatool_register_regional_currency_code:nn { FK } { FKP }
4212 % \end{macrocode}
4213 % Provide a command to set the currency for this region (for use
4214 % with any hook used when the locale changes).
4215 % NB this should do nothing with
4216 % \verb|\DTLsetup{region-currency=false}|
4217 % \begin{macrocode}
4218 \newcommand \datatoolFKSetCurrency
4219 {
4220 \bool_if:NT \l_datatool_region_set_currency_bool
4221 {
4222 \DTLsetdefaultcurrency { FKP }
4223 % \end{macrocode}
4224 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
4225 % \begin{macrocode}
4226 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
4227 % \end{macrocode}
4228 %Separator between symbol and value:
4229 % \begin{macrocode}
4230 \renewcommand \dtlcurrfmtsymsep { \l_datatool_FK_sym_sep_tl }
4231 }
4232 }
4233 % \end{macrocode}
4234 %
4235 %\subsection{Date and Time Parsing}
4236 % This defaults to day/month/year but may be changed with \cs{DTLsetLocaleOptions}. For example:
4237 %\begin{dispListing}
4238 %\DTLsetLocaleOptions{FK}{date-style=dmyyyy, date-variant=slash}
4239 %\end{dispListing}
4240 %An appropriate language file will need to also be installed to
4241 %parse dates containing month names or day of week names.
4242 %
4243 %Provide a way to configure parsing style.
4244 % \begin{macrocode}
4245 \tl_new:N \l__datatool_FK_datevariant_tl
4246 \tl_set:Nn \l__datatool_FK_datevariant_tl { slash }
4247 % \end{macrocode}
4248 %NB These token lists are used to form command names. The following is not
4249 %a format string.
4250 % \begin{macrocode}
4251 \tl_new:N \l__datatool_FK_datestyle_tl
4252 \tl_set:Nn \l__datatool_FK_datestyle_tl { ddmmyyyy }
4253 \tl_new:N \l__datatool_FK_timevariant_tl
4254 \tl_set:Nn \l__datatool_FK_timevariant_tl { colon }
4255 % \end{macrocode}
4256 %
4257 %Each parsing command defined below has final \marg{true} and \marg{false}
4258 %arguments (\code{TF}). These are used if parsing was successful (true) or if
4259 %parsing failed (false). The internal commands used by
4260 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
4261 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
4262 %not as conditionals.
4263 %
4264 %\subsubsection{Time Stamp Parsing}
4265 %Use command
4266 %\begin{definition}
4267 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
4268 %\end{definition}
4269 %with date regular expression
4270 %\begin{definition}
4271 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
4272 %\end{definition}
4273 %and time regular expression
4274 %\begin{definition}
4275 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
4276 %\end{definition}
4277 % \begin{macrocode}
4278 \cs_new:Nn \datatool_FK_parse_timestamp:NnTF
4279 {
4280 \cs_if_exist:cTF
4281 {
4282 datatool_
4283 \l__datatool_FK_datestyle_tl
4284 _hhmmss_tz_parse_timestamp:ccNnTF
4285 }
4286 {
4287 \cs_if_exist:cTF
4288 {
4289 c_datatool_
4290 \l__datatool_FK_datevariant_tl
4291 _
4292 \l__datatool_FK_datestyle_tl
4293 _date_regex
4294 }
4295 {
4296 \cs_if_exist:cTF
4297 {
4298 c_datatool_
4299 \l__datatool_FK_timevariant_tl
4300 _hhmmss_time_regex
4301 }
4302 {
4303 \use:c
4304 {
4305 datatool_
4306 \l__datatool_FK_datestyle_tl
4307 _hhmmss_tz_parse_timestamp:ccNnTF
4308 }
4309 {
4310 c_datatool_
4311 \l__datatool_FK_datevariant_tl
4312 _
4313 \l__datatool_FK_datestyle_tl
4314 _date_regex
4315 }
4316 {
4317 c_datatool_
4318 \l__datatool_FK_timevariant_tl
4319 _hhmmss_time_regex
4320 }
4321 #1 { #2 } { #3 } { #4 }
4322 }
4323 {
4324 \datatool_warn_check_head_language_empty:Vnnn
4325 \l__datatool_FK_timevariant_tl
4326 { datatool-FK }
4327 {
4328 No ~ language ~ support ~ for ~ time ~ variant ~
4329 ` \exp_args:Ne \tl_tail:n { \l__datatool_FK_timevariant_tl } '
4330 }
4331 {
4332 No ~ support ~ for ~ time ~ variant ~
4333 ` \l__datatool_FK_timevariant_tl '
4334 }
4335 #4
4336 }
4337 }
4338 {
4339 \datatool_warn_check_head_language_empty:Vnnn
4340 \l__datatool_FK_datevariant_tl
4341 { datatool-FK }
4342 {
4343 No ~ language ~ support ~ for ~ date ~ style ~
4344 ` \l__datatool_FK_datestyle_tl '
4345 }
4346 {
4347 No ~ support ~ for ~ date ~ style ~
4348 ` \l__datatool_FK_datestyle_tl ' ~ with ~
4349 variant ~
4350 ` \l__datatool_FK_datevariant_tl '
4351 }
4352 #4
4353 }
4354 }
4355 {
4356 \datatool_locale_warn:nn { datatool-FK }
4357 {
4358 No ~ support ~ for ~ date ~ style ~
4359 ` \l__datatool_FK_datestyle_tl '
4360 }
4361 #4
4362 }
4363 }
4364 % \end{macrocode}
4365 %
4366 %\subsubsection{Date Parsing}
4367 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
4368 %with regular expression
4369 %\begin{definition}
4370 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
4371 %\end{definition}
4372 % \begin{macrocode}
4373 \cs_new:Nn \datatool_FK_parse_date:NnTF
4374 {
4375 \cs_if_exist:cTF
4376 {
4377 datatool_
4378 \l__datatool_FK_datestyle_tl
4379 _parse_date:NNnTF
4380 }
4381 {
4382 \cs_if_exist:cTF
4383 {
4384 c_datatool_
4385 \l__datatool_FK_datevariant_tl
4386 _anchored_
4387 \l__datatool_FK_datestyle_tl
4388 _date_regex
4389 }
4390 {
4391 \exp_args:cc
4392 {
4393 datatool_
4394 \l__datatool_FK_datestyle_tl
4395 _parse_date:NNnTF
4396 }
4397 {
4398 c_datatool_
4399 \l__datatool_FK_datevariant_tl
4400 _anchored_
4401 \l__datatool_FK_datestyle_tl
4402 _date_regex
4403 }
4404 #1 { #2 } { #3 } { #4 }
4405 }
4406 {
4407 \datatool_warn_check_head_language_empty:Vnnn
4408 \l__datatool_FK_datevariant_tl
4409 { datatool-FK }
4410 {
4411 No ~ language ~ support ~ for ~ date ~ style ~
4412 ` \l__datatool_FK_datestyle_tl '
4413 }
4414 {
4415 No ~ support ~ for ~ date ~ style ~
4416 ` \l__datatool_FK_datestyle_tl ' ~ with ~
4417 variant ~
4418 ` \l__datatool_FK_datevariant_tl '
4419 }
4420 #4
4421 }
4422 }
4423 {
4424 \datatool_locale_warn:nn { datatool-FK }
4425 {
4426 No ~ support ~ for ~ date ~ style ~
4427 ` \l__datatool_FK_datestyle_tl '
4428 }
4429 #4
4430 }
4431 }
4432 % \end{macrocode}
4433 %
4434 %\subsubsection{Time Parsing}
4435 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
4436 %with regular expression
4437 %\begin{definition}
4438 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
4439 %\end{definition}
4440 % \begin{macrocode}
4441 \cs_new:Nn \datatool_FK_parse_time:NnTF
4442 {
4443 \cs_if_exist:cTF
4444 {
4445 c_datatool_
4446 \l__datatool_FK_timevariant_tl
4447 _anchored_hhmmss_time_regex
4448 }
4449 {
4450 \datatool_hhmmss_parse_time:cNnTF
4451 {
4452 c_datatool_
4453 \l__datatool_FK_timevariant_tl
4454 _anchored_hhmmss_time_regex
4455 }
4456 #1 { #2 } { #3 } { #4 }
4457 }
4458 {
4459 \datatool_warn_check_head_language_empty:Vnnn
4460 \l__datatool_FK_timevariant_tl
4461 { datatool-FK }
4462 {
4463 No ~ language ~ support ~ for ~ time ~ variant ~
4464 ` \exp_args:Ne \tl_tail:n { \l__datatool_FK_timevariant_tl } '
4465 }
4466 {
4467 No ~ support ~ for ~ time ~ variant ~
4468 ` \l__datatool_FK_timevariant_tl '
4469 }
4470 #4
4471 }
4472 }
4473 % \end{macrocode}
4474 %
4475 %\subsubsection{Time Zone Mappings}
4476 %Define time zone mapping command for this region:
4477 % \begin{macrocode}
4478 \cs_new:Nn \datatool_FK_get_timezone_map:n
4479 {
4480 \datatool_region_get_timezone_map:n { FK / #1 }
4481 }
4482 % \end{macrocode}
4483 %Define time zone IDs for this region (one-way map from ID to offset):
4484 % \begin{macrocode}
4485 \datatool_region_set_timezone_map:nn { FK / BST } { +01:00 }
4486 \datatool_region_set_timezone_map:nn { FK / FKST } { -03:00 }
4487 \datatool_region_set_timezone_map:nn { FK / GMT } { +00:00 }
4488 % \end{macrocode}
4489 %
4490 %\subsection{Options}
4491 %Define options for this region:
4492 % \begin{macrocode}
4493 \datatool_locale_define_keys:nn { FK }
4494 {
4495 number-style .choices:nn =
4496 { official, unofficial }
4497 {
4498 \exp_args:NNe \renewcommand
4499 \datatoolFKSetNumberChars
4500 {
4501 \exp_not:N \bool_if:NT
4502 \exp_not:N \l_datatool_region_set_numberchars_bool
4503 {
4504 \exp_not:c { datatool_FK_set_numberchars_ \l_keys_choice_tl : }
4505 }
4506 }
4507 \tl_if_eq:NnT \l_datatool_current_region_tl { FK }
4508 {
4509 \datatoolFKSetNumberChars
4510 }
4511 } ,
4512 % \end{macrocode}
4513 % Currency symbol before or after value:
4514 % \begin{macrocode}
4515 currency-symbol-position .choice: ,
4516 currency-symbol-position / before .code:n =
4517 {
4518 \cs_set_eq:NN \datatool_FK_currency_position:nn \dtlcurrprefixfmt
4519 } ,
4520 currency-symbol-position / after .code:n =
4521 {
4522 \cs_set_eq:NN \datatool_FK_currency_position:nn \dtlcurrsuffixfmt
4523 } ,
4524 % \end{macrocode}
4525 % Should the currency symbol be prefixed with the region code:
4526 % \begin{macrocode}
4527 currency-symbol-prefix .choice: ,
4528 currency-symbol-prefix / false .code:n =
4529 {
4530 \cs_set_eq:NN \datatoolFKsymbolprefix \use_none:n
4531 } ,
4532 currency-symbol-prefix / true .code:n =
4533 {
4534 \cs_set_eq:NN
4535 \datatoolFKsymbolprefix
4536 \datatool_currency_symbol_region_prefix:n
4537 } ,
4538 currency-symbol-prefix .default:n = { true } ,
4539 % \end{macrocode}
4540 % Separator between currency symbol (not code) and value:
4541 % \begin{macrocode}
4542 currency-symbol-sep .choice: ,
4543 currency-symbol-sep / none .code:n =
4544 {
4545 \tl_clear:N \l_datatool_FK_sym_sep_tl
4546 } ,
4547 currency-symbol-sep / thin-space .code:n =
4548 {
4549 \tl_set:Nn \l_datatool_FK_sym_sep_tl { \, }
4550 } ,
4551 currency-symbol-sep / space .code:n =
4552 {
4553 \tl_set:Nn \l_datatool_FK_sym_sep_tl { ~ }
4554 } ,
4555 currency-symbol-sep / nbsp .code:n =
4556 {
4557 \tl_set:Nn \l_datatool_FK_sym_sep_tl { \nobreakspace }
4558 } ,
4559 currency-symbol-sep . initial:n = { none } ,
4560 % \end{macrocode}
4561 % Date and time styles:
4562 % \begin{macrocode}
4563 date-style .choice: ,
4564 date-style / dmyyyy .code: n =
4565 {
4566 \tl_set:Nn \l__datatool_FK_datestyle_tl { ddmmyyyy }
4567 } ,
4568 date-style / mdyyyy .code: n =
4569 {
4570 \tl_set:Nn \l__datatool_FK_datestyle_tl { mmddyyyy }
4571 } ,
4572 date-style / yyyymd .code: n =
4573 {
4574 \tl_set:Nn \l__datatool_FK_datestyle_tl { yyyymmdd }
4575 } ,
4576 date-style / dmyy .code: n =
4577 {
4578 \tl_set:Nn \l__datatool_FK_datestyle_tl { ddmmyy }
4579 } ,
4580 date-style / mdyy .code: n =
4581 {
4582 \tl_set:Nn \l__datatool_FK_datestyle_tl { mmddyy }
4583 } ,
4584 date-style / yymd .code: n =
4585 {
4586 \tl_set:Nn \l__datatool_FK_datestyle_tl { yymmdd }
4587 } ,
4588 date-variant .choice: ,
4589 date-variant / slash .code:n =
4590 {
4591 \tl_set:Nn \l__datatool_FK_datevariant_tl { slash }
4592 } ,
4593 date-variant / hyphen .code:n =
4594 {
4595 \tl_set:Nn \l__datatool_FK_datevariant_tl { hyphen }
4596 } ,
4597 date-variant / dot .code:n =
4598 {
4599 \tl_set:Nn \l__datatool_FK_datevariant_tl { dot }
4600 } ,
4601 date-variant / dialect .code:n =
4602 {
4603 \tl_set:Nn \l__datatool_FK_datevariant_tl
4604 { \l_datatool_current_language_tl }
4605 } ,
4606 time-variant .choice: ,
4607 time-variant / colon .code:n =
4608 {
4609 \tl_set:Nn \l__datatool_FK_timevariant_tl { colon }
4610 } ,
4611 time-variant / dot .code:n =
4612 {
4613 \tl_set:Nn \l__datatool_FK_timevariant_tl { dot }
4614 } ,
4615 time-variant / dialect .code:n =
4616 {
4617 \tl_if_eq:NnTF \l__datatool_FK_timevariant_tl { dot }
4618 {
4619 \tl_set:Nn \l__datatool_FK_timevariant_tl
4620 { \l_datatool_current_language_tl _dot }
4621 }
4622 {
4623 \tl_if_in:NnF
4624 \l__datatool_FK_timevariant_tl
4625 { \l_datatool_current_language_tl }
4626 {
4627 \tl_set:Nn \l__datatool_FK_timevariant_tl
4628 { \l_datatool_current_language_tl _colon }
4629 }
4630 }
4631 } ,
4632 time-variant / dialect-colon .code:n =
4633 {
4634 \tl_set:Nn \l__datatool_FK_timevariant_tl
4635 { \l_datatool_current_language_tl _colon }
4636 } ,
4637 time-variant / dialect-dot .code:n =
4638 {
4639 \tl_set:Nn \l__datatool_FK_timevariant_tl
4640 { \l_datatool_current_language_tl _dot }
4641 } ,
4642 }
4643 % \end{macrocode}
4644 %
4645 %\subsection{Hooks}
4646 %Command to update temporal parsing commands for this region:
4647 % \begin{macrocode}
4648 \newcommand \datatoolFKSetTemporalParsers
4649 {
4650 \renewcommand \DTLCurrentLocaleParseTimeStamp
4651 { \datatool_FK_parse_timestamp:NnTF }
4652 \renewcommand \DTLCurrentLocaleParseDate
4653 { \datatool_FK_parse_date:NnTF }
4654 \renewcommand \DTLCurrentLocaleParseTime
4655 { \datatool_FK_parse_time:NnTF }
4656 \let
4657 \DTLCurrentLocaleGetTimeZoneMap
4658 \datatool_FK_get_timezone_map:n
4659 }
4660 % \end{macrocode}
4661 %Set temporal formatting commands for this region. Currently this
4662 %just resets to the default, but may change in future.
4663 %Note that the defaults test if the applicable \sty{datetime2}
4664 %command is available and will fallback on ISO if not defined.
4665 %Bear in mind that the default style for \sty{datetime2} is
4666 %\texttt{iso} so there won't be a noticeable difference unless the
4667 %\sty{datetime2} regional setting is on.
4668 % \begin{macrocode}
4669 \newcommand \datatoolFKSetTemporalFormatters
4670 {
4671 \let
4672 \DTLCurrentLocaleFormatDate
4673 \datatool_default_date_fmt:nnnn
4674 \let
4675 \DTLCurrentLocaleFormatTime
4676 \datatool_default_time_fmt:nnn
4677 \let
4678 \DTLCurrentLocaleFormatTimeZone
4679 \datatool_default_timezone_fmt:nn
4680 \let
4681 \DTLCurrentLocaleFormatTimeStampNoZone
4682 \datatool_default_timestamp_fmt:nnnnnnn
4683 \let
4684 \DTLCurrentLocaleFormatTimeStampWithZone
4685 \datatool_default_timestamp_fmt:nnnnnnnnn
4686 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
4687 }
4688 % \end{macrocode}
4689 %
4690 %
4691 %Command to update currency and temporal parsing commands for this region:
4692 % \begin{macrocode}
4693 \newcommand \DTLFKLocaleHook
4694 {
4695 \datatoolFKSetNumberChars
4696 \datatoolFKSetCurrency
4697 \datatoolFKSetTemporalParsers
4698 \datatoolFKSetTemporalFormatters
4699 % \end{macrocode}
4700 %Allow language files to reference the region:
4701 % \begin{macrocode}
4702 \tl_set:Nn \l_datatool_current_region_tl { FK }
4703 }
4704 % \end{macrocode}
4705 %
4706 % Finished with \LaTeX3 syntax.
4707 % \begin{macrocode}
4708 \ExplSyntaxOff
4709 % \end{macrocode}
4710 %Note that the hook is added to the captions by \sty{datatool-base}
4711 %not by the region file.
4712 %\iffalse
4713 % \begin{macrocode}
4714 %</datatool-FK.ldf>
4715 % \end{macrocode}
4716 %\fi
4717 %\iffalse
4718 % \begin{macrocode}
4719 %<*datatool-GB.ldf>
4720 % \end{macrocode}
4721 %\fi
4722 %\section{datatool-GB.ldf}\label{sec:datatool-GB}
4723 % Support for region GB.
4724 % \begin{macrocode}
4725 \TrackLangProvidesResource{GB}[2025/03/01 v1.0]
4726 % \end{macrocode}
4727 % Switch on \LaTeX3 syntax:
4728 % \begin{macrocode}
4729 \ExplSyntaxOn
4730 % \end{macrocode}
4731 %\subsection{Numbers and Currency}
4732 % Set the number group and decimal symbols for this region.
4733 %Official style has comma number group and decimal dot.
4734 % \begin{macrocode}
4735 \cs_new:Nn \datatool_GB_set_numberchars_official:
4736 {
4737 \DTLsetnumberchars { , } { . }
4738 }
4739 % \end{macrocode}
4740 % This will allow a normal space, \cs{,} (thin space command) or
4741 % the thin space Unicode character U+2009 as the number group separator when
4742 % parsing and will use \cs{,} when formatting.
4743 % \begin{macrocode}
4744 \cs_new:Nn \datatool_GB_set_numberchars_education:
4745 {
4746 \datatool_set_thinspace_group_decimal_char:n { . }
4747 }
4748 % \end{macrocode}
4749 %Old style uses mid-dot as the decimal point but allows both middle
4750 %dot and low dot when parsing.
4751 % \begin{macrocode}
4752 \cs_new:Nn \datatool_GB_set_numberchars_old:
4753 {
4754 \datatool_set_numberchars_tl_regex:nnnn
4755 { , } { \textperiodcentered }
4756 { , } { \x{2E} | \u{l_datatool_middot_tl} | \c{textperiodcentered} }
4757 }
4758 % \end{macrocode}
4759 %Hook to set the number group and decimal characters for the region:
4760 % \begin{macrocode}
4761 \newcommand \datatoolGBSetNumberChars
4762 {
4763 \bool_if:NT \l_datatool_region_set_numberchars_bool
4764 {
4765 \datatool_GB_set_numberchars_official:
4766 }
4767 }
4768 % \end{macrocode}
4769 %How to format the position of the currency symbol in relation to the value.
4770 % \begin{macrocode}
4771 \cs_new:Nn \datatool_GB_currency_position:nn
4772 {
4773 \dtlcurrprefixfmt { #1 } { #2 }
4774 }
4775 % \end{macrocode}
4776 %Separator between currency symbol and value.
4777 % \begin{macrocode}
4778 \tl_new:N \l_datatool_GB_sym_sep_tl
4779 % \end{macrocode}
4780 % Set the currency format for this region.
4781 % \begin{macrocode}
4782 \newcommand \datatoolGBcurrencyfmt [ 2 ]
4783 {
4784 \datatool_GB_currency_position:nn
4785 {
4786 \datatoolGBsymbolprefix { GB }
4787 #1
4788 }
4789 { #2 }
4790 }
4791 % \end{macrocode}
4792 %Prefix for symbol, if required.
4793 % \begin{macrocode}
4794 \newcommand \datatoolGBsymbolprefix [ 1 ] { }
4795 % \end{macrocode}
4796 % Define the currency symbols for this region.
4797 % \begin{macrocode}
4798 \datatool_def_currency:nnnV
4799 { \datatoolGBcurrencyfmt }
4800 { GBP }
4801 { \pounds }
4802 \l_datatool_pound_tl
4803 % \end{macrocode}
4804 %Register the currency code with this region:
4805 % \begin{macrocode}
4806 \datatool_register_regional_currency_code:nn { GB } { GBP }
4807 % \end{macrocode}
4808 % Provide a command to set the currency for this region (for use
4809 % with any hook used when the locale changes).
4810 % NB this should do nothing with
4811 % \verb|\DTLsetup{region-currency=false}|
4812 % \begin{macrocode}
4813 \newcommand \datatoolGBSetCurrency
4814 {
4815 \bool_if:NT \l_datatool_region_set_currency_bool
4816 {
4817 \DTLsetdefaultcurrency { GBP }
4818 % \end{macrocode}
4819 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
4820 % \begin{macrocode}
4821 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
4822 % \end{macrocode}
4823 %Separator between symbol and value:
4824 % \begin{macrocode}
4825 \renewcommand \dtlcurrfmtsymsep { \l_datatool_GB_sym_sep_tl }
4826 }
4827 }
4828 % \end{macrocode}
4829 %
4830 %\subsection{Date and Time Parsing}
4831 % Provide a way to configure temporal parsing style.
4832 % The default is day/month/year but may be changed with
4833 % \cs{DTLsetLocaleOptions}. For example:
4834 %\begin{dispListing}
4835 %\DTLsetLocaleOptions{GB}{date-style=dmyy, date-variant=dot}
4836 %\end{dispListing}
4837 %An appropriate language file will need to also be installed to
4838 %parse dates containing month names or day of week names.
4839 %
4840 % \begin{macrocode}
4841 \tl_new:N \l__datatool_GB_datevariant_tl
4842 \tl_set:Nn \l__datatool_GB_datevariant_tl { slash }
4843 % \end{macrocode}
4844 %NB These token lists are used to form command names. The following is not
4845 %a format string.
4846 % \begin{macrocode}
4847 \tl_new:N \l__datatool_GB_datestyle_tl
4848 \tl_set:Nn \l__datatool_GB_datestyle_tl { ddmmyyyy }
4849 \tl_new:N \l__datatool_GB_timevariant_tl
4850 \tl_set:Nn \l__datatool_GB_timevariant_tl { colon }
4851 % \end{macrocode}
4852 %
4853 %Each parsing command defined below has final \marg{true} and \marg{false}
4854 %arguments (\code{TF}). These are used if parsing was successful (true) or if
4855 %parsing failed (false). The internal commands used by
4856 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
4857 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
4858 %not as conditionals.
4859 %
4860 %\subsubsection{Time Stamp Parsing}
4861 %Use command
4862 %\begin{definition}
4863 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
4864 %\end{definition}
4865 %with date regular expression
4866 %\begin{definition}
4867 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
4868 %\end{definition}
4869 %and time regular expression
4870 %\begin{definition}
4871 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
4872 %\end{definition}
4873 % \begin{macrocode}
4874 \cs_new:Nn \datatool_GB_parse_timestamp:NnTF
4875 {
4876 \cs_if_exist:cTF
4877 {
4878 datatool_
4879 \l__datatool_GB_datestyle_tl
4880 _hhmmss_tz_parse_timestamp:ccNnTF
4881 }
4882 {
4883 \cs_if_exist:cTF
4884 {
4885 c_datatool_
4886 \l__datatool_GB_datevariant_tl
4887 _
4888 \l__datatool_GB_datestyle_tl
4889 _date_regex
4890 }
4891 {
4892 \cs_if_exist:cTF
4893 {
4894 c_datatool_
4895 \l__datatool_GB_timevariant_tl
4896 _hhmmss_time_regex
4897 }
4898 {
4899 \use:c
4900 {
4901 datatool_
4902 \l__datatool_GB_datestyle_tl
4903 _hhmmss_tz_parse_timestamp:ccNnTF
4904 }
4905 {
4906 c_datatool_
4907 \l__datatool_GB_datevariant_tl
4908 _
4909 \l__datatool_GB_datestyle_tl
4910 _date_regex
4911 }
4912 {
4913 c_datatool_
4914 \l__datatool_GB_timevariant_tl
4915 _hhmmss_time_regex
4916 }
4917 #1 { #2 } { #3 } { #4 }
4918 }
4919 {
4920 \datatool_warn_check_head_language_empty:Vnnn
4921 \l__datatool_GB_timevariant_tl
4922 { datatool-GB }
4923 {
4924 No ~ language ~ support ~ for ~ time ~ variant ~
4925 ` \exp_args:Ne \tl_tail:n { \l__datatool_GB_timevariant_tl } '
4926 }
4927 {
4928 No ~ support ~ for ~ time ~ variant ~
4929 ` \l__datatool_GB_timevariant_tl '
4930 }
4931 #4
4932 }
4933 }
4934 {
4935 \datatool_warn_check_head_language_empty:Vnnn
4936 \l__datatool_GB_datevariant_tl
4937 { datatool-GB }
4938 {
4939 No ~ language ~ support ~ for ~ date ~ style ~
4940 ` \l__datatool_GB_datestyle_tl '
4941 }
4942 {
4943 No ~ support ~ for ~ date ~ style ~
4944 ` \l__datatool_GB_datestyle_tl ' ~ with ~
4945 variant ~
4946 ` \l__datatool_GB_datevariant_tl '
4947 }
4948 #4
4949 }
4950 }
4951 {
4952 \datatool_locale_warn:nn { datatool-GB }
4953 {
4954 No ~ support ~ for ~ date ~ style ~
4955 ` \l__datatool_GB_datestyle_tl '
4956 }
4957 #4
4958 }
4959 }
4960 % \end{macrocode}
4961 %\subsubsection{Date Parsing}
4962 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
4963 %with regular expression
4964 %\begin{definition}
4965 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
4966 %\end{definition}
4967 % \begin{macrocode}
4968 \cs_new:Nn \datatool_GB_parse_date:NnTF
4969 {
4970 \cs_if_exist:cTF
4971 {
4972 datatool_
4973 \l__datatool_GB_datestyle_tl
4974 _parse_date:NNnTF
4975 }
4976 {
4977 \cs_if_exist:cTF
4978 {
4979 c_datatool_
4980 \l__datatool_GB_datevariant_tl
4981 _anchored_
4982 \l__datatool_GB_datestyle_tl
4983 _date_regex
4984 }
4985 {
4986 \exp_args:cc
4987 {
4988 datatool_
4989 \l__datatool_GB_datestyle_tl
4990 _parse_date:NNnTF
4991 }
4992 {
4993 c_datatool_
4994 \l__datatool_GB_datevariant_tl
4995 _anchored_
4996 \l__datatool_GB_datestyle_tl
4997 _date_regex
4998 }
4999 #1 { #2 } { #3 } { #4 }
5000 }
5001 {
5002 \datatool_warn_check_head_language_empty:Vnnn
5003 \l__datatool_GB_datevariant_tl
5004 { datatool-GB }
5005 {
5006 No ~ language ~ support ~ for ~ date ~ style ~
5007 ` \l__datatool_GB_datestyle_tl '
5008 }
5009 {
5010 No ~ support ~ for ~ date ~ style ~
5011 ` \l__datatool_GB_datestyle_tl ' ~ with ~
5012 variant ~
5013 ` \l__datatool_GB_datevariant_tl '
5014 }
5015 #4
5016 }
5017 }
5018 {
5019 \datatool_locale_warn:nn { datatool-GB }
5020 {
5021 No ~ support ~ for ~ date ~ style ~
5022 ` \l__datatool_GB_datestyle_tl '
5023 }
5024 #4
5025 }
5026 }
5027 % \end{macrocode}
5028 %\subsubsection{Time Parsing}
5029 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
5030 %with regular expression
5031 %\begin{definition}
5032 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
5033 %\end{definition}
5034 % \begin{macrocode}
5035 \cs_new:Nn \datatool_GB_parse_time:NnTF
5036 {
5037 \cs_if_exist:cTF
5038 {
5039 c_datatool_
5040 \l__datatool_GB_timevariant_tl
5041 _anchored_hhmmss_time_regex
5042 }
5043 {
5044 \datatool_hhmmss_parse_time:cNnTF
5045 {
5046 c_datatool_
5047 \l__datatool_GB_timevariant_tl
5048 _anchored_hhmmss_time_regex
5049 }
5050 #1 { #2 } { #3 } { #4 }
5051 }
5052 {
5053 \datatool_warn_check_head_language_empty:Vnnn
5054 \l__datatool_GB_timevariant_tl
5055 { datatool-GB }
5056 {
5057 No ~ language ~ support ~ for ~ time ~ variant ~
5058 ` \exp_args:Ne \tl_tail:n { \l__datatool_GB_timevariant_tl } '
5059 }
5060 {
5061 No ~ support ~ for ~ time ~ variant ~
5062 ` \l__datatool_GB_timevariant_tl '
5063 }
5064 #4
5065 }
5066 }
5067 % \end{macrocode}
5068 %
5069 %\subsubsection{Time Zones}
5070 %Define time zone mapping command for this region:
5071 % \begin{macrocode}
5072 \cs_new:Nn \datatool_GB_get_timezone_map:n
5073 {
5074 \datatool_region_get_timezone_map:n { GB / #1 }
5075 }
5076 % \end{macrocode}
5077 %Define time zone IDs for this region (one-way map from ID to offset):
5078 % \begin{macrocode}
5079 \datatool_region_set_timezone_map:nn { GB / GMT } { +00:00 }
5080 \datatool_region_set_timezone_map:nn { GB / BST } { +01:00 }
5081 \datatool_region_set_timezone_map:nn { GB / CET } { +01:00 }
5082 \datatool_region_set_timezone_map:nn { GB / CEST } { +02:00 }
5083 % \end{macrocode}
5084 %
5085 %\subsection{Options}
5086 %Define options for this region:
5087 % \begin{macrocode}
5088 \datatool_locale_define_keys:nn { GB }
5089 {
5090 number-style .choices:nn =
5091 { official , education , old }
5092 {
5093 \exp_args:NNe \renewcommand
5094 \datatoolGBSetNumberChars
5095 {
5096 \exp_not:N \bool_if:NT
5097 \exp_not:N \l_datatool_region_set_numberchars_bool
5098 {
5099 \exp_not:c { datatool_GB_set_numberchars_ \l_keys_choice_tl : }
5100 }
5101 }
5102 \tl_if_eq:NnT \l_datatool_current_region_tl { GB }
5103 {
5104 \datatoolGBSetNumberChars
5105 }
5106 } ,
5107 % \end{macrocode}
5108 % Currency symbol before or after value:
5109 % \begin{macrocode}
5110 currency-symbol-position .choice: ,
5111 currency-symbol-position / before .code:n =
5112 {
5113 \cs_set_eq:NN \datatool_GB_currency_position:nn \dtlcurrprefixfmt
5114 } ,
5115 currency-symbol-position / after .code:n =
5116 {
5117 \cs_set_eq:NN \datatool_GB_currency_position:nn \dtlcurrsuffixfmt
5118 } ,
5119 % \end{macrocode}
5120 % Should the currency symbol be prefixed with the region code:
5121 % \begin{macrocode}
5122 currency-symbol-prefix .choice: ,
5123 currency-symbol-prefix / false .code:n =
5124 {
5125 \cs_set_eq:NN \datatoolGBsymbolprefix \use_none:n
5126 } ,
5127 currency-symbol-prefix / true .code:n =
5128 {
5129 \cs_set_eq:NN
5130 \datatoolGBsymbolprefix
5131 \datatool_currency_symbol_region_prefix:n
5132 } ,
5133 currency-symbol-prefix .default:n = { true } ,
5134 % \end{macrocode}
5135 % Separator between currency symbol (not code) and value:
5136 % \begin{macrocode}
5137 currency-symbol-sep .choice: ,
5138 currency-symbol-sep / none .code:n =
5139 {
5140 \tl_clear:N \l_datatool_GB_sym_sep_tl
5141 } ,
5142 currency-symbol-sep / thin-space .code:n =
5143 {
5144 \tl_set:Nn \l_datatool_GB_sym_sep_tl { \, }
5145 } ,
5146 currency-symbol-sep / space .code:n =
5147 {
5148 \tl_set:Nn \l_datatool_GB_sym_sep_tl { ~ }
5149 } ,
5150 currency-symbol-sep / nbsp .code:n =
5151 {
5152 \tl_set:Nn \l_datatool_GB_sym_sep_tl { \nobreakspace }
5153 } ,
5154 currency-symbol-sep .initial:n = { none } ,
5155 % \end{macrocode}
5156 % Date and time styles:
5157 % \begin{macrocode}
5158 date-style .choice: ,
5159 date-style / dmyyyy .code: n =
5160 {
5161 \tl_set:Nn \l__datatool_GB_datestyle_tl { ddmmyyyy }
5162 } ,
5163 date-style / mdyyyy .code: n =
5164 {
5165 \tl_set:Nn \l__datatool_GB_datestyle_tl { mmddyyyy }
5166 } ,
5167 date-style / yyyymd .code: n =
5168 {
5169 \tl_set:Nn \l__datatool_GB_datestyle_tl { yyyymmdd }
5170 } ,
5171 date-style / dmyy .code: n =
5172 {
5173 \tl_set:Nn \l__datatool_GB_datestyle_tl { ddmmyy }
5174 } ,
5175 date-style / mdyy .code: n =
5176 {
5177 \tl_set:Nn \l__datatool_GB_datestyle_tl { mmddyy }
5178 } ,
5179 date-style / yymd .code: n =
5180 {
5181 \tl_set:Nn \l__datatool_GB_datestyle_tl { yymmdd }
5182 } ,
5183 date-variant .choice: ,
5184 date-variant / slash .code:n =
5185 {
5186 \tl_set:Nn \l__datatool_GB_datevariant_tl { slash }
5187 } ,
5188 date-variant / hyphen .code:n =
5189 {
5190 \tl_set:Nn \l__datatool_GB_datevariant_tl { hyphen }
5191 } ,
5192 date-variant / dot .code:n =
5193 {
5194 \tl_set:Nn \l__datatool_GB_datevariant_tl { dot }
5195 } ,
5196 date-variant / dialect .code:n =
5197 {
5198 \tl_set:Nn \l__datatool_GB_datevariant_tl
5199 { \l_datatool_current_language_tl }
5200 } ,
5201 time-variant .choice: ,
5202 time-variant / colon .code:n =
5203 {
5204 \tl_set:Nn \l__datatool_GB_timevariant_tl { colon }
5205 } ,
5206 time-variant / dot .code:n =
5207 {
5208 \tl_set:Nn \l__datatool_GB_timevariant_tl { dot }
5209 } ,
5210 time-variant / dialect .code:n =
5211 {
5212 \tl_if_eq:NnTF \l__datatool_GB_timevariant_tl { dot }
5213 {
5214 \tl_set:Nn \l__datatool_GB_timevariant_tl
5215 { \l_datatool_current_language_tl _dot }
5216 }
5217 {
5218 \tl_if_in:NnF
5219 \l__datatool_GB_timevariant_tl
5220 { \l_datatool_current_language_tl }
5221 {
5222 \tl_set:Nn \l__datatool_GB_timevariant_tl
5223 { \l_datatool_current_language_tl _colon }
5224 }
5225 }
5226 } ,
5227 time-variant / dialect-colon .code:n =
5228 {
5229 \tl_set:Nn \l__datatool_GB_timevariant_tl
5230 { \l_datatool_current_language_tl _colon }
5231 } ,
5232 time-variant / dialect-dot .code:n =
5233 {
5234 \tl_set:Nn \l__datatool_GB_timevariant_tl
5235 { \l_datatool_current_language_tl _dot }
5236 } ,
5237 }
5238 % \end{macrocode}
5239 %
5240 %\subsection{Hooks}
5241 %Command to update temporal parsing commands for this region:
5242 % \begin{macrocode}
5243 \newcommand \datatoolGBSetTemporalParsers
5244 {
5245 \renewcommand \DTLCurrentLocaleParseTimeStamp
5246 { \datatool_GB_parse_timestamp:NnTF }
5247 \renewcommand \DTLCurrentLocaleParseDate
5248 { \datatool_GB_parse_date:NnTF }
5249 \renewcommand \DTLCurrentLocaleParseTime
5250 { \datatool_GB_parse_time:NnTF }
5251 \let
5252 \DTLCurrentLocaleGetTimeZoneMap
5253 \datatool_GB_get_timezone_map:n
5254 }
5255 % \end{macrocode}
5256 %Set temporal formatting commands for this region. Currently this
5257 %just resets to the default, but may change in future.
5258 %Note that the defaults test if the applicable \sty{datetime2}
5259 %command is available and will fallback on ISO if not defined.
5260 %Bear in mind that the default style for \sty{datetime2} is
5261 %\texttt{iso} so there won't be a noticeable difference unless the
5262 %\sty{datetime2} regional setting is on.
5263 % \begin{macrocode}
5264 \newcommand \datatoolGBSetTemporalFormatters
5265 {
5266 \let
5267 \DTLCurrentLocaleFormatDate
5268 \datatool_default_date_fmt:nnnn
5269 \let
5270 \DTLCurrentLocaleFormatTime
5271 \datatool_default_time_fmt:nnn
5272 \let
5273 \DTLCurrentLocaleFormatTimeZone
5274 \datatool_default_timezone_fmt:nn
5275 \let
5276 \DTLCurrentLocaleFormatTimeStampNoZone
5277 \datatool_default_timestamp_fmt:nnnnnnn
5278 \let
5279 \DTLCurrentLocaleFormatTimeStampWithZone
5280 \datatool_default_timestamp_fmt:nnnnnnnnn
5281 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
5282 }
5283 % \end{macrocode}
5284 %
5285 %Command to update number symbols, currency and temporal parsing commands
5286 %for this region:
5287 % \begin{macrocode}
5288 \newcommand \DTLGBLocaleHook
5289 {
5290 \datatoolGBSetNumberChars
5291 \datatoolGBSetCurrency
5292 \datatoolGBSetTemporalParsers
5293 \datatoolGBSetTemporalFormatters
5294 % \end{macrocode}
5295 %Allow language files to reference the region:
5296 % \begin{macrocode}
5297 \tl_set:Nn \l_datatool_current_region_tl { GB }
5298 }
5299 % \end{macrocode}
5300 %
5301 % Finished with \LaTeX3 syntax.
5302 % \begin{macrocode}
5303 \ExplSyntaxOff
5304 % \end{macrocode}
5305 %Note that the hook is added to the captions by \sty{datatool-base}
5306 %not by the region file.
5307 %\iffalse
5308 % \begin{macrocode}
5309 %</datatool-GB.ldf>
5310 % \end{macrocode}
5311 %\fi
5312 %\iffalse
5313 % \begin{macrocode}
5314 %<*datatool-GG.ldf>
5315 % \end{macrocode}
5316 %\fi
5317 %\section{datatool-GG.ldf}\label{sec:datatool-GG}
5318 % Support for region GG.
5319 % \begin{macrocode}
5320 \TrackLangProvidesResource{GG}[2025/03/01 v1.0]
5321 % \end{macrocode}
5322 % Switch on \LaTeX3 syntax:
5323 % \begin{macrocode}
5324 \ExplSyntaxOn
5325 % \end{macrocode}
5326 %
5327 %\subsection{Numbers and Currency}
5328 %Set the number group and decimal symbols for this region.
5329 % \begin{macrocode}
5330 \cs_new:Nn \datatool_GG_set_numberchars_official:
5331 {
5332 \datatool_set_numberchars:nn { , } { . }
5333 }
5334 % \end{macrocode}
5335 %Unofficial style.
5336 % \begin{macrocode}
5337 \cs_new:Nn \datatool_GG_set_numberchars_unofficial:
5338 {
5339 \datatool_set_thinspace_group_decimal_char:n { . }
5340 }
5341 % \end{macrocode}
5342 %Hook to set the number group and decimal characters for the region:
5343 % \begin{macrocode}
5344 \newcommand \datatoolGGSetNumberChars
5345 {
5346 \bool_if:NT \l_datatool_region_set_numberchars_bool
5347 {
5348 \datatool_GG_set_numberchars_official:
5349 }
5350 }
5351 % \end{macrocode}
5352 %How to format the position of the currency symbol in relation to the value.
5353 % \begin{macrocode}
5354 \cs_new:Nn \datatool_GG_currency_position:nn
5355 {
5356 \dtlcurrprefixfmt { #1 } { #2 }
5357 }
5358 % \end{macrocode}
5359 %Separator between currency symbol and value.
5360 % \begin{macrocode}
5361 \tl_new:N \l_datatool_GG_sym_sep_tl
5362 % \end{macrocode}
5363 % Set the currency format for this region.
5364 % \begin{macrocode}
5365 \newcommand \datatoolGGcurrencyfmt [ 2 ]
5366 {
5367 \datatool_GG_currency_position:nn
5368 {
5369 \datatoolGGsymbolprefix { GG }
5370 #1
5371 }
5372 { #2 }
5373 }
5374 % \end{macrocode}
5375 %Prefix for symbol, if required.
5376 % \begin{macrocode}
5377 \newcommand \datatoolGGsymbolprefix [ 1 ] { }
5378 % \end{macrocode}
5379 % Define the currency symbols for this region.
5380 % \begin{macrocode}
5381 \datatool_def_currency:nnnV
5382 { \datatoolGGcurrencyfmt }
5383 { GGP }
5384 { \pounds }
5385 \l_datatool_pound_tl
5386 % \end{macrocode}
5387 % Register the currency code with this region:
5388 % \begin{macrocode}
5389 \datatool_register_regional_currency_code:nn { GG } { GGP }
5390 % \end{macrocode}
5391 % Provide a command to set the currency for this region (for use
5392 % with any hook used when the locale changes).
5393 % NB this should do nothing with
5394 % \verb|\DTLsetup{region-currency=false}|
5395 % \begin{macrocode}
5396 \newcommand \datatoolGGSetCurrency
5397 {
5398 \bool_if:NT \l_datatool_region_set_currency_bool
5399 {
5400 \DTLsetdefaultcurrency { GGP }
5401 % \end{macrocode}
5402 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
5403 % \begin{macrocode}
5404 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
5405 % \end{macrocode}
5406 %Separator between symbol and value:
5407 % \begin{macrocode}
5408 \renewcommand \dtlcurrfmtsymsep { \l_datatool_GG_sym_sep_tl }
5409 }
5410 }
5411 % \end{macrocode}
5412 %
5413 %\subsection{Date and Time Parsing}
5414 % This defaults to day/month/year but may be changed with \cs{DTLsetLocaleOptions}. For example:
5415 %\begin{dispListing}
5416 %\DTLsetLocaleOptions{GG}{date-style=dmyyyy, date-variant=slash}
5417 %\end{dispListing}
5418 %An appropriate language file will need to also be installed to
5419 %parse dates containing month names or day of week names.
5420 %
5421 %Provide a way to configure parsing style.
5422 % \begin{macrocode}
5423 \tl_new:N \l__datatool_GG_datevariant_tl
5424 \tl_set:Nn \l__datatool_GG_datevariant_tl { slash }
5425 % \end{macrocode}
5426 %NB These token lists are used to form command names. The following is not
5427 %a format string.
5428 % \begin{macrocode}
5429 \tl_new:N \l__datatool_GG_datestyle_tl
5430 \tl_set:Nn \l__datatool_GG_datestyle_tl { ddmmyyyy }
5431 \tl_new:N \l__datatool_GG_timevariant_tl
5432 \tl_set:Nn \l__datatool_GG_timevariant_tl { colon }
5433 % \end{macrocode}
5434 %
5435 %Each parsing command defined below has final \marg{true} and \marg{false}
5436 %arguments (\code{TF}). These are used if parsing was successful (true) or if
5437 %parsing failed (false). The internal commands used by
5438 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
5439 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
5440 %not as conditionals.
5441 %
5442 %\subsubsection{Time Stamp Parsing}
5443 %Use command
5444 %\begin{definition}
5445 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
5446 %\end{definition}
5447 %with date regular expression
5448 %\begin{definition}
5449 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
5450 %\end{definition}
5451 %and time regular expression
5452 %\begin{definition}
5453 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
5454 %\end{definition}
5455 % \begin{macrocode}
5456 \cs_new:Nn \datatool_GG_parse_timestamp:NnTF
5457 {
5458 \cs_if_exist:cTF
5459 {
5460 datatool_
5461 \l__datatool_GG_datestyle_tl
5462 _hhmmss_tz_parse_timestamp:ccNnTF
5463 }
5464 {
5465 \cs_if_exist:cTF
5466 {
5467 c_datatool_
5468 \l__datatool_GG_datevariant_tl
5469 _
5470 \l__datatool_GG_datestyle_tl
5471 _date_regex
5472 }
5473 {
5474 \cs_if_exist:cTF
5475 {
5476 c_datatool_
5477 \l__datatool_GG_timevariant_tl
5478 _hhmmss_time_regex
5479 }
5480 {
5481 \use:c
5482 {
5483 datatool_
5484 \l__datatool_GG_datestyle_tl
5485 _hhmmss_tz_parse_timestamp:ccNnTF
5486 }
5487 {
5488 c_datatool_
5489 \l__datatool_GG_datevariant_tl
5490 _
5491 \l__datatool_GG_datestyle_tl
5492 _date_regex
5493 }
5494 {
5495 c_datatool_
5496 \l__datatool_GG_timevariant_tl
5497 _hhmmss_time_regex
5498 }
5499 #1 { #2 } { #3 } { #4 }
5500 }
5501 {
5502 \datatool_warn_check_head_language_empty:Vnnn
5503 \l__datatool_GG_timevariant_tl
5504 { datatool-GG }
5505 {
5506 No ~ language ~ support ~ for ~ time ~ variant ~
5507 ` \exp_args:Ne \tl_tail:n { \l__datatool_GG_timevariant_tl } '
5508 }
5509 {
5510 No ~ support ~ for ~ time ~ variant ~
5511 ` \l__datatool_GG_timevariant_tl '
5512 }
5513 #4
5514 }
5515 }
5516 {
5517 \datatool_warn_check_head_language_empty:Vnnn
5518 \l__datatool_GG_datevariant_tl
5519 { datatool-GG }
5520 {
5521 No ~ language ~ support ~ for ~ date ~ style ~
5522 ` \l__datatool_GG_datestyle_tl '
5523 }
5524 {
5525 No ~ support ~ for ~ date ~ style ~
5526 ` \l__datatool_GG_datestyle_tl ' ~ with ~
5527 variant ~
5528 ` \l__datatool_GG_datevariant_tl '
5529 }
5530 #4
5531 }
5532 }
5533 {
5534 \datatool_locale_warn:nn { datatool-GG }
5535 {
5536 No ~ support ~ for ~ date ~ style ~
5537 ` \l__datatool_GG_datestyle_tl '
5538 }
5539 #4
5540 }
5541 }
5542 % \end{macrocode}
5543 %
5544 %\subsubsection{Date Parsing}
5545 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
5546 %with regular expression
5547 %\begin{definition}
5548 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
5549 %\end{definition}
5550 % \begin{macrocode}
5551 \cs_new:Nn \datatool_GG_parse_date:NnTF
5552 {
5553 \cs_if_exist:cTF
5554 {
5555 datatool_
5556 \l__datatool_GG_datestyle_tl
5557 _parse_date:NNnTF
5558 }
5559 {
5560 \cs_if_exist:cTF
5561 {
5562 c_datatool_
5563 \l__datatool_GG_datevariant_tl
5564 _anchored_
5565 \l__datatool_GG_datestyle_tl
5566 _date_regex
5567 }
5568 {
5569 \exp_args:cc
5570 {
5571 datatool_
5572 \l__datatool_GG_datestyle_tl
5573 _parse_date:NNnTF
5574 }
5575 {
5576 c_datatool_
5577 \l__datatool_GG_datevariant_tl
5578 _anchored_
5579 \l__datatool_GG_datestyle_tl
5580 _date_regex
5581 }
5582 #1 { #2 } { #3 } { #4 }
5583 }
5584 {
5585 \datatool_warn_check_head_language_empty:Vnnn
5586 \l__datatool_GG_datevariant_tl
5587 { datatool-GG }
5588 {
5589 No ~ language ~ support ~ for ~ date ~ style ~
5590 ` \l__datatool_GG_datestyle_tl '
5591 }
5592 {
5593 No ~ support ~ for ~ date ~ style ~
5594 ` \l__datatool_GG_datestyle_tl ' ~ with ~
5595 variant ~
5596 ` \l__datatool_GG_datevariant_tl '
5597 }
5598 #4
5599 }
5600 }
5601 {
5602 \datatool_locale_warn:nn { datatool-GG }
5603 {
5604 No ~ support ~ for ~ date ~ style ~
5605 ` \l__datatool_GG_datestyle_tl '
5606 }
5607 #4
5608 }
5609 }
5610 % \end{macrocode}
5611 %
5612 %\subsubsection{Time Parsing}
5613 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
5614 %with regular expression
5615 %\begin{definition}
5616 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
5617 %\end{definition}
5618 % \begin{macrocode}
5619 \cs_new:Nn \datatool_GG_parse_time:NnTF
5620 {
5621 \cs_if_exist:cTF
5622 {
5623 c_datatool_
5624 \l__datatool_GG_timevariant_tl
5625 _anchored_hhmmss_time_regex
5626 }
5627 {
5628 \datatool_hhmmss_parse_time:cNnTF
5629 {
5630 c_datatool_
5631 \l__datatool_GG_timevariant_tl
5632 _anchored_hhmmss_time_regex
5633 }
5634 #1 { #2 } { #3 } { #4 }
5635 }
5636 {
5637 \datatool_warn_check_head_language_empty:Vnnn
5638 \l__datatool_GG_timevariant_tl
5639 { datatool-GG }
5640 {
5641 No ~ language ~ support ~ for ~ time ~ variant ~
5642 ` \exp_args:Ne \tl_tail:n { \l__datatool_GG_timevariant_tl } '
5643 }
5644 {
5645 No ~ support ~ for ~ time ~ variant ~
5646 ` \l__datatool_GG_timevariant_tl '
5647 }
5648 #4
5649 }
5650 }
5651 % \end{macrocode}
5652 %
5653 %\subsubsection{Time Zone Mappings}
5654 %Define time zone mapping command for this region:
5655 % \begin{macrocode}
5656 \cs_new:Nn \datatool_GG_get_timezone_map:n
5657 {
5658 \datatool_region_get_timezone_map:n { GG / #1 }
5659 }
5660 % \end{macrocode}
5661 %Define time zone IDs for this region (one-way map from ID to offset):
5662 % \begin{macrocode}
5663 \datatool_region_set_timezone_map:nn { GG / BST } { +01:00 }
5664 \datatool_region_set_timezone_map:nn { GG / GMT } { +00:00 }
5665 \datatool_region_set_timezone_map:nn { GG / CET } { +01:00 }
5666 \datatool_region_set_timezone_map:nn { GG / CEST } { +02:00 }
5667 % \end{macrocode}
5668 %
5669 %\subsection{Options}
5670 %Define options for this region:
5671 % \begin{macrocode}
5672 \datatool_locale_define_keys:nn { GG }
5673 {
5674 number-style .choices:nn =
5675 { official, unofficial }
5676 {
5677 \exp_args:NNe \renewcommand
5678 \datatoolGGSetNumberChars
5679 {
5680 \exp_not:N \bool_if:NT
5681 \exp_not:N \l_datatool_region_set_numberchars_bool
5682 {
5683 \exp_not:c { datatool_GG_set_numberchars_ \l_keys_choice_tl : }
5684 }
5685 }
5686 \tl_if_eq:NnT \l_datatool_current_region_tl { GG }
5687 {
5688 \datatoolGGSetNumberChars
5689 }
5690 } ,
5691 % \end{macrocode}
5692 % Currency symbol before or after value:
5693 % \begin{macrocode}
5694 currency-symbol-position .choice: ,
5695 currency-symbol-position / before .code:n =
5696 {
5697 \cs_set_eq:NN \datatool_GG_currency_position:nn \dtlcurrprefixfmt
5698 } ,
5699 currency-symbol-position / after .code:n =
5700 {
5701 \cs_set_eq:NN \datatool_GG_currency_position:nn \dtlcurrsuffixfmt
5702 } ,
5703 % \end{macrocode}
5704 % Should the currency symbol be prefixed with the region code:
5705 % \begin{macrocode}
5706 currency-symbol-prefix .choice: ,
5707 currency-symbol-prefix / false .code:n =
5708 {
5709 \cs_set_eq:NN \datatoolGGsymbolprefix \use_none:n
5710 } ,
5711 currency-symbol-prefix / true .code:n =
5712 {
5713 \cs_set_eq:NN
5714 \datatoolGGsymbolprefix
5715 \datatool_currency_symbol_region_prefix:n
5716 } ,
5717 currency-symbol-prefix .default:n = { true } ,
5718 % \end{macrocode}
5719 % Separator between currency symbol (not code) and value:
5720 % \begin{macrocode}
5721 currency-symbol-sep .choice: ,
5722 currency-symbol-sep / none .code:n =
5723 {
5724 \tl_clear:N \l_datatool_GG_sym_sep_tl
5725 } ,
5726 currency-symbol-sep / thin-space .code:n =
5727 {
5728 \tl_set:Nn \l_datatool_GG_sym_sep_tl { \, }
5729 } ,
5730 currency-symbol-sep / space .code:n =
5731 {
5732 \tl_set:Nn \l_datatool_GG_sym_sep_tl { ~ }
5733 } ,
5734 currency-symbol-sep / nbsp .code:n =
5735 {
5736 \tl_set:Nn \l_datatool_GG_sym_sep_tl { \nobreakspace }
5737 } ,
5738 currency-symbol-sep . initial:n = { none } ,
5739 % \end{macrocode}
5740 % Date and time styles:
5741 % \begin{macrocode}
5742 date-style .choice: ,
5743 date-style / dmyyyy .code: n =
5744 {
5745 \tl_set:Nn \l__datatool_GG_datestyle_tl { ddmmyyyy }
5746 } ,
5747 date-style / mdyyyy .code: n =
5748 {
5749 \tl_set:Nn \l__datatool_GG_datestyle_tl { mmddyyyy }
5750 } ,
5751 date-style / yyyymd .code: n =
5752 {
5753 \tl_set:Nn \l__datatool_GG_datestyle_tl { yyyymmdd }
5754 } ,
5755 date-style / dmyy .code: n =
5756 {
5757 \tl_set:Nn \l__datatool_GG_datestyle_tl { ddmmyy }
5758 } ,
5759 date-style / mdyy .code: n =
5760 {
5761 \tl_set:Nn \l__datatool_GG_datestyle_tl { mmddyy }
5762 } ,
5763 date-style / yymd .code: n =
5764 {
5765 \tl_set:Nn \l__datatool_GG_datestyle_tl { yymmdd }
5766 } ,
5767 date-variant .choice: ,
5768 date-variant / slash .code:n =
5769 {
5770 \tl_set:Nn \l__datatool_GG_datevariant_tl { slash }
5771 } ,
5772 date-variant / hyphen .code:n =
5773 {
5774 \tl_set:Nn \l__datatool_GG_datevariant_tl { hyphen }
5775 } ,
5776 date-variant / dot .code:n =
5777 {
5778 \tl_set:Nn \l__datatool_GG_datevariant_tl { dot }
5779 } ,
5780 date-variant / dialect .code:n =
5781 {
5782 \tl_set:Nn \l__datatool_GG_datevariant_tl
5783 { \l_datatool_current_language_tl }
5784 } ,
5785 time-variant .choice: ,
5786 time-variant / colon .code:n =
5787 {
5788 \tl_set:Nn \l__datatool_GG_timevariant_tl { colon }
5789 } ,
5790 time-variant / dot .code:n =
5791 {
5792 \tl_set:Nn \l__datatool_GG_timevariant_tl { dot }
5793 } ,
5794 time-variant / dialect .code:n =
5795 {
5796 \tl_if_eq:NnTF \l__datatool_GG_timevariant_tl { dot }
5797 {
5798 \tl_set:Nn \l__datatool_GG_timevariant_tl
5799 { \l_datatool_current_language_tl _dot }
5800 }
5801 {
5802 \tl_if_in:NnF
5803 \l__datatool_GG_timevariant_tl
5804 { \l_datatool_current_language_tl }
5805 {
5806 \tl_set:Nn \l__datatool_GG_timevariant_tl
5807 { \l_datatool_current_language_tl _colon }
5808 }
5809 }
5810 } ,
5811 time-variant / dialect-colon .code:n =
5812 {
5813 \tl_set:Nn \l__datatool_GG_timevariant_tl
5814 { \l_datatool_current_language_tl _colon }
5815 } ,
5816 time-variant / dialect-dot .code:n =
5817 {
5818 \tl_set:Nn \l__datatool_GG_timevariant_tl
5819 { \l_datatool_current_language_tl _dot }
5820 } ,
5821 }
5822 % \end{macrocode}
5823 %
5824 %\subsection{Hooks}
5825 %Command to update temporal parsing commands for this region:
5826 % \begin{macrocode}
5827 \newcommand \datatoolGGSetTemporalParsers
5828 {
5829 \renewcommand \DTLCurrentLocaleParseTimeStamp
5830 { \datatool_GG_parse_timestamp:NnTF }
5831 \renewcommand \DTLCurrentLocaleParseDate
5832 { \datatool_GG_parse_date:NnTF }
5833 \renewcommand \DTLCurrentLocaleParseTime
5834 { \datatool_GG_parse_time:NnTF }
5835 \let
5836 \DTLCurrentLocaleGetTimeZoneMap
5837 \datatool_GG_get_timezone_map:n
5838 }
5839 % \end{macrocode}
5840 %Set temporal formatting commands for this region. Currently this
5841 %just resets to the default, but may change in future.
5842 %Note that the defaults test if the applicable \sty{datetime2}
5843 %command is available and will fallback on ISO if not defined.
5844 %Bear in mind that the default style for \sty{datetime2} is
5845 %\texttt{iso} so there won't be a noticeable difference unless the
5846 %\sty{datetime2} regional setting is on.
5847 % \begin{macrocode}
5848 \newcommand \datatoolGGSetTemporalFormatters
5849 {
5850 \let
5851 \DTLCurrentLocaleFormatDate
5852 \datatool_default_date_fmt:nnnn
5853 \let
5854 \DTLCurrentLocaleFormatTime
5855 \datatool_default_time_fmt:nnn
5856 \let
5857 \DTLCurrentLocaleFormatTimeZone
5858 \datatool_default_timezone_fmt:nn
5859 \let
5860 \DTLCurrentLocaleFormatTimeStampNoZone
5861 \datatool_default_timestamp_fmt:nnnnnnn
5862 \let
5863 \DTLCurrentLocaleFormatTimeStampWithZone
5864 \datatool_default_timestamp_fmt:nnnnnnnnn
5865 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
5866 }
5867 % \end{macrocode}
5868 %
5869 %
5870 %Command to update currency and temporal parsing commands for this region:
5871 % \begin{macrocode}
5872 \newcommand \DTLGGLocaleHook
5873 {
5874 \datatoolGGSetNumberChars
5875 \datatoolGGSetCurrency
5876 \datatoolGGSetTemporalParsers
5877 \datatoolGGSetTemporalFormatters
5878 % \end{macrocode}
5879 %Allow language files to reference the region:
5880 % \begin{macrocode}
5881 \tl_set:Nn \l_datatool_current_region_tl { GG }
5882 }
5883 % \end{macrocode}
5884 %
5885 % Finished with \LaTeX3 syntax.
5886 % \begin{macrocode}
5887 \ExplSyntaxOff
5888 % \end{macrocode}
5889 %Note that the hook is added to the captions by \sty{datatool-base}
5890 %not by the region file.
5891 %\iffalse
5892 % \begin{macrocode}
5893 %</datatool-GG.ldf>
5894 % \end{macrocode}
5895 %\fi
5896 %\iffalse
5897 % \begin{macrocode}
5898 %<*datatool-GI.ldf>
5899 % \end{macrocode}
5900 %\fi
5901 %\section{datatool-GI.ldf}\label{sec:datatool-GI}
5902 % Support for region GI.
5903 % \begin{macrocode}
5904 \TrackLangProvidesResource{GI}[2025/03/01 v1.0]
5905 % \end{macrocode}
5906 % Switch on \LaTeX3 syntax:
5907 % \begin{macrocode}
5908 \ExplSyntaxOn
5909 % \end{macrocode}
5910 %
5911 %\subsection{Numbers and Currency}
5912 %Set the number group and decimal symbols for this region.
5913 % \begin{macrocode}
5914 \cs_new:Nn \datatool_GI_set_numberchars_official:
5915 {
5916 \datatool_set_numberchars:nn { , } { . }
5917 }
5918 % \end{macrocode}
5919 %Unofficial style.
5920 % \begin{macrocode}
5921 \cs_new:Nn \datatool_GI_set_numberchars_unofficial:
5922 {
5923 \datatool_set_thinspace_group_decimal_char:n { . }
5924 }
5925 % \end{macrocode}
5926 %Hook to set the number group and decimal characters for the region:
5927 % \begin{macrocode}
5928 \newcommand \datatoolGISetNumberChars
5929 {
5930 \bool_if:NT \l_datatool_region_set_numberchars_bool
5931 {
5932 \datatool_GI_set_numberchars_official:
5933 }
5934 }
5935 % \end{macrocode}
5936 %How to format the position of the currency symbol in relation to the value.
5937 % \begin{macrocode}
5938 \cs_new:Nn \datatool_GI_currency_position:nn
5939 {
5940 \dtlcurrprefixfmt { #1 } { #2 }
5941 }
5942 % \end{macrocode}
5943 %Separator between currency symbol and value.
5944 % \begin{macrocode}
5945 \tl_new:N \l_datatool_GI_sym_sep_tl
5946 % \end{macrocode}
5947 % Set the currency format for this region.
5948 % \begin{macrocode}
5949 \newcommand \datatoolGIcurrencyfmt [ 2 ]
5950 {
5951 \datatool_GI_currency_position:nn
5952 {
5953 \datatoolGIsymbolprefix { GI }
5954 #1
5955 }
5956 { #2 }
5957 }
5958 % \end{macrocode}
5959 %Prefix for symbol, if required.
5960 % \begin{macrocode}
5961 \newcommand \datatoolGIsymbolprefix [ 1 ] { }
5962 % \end{macrocode}
5963 % Define the currency symbols for this region.
5964 % \begin{macrocode}
5965 \datatool_def_currency:nnnV
5966 { \datatoolGIcurrencyfmt }
5967 { GIP }
5968 { \pounds }
5969 \l_datatool_pound_tl
5970 % \end{macrocode}
5971 % Register the currency code with this region:
5972 % \begin{macrocode}
5973 \datatool_register_regional_currency_code:nn { GI } { GIP }
5974 % \end{macrocode}
5975 % Provide a command to set the currency for this region (for use
5976 % with any hook used when the locale changes).
5977 % NB this should do nothing with
5978 % \verb|\DTLsetup{region-currency=false}|
5979 % \begin{macrocode}
5980 \newcommand \datatoolGISetCurrency
5981 {
5982 \bool_if:NT \l_datatool_region_set_currency_bool
5983 {
5984 \DTLsetdefaultcurrency { GIP }
5985 % \end{macrocode}
5986 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
5987 % \begin{macrocode}
5988 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
5989 % \end{macrocode}
5990 %Separator between symbol and value:
5991 % \begin{macrocode}
5992 \renewcommand \dtlcurrfmtsymsep { \l_datatool_GI_sym_sep_tl }
5993 }
5994 }
5995 % \end{macrocode}
5996 %
5997 %\subsection{Date and Time Parsing}
5998 % This defaults to day/month/year but may be changed with \cs{DTLsetLocaleOptions}. For example:
5999 %\begin{dispListing}
6000 %\DTLsetLocaleOptions{GI}{date-style=dmyyyy, date-variant=slash}
6001 %\end{dispListing}
6002 %An appropriate language file will need to also be installed to
6003 %parse dates containing month names or day of week names.
6004 %
6005 %Provide a way to configure parsing style.
6006 % \begin{macrocode}
6007 \tl_new:N \l__datatool_GI_datevariant_tl
6008 \tl_set:Nn \l__datatool_GI_datevariant_tl { slash }
6009 % \end{macrocode}
6010 %NB These token lists are used to form command names. The following is not
6011 %a format string.
6012 % \begin{macrocode}
6013 \tl_new:N \l__datatool_GI_datestyle_tl
6014 \tl_set:Nn \l__datatool_GI_datestyle_tl { ddmmyyyy }
6015 \tl_new:N \l__datatool_GI_timevariant_tl
6016 \tl_set:Nn \l__datatool_GI_timevariant_tl { colon }
6017 % \end{macrocode}
6018 %
6019 %Each parsing command defined below has final \marg{true} and \marg{false}
6020 %arguments (\code{TF}). These are used if parsing was successful (true) or if
6021 %parsing failed (false). The internal commands used by
6022 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
6023 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
6024 %not as conditionals.
6025 %
6026 %\subsubsection{Time Stamp Parsing}
6027 %Use command
6028 %\begin{definition}
6029 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
6030 %\end{definition}
6031 %with date regular expression
6032 %\begin{definition}
6033 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
6034 %\end{definition}
6035 %and time regular expression
6036 %\begin{definition}
6037 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
6038 %\end{definition}
6039 % \begin{macrocode}
6040 \cs_new:Nn \datatool_GI_parse_timestamp:NnTF
6041 {
6042 \cs_if_exist:cTF
6043 {
6044 datatool_
6045 \l__datatool_GI_datestyle_tl
6046 _hhmmss_tz_parse_timestamp:ccNnTF
6047 }
6048 {
6049 \cs_if_exist:cTF
6050 {
6051 c_datatool_
6052 \l__datatool_GI_datevariant_tl
6053 _
6054 \l__datatool_GI_datestyle_tl
6055 _date_regex
6056 }
6057 {
6058 \cs_if_exist:cTF
6059 {
6060 c_datatool_
6061 \l__datatool_GI_timevariant_tl
6062 _hhmmss_time_regex
6063 }
6064 {
6065 \use:c
6066 {
6067 datatool_
6068 \l__datatool_GI_datestyle_tl
6069 _hhmmss_tz_parse_timestamp:ccNnTF
6070 }
6071 {
6072 c_datatool_
6073 \l__datatool_GI_datevariant_tl
6074 _
6075 \l__datatool_GI_datestyle_tl
6076 _date_regex
6077 }
6078 {
6079 c_datatool_
6080 \l__datatool_GI_timevariant_tl
6081 _hhmmss_time_regex
6082 }
6083 #1 { #2 } { #3 } { #4 }
6084 }
6085 {
6086 \datatool_warn_check_head_language_empty:Vnnn
6087 \l__datatool_GI_timevariant_tl
6088 { datatool-GI }
6089 {
6090 No ~ language ~ support ~ for ~ time ~ variant ~
6091 ` \exp_args:Ne \tl_tail:n { \l__datatool_GI_timevariant_tl } '
6092 }
6093 {
6094 No ~ support ~ for ~ time ~ variant ~
6095 ` \l__datatool_GI_timevariant_tl '
6096 }
6097 #4
6098 }
6099 }
6100 {
6101 \datatool_warn_check_head_language_empty:Vnnn
6102 \l__datatool_GI_datevariant_tl
6103 { datatool-GI }
6104 {
6105 No ~ language ~ support ~ for ~ date ~ style ~
6106 ` \l__datatool_GI_datestyle_tl '
6107 }
6108 {
6109 No ~ support ~ for ~ date ~ style ~
6110 ` \l__datatool_GI_datestyle_tl ' ~ with ~
6111 variant ~
6112 ` \l__datatool_GI_datevariant_tl '
6113 }
6114 #4
6115 }
6116 }
6117 {
6118 \datatool_locale_warn:nn { datatool-GI }
6119 {
6120 No ~ support ~ for ~ date ~ style ~
6121 ` \l__datatool_GI_datestyle_tl '
6122 }
6123 #4
6124 }
6125 }
6126 % \end{macrocode}
6127 %
6128 %\subsubsection{Date Parsing}
6129 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
6130 %with regular expression
6131 %\begin{definition}
6132 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
6133 %\end{definition}
6134 % \begin{macrocode}
6135 \cs_new:Nn \datatool_GI_parse_date:NnTF
6136 {
6137 \cs_if_exist:cTF
6138 {
6139 datatool_
6140 \l__datatool_GI_datestyle_tl
6141 _parse_date:NNnTF
6142 }
6143 {
6144 \cs_if_exist:cTF
6145 {
6146 c_datatool_
6147 \l__datatool_GI_datevariant_tl
6148 _anchored_
6149 \l__datatool_GI_datestyle_tl
6150 _date_regex
6151 }
6152 {
6153 \exp_args:cc
6154 {
6155 datatool_
6156 \l__datatool_GI_datestyle_tl
6157 _parse_date:NNnTF
6158 }
6159 {
6160 c_datatool_
6161 \l__datatool_GI_datevariant_tl
6162 _anchored_
6163 \l__datatool_GI_datestyle_tl
6164 _date_regex
6165 }
6166 #1 { #2 } { #3 } { #4 }
6167 }
6168 {
6169 \datatool_warn_check_head_language_empty:Vnnn
6170 \l__datatool_GI_datevariant_tl
6171 { datatool-GI }
6172 {
6173 No ~ language ~ support ~ for ~ date ~ style ~
6174 ` \l__datatool_GI_datestyle_tl '
6175 }
6176 {
6177 No ~ support ~ for ~ date ~ style ~
6178 ` \l__datatool_GI_datestyle_tl ' ~ with ~
6179 variant ~
6180 ` \l__datatool_GI_datevariant_tl '
6181 }
6182 #4
6183 }
6184 }
6185 {
6186 \datatool_locale_warn:nn { datatool-GI }
6187 {
6188 No ~ support ~ for ~ date ~ style ~
6189 ` \l__datatool_GI_datestyle_tl '
6190 }
6191 #4
6192 }
6193 }
6194 % \end{macrocode}
6195 %
6196 %\subsubsection{Time Parsing}
6197 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
6198 %with regular expression
6199 %\begin{definition}
6200 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
6201 %\end{definition}
6202 % \begin{macrocode}
6203 \cs_new:Nn \datatool_GI_parse_time:NnTF
6204 {
6205 \cs_if_exist:cTF
6206 {
6207 c_datatool_
6208 \l__datatool_GI_timevariant_tl
6209 _anchored_hhmmss_time_regex
6210 }
6211 {
6212 \datatool_hhmmss_parse_time:cNnTF
6213 {
6214 c_datatool_
6215 \l__datatool_GI_timevariant_tl
6216 _anchored_hhmmss_time_regex
6217 }
6218 #1 { #2 } { #3 } { #4 }
6219 }
6220 {
6221 \datatool_warn_check_head_language_empty:Vnnn
6222 \l__datatool_GI_timevariant_tl
6223 { datatool-GI }
6224 {
6225 No ~ language ~ support ~ for ~ time ~ variant ~
6226 ` \exp_args:Ne \tl_tail:n { \l__datatool_GI_timevariant_tl } '
6227 }
6228 {
6229 No ~ support ~ for ~ time ~ variant ~
6230 ` \l__datatool_GI_timevariant_tl '
6231 }
6232 #4
6233 }
6234 }
6235 % \end{macrocode}
6236 %
6237 %\subsubsection{Time Zone Mappings}
6238 %Define time zone mapping command for this region:
6239 % \begin{macrocode}
6240 \cs_new:Nn \datatool_GI_get_timezone_map:n
6241 {
6242 \datatool_region_get_timezone_map:n { GI / #1 }
6243 }
6244 % \end{macrocode}
6245 %Define time zone IDs for this region (one-way map from ID to offset):
6246 % \begin{macrocode}
6247 \datatool_region_set_timezone_map:nn { GI / CEST } { +02:00 }
6248 \datatool_region_set_timezone_map:nn { GI / BST } { +01:00 }
6249 \datatool_region_set_timezone_map:nn { GI / CET } { +01:00 }
6250 \datatool_region_set_timezone_map:nn { GI / GMT } { +00:00 }
6251 % \end{macrocode}
6252 %
6253 %\subsection{Options}
6254 %Define options for this region:
6255 % \begin{macrocode}
6256 \datatool_locale_define_keys:nn { GI }
6257 {
6258 number-style .choices:nn =
6259 { official, unofficial }
6260 {
6261 \exp_args:NNe \renewcommand
6262 \datatoolGISetNumberChars
6263 {
6264 \exp_not:N \bool_if:NT
6265 \exp_not:N \l_datatool_region_set_numberchars_bool
6266 {
6267 \exp_not:c { datatool_GI_set_numberchars_ \l_keys_choice_tl : }
6268 }
6269 }
6270 \tl_if_eq:NnT \l_datatool_current_region_tl { GI }
6271 {
6272 \datatoolGISetNumberChars
6273 }
6274 } ,
6275 % \end{macrocode}
6276 % Currency symbol before or after value:
6277 % \begin{macrocode}
6278 currency-symbol-position .choice: ,
6279 currency-symbol-position / before .code:n =
6280 {
6281 \cs_set_eq:NN \datatool_GI_currency_position:nn \dtlcurrprefixfmt
6282 } ,
6283 currency-symbol-position / after .code:n =
6284 {
6285 \cs_set_eq:NN \datatool_GI_currency_position:nn \dtlcurrsuffixfmt
6286 } ,
6287 % \end{macrocode}
6288 % Should the currency symbol be prefixed with the region code:
6289 % \begin{macrocode}
6290 currency-symbol-prefix .choice: ,
6291 currency-symbol-prefix / false .code:n =
6292 {
6293 \cs_set_eq:NN \datatoolGIsymbolprefix \use_none:n
6294 } ,
6295 currency-symbol-prefix / true .code:n =
6296 {
6297 \cs_set_eq:NN
6298 \datatoolGIsymbolprefix
6299 \datatool_currency_symbol_region_prefix:n
6300 } ,
6301 currency-symbol-prefix .default:n = { true } ,
6302 % \end{macrocode}
6303 % Separator between currency symbol (not code) and value:
6304 % \begin{macrocode}
6305 currency-symbol-sep .choice: ,
6306 currency-symbol-sep / none .code:n =
6307 {
6308 \tl_clear:N \l_datatool_GI_sym_sep_tl
6309 } ,
6310 currency-symbol-sep / thin-space .code:n =
6311 {
6312 \tl_set:Nn \l_datatool_GI_sym_sep_tl { \, }
6313 } ,
6314 currency-symbol-sep / space .code:n =
6315 {
6316 \tl_set:Nn \l_datatool_GI_sym_sep_tl { ~ }
6317 } ,
6318 currency-symbol-sep / nbsp .code:n =
6319 {
6320 \tl_set:Nn \l_datatool_GI_sym_sep_tl { \nobreakspace }
6321 } ,
6322 currency-symbol-sep . initial:n = { none } ,
6323 % \end{macrocode}
6324 % Date and time styles:
6325 % \begin{macrocode}
6326 date-style .choice: ,
6327 date-style / dmyyyy .code: n =
6328 {
6329 \tl_set:Nn \l__datatool_GI_datestyle_tl { ddmmyyyy }
6330 } ,
6331 date-style / mdyyyy .code: n =
6332 {
6333 \tl_set:Nn \l__datatool_GI_datestyle_tl { mmddyyyy }
6334 } ,
6335 date-style / yyyymd .code: n =
6336 {
6337 \tl_set:Nn \l__datatool_GI_datestyle_tl { yyyymmdd }
6338 } ,
6339 date-style / dmyy .code: n =
6340 {
6341 \tl_set:Nn \l__datatool_GI_datestyle_tl { ddmmyy }
6342 } ,
6343 date-style / mdyy .code: n =
6344 {
6345 \tl_set:Nn \l__datatool_GI_datestyle_tl { mmddyy }
6346 } ,
6347 date-style / yymd .code: n =
6348 {
6349 \tl_set:Nn \l__datatool_GI_datestyle_tl { yymmdd }
6350 } ,
6351 date-variant .choice: ,
6352 date-variant / slash .code:n =
6353 {
6354 \tl_set:Nn \l__datatool_GI_datevariant_tl { slash }
6355 } ,
6356 date-variant / hyphen .code:n =
6357 {
6358 \tl_set:Nn \l__datatool_GI_datevariant_tl { hyphen }
6359 } ,
6360 date-variant / dot .code:n =
6361 {
6362 \tl_set:Nn \l__datatool_GI_datevariant_tl { dot }
6363 } ,
6364 date-variant / dialect .code:n =
6365 {
6366 \tl_set:Nn \l__datatool_GI_datevariant_tl
6367 { \l_datatool_current_language_tl }
6368 } ,
6369 time-variant .choice: ,
6370 time-variant / colon .code:n =
6371 {
6372 \tl_set:Nn \l__datatool_GI_timevariant_tl { colon }
6373 } ,
6374 time-variant / dot .code:n =
6375 {
6376 \tl_set:Nn \l__datatool_GI_timevariant_tl { dot }
6377 } ,
6378 time-variant / dialect .code:n =
6379 {
6380 \tl_if_eq:NnTF \l__datatool_GI_timevariant_tl { dot }
6381 {
6382 \tl_set:Nn \l__datatool_GI_timevariant_tl
6383 { \l_datatool_current_language_tl _dot }
6384 }
6385 {
6386 \tl_if_in:NnF
6387 \l__datatool_GI_timevariant_tl
6388 { \l_datatool_current_language_tl }
6389 {
6390 \tl_set:Nn \l__datatool_GI_timevariant_tl
6391 { \l_datatool_current_language_tl _colon }
6392 }
6393 }
6394 } ,
6395 time-variant / dialect-colon .code:n =
6396 {
6397 \tl_set:Nn \l__datatool_GI_timevariant_tl
6398 { \l_datatool_current_language_tl _colon }
6399 } ,
6400 time-variant / dialect-dot .code:n =
6401 {
6402 \tl_set:Nn \l__datatool_GI_timevariant_tl
6403 { \l_datatool_current_language_tl _dot }
6404 } ,
6405 }
6406 % \end{macrocode}
6407 %
6408 %\subsection{Hooks}
6409 %Command to update temporal parsing commands for this region:
6410 % \begin{macrocode}
6411 \newcommand \datatoolGISetTemporalParsers
6412 {
6413 \renewcommand \DTLCurrentLocaleParseTimeStamp
6414 { \datatool_GI_parse_timestamp:NnTF }
6415 \renewcommand \DTLCurrentLocaleParseDate
6416 { \datatool_GI_parse_date:NnTF }
6417 \renewcommand \DTLCurrentLocaleParseTime
6418 { \datatool_GI_parse_time:NnTF }
6419 \let
6420 \DTLCurrentLocaleGetTimeZoneMap
6421 \datatool_GI_get_timezone_map:n
6422 }
6423 % \end{macrocode}
6424 %Set temporal formatting commands for this region. Currently this
6425 %just resets to the default, but may change in future.
6426 %Note that the defaults test if the applicable \sty{datetime2}
6427 %command is available and will fallback on ISO if not defined.
6428 %Bear in mind that the default style for \sty{datetime2} is
6429 %\texttt{iso} so there won't be a noticeable difference unless the
6430 %\sty{datetime2} regional setting is on.
6431 % \begin{macrocode}
6432 \newcommand \datatoolGISetTemporalFormatters
6433 {
6434 \let
6435 \DTLCurrentLocaleFormatDate
6436 \datatool_default_date_fmt:nnnn
6437 \let
6438 \DTLCurrentLocaleFormatTime
6439 \datatool_default_time_fmt:nnn
6440 \let
6441 \DTLCurrentLocaleFormatTimeZone
6442 \datatool_default_timezone_fmt:nn
6443 \let
6444 \DTLCurrentLocaleFormatTimeStampNoZone
6445 \datatool_default_timestamp_fmt:nnnnnnn
6446 \let
6447 \DTLCurrentLocaleFormatTimeStampWithZone
6448 \datatool_default_timestamp_fmt:nnnnnnnnn
6449 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
6450 }
6451 % \end{macrocode}
6452 %
6453 %
6454 %Command to update currency and temporal parsing commands for this region:
6455 % \begin{macrocode}
6456 \newcommand \DTLGILocaleHook
6457 {
6458 \datatoolGISetNumberChars
6459 \datatoolGISetCurrency
6460 \datatoolGISetTemporalParsers
6461 \datatoolGISetTemporalFormatters
6462 % \end{macrocode}
6463 %Allow language files to reference the region:
6464 % \begin{macrocode}
6465 \tl_set:Nn \l_datatool_current_region_tl { GI }
6466 }
6467 % \end{macrocode}
6468 %
6469 % Finished with \LaTeX3 syntax.
6470 % \begin{macrocode}
6471 \ExplSyntaxOff
6472 % \end{macrocode}
6473 %Note that the hook is added to the captions by \sty{datatool-base}
6474 %not by the region file.
6475 %\iffalse
6476 % \begin{macrocode}
6477 %</datatool-GI.ldf>
6478 % \end{macrocode}
6479 %\fi
6480 %\iffalse
6481 % \begin{macrocode}
6482 %<*datatool-IE.ldf>
6483 % \end{macrocode}
6484 %\fi
6485 %\section{datatool-IE.ldf}\label{sec:datatool-IE}
6486 % Support for region IE.
6487 % \begin{macrocode}
6488 \TrackLangProvidesResource{IE}[2025/03/01 v1.0]
6489 % \end{macrocode}
6490 % Switch on \LaTeX3 syntax:
6491 % \begin{macrocode}
6492 \ExplSyntaxOn
6493 % \end{macrocode}
6494 %
6495 %\subsection{Numbers and Currency}
6496 %Set the number group and decimal symbols for this region.
6497 % \begin{macrocode}
6498 \cs_new:Nn \datatool_IE_set_numberchars_official:
6499 {
6500 \datatool_set_numberchars:nn { , } { . }
6501 }
6502 % \end{macrocode}
6503 %Unofficial style.
6504 % \begin{macrocode}
6505 \cs_new:Nn \datatool_IE_set_numberchars_unofficial:
6506 {
6507 \datatool_set_thinspace_group_decimal_char:n { . }
6508 }
6509 % \end{macrocode}
6510 %Hook to set the number group and decimal characters for the region:
6511 % \begin{macrocode}
6512 \newcommand \datatoolIESetNumberChars
6513 {
6514 \bool_if:NT \l_datatool_region_set_numberchars_bool
6515 {
6516 \datatool_IE_set_numberchars_official:
6517 }
6518 }
6519 % \end{macrocode}
6520 % The EUR currency is already defined by \sty{datatool-base}, but we
6521 % need to register the currency code with this region:
6522 % \begin{macrocode}
6523 \datatool_register_regional_currency_code:nn { IE } { EUR }
6524 % \end{macrocode}
6525 %How to format the position of the currency symbol in relation to the value.
6526 % \begin{macrocode}
6527 \cs_new:Nn \datatool_IE_currency_position:nn
6528 {
6529 \dtlcurrprefixfmt { #1 } { #2 }
6530 }
6531 % \end{macrocode}
6532 %Separator between currency symbol and value.
6533 % \begin{macrocode}
6534 \tl_new:N \l_datatool_IE_sym_sep_tl
6535 % \end{macrocode}
6536 %
6537 % Provide a command to set the currency for this region (for use
6538 % with any hook used when the locale changes).
6539 % \begin{macrocode}
6540 \newcommand \datatoolIESetCurrency
6541 {
6542 \bool_if:NT \l_datatool_region_set_currency_bool
6543 {
6544 \DTLsetdefaultcurrency { EUR }
6545 % \end{macrocode}
6546 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
6547 % \begin{macrocode}
6548 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
6549 % \end{macrocode}
6550 %Update EUR format to reflect current region style:
6551 % \begin{macrocode}
6552 \renewcommand \DTLdefaultEURcurrencyfmt
6553 { \datatool_IE_currency_position:nn }
6554 % \end{macrocode}
6555 %Separator between symbol and value:
6556 % \begin{macrocode}
6557 \renewcommand \dtlcurrfmtsymsep { \l_datatool_IE_sym_sep_tl }
6558 }
6559 }
6560 % \end{macrocode}
6561 %
6562 %\subsection{Date and Time Parsing}
6563 % This defaults to day/month/year but may be changed with \cs{DTLsetLocaleOptions}. For example:
6564 %\begin{dispListing}
6565 %\DTLsetLocaleOptions{IE}{date-style=dmyyyy, date-variant=slash}
6566 %\end{dispListing}
6567 %An appropriate language file will need to also be installed to
6568 %parse dates containing month names or day of week names.
6569 %
6570 % Provide a way to configure parsing style.
6571 % \begin{macrocode}
6572 \tl_new:N \l__datatool_IE_datevariant_tl
6573 \tl_set:Nn \l__datatool_IE_datevariant_tl { slash }
6574 % \end{macrocode}
6575 %NB These token lists are used to form command names. The following is not
6576 %a format string.
6577 % \begin{macrocode}
6578 \tl_new:N \l__datatool_IE_datestyle_tl
6579 \tl_set:Nn \l__datatool_IE_datestyle_tl { ddmmyyyy }
6580 \tl_new:N \l__datatool_IE_timevariant_tl
6581 \tl_set:Nn \l__datatool_IE_timevariant_tl { colon }
6582 % \end{macrocode}
6583 %
6584 %Each parsing command defined below has final \marg{true} and \marg{false}
6585 %arguments (\code{TF}). These are used if parsing was successful (true) or if
6586 %parsing failed (false). The internal commands used by
6587 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
6588 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
6589 %not as conditionals.
6590 %
6591 %\subsubsection{Time Stamp Parsing}
6592 %Use command
6593 %\begin{definition}
6594 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
6595 %\end{definition}
6596 %with date regular expression
6597 %\begin{definition}
6598 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
6599 %\end{definition}
6600 %and time regular expression
6601 %\begin{definition}
6602 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
6603 %\end{definition}
6604 % \begin{macrocode}
6605 \cs_new:Nn \datatool_IE_parse_timestamp:NnTF
6606 {
6607 \cs_if_exist:cTF
6608 {
6609 datatool_
6610 \l__datatool_IE_datestyle_tl
6611 _hhmmss_tz_parse_timestamp:ccNnTF
6612 }
6613 {
6614 \cs_if_exist:cTF
6615 {
6616 c_datatool_
6617 \l__datatool_IE_datevariant_tl
6618 _
6619 \l__datatool_IE_datestyle_tl
6620 _date_regex
6621 }
6622 {
6623 \cs_if_exist:cTF
6624 {
6625 c_datatool_
6626 \l__datatool_IE_timevariant_tl
6627 _hhmmss_time_regex
6628 }
6629 {
6630 \use:c
6631 {
6632 datatool_
6633 \l__datatool_IE_datestyle_tl
6634 _hhmmss_tz_parse_timestamp:ccNnTF
6635 }
6636 {
6637 c_datatool_
6638 \l__datatool_IE_datevariant_tl
6639 _
6640 \l__datatool_IE_datestyle_tl
6641 _date_regex
6642 }
6643 {
6644 c_datatool_
6645 \l__datatool_IE_timevariant_tl
6646 _hhmmss_time_regex
6647 }
6648 #1 { #2 } { #3 } { #4 }
6649 }
6650 {
6651 \datatool_warn_check_head_language_empty:Vnnn
6652 \l__datatool_IE_timevariant_tl
6653 { datatool-IE }
6654 {
6655 No ~ language ~ support ~ for ~ time ~ variant ~
6656 ` \exp_args:Ne \tl_tail:n { \l__datatool_IE_timevariant_tl } '
6657 }
6658 {
6659 No ~ support ~ for ~ time ~ variant ~
6660 ` \l__datatool_IE_timevariant_tl '
6661 }
6662 #4
6663 }
6664 }
6665 {
6666 \datatool_warn_check_head_language_empty:Vnnn
6667 \l__datatool_IE_datevariant_tl
6668 { datatool-IE }
6669 {
6670 No ~ language ~ support ~ for ~ date ~ style ~
6671 ` \l__datatool_IE_datestyle_tl '
6672 }
6673 {
6674 No ~ support ~ for ~ date ~ style ~
6675 ` \l__datatool_IE_datestyle_tl ' ~ with ~
6676 variant ~
6677 ` \l__datatool_IE_datevariant_tl '
6678 }
6679 #4
6680 }
6681 }
6682 {
6683 \datatool_locale_warn:nn { datatool-IE }
6684 {
6685 No ~ support ~ for ~ date ~ style ~
6686 ` \l__datatool_IE_datestyle_tl '
6687 }
6688 #4
6689 }
6690 }
6691 % \end{macrocode}
6692 %
6693 %\subsubsection{Date Parsing}
6694 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
6695 %with regular expression
6696 %\begin{definition}
6697 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
6698 %\end{definition}
6699 % \begin{macrocode}
6700 \cs_new:Nn \datatool_IE_parse_date:NnTF
6701 {
6702 \cs_if_exist:cTF
6703 {
6704 datatool_
6705 \l__datatool_IE_datestyle_tl
6706 _parse_date:NNnTF
6707 }
6708 {
6709 \cs_if_exist:cTF
6710 {
6711 c_datatool_
6712 \l__datatool_IE_datevariant_tl
6713 _anchored_
6714 \l__datatool_IE_datestyle_tl
6715 _date_regex
6716 }
6717 {
6718 \exp_args:cc
6719 {
6720 datatool_
6721 \l__datatool_IE_datestyle_tl
6722 _parse_date:NNnTF
6723 }
6724 {
6725 c_datatool_
6726 \l__datatool_IE_datevariant_tl
6727 _anchored_
6728 \l__datatool_IE_datestyle_tl
6729 _date_regex
6730 }
6731 #1 { #2 } { #3 } { #4 }
6732 }
6733 {
6734 \datatool_warn_check_head_language_empty:Vnnn
6735 \l__datatool_IE_datevariant_tl
6736 { datatool-IE }
6737 {
6738 No ~ language ~ support ~ for ~ date ~ style ~
6739 ` \l__datatool_IE_datestyle_tl '
6740 }
6741 {
6742 No ~ support ~ for ~ date ~ style ~
6743 ` \l__datatool_IE_datestyle_tl ' ~ with ~
6744 variant ~
6745 ` \l__datatool_IE_datevariant_tl '
6746 }
6747 #4
6748 }
6749 }
6750 {
6751 \datatool_locale_warn:nn { datatool-IE }
6752 {
6753 No ~ support ~ for ~ date ~ style ~
6754 ` \l__datatool_IE_datestyle_tl '
6755 }
6756 #4
6757 }
6758 }
6759 % \end{macrocode}
6760 %
6761 %\subsubsection{Time Parsing}
6762 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
6763 %with regular expression
6764 %\begin{definition}
6765 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
6766 %\end{definition}
6767 % \begin{macrocode}
6768 \cs_new:Nn \datatool_IE_parse_time:NnTF
6769 {
6770 \cs_if_exist:cTF
6771 {
6772 c_datatool_
6773 \l__datatool_IE_timevariant_tl
6774 _anchored_hhmmss_time_regex
6775 }
6776 {
6777 \datatool_hhmmss_parse_time:cNnTF
6778 {
6779 c_datatool_
6780 \l__datatool_IE_timevariant_tl
6781 _anchored_hhmmss_time_regex
6782 }
6783 #1 { #2 } { #3 } { #4 }
6784 }
6785 {
6786 \datatool_warn_check_head_language_empty:Vnnn
6787 \l__datatool_IE_timevariant_tl
6788 { datatool-IE }
6789 {
6790 No ~ language ~ support ~ for ~ time ~ variant ~
6791 ` \exp_args:Ne \tl_tail:n { \l__datatool_IE_timevariant_tl } '
6792 }
6793 {
6794 No ~ support ~ for ~ time ~ variant ~
6795 ` \l__datatool_IE_timevariant_tl '
6796 }
6797 #4
6798 }
6799 }
6800 % \end{macrocode}
6801 %
6802 %\subsubsection{Time Zone Mappings}
6803 %Define time zone mapping command for this region:
6804 % \begin{macrocode}
6805 \cs_new:Nn \datatool_IE_get_timezone_map:n
6806 {
6807 \datatool_region_get_timezone_map:n { IE / #1 }
6808 }
6809 % \end{macrocode}
6810 %Define time zone IDs for this region (one-way map from ID to offset):
6811 % \begin{macrocode}
6812 \datatool_region_set_timezone_map:nn { IE / IST } { +01:00 }
6813 \datatool_region_set_timezone_map:nn { IE / GMT } { +00:00 }
6814 \datatool_region_set_timezone_map:nn { IE / CEST } { +02:00 }
6815 \datatool_region_set_timezone_map:nn { IE / CET } { +01:00 }
6816 % \end{macrocode}
6817 %\subsection{Options}
6818 %Define options for this region:
6819 % \begin{macrocode}
6820 \datatool_locale_define_keys:nn { IE }
6821 {
6822 number-style .choices:nn =
6823 { official, unofficial }
6824 {
6825 \exp_args:NNe \renewcommand
6826 \datatoolIESetNumberChars
6827 {
6828 \exp_not:N \bool_if:NT
6829 \exp_not:N \l_datatool_region_set_numberchars_bool
6830 {
6831 \exp_not:c { datatool_IE_set_numberchars_ \l_keys_choice_tl : }
6832 }
6833 }
6834 \tl_if_eq:NnT \l_datatool_current_region_tl { IE }
6835 {
6836 \datatoolIESetNumberChars
6837 }
6838 } ,
6839 % \end{macrocode}
6840 % Currency symbol before or after value:
6841 % \begin{macrocode}
6842 currency-symbol-position .choice: ,
6843 currency-symbol-position / before .code:n =
6844 {
6845 \cs_set_eq:NN \datatool_IE_currency_position:nn \dtlcurrprefixfmt
6846 } ,
6847 currency-symbol-position / after .code:n =
6848 {
6849 \cs_set_eq:NN \datatool_IE_currency_position:nn \dtlcurrsuffixfmt
6850 } ,
6851 % \end{macrocode}
6852 % Separator between currency symbol (not code) and value:
6853 % \begin{macrocode}
6854 currency-symbol-sep .choice: ,
6855 currency-symbol-sep / none .code:n =
6856 {
6857 \tl_clear:N \l_datatool_IE_sym_sep_tl
6858 } ,
6859 currency-symbol-sep / thin-space .code:n =
6860 {
6861 \tl_set:Nn \l_datatool_IE_sym_sep_tl { \, }
6862 } ,
6863 currency-symbol-sep / space .code:n =
6864 {
6865 \tl_set:Nn \l_datatool_IE_sym_sep_tl { ~ }
6866 } ,
6867 currency-symbol-sep / nbsp .code:n =
6868 {
6869 \tl_set:Nn \l_datatool_IE_sym_sep_tl { \nobreakspace }
6870 } ,
6871 currency-symbol-sep .initial:n = { none } ,
6872 % \end{macrocode}
6873 % Date and time styles:
6874 % \begin{macrocode}
6875 date-style .choice: ,
6876 date-style / dmyyyy .code: n =
6877 {
6878 \tl_set:Nn \l__datatool_IE_datestyle_tl { ddmmyyyy }
6879 } ,
6880 date-style / mdyyyy .code: n =
6881 {
6882 \tl_set:Nn \l__datatool_IE_datestyle_tl { mmddyyyy }
6883 } ,
6884 date-style / yyyymd .code: n =
6885 {
6886 \tl_set:Nn \l__datatool_IE_datestyle_tl { yyyymmdd }
6887 } ,
6888 date-style / dmyy .code: n =
6889 {
6890 \tl_set:Nn \l__datatool_IE_datestyle_tl { ddmmyy }
6891 } ,
6892 date-style / mdyy .code: n =
6893 {
6894 \tl_set:Nn \l__datatool_IE_datestyle_tl { mmddyy }
6895 } ,
6896 date-style / yymd .code: n =
6897 {
6898 \tl_set:Nn \l__datatool_IE_datestyle_tl { yymmdd }
6899 } ,
6900 date-variant .choice: ,
6901 date-variant / slash .code:n =
6902 {
6903 \tl_set:Nn \l__datatool_IE_datevariant_tl { slash }
6904 } ,
6905 date-variant / hyphen .code:n =
6906 {
6907 \tl_set:Nn \l__datatool_IE_datevariant_tl { hyphen }
6908 } ,
6909 date-variant / dot .code:n =
6910 {
6911 \tl_set:Nn \l__datatool_IE_datevariant_tl { dot }
6912 } ,
6913 date-variant / dialect .code:n =
6914 {
6915 \tl_set:Nn \l__datatool_IE_datevariant_tl
6916 { \l_datatool_current_language_tl }
6917 } ,
6918 time-variant .choice: ,
6919 time-variant / colon .code:n =
6920 {
6921 \tl_set:Nn \l__datatool_IE_timevariant_tl { colon }
6922 } ,
6923 time-variant / dot .code:n =
6924 {
6925 \tl_set:Nn \l__datatool_IE_timevariant_tl { dot }
6926 } ,
6927 time-variant / dialect .code:n =
6928 {
6929 \tl_if_eq:NnTF \l__datatool_IE_timevariant_tl { dot }
6930 {
6931 \tl_set:Nn \l__datatool_IE_timevariant_tl
6932 { \l_datatool_current_language_tl _dot }
6933 }
6934 {
6935 \tl_if_in:NnF
6936 \l__datatool_IE_timevariant_tl
6937 { \l_datatool_current_language_tl }
6938 {
6939 \tl_set:Nn \l__datatool_IE_timevariant_tl
6940 { \l_datatool_current_language_tl _colon }
6941 }
6942 }
6943 } ,
6944 time-variant / dialect-colon .code:n =
6945 {
6946 \tl_set:Nn \l__datatool_IE_timevariant_tl
6947 { \l_datatool_current_language_tl _colon }
6948 } ,
6949 time-variant / dialect-dot .code:n =
6950 {
6951 \tl_set:Nn \l__datatool_IE_timevariant_tl
6952 { \l_datatool_current_language_tl _dot }
6953 } ,
6954 }
6955 % \end{macrocode}
6956 %\subsection{Hooks}
6957 %Command to update temporal parsing commands for this region:
6958 % \begin{macrocode}
6959 \newcommand \datatoolIESetTemporalParsers
6960 {
6961 \renewcommand \DTLCurrentLocaleParseTimeStamp
6962 { \datatool_IE_parse_timestamp:NnTF }
6963 \renewcommand \DTLCurrentLocaleParseDate
6964 { \datatool_IE_parse_date:NnTF }
6965 \renewcommand \DTLCurrentLocaleParseTime
6966 { \datatool_IE_parse_time:NnTF }
6967 \let
6968 \DTLCurrentLocaleGetTimeZoneMap
6969 \datatool_IE_get_timezone_map:n
6970 }
6971 % \end{macrocode}
6972 %Set temporal formatting commands for this region. Currently this
6973 %just resets to the default, but may change in future.
6974 %Note that the defaults test if the applicable \sty{datetime2}
6975 %command is available and will fallback on ISO if not defined.
6976 %Bear in mind that the default style for \sty{datetime2} is
6977 %\texttt{iso} so there won't be a noticeable difference unless the
6978 %\sty{datetime2} regional setting is on.
6979 % \begin{macrocode}
6980 \newcommand \datatoolIESetTemporalFormatters
6981 {
6982 \let
6983 \DTLCurrentLocaleFormatDate
6984 \datatool_default_date_fmt:nnnn
6985 \let
6986 \DTLCurrentLocaleFormatTime
6987 \datatool_default_time_fmt:nnn
6988 \let
6989 \DTLCurrentLocaleFormatTimeZone
6990 \datatool_default_timezone_fmt:nn
6991 \let
6992 \DTLCurrentLocaleFormatTimeStampNoZone
6993 \datatool_default_timestamp_fmt:nnnnnnn
6994 \let
6995 \DTLCurrentLocaleFormatTimeStampWithZone
6996 \datatool_default_timestamp_fmt:nnnnnnnnn
6997 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
6998 }
6999 % \end{macrocode}
7000 %
7001
7002 %Command to update currency and temporal parsing commands for this region:
7003 % \begin{macrocode}
7004 \newcommand \DTLIELocaleHook
7005 {
7006 \datatoolIESetNumberChars
7007 \datatoolIESetCurrency
7008 \datatoolIESetTemporalParsers
7009 \datatoolIESetTemporalFormatters
7010 % \end{macrocode}
7011 %Allow language files to reference the region:
7012 % \begin{macrocode}
7013 \tl_set:Nn \l_datatool_current_region_tl { IE }
7014 }
7015 % \end{macrocode}
7016 %
7017 % Finished with \LaTeX3 syntax.
7018 % \begin{macrocode}
7019 \ExplSyntaxOff
7020 % \end{macrocode}
7021 %Note that the hook is added to the captions by \sty{datatool-base}
7022 %not by the region file.
7023 %\iffalse
7024 % \begin{macrocode}
7025 %</datatool-IE.ldf>
7026 % \end{macrocode}
7027 %\fi
7028 %\iffalse
7029 % \begin{macrocode}
7030 %<*datatool-IM.ldf>
7031 % \end{macrocode}
7032 %\fi
7033 %\section{datatool-IM.ldf}\label{sec:datatool-IM}
7034 % Support for region IM.
7035 % \begin{macrocode}
7036 \TrackLangProvidesResource{IM}[2025/03/01 v1.0]
7037 % \end{macrocode}
7038 % Switch on \LaTeX3 syntax:
7039 % \begin{macrocode}
7040 \ExplSyntaxOn
7041 % \end{macrocode}
7042 %
7043 %\subsection{Numbers and Currency}
7044 %Set the number group and decimal symbols for this region.
7045 % \begin{macrocode}
7046 \cs_new:Nn \datatool_IM_set_numberchars_official:
7047 {
7048 \datatool_set_numberchars:nn { , } { . }
7049 }
7050 % \end{macrocode}
7051 %Unofficial style.
7052 % \begin{macrocode}
7053 \cs_new:Nn \datatool_IM_set_numberchars_unofficial:
7054 {
7055 \datatool_set_thinspace_group_decimal_char:n { . }
7056 }
7057 % \end{macrocode}
7058 %Hook to set the number group and decimal characters for the region:
7059 % \begin{macrocode}
7060 \newcommand \datatoolIMSetNumberChars
7061 {
7062 \bool_if:NT \l_datatool_region_set_numberchars_bool
7063 {
7064 \datatool_IM_set_numberchars_official:
7065 }
7066 }
7067 % \end{macrocode}
7068 %How to format the position of the currency symbol in relation to the value.
7069 % \begin{macrocode}
7070 \cs_new:Nn \datatool_IM_currency_position:nn
7071 {
7072 \dtlcurrprefixfmt { #1 } { #2 }
7073 }
7074 % \end{macrocode}
7075 %Separator between currency symbol and value.
7076 % \begin{macrocode}
7077 \tl_new:N \l_datatool_IM_sym_sep_tl
7078 % \end{macrocode}
7079 % Set the currency format for this region.
7080 % \begin{macrocode}
7081 \newcommand \datatoolIMcurrencyfmt [ 2 ]
7082 {
7083 \datatool_IM_currency_position:nn
7084 {
7085 \datatoolIMsymbolprefix { IM }
7086 #1
7087 }
7088 { #2 }
7089 }
7090 % \end{macrocode}
7091 %Prefix for symbol, if required.
7092 % \begin{macrocode}
7093 \newcommand \datatoolIMsymbolprefix [ 1 ] { }
7094 % \end{macrocode}
7095 % Define the currency symbols for this region.
7096 % \begin{macrocode}
7097 \datatool_def_currency:nnnV
7098 { \datatoolIMcurrencyfmt }
7099 { IMP }
7100 { \pounds }
7101 \l_datatool_pound_tl
7102 % \end{macrocode}
7103 % Register the currency code with this region:
7104 % \begin{macrocode}
7105 \datatool_register_regional_currency_code:nn { IM } { IMP }
7106 % \end{macrocode}
7107 % Provide a command to set the currency for this region (for use
7108 % with any hook used when the locale changes).
7109 % NB this should do nothing with
7110 % \verb|\DTLsetup{region-currency=false}|
7111 % \begin{macrocode}
7112 \newcommand \datatoolIMSetCurrency
7113 {
7114 \bool_if:NT \l_datatool_region_set_currency_bool
7115 {
7116 \DTLsetdefaultcurrency { IMP }
7117 % \end{macrocode}
7118 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
7119 % \begin{macrocode}
7120 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
7121 % \end{macrocode}
7122 %Separator between symbol and value:
7123 % \begin{macrocode}
7124 \renewcommand \dtlcurrfmtsymsep { \l_datatool_IM_sym_sep_tl }
7125 }
7126 }
7127 % \end{macrocode}
7128 %
7129 %\subsection{Date and Time Parsing}
7130 % This defaults to day/month/year but may be changed with \cs{DTLsetLocaleOptions}. For example:
7131 %\begin{dispListing}
7132 %\DTLsetLocaleOptions{IM}{date-style=dmyyyy, date-variant=slash}
7133 %\end{dispListing}
7134 %An appropriate language file will need to also be installed to
7135 %parse dates containing month names or day of week names.
7136 %
7137 %Provide a way to configure parsing style.
7138 % \begin{macrocode}
7139 \tl_new:N \l__datatool_IM_datevariant_tl
7140 \tl_set:Nn \l__datatool_IM_datevariant_tl { slash }
7141 % \end{macrocode}
7142 %NB These token lists are used to form command names. The following is not
7143 %a format string.
7144 % \begin{macrocode}
7145 \tl_new:N \l__datatool_IM_datestyle_tl
7146 \tl_set:Nn \l__datatool_IM_datestyle_tl { ddmmyyyy }
7147 \tl_new:N \l__datatool_IM_timevariant_tl
7148 \tl_set:Nn \l__datatool_IM_timevariant_tl { colon }
7149 % \end{macrocode}
7150 %
7151 %Each parsing command defined below has final \marg{true} and \marg{false}
7152 %arguments (\code{TF}). These are used if parsing was successful (true) or if
7153 %parsing failed (false). The internal commands used by
7154 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
7155 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
7156 %not as conditionals.
7157 %
7158 %\subsubsection{Time Stamp Parsing}
7159 %Use command
7160 %\begin{definition}
7161 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
7162 %\end{definition}
7163 %with date regular expression
7164 %\begin{definition}
7165 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
7166 %\end{definition}
7167 %and time regular expression
7168 %\begin{definition}
7169 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
7170 %\end{definition}
7171 % \begin{macrocode}
7172 \cs_new:Nn \datatool_IM_parse_timestamp:NnTF
7173 {
7174 \cs_if_exist:cTF
7175 {
7176 datatool_
7177 \l__datatool_IM_datestyle_tl
7178 _hhmmss_tz_parse_timestamp:ccNnTF
7179 }
7180 {
7181 \cs_if_exist:cTF
7182 {
7183 c_datatool_
7184 \l__datatool_IM_datevariant_tl
7185 _
7186 \l__datatool_IM_datestyle_tl
7187 _date_regex
7188 }
7189 {
7190 \cs_if_exist:cTF
7191 {
7192 c_datatool_
7193 \l__datatool_IM_timevariant_tl
7194 _hhmmss_time_regex
7195 }
7196 {
7197 \use:c
7198 {
7199 datatool_
7200 \l__datatool_IM_datestyle_tl
7201 _hhmmss_tz_parse_timestamp:ccNnTF
7202 }
7203 {
7204 c_datatool_
7205 \l__datatool_IM_datevariant_tl
7206 _
7207 \l__datatool_IM_datestyle_tl
7208 _date_regex
7209 }
7210 {
7211 c_datatool_
7212 \l__datatool_IM_timevariant_tl
7213 _hhmmss_time_regex
7214 }
7215 #1 { #2 } { #3 } { #4 }
7216 }
7217 {
7218 \datatool_warn_check_head_language_empty:Vnnn
7219 \l__datatool_IM_timevariant_tl
7220 { datatool-IM }
7221 {
7222 No ~ language ~ support ~ for ~ time ~ variant ~
7223 ` \exp_args:Ne \tl_tail:n { \l__datatool_IM_timevariant_tl } '
7224 }
7225 {
7226 No ~ support ~ for ~ time ~ variant ~
7227 ` \l__datatool_IM_timevariant_tl '
7228 }
7229 #4
7230 }
7231 }
7232 {
7233 \datatool_warn_check_head_language_empty:Vnnn
7234 \l__datatool_IM_datevariant_tl
7235 { datatool-IM }
7236 {
7237 No ~ language ~ support ~ for ~ date ~ style ~
7238 ` \l__datatool_IM_datestyle_tl '
7239 }
7240 {
7241 No ~ support ~ for ~ date ~ style ~
7242 ` \l__datatool_IM_datestyle_tl ' ~ with ~
7243 variant ~
7244 ` \l__datatool_IM_datevariant_tl '
7245 }
7246 #4
7247 }
7248 }
7249 {
7250 \datatool_locale_warn:nn { datatool-IM }
7251 {
7252 No ~ support ~ for ~ date ~ style ~
7253 ` \l__datatool_IM_datestyle_tl '
7254 }
7255 #4
7256 }
7257 }
7258 % \end{macrocode}
7259 %
7260 %\subsubsection{Date Parsing}
7261 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
7262 %with regular expression
7263 %\begin{definition}
7264 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
7265 %\end{definition}
7266 % \begin{macrocode}
7267 \cs_new:Nn \datatool_IM_parse_date:NnTF
7268 {
7269 \cs_if_exist:cTF
7270 {
7271 datatool_
7272 \l__datatool_IM_datestyle_tl
7273 _parse_date:NNnTF
7274 }
7275 {
7276 \cs_if_exist:cTF
7277 {
7278 c_datatool_
7279 \l__datatool_IM_datevariant_tl
7280 _anchored_
7281 \l__datatool_IM_datestyle_tl
7282 _date_regex
7283 }
7284 {
7285 \exp_args:cc
7286 {
7287 datatool_
7288 \l__datatool_IM_datestyle_tl
7289 _parse_date:NNnTF
7290 }
7291 {
7292 c_datatool_
7293 \l__datatool_IM_datevariant_tl
7294 _anchored_
7295 \l__datatool_IM_datestyle_tl
7296 _date_regex
7297 }
7298 #1 { #2 } { #3 } { #4 }
7299 }
7300 {
7301 \datatool_warn_check_head_language_empty:Vnnn
7302 \l__datatool_IM_datevariant_tl
7303 { datatool-IM }
7304 {
7305 No ~ language ~ support ~ for ~ date ~ style ~
7306 ` \l__datatool_IM_datestyle_tl '
7307 }
7308 {
7309 No ~ support ~ for ~ date ~ style ~
7310 ` \l__datatool_IM_datestyle_tl ' ~ with ~
7311 variant ~
7312 ` \l__datatool_IM_datevariant_tl '
7313 }
7314 #4
7315 }
7316 }
7317 {
7318 \datatool_locale_warn:nn { datatool-IM }
7319 {
7320 No ~ support ~ for ~ date ~ style ~
7321 ` \l__datatool_IM_datestyle_tl '
7322 }
7323 #4
7324 }
7325 }
7326 % \end{macrocode}
7327 %
7328 %\subsubsection{Time Parsing}
7329 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
7330 %with regular expression
7331 %\begin{definition}
7332 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
7333 %\end{definition}
7334 % \begin{macrocode}
7335 \cs_new:Nn \datatool_IM_parse_time:NnTF
7336 {
7337 \cs_if_exist:cTF
7338 {
7339 c_datatool_
7340 \l__datatool_IM_timevariant_tl
7341 _anchored_hhmmss_time_regex
7342 }
7343 {
7344 \datatool_hhmmss_parse_time:cNnTF
7345 {
7346 c_datatool_
7347 \l__datatool_IM_timevariant_tl
7348 _anchored_hhmmss_time_regex
7349 }
7350 #1 { #2 } { #3 } { #4 }
7351 }
7352 {
7353 \datatool_warn_check_head_language_empty:Vnnn
7354 \l__datatool_IM_timevariant_tl
7355 { datatool-IM }
7356 {
7357 No ~ language ~ support ~ for ~ time ~ variant ~
7358 ` \exp_args:Ne \tl_tail:n { \l__datatool_IM_timevariant_tl } '
7359 }
7360 {
7361 No ~ support ~ for ~ time ~ variant ~
7362 ` \l__datatool_IM_timevariant_tl '
7363 }
7364 #4
7365 }
7366 }
7367 % \end{macrocode}
7368 %
7369 %\subsubsection{Time Zone Mappings}
7370 %Define time zone mapping command for this region:
7371 % \begin{macrocode}
7372 \cs_new:Nn \datatool_IM_get_timezone_map:n
7373 {
7374 \datatool_region_get_timezone_map:n { IM / #1 }
7375 }
7376 % \end{macrocode}
7377 %Define time zone IDs for this region (one-way map from ID to offset):
7378 % \begin{macrocode}
7379 \datatool_region_set_timezone_map:nn { IM / CET } { +01:00 }
7380 \datatool_region_set_timezone_map:nn { IM / GMT } { +00:00 }
7381 \datatool_region_set_timezone_map:nn { IM / BST } { +01:00 }
7382 \datatool_region_set_timezone_map:nn { IM / CEST } { +02:00 }
7383 % \end{macrocode}
7384 %
7385 %\subsection{Options}
7386 %Define options for this region:
7387 % \begin{macrocode}
7388 \datatool_locale_define_keys:nn { IM }
7389 {
7390 number-style .choices:nn =
7391 { official, unofficial }
7392 {
7393 \exp_args:NNe \renewcommand
7394 \datatoolIMSetNumberChars
7395 {
7396 \exp_not:N \bool_if:NT
7397 \exp_not:N \l_datatool_region_set_numberchars_bool
7398 {
7399 \exp_not:c { datatool_IM_set_numberchars_ \l_keys_choice_tl : }
7400 }
7401 }
7402 \tl_if_eq:NnT \l_datatool_current_region_tl { IM }
7403 {
7404 \datatoolIMSetNumberChars
7405 }
7406 } ,
7407 % \end{macrocode}
7408 % Currency symbol before or after value:
7409 % \begin{macrocode}
7410 currency-symbol-position .choice: ,
7411 currency-symbol-position / before .code:n =
7412 {
7413 \cs_set_eq:NN \datatool_IM_currency_position:nn \dtlcurrprefixfmt
7414 } ,
7415 currency-symbol-position / after .code:n =
7416 {
7417 \cs_set_eq:NN \datatool_IM_currency_position:nn \dtlcurrsuffixfmt
7418 } ,
7419 % \end{macrocode}
7420 % Should the currency symbol be prefixed with the region code:
7421 % \begin{macrocode}
7422 currency-symbol-prefix .choice: ,
7423 currency-symbol-prefix / false .code:n =
7424 {
7425 \cs_set_eq:NN \datatoolIMsymbolprefix \use_none:n
7426 } ,
7427 currency-symbol-prefix / true .code:n =
7428 {
7429 \cs_set_eq:NN
7430 \datatoolIMsymbolprefix
7431 \datatool_currency_symbol_region_prefix:n
7432 } ,
7433 currency-symbol-prefix .default:n = { true } ,
7434 % \end{macrocode}
7435 % Separator between currency symbol (not code) and value:
7436 % \begin{macrocode}
7437 currency-symbol-sep .choice: ,
7438 currency-symbol-sep / none .code:n =
7439 {
7440 \tl_clear:N \l_datatool_IM_sym_sep_tl
7441 } ,
7442 currency-symbol-sep / thin-space .code:n =
7443 {
7444 \tl_set:Nn \l_datatool_IM_sym_sep_tl { \, }
7445 } ,
7446 currency-symbol-sep / space .code:n =
7447 {
7448 \tl_set:Nn \l_datatool_IM_sym_sep_tl { ~ }
7449 } ,
7450 currency-symbol-sep / nbsp .code:n =
7451 {
7452 \tl_set:Nn \l_datatool_IM_sym_sep_tl { \nobreakspace }
7453 } ,
7454 currency-symbol-sep . initial:n = { none } ,
7455 % \end{macrocode}
7456 % Date and time styles:
7457 % \begin{macrocode}
7458 date-style .choice: ,
7459 date-style / dmyyyy .code: n =
7460 {
7461 \tl_set:Nn \l__datatool_IM_datestyle_tl { ddmmyyyy }
7462 } ,
7463 date-style / mdyyyy .code: n =
7464 {
7465 \tl_set:Nn \l__datatool_IM_datestyle_tl { mmddyyyy }
7466 } ,
7467 date-style / yyyymd .code: n =
7468 {
7469 \tl_set:Nn \l__datatool_IM_datestyle_tl { yyyymmdd }
7470 } ,
7471 date-style / dmyy .code: n =
7472 {
7473 \tl_set:Nn \l__datatool_IM_datestyle_tl { ddmmyy }
7474 } ,
7475 date-style / mdyy .code: n =
7476 {
7477 \tl_set:Nn \l__datatool_IM_datestyle_tl { mmddyy }
7478 } ,
7479 date-style / yymd .code: n =
7480 {
7481 \tl_set:Nn \l__datatool_IM_datestyle_tl { yymmdd }
7482 } ,
7483 date-variant .choice: ,
7484 date-variant / slash .code:n =
7485 {
7486 \tl_set:Nn \l__datatool_IM_datevariant_tl { slash }
7487 } ,
7488 date-variant / hyphen .code:n =
7489 {
7490 \tl_set:Nn \l__datatool_IM_datevariant_tl { hyphen }
7491 } ,
7492 date-variant / dot .code:n =
7493 {
7494 \tl_set:Nn \l__datatool_IM_datevariant_tl { dot }
7495 } ,
7496 date-variant / dialect .code:n =
7497 {
7498 \tl_set:Nn \l__datatool_IM_datevariant_tl
7499 { \l_datatool_current_language_tl }
7500 } ,
7501 time-variant .choice: ,
7502 time-variant / colon .code:n =
7503 {
7504 \tl_set:Nn \l__datatool_IM_timevariant_tl { colon }
7505 } ,
7506 time-variant / dot .code:n =
7507 {
7508 \tl_set:Nn \l__datatool_IM_timevariant_tl { dot }
7509 } ,
7510 time-variant / dialect .code:n =
7511 {
7512 \tl_if_eq:NnTF \l__datatool_IM_timevariant_tl { dot }
7513 {
7514 \tl_set:Nn \l__datatool_IM_timevariant_tl
7515 { \l_datatool_current_language_tl _dot }
7516 }
7517 {
7518 \tl_if_in:NnF
7519 \l__datatool_IM_timevariant_tl
7520 { \l_datatool_current_language_tl }
7521 {
7522 \tl_set:Nn \l__datatool_IM_timevariant_tl
7523 { \l_datatool_current_language_tl _colon }
7524 }
7525 }
7526 } ,
7527 time-variant / dialect-colon .code:n =
7528 {
7529 \tl_set:Nn \l__datatool_IM_timevariant_tl
7530 { \l_datatool_current_language_tl _colon }
7531 } ,
7532 time-variant / dialect-dot .code:n =
7533 {
7534 \tl_set:Nn \l__datatool_IM_timevariant_tl
7535 { \l_datatool_current_language_tl _dot }
7536 } ,
7537 }
7538 % \end{macrocode}
7539 %
7540 %\subsection{Hooks}
7541 %Command to update temporal parsing commands for this region:
7542 % \begin{macrocode}
7543 \newcommand \datatoolIMSetTemporalParsers
7544 {
7545 \renewcommand \DTLCurrentLocaleParseTimeStamp
7546 { \datatool_IM_parse_timestamp:NnTF }
7547 \renewcommand \DTLCurrentLocaleParseDate
7548 { \datatool_IM_parse_date:NnTF }
7549 \renewcommand \DTLCurrentLocaleParseTime
7550 { \datatool_IM_parse_time:NnTF }
7551 \let
7552 \DTLCurrentLocaleGetTimeZoneMap
7553 \datatool_IM_get_timezone_map:n
7554 }
7555 % \end{macrocode}
7556 %Set temporal formatting commands for this region. Currently this
7557 %just resets to the default, but may change in future.
7558 %Note that the defaults test if the applicable \sty{datetime2}
7559 %command is available and will fallback on ISO if not defined.
7560 %Bear in mind that the default style for \sty{datetime2} is
7561 %\texttt{iso} so there won't be a noticeable difference unless the
7562 %\sty{datetime2} regional setting is on.
7563 % \begin{macrocode}
7564 \newcommand \datatoolIMSetTemporalFormatters
7565 {
7566 \let
7567 \DTLCurrentLocaleFormatDate
7568 \datatool_default_date_fmt:nnnn
7569 \let
7570 \DTLCurrentLocaleFormatTime
7571 \datatool_default_time_fmt:nnn
7572 \let
7573 \DTLCurrentLocaleFormatTimeZone
7574 \datatool_default_timezone_fmt:nn
7575 \let
7576 \DTLCurrentLocaleFormatTimeStampNoZone
7577 \datatool_default_timestamp_fmt:nnnnnnn
7578 \let
7579 \DTLCurrentLocaleFormatTimeStampWithZone
7580 \datatool_default_timestamp_fmt:nnnnnnnnn
7581 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
7582 }
7583 % \end{macrocode}
7584 %
7585 %
7586 %Command to update currency and temporal parsing commands for this region:
7587 % \begin{macrocode}
7588 \newcommand \DTLIMLocaleHook
7589 {
7590 \datatoolIMSetNumberChars
7591 \datatoolIMSetCurrency
7592 \datatoolIMSetTemporalParsers
7593 \datatoolIMSetTemporalFormatters
7594 % \end{macrocode}
7595 %Allow language files to reference the region:
7596 % \begin{macrocode}
7597 \tl_set:Nn \l_datatool_current_region_tl { IM }
7598 }
7599 % \end{macrocode}
7600 %
7601 % Finished with \LaTeX3 syntax.
7602 % \begin{macrocode}
7603 \ExplSyntaxOff
7604 % \end{macrocode}
7605 %Note that the hook is added to the captions by \sty{datatool-base}
7606 %not by the region file.
7607 %\iffalse
7608 % \begin{macrocode}
7609 %</datatool-IM.ldf>
7610 % \end{macrocode}
7611 %\fi
7612 %\iffalse
7613 % \begin{macrocode}
7614 %<*datatool-JE.ldf>
7615 % \end{macrocode}
7616 %\fi
7617 %\section{datatool-JE.ldf}\label{sec:datatool-JE}
7618 % Support for region JE.
7619 % \begin{macrocode}
7620 \TrackLangProvidesResource{JE}[2025/03/01 v1.0]
7621 % \end{macrocode}
7622 % Switch on \LaTeX3 syntax:
7623 % \begin{macrocode}
7624 \ExplSyntaxOn
7625 % \end{macrocode}
7626 %
7627 %\subsection{Numbers and Currency}
7628 %Set the number group and decimal symbols for this region.
7629 % \begin{macrocode}
7630 \cs_new:Nn \datatool_JE_set_numberchars_official:
7631 {
7632 \datatool_set_numberchars:nn { , } { . }
7633 }
7634 % \end{macrocode}
7635 %Unofficial style.
7636 % \begin{macrocode}
7637 \cs_new:Nn \datatool_JE_set_numberchars_unofficial:
7638 {
7639 \datatool_set_thinspace_group_decimal_char:n { . }
7640 }
7641 % \end{macrocode}
7642 %Hook to set the number group and decimal characters for the region:
7643 % \begin{macrocode}
7644 \newcommand \datatoolJESetNumberChars
7645 {
7646 \bool_if:NT \l_datatool_region_set_numberchars_bool
7647 {
7648 \datatool_JE_set_numberchars_official:
7649 }
7650 }
7651 % \end{macrocode}
7652 %How to format the position of the currency symbol in relation to the value.
7653 % \begin{macrocode}
7654 \cs_new:Nn \datatool_JE_currency_position:nn
7655 {
7656 \dtlcurrprefixfmt { #1 } { #2 }
7657 }
7658 % \end{macrocode}
7659 %Separator between currency symbol and value.
7660 % \begin{macrocode}
7661 \tl_new:N \l_datatool_JE_sym_sep_tl
7662 % \end{macrocode}
7663 % Set the currency format for this region.
7664 % \begin{macrocode}
7665 \newcommand \datatoolJEcurrencyfmt [ 2 ]
7666 {
7667 \datatool_JE_currency_position:nn
7668 {
7669 \datatoolJEsymbolprefix { JE }
7670 #1
7671 }
7672 { #2 }
7673 }
7674 % \end{macrocode}
7675 %Prefix for symbol, if required.
7676 % \begin{macrocode}
7677 \newcommand \datatoolJEsymbolprefix [ 1 ] { }
7678 % \end{macrocode}
7679 % Define the currency symbols for this region.
7680 % \begin{macrocode}
7681 \datatool_def_currency:nnnV
7682 { \datatoolJEcurrencyfmt }
7683 { JEP }
7684 { \pounds }
7685 \l_datatool_pound_tl
7686 % \end{macrocode}
7687 % Register the currency code with this region:
7688 % \begin{macrocode}
7689 \datatool_register_regional_currency_code:nn { JE } { JEP }
7690 % \end{macrocode}
7691 % Provide a command to set the currency for this region (for use
7692 % with any hook used when the locale changes).
7693 % NB this should do nothing with
7694 % \verb|\DTLsetup{region-currency=false}|
7695 % \begin{macrocode}
7696 \newcommand \datatoolJESetCurrency
7697 {
7698 \bool_if:NT \l_datatool_region_set_currency_bool
7699 {
7700 \DTLsetdefaultcurrency { JEP }
7701 % \end{macrocode}
7702 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
7703 % \begin{macrocode}
7704 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
7705 % \end{macrocode}
7706 %Separator between symbol and value:
7707 % \begin{macrocode}
7708 \renewcommand \dtlcurrfmtsymsep { \l_datatool_JE_sym_sep_tl }
7709 }
7710 }
7711 % \end{macrocode}
7712 %
7713 %\subsection{Date and Time Parsing}
7714 % This defaults to day/month/year but may be changed with \cs{DTLsetLocaleOptions}. For example:
7715 %\begin{dispListing}
7716 %\DTLsetLocaleOptions{JE}{date-style=dmyyyy, date-variant=slash}
7717 %\end{dispListing}
7718 %An appropriate language file will need to also be installed to
7719 %parse dates containing month names or day of week names.
7720 %
7721 %Provide a way to configure parsing style.
7722 % \begin{macrocode}
7723 \tl_new:N \l__datatool_JE_datevariant_tl
7724 \tl_set:Nn \l__datatool_JE_datevariant_tl { slash }
7725 % \end{macrocode}
7726 %NB These token lists are used to form command names. The following is not
7727 %a format string.
7728 % \begin{macrocode}
7729 \tl_new:N \l__datatool_JE_datestyle_tl
7730 \tl_set:Nn \l__datatool_JE_datestyle_tl { ddmmyyyy }
7731 \tl_new:N \l__datatool_JE_timevariant_tl
7732 \tl_set:Nn \l__datatool_JE_timevariant_tl { colon }
7733 % \end{macrocode}
7734 %
7735 %Each parsing command defined below has final \marg{true} and \marg{false}
7736 %arguments (\code{TF}). These are used if parsing was successful (true) or if
7737 %parsing failed (false). The internal commands used by
7738 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
7739 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
7740 %not as conditionals.
7741 %
7742 %\subsubsection{Time Stamp Parsing}
7743 %Use command
7744 %\begin{definition}
7745 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
7746 %\end{definition}
7747 %with date regular expression
7748 %\begin{definition}
7749 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
7750 %\end{definition}
7751 %and time regular expression
7752 %\begin{definition}
7753 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
7754 %\end{definition}
7755 % \begin{macrocode}
7756 \cs_new:Nn \datatool_JE_parse_timestamp:NnTF
7757 {
7758 \cs_if_exist:cTF
7759 {
7760 datatool_
7761 \l__datatool_JE_datestyle_tl
7762 _hhmmss_tz_parse_timestamp:ccNnTF
7763 }
7764 {
7765 \cs_if_exist:cTF
7766 {
7767 c_datatool_
7768 \l__datatool_JE_datevariant_tl
7769 _
7770 \l__datatool_JE_datestyle_tl
7771 _date_regex
7772 }
7773 {
7774 \cs_if_exist:cTF
7775 {
7776 c_datatool_
7777 \l__datatool_JE_timevariant_tl
7778 _hhmmss_time_regex
7779 }
7780 {
7781 \use:c
7782 {
7783 datatool_
7784 \l__datatool_JE_datestyle_tl
7785 _hhmmss_tz_parse_timestamp:ccNnTF
7786 }
7787 {
7788 c_datatool_
7789 \l__datatool_JE_datevariant_tl
7790 _
7791 \l__datatool_JE_datestyle_tl
7792 _date_regex
7793 }
7794 {
7795 c_datatool_
7796 \l__datatool_JE_timevariant_tl
7797 _hhmmss_time_regex
7798 }
7799 #1 { #2 } { #3 } { #4 }
7800 }
7801 {
7802 \datatool_warn_check_head_language_empty:Vnnn
7803 \l__datatool_JE_timevariant_tl
7804 { datatool-JE }
7805 {
7806 No ~ language ~ support ~ for ~ time ~ variant ~
7807 ` \exp_args:Ne \tl_tail:n { \l__datatool_JE_timevariant_tl } '
7808 }
7809 {
7810 No ~ support ~ for ~ time ~ variant ~
7811 ` \l__datatool_JE_timevariant_tl '
7812 }
7813 #4
7814 }
7815 }
7816 {
7817 \datatool_warn_check_head_language_empty:Vnnn
7818 \l__datatool_JE_datevariant_tl
7819 { datatool-JE }
7820 {
7821 No ~ language ~ support ~ for ~ date ~ style ~
7822 ` \l__datatool_JE_datestyle_tl '
7823 }
7824 {
7825 No ~ support ~ for ~ date ~ style ~
7826 ` \l__datatool_JE_datestyle_tl ' ~ with ~
7827 variant ~
7828 ` \l__datatool_JE_datevariant_tl '
7829 }
7830 #4
7831 }
7832 }
7833 {
7834 \datatool_locale_warn:nn { datatool-JE }
7835 {
7836 No ~ support ~ for ~ date ~ style ~
7837 ` \l__datatool_JE_datestyle_tl '
7838 }
7839 #4
7840 }
7841 }
7842 % \end{macrocode}
7843 %
7844 %\subsubsection{Date Parsing}
7845 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
7846 %with regular expression
7847 %\begin{definition}
7848 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
7849 %\end{definition}
7850 % \begin{macrocode}
7851 \cs_new:Nn \datatool_JE_parse_date:NnTF
7852 {
7853 \cs_if_exist:cTF
7854 {
7855 datatool_
7856 \l__datatool_JE_datestyle_tl
7857 _parse_date:NNnTF
7858 }
7859 {
7860 \cs_if_exist:cTF
7861 {
7862 c_datatool_
7863 \l__datatool_JE_datevariant_tl
7864 _anchored_
7865 \l__datatool_JE_datestyle_tl
7866 _date_regex
7867 }
7868 {
7869 \exp_args:cc
7870 {
7871 datatool_
7872 \l__datatool_JE_datestyle_tl
7873 _parse_date:NNnTF
7874 }
7875 {
7876 c_datatool_
7877 \l__datatool_JE_datevariant_tl
7878 _anchored_
7879 \l__datatool_JE_datestyle_tl
7880 _date_regex
7881 }
7882 #1 { #2 } { #3 } { #4 }
7883 }
7884 {
7885 \datatool_warn_check_head_language_empty:Vnnn
7886 \l__datatool_JE_datevariant_tl
7887 { datatool-JE }
7888 {
7889 No ~ language ~ support ~ for ~ date ~ style ~
7890 ` \l__datatool_JE_datestyle_tl '
7891 }
7892 {
7893 No ~ support ~ for ~ date ~ style ~
7894 ` \l__datatool_JE_datestyle_tl ' ~ with ~
7895 variant ~
7896 ` \l__datatool_JE_datevariant_tl '
7897 }
7898 #4
7899 }
7900 }
7901 {
7902 \datatool_locale_warn:nn { datatool-JE }
7903 {
7904 No ~ support ~ for ~ date ~ style ~
7905 ` \l__datatool_JE_datestyle_tl '
7906 }
7907 #4
7908 }
7909 }
7910 % \end{macrocode}
7911 %
7912 %\subsubsection{Time Parsing}
7913 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
7914 %with regular expression
7915 %\begin{definition}
7916 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
7917 %\end{definition}
7918 % \begin{macrocode}
7919 \cs_new:Nn \datatool_JE_parse_time:NnTF
7920 {
7921 \cs_if_exist:cTF
7922 {
7923 c_datatool_
7924 \l__datatool_JE_timevariant_tl
7925 _anchored_hhmmss_time_regex
7926 }
7927 {
7928 \datatool_hhmmss_parse_time:cNnTF
7929 {
7930 c_datatool_
7931 \l__datatool_JE_timevariant_tl
7932 _anchored_hhmmss_time_regex
7933 }
7934 #1 { #2 } { #3 } { #4 }
7935 }
7936 {
7937 \datatool_warn_check_head_language_empty:Vnnn
7938 \l__datatool_JE_timevariant_tl
7939 { datatool-JE }
7940 {
7941 No ~ language ~ support ~ for ~ time ~ variant ~
7942 ` \exp_args:Ne \tl_tail:n { \l__datatool_JE_timevariant_tl } '
7943 }
7944 {
7945 No ~ support ~ for ~ time ~ variant ~
7946 ` \l__datatool_JE_timevariant_tl '
7947 }
7948 #4
7949 }
7950 }
7951 % \end{macrocode}
7952 %
7953 %\subsubsection{Time Zone Mappings}
7954 %Define time zone mapping command for this region:
7955 % \begin{macrocode}
7956 \cs_new:Nn \datatool_JE_get_timezone_map:n
7957 {
7958 \datatool_region_get_timezone_map:n { JE / #1 }
7959 }
7960 % \end{macrocode}
7961 %Define time zone IDs for this region (one-way map from ID to offset):
7962 % \begin{macrocode}
7963 \datatool_region_set_timezone_map:nn { JE / CEST } { +02:00 }
7964 \datatool_region_set_timezone_map:nn { JE / GMT } { +00:00 }
7965 \datatool_region_set_timezone_map:nn { JE / CET } { +01:00 }
7966 \datatool_region_set_timezone_map:nn { JE / BST } { +01:00 }
7967 % \end{macrocode}
7968 %
7969 %\subsection{Options}
7970 %Define options for this region:
7971 % \begin{macrocode}
7972 \datatool_locale_define_keys:nn { JE }
7973 {
7974 number-style .choices:nn =
7975 { official, unofficial }
7976 {
7977 \exp_args:NNe \renewcommand
7978 \datatoolJESetNumberChars
7979 {
7980 \exp_not:N \bool_if:NT
7981 \exp_not:N \l_datatool_region_set_numberchars_bool
7982 {
7983 \exp_not:c { datatool_JE_set_numberchars_ \l_keys_choice_tl : }
7984 }
7985 }
7986 \tl_if_eq:NnT \l_datatool_current_region_tl { JE }
7987 {
7988 \datatoolJESetNumberChars
7989 }
7990 } ,
7991 % \end{macrocode}
7992 % Currency symbol before or after value:
7993 % \begin{macrocode}
7994 currency-symbol-position .choice: ,
7995 currency-symbol-position / before .code:n =
7996 {
7997 \cs_set_eq:NN \datatool_JE_currency_position:nn \dtlcurrprefixfmt
7998 } ,
7999 currency-symbol-position / after .code:n =
8000 {
8001 \cs_set_eq:NN \datatool_JE_currency_position:nn \dtlcurrsuffixfmt
8002 } ,
8003 % \end{macrocode}
8004 % Should the currency symbol be prefixed with the region code:
8005 % \begin{macrocode}
8006 currency-symbol-prefix .choice: ,
8007 currency-symbol-prefix / false .code:n =
8008 {
8009 \cs_set_eq:NN \datatoolJEsymbolprefix \use_none:n
8010 } ,
8011 currency-symbol-prefix / true .code:n =
8012 {
8013 \cs_set_eq:NN
8014 \datatoolJEsymbolprefix
8015 \datatool_currency_symbol_region_prefix:n
8016 } ,
8017 currency-symbol-prefix .default:n = { true } ,
8018 % \end{macrocode}
8019 % Separator between currency symbol (not code) and value:
8020 % \begin{macrocode}
8021 currency-symbol-sep .choice: ,
8022 currency-symbol-sep / none .code:n =
8023 {
8024 \tl_clear:N \l_datatool_JE_sym_sep_tl
8025 } ,
8026 currency-symbol-sep / thin-space .code:n =
8027 {
8028 \tl_set:Nn \l_datatool_JE_sym_sep_tl { \, }
8029 } ,
8030 currency-symbol-sep / space .code:n =
8031 {
8032 \tl_set:Nn \l_datatool_JE_sym_sep_tl { ~ }
8033 } ,
8034 currency-symbol-sep / nbsp .code:n =
8035 {
8036 \tl_set:Nn \l_datatool_JE_sym_sep_tl { \nobreakspace }
8037 } ,
8038 currency-symbol-sep . initial:n = { none } ,
8039 % \end{macrocode}
8040 % Date and time styles:
8041 % \begin{macrocode}
8042 date-style .choice: ,
8043 date-style / dmyyyy .code: n =
8044 {
8045 \tl_set:Nn \l__datatool_JE_datestyle_tl { ddmmyyyy }
8046 } ,
8047 date-style / mdyyyy .code: n =
8048 {
8049 \tl_set:Nn \l__datatool_JE_datestyle_tl { mmddyyyy }
8050 } ,
8051 date-style / yyyymd .code: n =
8052 {
8053 \tl_set:Nn \l__datatool_JE_datestyle_tl { yyyymmdd }
8054 } ,
8055 date-style / dmyy .code: n =
8056 {
8057 \tl_set:Nn \l__datatool_JE_datestyle_tl { ddmmyy }
8058 } ,
8059 date-style / mdyy .code: n =
8060 {
8061 \tl_set:Nn \l__datatool_JE_datestyle_tl { mmddyy }
8062 } ,
8063 date-style / yymd .code: n =
8064 {
8065 \tl_set:Nn \l__datatool_JE_datestyle_tl { yymmdd }
8066 } ,
8067 date-variant .choice: ,
8068 date-variant / slash .code:n =
8069 {
8070 \tl_set:Nn \l__datatool_JE_datevariant_tl { slash }
8071 } ,
8072 date-variant / hyphen .code:n =
8073 {
8074 \tl_set:Nn \l__datatool_JE_datevariant_tl { hyphen }
8075 } ,
8076 date-variant / dot .code:n =
8077 {
8078 \tl_set:Nn \l__datatool_JE_datevariant_tl { dot }
8079 } ,
8080 date-variant / dialect .code:n =
8081 {
8082 \tl_set:Nn \l__datatool_JE_datevariant_tl
8083 { \l_datatool_current_language_tl }
8084 } ,
8085 time-variant .choice: ,
8086 time-variant / colon .code:n =
8087 {
8088 \tl_set:Nn \l__datatool_JE_timevariant_tl { colon }
8089 } ,
8090 time-variant / dot .code:n =
8091 {
8092 \tl_set:Nn \l__datatool_JE_timevariant_tl { dot }
8093 } ,
8094 time-variant / dialect .code:n =
8095 {
8096 \tl_if_eq:NnTF \l__datatool_JE_timevariant_tl { dot }
8097 {
8098 \tl_set:Nn \l__datatool_JE_timevariant_tl
8099 { \l_datatool_current_language_tl _dot }
8100 }
8101 {
8102 \tl_if_in:NnF
8103 \l__datatool_JE_timevariant_tl
8104 { \l_datatool_current_language_tl }
8105 {
8106 \tl_set:Nn \l__datatool_JE_timevariant_tl
8107 { \l_datatool_current_language_tl _colon }
8108 }
8109 }
8110 } ,
8111 time-variant / dialect-colon .code:n =
8112 {
8113 \tl_set:Nn \l__datatool_JE_timevariant_tl
8114 { \l_datatool_current_language_tl _colon }
8115 } ,
8116 time-variant / dialect-dot .code:n =
8117 {
8118 \tl_set:Nn \l__datatool_JE_timevariant_tl
8119 { \l_datatool_current_language_tl _dot }
8120 } ,
8121 }
8122 % \end{macrocode}
8123 %
8124 %\subsection{Hooks}
8125 %Command to update temporal parsing commands for this region:
8126 % \begin{macrocode}
8127 \newcommand \datatoolJESetTemporalParsers
8128 {
8129 \renewcommand \DTLCurrentLocaleParseTimeStamp
8130 { \datatool_JE_parse_timestamp:NnTF }
8131 \renewcommand \DTLCurrentLocaleParseDate
8132 { \datatool_JE_parse_date:NnTF }
8133 \renewcommand \DTLCurrentLocaleParseTime
8134 { \datatool_JE_parse_time:NnTF }
8135 \let
8136 \DTLCurrentLocaleGetTimeZoneMap
8137 \datatool_JE_get_timezone_map:n
8138 }
8139 % \end{macrocode}
8140 %Set temporal formatting commands for this region. Currently this
8141 %just resets to the default, but may change in future.
8142 %Note that the defaults test if the applicable \sty{datetime2}
8143 %command is available and will fallback on ISO if not defined.
8144 %Bear in mind that the default style for \sty{datetime2} is
8145 %\texttt{iso} so there won't be a noticeable difference unless the
8146 %\sty{datetime2} regional setting is on.
8147 % \begin{macrocode}
8148 \newcommand \datatoolJESetTemporalFormatters
8149 {
8150 \let
8151 \DTLCurrentLocaleFormatDate
8152 \datatool_default_date_fmt:nnnn
8153 \let
8154 \DTLCurrentLocaleFormatTime
8155 \datatool_default_time_fmt:nnn
8156 \let
8157 \DTLCurrentLocaleFormatTimeZone
8158 \datatool_default_timezone_fmt:nn
8159 \let
8160 \DTLCurrentLocaleFormatTimeStampNoZone
8161 \datatool_default_timestamp_fmt:nnnnnnn
8162 \let
8163 \DTLCurrentLocaleFormatTimeStampWithZone
8164 \datatool_default_timestamp_fmt:nnnnnnnnn
8165 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
8166 }
8167 % \end{macrocode}
8168 %
8169 %
8170 %Command to update currency and temporal parsing commands for this region:
8171 % \begin{macrocode}
8172 \newcommand \DTLJELocaleHook
8173 {
8174 \datatoolJESetNumberChars
8175 \datatoolJESetCurrency
8176 \datatoolJESetTemporalParsers
8177 \datatoolJESetTemporalFormatters
8178 % \end{macrocode}
8179 %Allow language files to reference the region:
8180 % \begin{macrocode}
8181 \tl_set:Nn \l_datatool_current_region_tl { JE }
8182 }
8183 % \end{macrocode}
8184 %
8185 % Finished with \LaTeX3 syntax.
8186 % \begin{macrocode}
8187 \ExplSyntaxOff
8188 % \end{macrocode}
8189 %Note that the hook is added to the captions by \sty{datatool-base}
8190 %not by the region file.
8191 %\iffalse
8192 % \begin{macrocode}
8193 %</datatool-JE.ldf>
8194 % \end{macrocode}
8195 %\fi
8196 %\iffalse
8197 % \begin{macrocode}
8198 %<*datatool-NZ.ldf>
8199 % \end{macrocode}
8200 %\fi
8201 %\section{datatool-NZ.ldf}\label{sec:datatool-NZ}
8202 % Support for region NZ.
8203 % \begin{macrocode}
8204 \TrackLangProvidesResource{NZ}[2025/03/01 v1.0]
8205 % \end{macrocode}
8206 % Switch on \LaTeX3 syntax:
8207 % \begin{macrocode}
8208 \ExplSyntaxOn
8209 % \end{macrocode}
8210 %
8211 %\subsection{Numbers and Currency}
8212 %Set the number group and decimal symbols for this region.
8213 % \begin{macrocode}
8214 \cs_new:Nn \datatool_NZ_set_numberchars_official:
8215 {
8216 \datatool_set_numberchars:nn { , } { . }
8217 }
8218 % \end{macrocode}
8219 %Unofficial style.
8220 % \begin{macrocode}
8221 \cs_new:Nn \datatool_NZ_set_numberchars_unofficial:
8222 {
8223 \datatool_set_thinspace_group_decimal_char:n { . }
8224 }
8225 % \end{macrocode}
8226 %Hook to set the number group and decimal characters for the region:
8227 % \begin{macrocode}
8228 \newcommand \datatoolNZSetNumberChars
8229 {
8230 \bool_if:NT \l_datatool_region_set_numberchars_bool
8231 {
8232 \datatool_NZ_set_numberchars_official:
8233 }
8234 }
8235 % \end{macrocode}
8236 %How to format the position of the currency symbol in relation to the value.
8237 % \begin{macrocode}
8238 \cs_new:Nn \datatool_NZ_currency_position:nn
8239 {
8240 \dtlcurrprefixfmt { #1 } { #2 }
8241 }
8242 % \end{macrocode}
8243 %Separator between currency symbol and value.
8244 % \begin{macrocode}
8245 \tl_new:N \l_datatool_NZ_sym_sep_tl
8246 % \end{macrocode}
8247 % Set the currency format for this region.
8248 % \begin{macrocode}
8249 \newcommand \datatoolNZcurrencyfmt [ 2 ]
8250 {
8251 \datatool_NZ_currency_position:nn
8252 {
8253 \datatoolNZsymbolprefix { NZ }
8254 #1
8255 }
8256 { #2 }
8257 }
8258 % \end{macrocode}
8259 %Prefix for symbol, if required.
8260 % \begin{macrocode}
8261 \newcommand \datatoolNZsymbolprefix [ 1 ] { }
8262 % \end{macrocode}
8263 % Define the currency symbols for this region.
8264 % \begin{macrocode}
8265 \datatool_def_currency:nnnV
8266 { \datatoolNZcurrencyfmt }
8267 { NZD }
8268 { \$ }
8269 \c_dollar_str
8270 % \end{macrocode}
8271 % Register the currency code with this region:
8272 % \begin{macrocode}
8273 \datatool_register_regional_currency_code:nn { NZ } { NZD }
8274 % \end{macrocode}
8275 % Provide a command to set the currency for this region (for use
8276 % with any hook used when the locale changes).
8277 % NB this should do nothing with
8278 % \verb|\DTLsetup{region-currency=false}|
8279 % \begin{macrocode}
8280 \newcommand \datatoolNZSetCurrency
8281 {
8282 \bool_if:NT \l_datatool_region_set_currency_bool
8283 {
8284 \DTLsetdefaultcurrency { NZD }
8285 % \end{macrocode}
8286 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
8287 % \begin{macrocode}
8288 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
8289 % \end{macrocode}
8290 %Separator between symbol and value:
8291 % \begin{macrocode}
8292 \renewcommand \dtlcurrfmtsymsep { \l_datatool_NZ_sym_sep_tl }
8293 }
8294 }
8295 % \end{macrocode}
8296 %
8297 %\subsection{Date and Time Parsing}
8298 % This defaults to day/month/year but may be changed with \cs{DTLsetLocaleOptions}. For example:
8299 %\begin{dispListing}
8300 %\DTLsetLocaleOptions{NZ}{date-style=dmyyyy, date-variant=slash}
8301 %\end{dispListing}
8302 %An appropriate language file will need to also be installed to
8303 %parse dates containing month names or day of week names.
8304 %
8305 %Provide a way to configure parsing style.
8306 % \begin{macrocode}
8307 \tl_new:N \l__datatool_NZ_datevariant_tl
8308 \tl_set:Nn \l__datatool_NZ_datevariant_tl { slash }
8309 % \end{macrocode}
8310 %NB These token lists are used to form command names. The following is not
8311 %a format string.
8312 % \begin{macrocode}
8313 \tl_new:N \l__datatool_NZ_datestyle_tl
8314 \tl_set:Nn \l__datatool_NZ_datestyle_tl { ddmmyyyy }
8315 \tl_new:N \l__datatool_NZ_timevariant_tl
8316 \tl_set:Nn \l__datatool_NZ_timevariant_tl { colon }
8317 % \end{macrocode}
8318 %
8319 %Each parsing command defined below has final \marg{true} and \marg{false}
8320 %arguments (\code{TF}). These are used if parsing was successful (true) or if
8321 %parsing failed (false). The internal commands used by
8322 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
8323 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
8324 %not as conditionals.
8325 %
8326 %\subsubsection{Time Stamp Parsing}
8327 %Use command
8328 %\begin{definition}
8329 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
8330 %\end{definition}
8331 %with date regular expression
8332 %\begin{definition}
8333 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
8334 %\end{definition}
8335 %and time regular expression
8336 %\begin{definition}
8337 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
8338 %\end{definition}
8339 % \begin{macrocode}
8340 \cs_new:Nn \datatool_NZ_parse_timestamp:NnTF
8341 {
8342 \cs_if_exist:cTF
8343 {
8344 datatool_
8345 \l__datatool_NZ_datestyle_tl
8346 _hhmmss_tz_parse_timestamp:ccNnTF
8347 }
8348 {
8349 \cs_if_exist:cTF
8350 {
8351 c_datatool_
8352 \l__datatool_NZ_datevariant_tl
8353 _
8354 \l__datatool_NZ_datestyle_tl
8355 _date_regex
8356 }
8357 {
8358 \cs_if_exist:cTF
8359 {
8360 c_datatool_
8361 \l__datatool_NZ_timevariant_tl
8362 _hhmmss_time_regex
8363 }
8364 {
8365 \use:c
8366 {
8367 datatool_
8368 \l__datatool_NZ_datestyle_tl
8369 _hhmmss_tz_parse_timestamp:ccNnTF
8370 }
8371 {
8372 c_datatool_
8373 \l__datatool_NZ_datevariant_tl
8374 _
8375 \l__datatool_NZ_datestyle_tl
8376 _date_regex
8377 }
8378 {
8379 c_datatool_
8380 \l__datatool_NZ_timevariant_tl
8381 _hhmmss_time_regex
8382 }
8383 #1 { #2 } { #3 } { #4 }
8384 }
8385 {
8386 \datatool_warn_check_head_language_empty:Vnnn
8387 \l__datatool_NZ_timevariant_tl
8388 { datatool-NZ }
8389 {
8390 No ~ language ~ support ~ for ~ time ~ variant ~
8391 ` \exp_args:Ne \tl_tail:n { \l__datatool_NZ_timevariant_tl } '
8392 }
8393 {
8394 No ~ support ~ for ~ time ~ variant ~
8395 ` \l__datatool_NZ_timevariant_tl '
8396 }
8397 #4
8398 }
8399 }
8400 {
8401 \datatool_warn_check_head_language_empty:Vnnn
8402 \l__datatool_NZ_datevariant_tl
8403 { datatool-NZ }
8404 {
8405 No ~ language ~ support ~ for ~ date ~ style ~
8406 ` \l__datatool_NZ_datestyle_tl '
8407 }
8408 {
8409 No ~ support ~ for ~ date ~ style ~
8410 ` \l__datatool_NZ_datestyle_tl ' ~ with ~
8411 variant ~
8412 ` \l__datatool_NZ_datevariant_tl '
8413 }
8414 #4
8415 }
8416 }
8417 {
8418 \datatool_locale_warn:nn { datatool-NZ }
8419 {
8420 No ~ support ~ for ~ date ~ style ~
8421 ` \l__datatool_NZ_datestyle_tl '
8422 }
8423 #4
8424 }
8425 }
8426 % \end{macrocode}
8427 %
8428 %\subsubsection{Date Parsing}
8429 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
8430 %with regular expression
8431 %\begin{definition}
8432 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
8433 %\end{definition}
8434 % \begin{macrocode}
8435 \cs_new:Nn \datatool_NZ_parse_date:NnTF
8436 {
8437 \cs_if_exist:cTF
8438 {
8439 datatool_
8440 \l__datatool_NZ_datestyle_tl
8441 _parse_date:NNnTF
8442 }
8443 {
8444 \cs_if_exist:cTF
8445 {
8446 c_datatool_
8447 \l__datatool_NZ_datevariant_tl
8448 _anchored_
8449 \l__datatool_NZ_datestyle_tl
8450 _date_regex
8451 }
8452 {
8453 \exp_args:cc
8454 {
8455 datatool_
8456 \l__datatool_NZ_datestyle_tl
8457 _parse_date:NNnTF
8458 }
8459 {
8460 c_datatool_
8461 \l__datatool_NZ_datevariant_tl
8462 _anchored_
8463 \l__datatool_NZ_datestyle_tl
8464 _date_regex
8465 }
8466 #1 { #2 } { #3 } { #4 }
8467 }
8468 {
8469 \datatool_warn_check_head_language_empty:Vnnn
8470 \l__datatool_NZ_datevariant_tl
8471 { datatool-NZ }
8472 {
8473 No ~ language ~ support ~ for ~ date ~ style ~
8474 ` \l__datatool_NZ_datestyle_tl '
8475 }
8476 {
8477 No ~ support ~ for ~ date ~ style ~
8478 ` \l__datatool_NZ_datestyle_tl ' ~ with ~
8479 variant ~
8480 ` \l__datatool_NZ_datevariant_tl '
8481 }
8482 #4
8483 }
8484 }
8485 {
8486 \datatool_locale_warn:nn { datatool-NZ }
8487 {
8488 No ~ support ~ for ~ date ~ style ~
8489 ` \l__datatool_NZ_datestyle_tl '
8490 }
8491 #4
8492 }
8493 }
8494 % \end{macrocode}
8495 %
8496 %\subsubsection{Time Parsing}
8497 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
8498 %with regular expression
8499 %\begin{definition}
8500 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
8501 %\end{definition}
8502 % \begin{macrocode}
8503 \cs_new:Nn \datatool_NZ_parse_time:NnTF
8504 {
8505 \cs_if_exist:cTF
8506 {
8507 c_datatool_
8508 \l__datatool_NZ_timevariant_tl
8509 _anchored_hhmmss_time_regex
8510 }
8511 {
8512 \datatool_hhmmss_parse_time:cNnTF
8513 {
8514 c_datatool_
8515 \l__datatool_NZ_timevariant_tl
8516 _anchored_hhmmss_time_regex
8517 }
8518 #1 { #2 } { #3 } { #4 }
8519 }
8520 {
8521 \datatool_warn_check_head_language_empty:Vnnn
8522 \l__datatool_NZ_timevariant_tl
8523 { datatool-NZ }
8524 {
8525 No ~ language ~ support ~ for ~ time ~ variant ~
8526 ` \exp_args:Ne \tl_tail:n { \l__datatool_NZ_timevariant_tl } '
8527 }
8528 {
8529 No ~ support ~ for ~ time ~ variant ~
8530 ` \l__datatool_NZ_timevariant_tl '
8531 }
8532 #4
8533 }
8534 }
8535 % \end{macrocode}
8536 %
8537 %\subsubsection{Time Zone Mappings}
8538 %Define time zone mapping command for this region:
8539 % \begin{macrocode}
8540 \cs_new:Nn \datatool_NZ_get_timezone_map:n
8541 {
8542 \datatool_region_get_timezone_map:n { NZ / #1 }
8543 }
8544 % \end{macrocode}
8545 %Define time zone IDs for this region (one-way map from ID to offset):
8546 % \begin{macrocode}
8547 \datatool_region_set_timezone_map:nn { NZ / NZST } { +12:00 }
8548 \datatool_region_set_timezone_map:nn { NZ / CHADT } { +13:45 }
8549 \datatool_region_set_timezone_map:nn { NZ / NZDT } { +13:00 }
8550 \datatool_region_set_timezone_map:nn { NZ / CHAST } { +12:45 }
8551 % \end{macrocode}
8552 %
8553 %\subsection{Options}
8554 %Define options for this region:
8555 % \begin{macrocode}
8556 \datatool_locale_define_keys:nn { NZ }
8557 {
8558 number-style .choices:nn =
8559 { official, unofficial }
8560 {
8561 \exp_args:NNe \renewcommand
8562 \datatoolNZSetNumberChars
8563 {
8564 \exp_not:N \bool_if:NT
8565 \exp_not:N \l_datatool_region_set_numberchars_bool
8566 {
8567 \exp_not:c { datatool_NZ_set_numberchars_ \l_keys_choice_tl : }
8568 }
8569 }
8570 \tl_if_eq:NnT \l_datatool_current_region_tl { NZ }
8571 {
8572 \datatoolNZSetNumberChars
8573 }
8574 } ,
8575 % \end{macrocode}
8576 % Currency symbol before or after value:
8577 % \begin{macrocode}
8578 currency-symbol-position .choice: ,
8579 currency-symbol-position / before .code:n =
8580 {
8581 \cs_set_eq:NN \datatool_NZ_currency_position:nn \dtlcurrprefixfmt
8582 } ,
8583 currency-symbol-position / after .code:n =
8584 {
8585 \cs_set_eq:NN \datatool_NZ_currency_position:nn \dtlcurrsuffixfmt
8586 } ,
8587 % \end{macrocode}
8588 % Should the currency symbol be prefixed with the region code:
8589 % \begin{macrocode}
8590 currency-symbol-prefix .choice: ,
8591 currency-symbol-prefix / false .code:n =
8592 {
8593 \cs_set_eq:NN \datatoolNZsymbolprefix \use_none:n
8594 } ,
8595 currency-symbol-prefix / true .code:n =
8596 {
8597 \cs_set_eq:NN
8598 \datatoolNZsymbolprefix
8599 \datatool_currency_symbol_region_prefix:n
8600 } ,
8601 currency-symbol-prefix .default:n = { true } ,
8602 % \end{macrocode}
8603 % Separator between currency symbol (not code) and value:
8604 % \begin{macrocode}
8605 currency-symbol-sep .choice: ,
8606 currency-symbol-sep / none .code:n =
8607 {
8608 \tl_clear:N \l_datatool_NZ_sym_sep_tl
8609 } ,
8610 currency-symbol-sep / thin-space .code:n =
8611 {
8612 \tl_set:Nn \l_datatool_NZ_sym_sep_tl { \, }
8613 } ,
8614 currency-symbol-sep / space .code:n =
8615 {
8616 \tl_set:Nn \l_datatool_NZ_sym_sep_tl { ~ }
8617 } ,
8618 currency-symbol-sep / nbsp .code:n =
8619 {
8620 \tl_set:Nn \l_datatool_NZ_sym_sep_tl { \nobreakspace }
8621 } ,
8622 currency-symbol-sep . initial:n = { none } ,
8623 % \end{macrocode}
8624 % Date and time styles:
8625 % \begin{macrocode}
8626 date-style .choice: ,
8627 date-style / dmyyyy .code: n =
8628 {
8629 \tl_set:Nn \l__datatool_NZ_datestyle_tl { ddmmyyyy }
8630 } ,
8631 date-style / mdyyyy .code: n =
8632 {
8633 \tl_set:Nn \l__datatool_NZ_datestyle_tl { mmddyyyy }
8634 } ,
8635 date-style / yyyymd .code: n =
8636 {
8637 \tl_set:Nn \l__datatool_NZ_datestyle_tl { yyyymmdd }
8638 } ,
8639 date-style / dmyy .code: n =
8640 {
8641 \tl_set:Nn \l__datatool_NZ_datestyle_tl { ddmmyy }
8642 } ,
8643 date-style / mdyy .code: n =
8644 {
8645 \tl_set:Nn \l__datatool_NZ_datestyle_tl { mmddyy }
8646 } ,
8647 date-style / yymd .code: n =
8648 {
8649 \tl_set:Nn \l__datatool_NZ_datestyle_tl { yymmdd }
8650 } ,
8651 date-variant .choice: ,
8652 date-variant / slash .code:n =
8653 {
8654 \tl_set:Nn \l__datatool_NZ_datevariant_tl { slash }
8655 } ,
8656 date-variant / hyphen .code:n =
8657 {
8658 \tl_set:Nn \l__datatool_NZ_datevariant_tl { hyphen }
8659 } ,
8660 date-variant / dot .code:n =
8661 {
8662 \tl_set:Nn \l__datatool_NZ_datevariant_tl { dot }
8663 } ,
8664 date-variant / dialect .code:n =
8665 {
8666 \tl_set:Nn \l__datatool_NZ_datevariant_tl
8667 { \l_datatool_current_language_tl }
8668 } ,
8669 time-variant .choice: ,
8670 time-variant / colon .code:n =
8671 {
8672 \tl_set:Nn \l__datatool_NZ_timevariant_tl { colon }
8673 } ,
8674 time-variant / dot .code:n =
8675 {
8676 \tl_set:Nn \l__datatool_NZ_timevariant_tl { dot }
8677 } ,
8678 time-variant / dialect .code:n =
8679 {
8680 \tl_if_eq:NnTF \l__datatool_NZ_timevariant_tl { dot }
8681 {
8682 \tl_set:Nn \l__datatool_NZ_timevariant_tl
8683 { \l_datatool_current_language_tl _dot }
8684 }
8685 {
8686 \tl_if_in:NnF
8687 \l__datatool_NZ_timevariant_tl
8688 { \l_datatool_current_language_tl }
8689 {
8690 \tl_set:Nn \l__datatool_NZ_timevariant_tl
8691 { \l_datatool_current_language_tl _colon }
8692 }
8693 }
8694 } ,
8695 time-variant / dialect-colon .code:n =
8696 {
8697 \tl_set:Nn \l__datatool_NZ_timevariant_tl
8698 { \l_datatool_current_language_tl _colon }
8699 } ,
8700 time-variant / dialect-dot .code:n =
8701 {
8702 \tl_set:Nn \l__datatool_NZ_timevariant_tl
8703 { \l_datatool_current_language_tl _dot }
8704 } ,
8705 }
8706 % \end{macrocode}
8707 %
8708 %\subsection{Hooks}
8709 %Command to update temporal parsing commands for this region:
8710 % \begin{macrocode}
8711 \newcommand \datatoolNZSetTemporalParsers
8712 {
8713 \renewcommand \DTLCurrentLocaleParseTimeStamp
8714 { \datatool_NZ_parse_timestamp:NnTF }
8715 \renewcommand \DTLCurrentLocaleParseDate
8716 { \datatool_NZ_parse_date:NnTF }
8717 \renewcommand \DTLCurrentLocaleParseTime
8718 { \datatool_NZ_parse_time:NnTF }
8719 \let
8720 \DTLCurrentLocaleGetTimeZoneMap
8721 \datatool_NZ_get_timezone_map:n
8722 }
8723 % \end{macrocode}
8724 %Set temporal formatting commands for this region. Currently this
8725 %just resets to the default, but may change in future.
8726 %Note that the defaults test if the applicable \sty{datetime2}
8727 %command is available and will fallback on ISO if not defined.
8728 %Bear in mind that the default style for \sty{datetime2} is
8729 %\texttt{iso} so there won't be a noticeable difference unless the
8730 %\sty{datetime2} regional setting is on.
8731 % \begin{macrocode}
8732 \newcommand \datatoolNZSetTemporalFormatters
8733 {
8734 \let
8735 \DTLCurrentLocaleFormatDate
8736 \datatool_default_date_fmt:nnnn
8737 \let
8738 \DTLCurrentLocaleFormatTime
8739 \datatool_default_time_fmt:nnn
8740 \let
8741 \DTLCurrentLocaleFormatTimeZone
8742 \datatool_default_timezone_fmt:nn
8743 \let
8744 \DTLCurrentLocaleFormatTimeStampNoZone
8745 \datatool_default_timestamp_fmt:nnnnnnn
8746 \let
8747 \DTLCurrentLocaleFormatTimeStampWithZone
8748 \datatool_default_timestamp_fmt:nnnnnnnnn
8749 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
8750 }
8751 % \end{macrocode}
8752 %
8753 %
8754 %Command to update currency and temporal parsing commands for this region:
8755 % \begin{macrocode}
8756 \newcommand \DTLNZLocaleHook
8757 {
8758 \datatoolNZSetNumberChars
8759 \datatoolNZSetCurrency
8760 \datatoolNZSetTemporalParsers
8761 \datatoolNZSetTemporalFormatters
8762 % \end{macrocode}
8763 %Allow language files to reference the region:
8764 % \begin{macrocode}
8765 \tl_set:Nn \l_datatool_current_region_tl { NZ }
8766 }
8767 % \end{macrocode}
8768 %
8769 % Finished with \LaTeX3 syntax.
8770 % \begin{macrocode}
8771 \ExplSyntaxOff
8772 % \end{macrocode}
8773 %Note that the hook is added to the captions by \sty{datatool-base}
8774 %not by the region file.
8775 %\iffalse
8776 % \begin{macrocode}
8777 %</datatool-NZ.ldf>
8778 % \end{macrocode}
8779 %\fi
8780 %\iffalse
8781 % \begin{macrocode}
8782 %<*datatool-US.ldf>
8783 % \end{macrocode}
8784 %\fi
8785 %\section{datatool-US.ldf}\label{sec:datatool-US}
8786 % Support for region US.
8787 % \begin{macrocode}
8788 \TrackLangProvidesResource{US}[2025/03/01 v1.0]
8789 % \end{macrocode}
8790 % Switch on \LaTeX3 syntax:
8791 % \begin{macrocode}
8792 \ExplSyntaxOn
8793 % \end{macrocode}
8794 %\subsection{Numbers and Currency}
8795 %Set the number group and decimal symbols for this region.
8796 % \begin{macrocode}
8797 \cs_new:Nn \datatool_US_set_numberchars_official:
8798 {
8799 \datatool_set_numberchars:nn { , } { . }
8800 }
8801 % \end{macrocode}
8802 %Unofficial style.
8803 % \begin{macrocode}
8804 \cs_new:Nn \datatool_US_set_numberchars_unofficial:
8805 {
8806 \datatool_set_thinspace_group_decimal_char:n { . }
8807 }
8808 % \end{macrocode}
8809 %Hook to set the number group and decimal characters for the region:
8810 % \begin{macrocode}
8811 \newcommand \datatoolUSSetNumberChars
8812 {
8813 \bool_if:NT \l_datatool_region_set_numberchars_bool
8814 {
8815 \datatool_US_set_numberchars_official:
8816 }
8817 }
8818 % \end{macrocode}
8819 %How to format the position of the currency symbol in relation to the value.
8820 % \begin{macrocode}
8821 \cs_new:Nn \datatool_US_currency_position:nn
8822 {
8823 \dtlcurrprefixfmt { #1 } { #2 }
8824 }
8825 % \end{macrocode}
8826 %Separator between currency symbol and value.
8827 % \begin{macrocode}
8828 \tl_new:N \l_datatool_US_sym_sep_tl
8829 % \end{macrocode}
8830 % Set the currency format for this region.
8831 % \begin{macrocode}
8832 \newcommand \datatoolUScurrencyfmt [ 2 ]
8833 {
8834 \datatool_US_currency_position:nn
8835 {
8836 \datatoolUSsymbolprefix { US }
8837 #1
8838 }
8839 { #2 }
8840 }
8841 % \end{macrocode}
8842 %Prefix for symbol, if required.
8843 % \begin{macrocode}
8844 \newcommand \datatoolUSsymbolprefix [ 1 ] { }
8845 % \end{macrocode}
8846 % Define the currency symbols for this region.
8847 % \begin{macrocode}
8848 \datatool_def_currency:nnnV
8849 { \datatoolUScurrencyfmt }
8850 { USD }
8851 { \$ }
8852 \c_dollar_str
8853 % \end{macrocode}
8854 % Register the currency code with this region:
8855 % \begin{macrocode}
8856 \datatool_register_regional_currency_code:nn { US } { USD }
8857 % \end{macrocode}
8858 % Provide a command to set the currency for this region (for use
8859 % with any hook used when the locale changes).
8860 % NB this should do nothing with
8861 % \verb|\DTLsetup{region-currency=false}|
8862 % \begin{macrocode}
8863 \newcommand \datatoolUSSetCurrency
8864 {
8865 \bool_if:NT \l_datatool_region_set_currency_bool
8866 {
8867 \DTLsetdefaultcurrency { USD }
8868 % \end{macrocode}
8869 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
8870 % \begin{macrocode}
8871 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
8872 % \end{macrocode}
8873 %Separator between symbol and value:
8874 % \begin{macrocode}
8875 \renewcommand \dtlcurrfmtsymsep { \l_datatool_US_sym_sep_tl }
8876 }
8877 }
8878 % \end{macrocode}
8879 %
8880 %\subsection{Date and Time Parsing}
8881 % This defaults to month/day/year but may be changed with \cs{DTLsetLocaleOptions}. For example:
8882 %\begin{dispListing}
8883 %\DTLsetLocaleOptions{US}{date-style=dmyyyy, date-variant=slash}
8884 %\end{dispListing}
8885 %An appropriate language file will need to also be installed to
8886 %parse dates containing month names or day of week names.
8887 %
8888 % Provide a way to configure parsing style.
8889 % \begin{macrocode}
8890 \tl_new:N \l__datatool_US_datevariant_tl
8891 \tl_set:Nn \l__datatool_US_datevariant_tl { slash }
8892 % \end{macrocode}
8893 %NB These token lists are used to form command names. The following is not
8894 %a format string.
8895 % \begin{macrocode}
8896 \tl_new:N \l__datatool_US_datestyle_tl
8897 \tl_set:Nn \l__datatool_US_datestyle_tl { mmddyyyy }
8898 \tl_new:N \l__datatool_US_timevariant_tl
8899 \tl_set:Nn \l__datatool_US_timevariant_tl { colon }
8900 % \end{macrocode}
8901 %
8902 %Each parsing command defined below has final \marg{true} and \marg{false}
8903 %arguments (\code{TF}). These are used if parsing was successful (true) or if
8904 %parsing failed (false). The internal commands used by
8905 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
8906 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
8907 %not as conditionals.
8908 %
8909 %\subsubsection{Time Stamp Parsing}
8910 %Use command
8911 %\begin{definition}
8912 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
8913 %\end{definition}
8914 %with date regular expression
8915 %\begin{definition}
8916 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
8917 %\end{definition}
8918 %and time regular expression
8919 %\begin{definition}
8920 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
8921 %\end{definition}
8922 % \begin{macrocode}
8923 \cs_new:Nn \datatool_US_parse_timestamp:NnTF
8924 {
8925 \cs_if_exist:cTF
8926 {
8927 datatool_
8928 \l__datatool_US_datestyle_tl
8929 _hhmmss_tz_parse_timestamp:ccNnTF
8930 }
8931 {
8932 \cs_if_exist:cTF
8933 {
8934 c_datatool_
8935 \l__datatool_US_datevariant_tl
8936 _
8937 \l__datatool_US_datestyle_tl
8938 _date_regex
8939 }
8940 {
8941 \cs_if_exist:cTF
8942 {
8943 c_datatool_
8944 \l__datatool_US_timevariant_tl
8945 _hhmmss_time_regex
8946 }
8947 {
8948 \use:c
8949 {
8950 datatool_
8951 \l__datatool_US_datestyle_tl
8952 _hhmmss_tz_parse_timestamp:ccNnTF
8953 }
8954 {
8955 c_datatool_
8956 \l__datatool_US_datevariant_tl
8957 _
8958 \l__datatool_US_datestyle_tl
8959 _date_regex
8960 }
8961 {
8962 c_datatool_
8963 \l__datatool_US_timevariant_tl
8964 _hhmmss_time_regex
8965 }
8966 #1 { #2 } { #3 } { #4 }
8967 }
8968 {
8969 \datatool_warn_check_head_language_empty:Vnnn
8970 \l__datatool_US_timevariant_tl
8971 { datatool-US }
8972 {
8973 No ~ language ~ support ~ for ~ time ~ variant ~
8974 ` \exp_args:Ne \tl_tail:n { \l__datatool_US_timevariant_tl } '
8975 }
8976 {
8977 No ~ support ~ for ~ time ~ variant ~
8978 ` \l__datatool_US_timevariant_tl '
8979 }
8980 #4
8981 }
8982 }
8983 {
8984 \datatool_warn_check_head_language_empty:Vnnn
8985 \l__datatool_US_datevariant_tl
8986 { datatool-US }
8987 {
8988 No ~ language ~ support ~ for ~ date ~ style ~
8989 ` \l__datatool_US_datestyle_tl '
8990 }
8991 {
8992 No ~ support ~ for ~ date ~ style ~
8993 ` \l__datatool_US_datestyle_tl ' ~ with ~
8994 variant ~
8995 ` \l__datatool_US_datevariant_tl '
8996 }
8997 #4
8998 }
8999 }
9000 {
9001 \datatool_locale_warn:nn { datatool-US }
9002 {
9003 No ~ support ~ for ~ date ~ style ~
9004 ` \l__datatool_US_datestyle_tl '
9005 }
9006 #4
9007 }
9008 }
9009 % \end{macrocode}
9010 %
9011 %\subsubsection{Date Parsing}
9012 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
9013 %with regular expression
9014 %\begin{definition}
9015 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
9016 %\end{definition}
9017 % \begin{macrocode}
9018 \cs_new:Nn \datatool_US_parse_date:NnTF
9019 {
9020 \cs_if_exist:cTF
9021 {
9022 datatool_
9023 \l__datatool_US_datestyle_tl
9024 _parse_date:NNnTF
9025 }
9026 {
9027 \cs_if_exist:cTF
9028 {
9029 c_datatool_
9030 \l__datatool_US_datevariant_tl
9031 _anchored_
9032 \l__datatool_US_datestyle_tl
9033 _date_regex
9034 }
9035 {
9036 \exp_args:cc
9037 {
9038 datatool_
9039 \l__datatool_US_datestyle_tl
9040 _parse_date:NNnTF
9041 }
9042 {
9043 c_datatool_
9044 \l__datatool_US_datevariant_tl
9045 _anchored_
9046 \l__datatool_US_datestyle_tl
9047 _date_regex
9048 }
9049 #1 { #2 } { #3 } { #4 }
9050 }
9051 {
9052 \datatool_warn_check_head_language_empty:Vnnn
9053 \l__datatool_US_datevariant_tl
9054 { datatool-US }
9055 {
9056 No ~ language ~ support ~ for ~ date ~ style ~
9057 ` \l__datatool_US_datestyle_tl '
9058 }
9059 {
9060 No ~ support ~ for ~ date ~ style ~
9061 ` \l__datatool_US_datestyle_tl ' ~ with ~
9062 variant ~
9063 ` \l__datatool_US_datevariant_tl '
9064 }
9065 #4
9066 }
9067 }
9068 {
9069 \datatool_locale_warn:nn { datatool-US }
9070 {
9071 No ~ support ~ for ~ date ~ style ~
9072 ` \l__datatool_US_datestyle_tl '
9073 }
9074 #4
9075 }
9076 }
9077 % \end{macrocode}
9078 %
9079 %\subsubsection{Time Parsing}
9080 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
9081 %with regular expression
9082 %\begin{definition}
9083 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
9084 %\end{definition}
9085 % \begin{macrocode}
9086 \cs_new:Nn \datatool_US_parse_time:NnTF
9087 {
9088 \cs_if_exist:cTF
9089 {
9090 c_datatool_
9091 \l__datatool_US_timevariant_tl
9092 _anchored_hhmmss_time_regex
9093 }
9094 {
9095 \datatool_hhmmss_parse_time:cNnTF
9096 {
9097 c_datatool_
9098 \l__datatool_US_timevariant_tl
9099 _anchored_hhmmss_time_regex
9100 }
9101 #1 { #2 } { #3 } { #4 }
9102 }
9103 {
9104 \datatool_warn_check_head_language_empty:Vnnn
9105 \l__datatool_US_timevariant_tl
9106 { datatool-US }
9107 {
9108 No ~ language ~ support ~ for ~ time ~ variant ~
9109 ` \exp_args:Ne \tl_tail:n { \l__datatool_US_timevariant_tl } '
9110 }
9111 {
9112 No ~ support ~ for ~ time ~ variant ~
9113 ` \l__datatool_US_timevariant_tl '
9114 }
9115 #4
9116 }
9117 }
9118 % \end{macrocode}
9119 %
9120 %\subsubsection{Time Zone Mappings}
9121 %Define time zone mapping command for this region:
9122 % \begin{macrocode}
9123 \cs_new:Nn \datatool_US_get_timezone_map:n
9124 {
9125 \datatool_region_get_timezone_map:n { US / #1 }
9126 }
9127 % \end{macrocode}
9128 %Define time zone IDs for this region (one-way map from ID to offset):
9129 % \begin{macrocode}
9130 \datatool_region_set_timezone_map:nn { US / AST } { -04:00 }
9131 \datatool_region_set_timezone_map:nn { US / ADT } { -03:00 }
9132 \datatool_region_set_timezone_map:nn { US / EST } { -05:00 }
9133 \datatool_region_set_timezone_map:nn { US / EDT } { -04:00 }
9134 \datatool_region_set_timezone_map:nn { US / CST } { -06:00 }
9135 \datatool_region_set_timezone_map:nn { US / CDT } { -05:00 }
9136 \datatool_region_set_timezone_map:nn { US / MST } { -07:00 }
9137 \datatool_region_set_timezone_map:nn { US / MDT } { -06:00 }
9138 \datatool_region_set_timezone_map:nn { US / PST } { -08:00 }
9139 \datatool_region_set_timezone_map:nn { US / PDT } { -07:00 }
9140 \datatool_region_set_timezone_map:nn { US / AKST } { -09:00 }
9141 \datatool_region_set_timezone_map:nn { US / AKDT } { -08:00 }
9142 \datatool_region_set_timezone_map:nn { US / HAST } { -10:00 }
9143 \datatool_region_set_timezone_map:nn { US / HADT } { -9:00 }
9144 \datatool_region_set_timezone_map:nn { US / SST } { -11:00 }
9145 \datatool_region_set_timezone_map:nn { US / ChST } { 10:00 }
9146 % \end{macrocode}
9147 %
9148 %\subsection{Options}
9149 %Define options for this region:
9150 % \begin{macrocode}
9151 \datatool_locale_define_keys:nn { US }
9152 {
9153 number-style .choices:nn =
9154 { official, unofficial }
9155 {
9156 \exp_args:NNe \renewcommand
9157 \datatoolUSSetNumberChars
9158 {
9159 \exp_not:N \bool_if:NT
9160 \exp_not:N \l_datatool_region_set_numberchars_bool
9161 {
9162 \exp_not:c { datatool_US_set_numberchars_ \l_keys_choice_tl : }
9163 }
9164 }
9165 \tl_if_eq:NnT \l_datatool_current_region_tl { US }
9166 {
9167 \datatoolUSSetNumberChars
9168 }
9169 } ,
9170 % \end{macrocode}
9171 % Currency symbol before or after value:
9172 % \begin{macrocode}
9173 currency-symbol-position .choice: ,
9174 currency-symbol-position / before .code:n =
9175 {
9176 \cs_set_eq:NN \datatool_US_currency_position:nn \dtlcurrprefixfmt
9177 } ,
9178 currency-symbol-position / after .code:n =
9179 {
9180 \cs_set_eq:NN \datatool_US_currency_position:nn \dtlcurrsuffixfmt
9181 } ,
9182 % \end{macrocode}
9183 % Should the currency symbol be prefixed with the region code:
9184 % \begin{macrocode}
9185 currency-symbol-prefix .choice: ,
9186 currency-symbol-prefix / false .code:n =
9187 {
9188 \cs_set_eq:NN \datatoolUSsymbolprefix \use_none:n
9189 } ,
9190 currency-symbol-prefix / true .code:n =
9191 {
9192 \cs_set_eq:NN
9193 \datatoolUSsymbolprefix
9194 \datatool_currency_symbol_region_prefix:n
9195 } ,
9196 currency-symbol-prefix .default:n = { true } ,
9197 % \end{macrocode}
9198 % Separator between currency symbol (not code) and value:
9199 % \begin{macrocode}
9200 currency-symbol-sep .choice: ,
9201 currency-symbol-sep / none .code:n =
9202 {
9203 \tl_clear:N \l_datatool_US_sym_sep_tl
9204 } ,
9205 currency-symbol-sep / thin-space .code:n =
9206 {
9207 \tl_set:Nn \l_datatool_US_sym_sep_tl { \, }
9208 } ,
9209 currency-symbol-sep / space .code:n =
9210 {
9211 \tl_set:Nn \l_datatool_US_sym_sep_tl { ~ }
9212 } ,
9213 currency-symbol-sep / nbsp .code:n =
9214 {
9215 \tl_set:Nn \l_datatool_US_sym_sep_tl { \nobreakspace }
9216 } ,
9217 currency-symbol-sep . initial:n = { none } ,
9218 % \end{macrocode}
9219 % Date and time styles:
9220 % \begin{macrocode}
9221 date-style .choice: ,
9222 date-style / dmyyyy .code: n =
9223 {
9224 \tl_set:Nn \l__datatool_US_datestyle_tl { ddmmyyyy }
9225 } ,
9226 date-style / mdyyyy .code: n =
9227 {
9228 \tl_set:Nn \l__datatool_US_datestyle_tl { mmddyyyy }
9229 } ,
9230 date-style / yyyymd .code: n =
9231 {
9232 \tl_set:Nn \l__datatool_US_datestyle_tl { yyyymmdd }
9233 } ,
9234 date-style / dmyy .code: n =
9235 {
9236 \tl_set:Nn \l__datatool_US_datestyle_tl { ddmmyy }
9237 } ,
9238 date-style / mdyy .code: n =
9239 {
9240 \tl_set:Nn \l__datatool_US_datestyle_tl { mmddyy }
9241 } ,
9242 date-style / yymd .code: n =
9243 {
9244 \tl_set:Nn \l__datatool_US_datestyle_tl { yymmdd }
9245 } ,
9246 date-variant .choice: ,
9247 date-variant / slash .code:n =
9248 {
9249 \tl_set:Nn \l__datatool_US_datevariant_tl { slash }
9250 } ,
9251 date-variant / hyphen .code:n =
9252 {
9253 \tl_set:Nn \l__datatool_US_datevariant_tl { hyphen }
9254 } ,
9255 date-variant / dot .code:n =
9256 {
9257 \tl_set:Nn \l__datatool_US_datevariant_tl { dot }
9258 } ,
9259 date-variant / dialect .code:n =
9260 {
9261 \tl_set:Nn \l__datatool_US_datevariant_tl
9262 { \l_datatool_current_language_tl }
9263 } ,
9264 time-variant .choice: ,
9265 time-variant / colon .code:n =
9266 {
9267 \tl_set:Nn \l__datatool_US_timevariant_tl { colon }
9268 } ,
9269 time-variant / dot .code:n =
9270 {
9271 \tl_set:Nn \l__datatool_US_timevariant_tl { dot }
9272 } ,
9273 time-variant / dialect .code:n =
9274 {
9275 \tl_if_eq:NnTF \l__datatool_US_timevariant_tl { dot }
9276 {
9277 \tl_set:Nn \l__datatool_US_timevariant_tl
9278 { \l_datatool_current_language_tl _dot }
9279 }
9280 {
9281 \tl_if_in:NnF
9282 \l__datatool_US_timevariant_tl
9283 { \l_datatool_current_language_tl }
9284 {
9285 \tl_set:Nn \l__datatool_US_timevariant_tl
9286 { \l_datatool_current_language_tl _colon }
9287 }
9288 }
9289 } ,
9290 time-variant / dialect-colon .code:n =
9291 {
9292 \tl_set:Nn \l__datatool_US_timevariant_tl
9293 { \l_datatool_current_language_tl _colon }
9294 } ,
9295 time-variant / dialect-dot .code:n =
9296 {
9297 \tl_set:Nn \l__datatool_US_timevariant_tl
9298 { \l_datatool_current_language_tl _dot }
9299 } ,
9300 }
9301 % \end{macrocode}
9302 %
9303 %\subsection{Hooks}
9304 %Command to update temporal parsing commands for this region:
9305 % \begin{macrocode}
9306 \newcommand \datatoolUSSetTemporalParsers
9307 {
9308 \renewcommand \DTLCurrentLocaleParseTimeStamp
9309 { \datatool_US_parse_timestamp:NnTF }
9310 \renewcommand \DTLCurrentLocaleParseDate
9311 { \datatool_US_parse_date:NnTF }
9312 \renewcommand \DTLCurrentLocaleParseTime
9313 { \datatool_US_parse_time:NnTF }
9314 \let
9315 \DTLCurrentLocaleGetTimeZoneMap
9316 \datatool_US_get_timezone_map:n
9317 }
9318 % \end{macrocode}
9319 %Set temporal formatting commands for this region. Currently this
9320 %just resets to the default, but may change in future.
9321 %Note that the defaults test if the applicable \sty{datetime2}
9322 %command is available and will fallback on ISO if not defined.
9323 %Bear in mind that the default style for \sty{datetime2} is
9324 %\texttt{iso} so there won't be a noticeable difference unless the
9325 %\sty{datetime2} regional setting is on.
9326 % \begin{macrocode}
9327 \newcommand \datatoolUSSetTemporalFormatters
9328 {
9329 \let
9330 \DTLCurrentLocaleFormatDate
9331 \datatool_default_date_fmt:nnnn
9332 \let
9333 \DTLCurrentLocaleFormatTime
9334 \datatool_default_time_fmt:nnn
9335 \let
9336 \DTLCurrentLocaleFormatTimeZone
9337 \datatool_default_timezone_fmt:nn
9338 \let
9339 \DTLCurrentLocaleFormatTimeStampNoZone
9340 \datatool_default_timestamp_fmt:nnnnnnn
9341 \let
9342 \DTLCurrentLocaleFormatTimeStampWithZone
9343 \datatool_default_timestamp_fmt:nnnnnnnnn
9344 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
9345 }
9346 % \end{macrocode}
9347 %
9348 %Command to update currency and temporal parsing commands for this region:
9349 % \begin{macrocode}
9350 \newcommand \DTLUSLocaleHook
9351 {
9352 \datatoolUSSetNumberChars
9353 \datatoolUSSetCurrency
9354 \datatoolUSSetTemporalParsers
9355 \datatoolUSSetTemporalFormatters
9356 % \end{macrocode}
9357 %Allow language files to reference the region:
9358 % \begin{macrocode}
9359 \tl_set:Nn \l_datatool_current_region_tl { US }
9360 }
9361 % \end{macrocode}
9362 %
9363 % Finished with \LaTeX3 syntax.
9364 % \begin{macrocode}
9365 \ExplSyntaxOff
9366 % \end{macrocode}
9367 %Note that the hook is added to the captions by \sty{datatool-base}
9368 %not by the region file.
9369 %\iffalse
9370 % \begin{macrocode}
9371 %</datatool-US.ldf>
9372 % \end{macrocode}
9373 %\fi
9374 %\iffalse
9375 % \begin{macrocode}
9376 %<*datatool-ZA.ldf>
9377 % \end{macrocode}
9378 %\fi
9379 %\section{datatool-ZA.ldf}\label{sec:code:datatool-ZA}
9380 % Support for region ZA.
9381 % \begin{macrocode}
9382 \TrackLangProvidesResource{ZA}[2025/03/01 v1.0]
9383 % \end{macrocode}
9384 % Switch on \LaTeX3 syntax:
9385 % \begin{macrocode}
9386 \ExplSyntaxOn
9387 % \end{macrocode}
9388 %
9389 %\subsection{Numbers and Currency}
9390 %Official style is to use dot separator and decimal dot.
9391 % \begin{macrocode}
9392 \cs_new:Nn \datatool_ZA_set_numberchars_official:
9393 {
9394 \DTLsetnumberchars { . } { , }
9395 }
9396 % \end{macrocode}
9397 %but allow dialect to use another style.
9398 % \begin{macrocode}
9399 \cs_new:Nn \datatool_ZA_set_numberchars_dialect:
9400 {
9401 \cs_if_exist_use:cF
9402 { datatool \l_datatool_current_language_tl ZASetNumberChars }
9403 {
9404 \datatool_ZA_set_numberchars_official:
9405 }
9406 }
9407 % \end{macrocode}
9408 %Hook to set the number group and decimal characters for the region:
9409 % \begin{macrocode}
9410 \newcommand \datatoolZASetNumberChars
9411 {
9412 \bool_if:NT \l_datatool_region_set_numberchars_bool
9413 {
9414 \datatool_ZA_set_numberchars_official:
9415 }
9416 }
9417 % \end{macrocode}
9418 %How to format the position of the currency symbol in relation to the value.
9419 % \begin{macrocode}
9420 \cs_new:Nn \datatool_ZA_currency_position:nn
9421 {
9422 \dtlcurrprefixfmt { #1 } { #2 }
9423 }
9424 % \end{macrocode}
9425 %Separator between currency symbol and value.
9426 % \begin{macrocode}
9427 \tl_new:N \l_datatool_ZA_sym_sep_tl
9428 % \end{macrocode}
9429 %
9430 % Set the currency format for this region.
9431 % \begin{macrocode}
9432 \newcommand \datatoolZAcurrencyfmt { \datatool_ZA_currency_position:nn }
9433 % \end{macrocode}
9434 % Define the currency symbols for this region.
9435 % \begin{macrocode}
9436 \datatool_def_currency:nnnn
9437 { \datatoolZAcurrencyfmt }
9438 { ZAR } { R } { R }
9439 % \end{macrocode}
9440 %Register the currency code with this region:
9441 % \begin{macrocode}
9442 \datatool_register_regional_currency_code:nn { ZA } { ZAR }
9443 % \end{macrocode}
9444 % Provide a command to set the currency for this region (for use
9445 % with any hook used when the locale changes).
9446 % NB this should do nothing with
9447 % \verb|\DTLsetup{region-currency=false}|
9448 % \begin{macrocode}
9449 \newcommand \datatoolZASetCurrency
9450 {
9451 \bool_if:NT \l_datatool_region_set_currency_bool
9452 {
9453 \DTLsetdefaultcurrency { ZAR }
9454 % \end{macrocode}
9455 %Number of digits that \cs{DTLdecimaltocurrency} should round to:
9456 % \begin{macrocode}
9457 \renewcommand \DTLCurrentLocaleCurrencyDP { 2 }
9458 % \end{macrocode}
9459 %Separator between symbol and value:
9460 % \begin{macrocode}
9461 \renewcommand \dtlcurrfmtsymsep { \l_datatool_ZA_sym_sep_tl }
9462 }
9463 }
9464 % \end{macrocode}
9465 %
9466 %\subsection{Date and Time Parsing}
9467 % Date parsing is more complicated as there seems to be a confusing
9468 % mixture of ISO, day/month/year and month/day/year formats.
9469 % The default is year-month-day but may be changed with
9470 % \cs{DTLsetLocaleOptions}. For example:
9471 %\begin{dispListing}
9472 %\DTLsetLocaleOptions{ZA}{date-style=dmyyyy, date-variant=slash}
9473 %\end{dispListing}
9474 %An appropriate language file will need to also be installed to
9475 %parse dates containing month names or day of week names.
9476 %
9477 % \begin{macrocode}
9478 \tl_new:N \l__datatool_ZA_datevariant_tl
9479 \tl_set:Nn \l__datatool_ZA_datevariant_tl { hyphen }
9480 % \end{macrocode}
9481 %NB These token lists are used to form command names. The following is not
9482 %a format string.
9483 % \begin{macrocode}
9484 \tl_new:N \l__datatool_ZA_datestyle_tl
9485 \tl_set:Nn \l__datatool_ZA_datestyle_tl { yyyymmdd }
9486 \tl_new:N \l__datatool_ZA_timevariant_tl
9487 \tl_set:Nn \l__datatool_ZA_timevariant_tl { colon }
9488 % \end{macrocode}
9489 %
9490 %Each parsing command defined below has final \marg{true} and \marg{false}
9491 %arguments (\code{TF}). These are used if parsing was successful (true) or if
9492 %parsing failed (false). The internal commands used by
9493 %\sty{datatool-base} have no need for solo branches (only \code{T} or only
9494 %\code{F}) so these commands are simply defined with \verb|\cs_new:Nn|
9495 %not as conditionals.
9496 %
9497 %\subsubsection{Time Stamp Parsing}
9498 %Use command
9499 %\begin{definition}
9500 %\cs{datatool\_}\meta{date-style}\verb|_hhmmss_tz_parse_timestamp:nnNnTF|
9501 %\end{definition}
9502 %with date regular expression
9503 %\begin{definition}
9504 %\cs{c\_datatool\_}\meta{date-variant}\verb|_|\meta{date-style}\verb|_date_regex|
9505 %\end{definition}
9506 %and time regular expression
9507 %\begin{definition}
9508 %\cs{c\_datatool\_}\meta{time-variant}\verb|_hhmmss_time_regex|
9509 %\end{definition}
9510 % \begin{macrocode}
9511 \cs_new:Nn \datatool_ZA_parse_timestamp:NnTF
9512 {
9513 \cs_if_exist:cTF
9514 {
9515 datatool_
9516 \l__datatool_ZA_datestyle_tl
9517 _hhmmss_tz_parse_timestamp:ccNnTF
9518 }
9519 {
9520 \cs_if_exist:cTF
9521 {
9522 c_datatool_
9523 \l__datatool_ZA_datevariant_tl
9524 _
9525 \l__datatool_ZA_datestyle_tl
9526 _date_regex
9527 }
9528 {
9529 \cs_if_exist:cTF
9530 {
9531 c_datatool_
9532 \l__datatool_ZA_timevariant_tl
9533 _hhmmss_time_regex
9534 }
9535 {
9536 \use:c
9537 {
9538 datatool_
9539 \l__datatool_ZA_datestyle_tl
9540 _hhmmss_tz_parse_timestamp:ccNnTF
9541 }
9542 {
9543 c_datatool_
9544 \l__datatool_ZA_datevariant_tl
9545 _
9546 \l__datatool_ZA_datestyle_tl
9547 _date_regex
9548 }
9549 {
9550 c_datatool_
9551 \l__datatool_ZA_timevariant_tl
9552 _hhmmss_time_regex
9553 }
9554 #1 { #2 } { #3 } { #4 }
9555 }
9556 {
9557 \datatool_locale_warn:nn { datatool-ZA }
9558 {
9559 No ~ support ~ for ~ time ~ variant ~
9560 ` \l__datatool_ZA_timevariant_tl '
9561 }
9562 #4
9563 }
9564 }
9565 {
9566 \datatool_locale_warn:nn { datatool-ZA }
9567 {
9568 No ~ support ~ for ~ date ~ style ~
9569 ` \l__datatool_ZA_datestyle_tl ' ~ with ~
9570 variant ~
9571 ` \l__datatool_ZA_datevariant_tl '
9572 }
9573 #4
9574 }
9575 }
9576 {
9577 \datatool_locale_warn:nn { datatool-ZA }
9578 {
9579 No ~ support ~ for ~ date ~ style ~
9580 ` \l__datatool_ZA_datestyle_tl '
9581 }
9582 #4
9583 }
9584 }
9585 % \end{macrocode}
9586 %
9587 %\subsubsection{Date Parsing}
9588 %Use command \cs{datatool\_}\meta{style}\verb|_parse_date:NNnTF|
9589 %with regular expression
9590 %\begin{definition}
9591 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_date_regex|
9592 %\end{definition}
9593 % \begin{macrocode}
9594 \cs_new:Nn \datatool_ZA_parse_date:NnTF
9595 {
9596 \cs_if_exist:cTF
9597 {
9598 datatool_
9599 \l__datatool_ZA_datestyle_tl
9600 _parse_date:NNnTF
9601 }
9602 {
9603 \cs_if_exist:cTF
9604 {
9605 c_datatool_
9606 \l__datatool_ZA_datevariant_tl
9607 _anchored_
9608 \l__datatool_ZA_datestyle_tl
9609 _date_regex
9610 }
9611 {
9612 \exp_args:cc
9613 {
9614 datatool_
9615 \l__datatool_ZA_datestyle_tl
9616 _parse_date:NNnTF
9617 }
9618 {
9619 c_datatool_
9620 \l__datatool_ZA_datevariant_tl
9621 _anchored_
9622 \l__datatool_ZA_datestyle_tl
9623 _date_regex
9624 }
9625 #1 { #2 } { #3 } { #4 }
9626 }
9627 {
9628 \datatool_locale_warn:nn { datatool-ZA }
9629 {
9630 No ~ support ~ for ~ date ~ style ~
9631 ` \l__datatool_ZA_datestyle_tl ' ~ with ~
9632 variant ~
9633 ` \l__datatool_ZA_datevariant_tl '
9634 }
9635 #4
9636 }
9637 }
9638 {
9639 \datatool_locale_warn:nn { datatool-ZA }
9640 {
9641 No ~ support ~ for ~ date ~ style ~
9642 ` \l__datatool_ZA_datestyle_tl '
9643 }
9644 #4
9645 }
9646 }
9647 % \end{macrocode}
9648 %
9649 %\subsubsection{Time Parsing}
9650 %Use command \cs{datatool\_}\meta{style}\verb|_parse_time:NNnTF|
9651 %with regular expression
9652 %\begin{definition}
9653 %\cs{c\_datatool\_}\meta{variant}\verb|_anchored_|\meta{style}\verb|_time_regex|
9654 %\end{definition}
9655 % \begin{macrocode}
9656 \cs_new:Nn \datatool_ZA_parse_time:NnTF
9657 {
9658 \cs_if_exist:cTF
9659 {
9660 c_datatool_
9661 \l__datatool_ZA_timevariant_tl
9662 _anchored_hhmmss_time_regex
9663 }
9664 {
9665 \datatool_hhmmss_parse_time:cNnTF
9666 {
9667 c_datatool_
9668 \l__datatool_ZA_timevariant_tl
9669 _anchored_hhmmss_time_regex
9670 }
9671 #1 { #2 } { #3 } { #4 }
9672 }
9673 {
9674 \datatool_locale_warn:nn { datatool-ZA }
9675 {
9676 No ~ support ~ for ~ time ~ variant ~
9677 ` \l__datatool_ZA_timevariant_tl '
9678 }
9679 #4
9680 }
9681 }
9682 % \end{macrocode}
9683 %
9684 %\subsubsection{Time Zone Mapping}
9685 %Define time zone mapping command for this region:
9686 % \begin{macrocode}
9687 \cs_new:Nn \datatool_ZA_get_timezone_map:n
9688 {
9689 \datatool_region_get_timezone_map:n { ZA / #1 }
9690 }
9691 % \end{macrocode}
9692 %Define time zone IDs for this region (one-way map from ID to offset):
9693 % \begin{macrocode}
9694 \datatool_region_set_timezone_map:nn { ZA / SAST } { +02:00 }
9695 % \end{macrocode}
9696 %
9697 %\subsection{Options}
9698 %Define options for this region:
9699 % \begin{macrocode}
9700 \datatool_locale_define_keys:nn { ZA }
9701 {
9702 number-style .choices:nn =
9703 { official , dialect }
9704 {
9705 \exp_args:NNe \renewcommand
9706 \datatoolZASetNumberChars
9707 {
9708 \exp_not:N \bool_if:NT
9709 \exp_not:N \l_datatool_region_set_numberchars_bool
9710 {
9711 \exp_not:c { datatool_ZA_set_numberchars_ \l_keys_choice_tl : }
9712 }
9713 }
9714 \tl_if_eq:NnT \l_datatool_current_region_tl { ZA }
9715 {
9716 \datatoolZASetNumberChars
9717 }
9718 } ,
9719 % \end{macrocode}
9720 % Currency symbol before or after value:
9721 % \begin{macrocode}
9722 currency-symbol-position .choice: ,
9723 currency-symbol-position / before .code:n =
9724 {
9725 \cs_set_eq:NN \datatool_ZA_currency_position:nn \dtlcurrprefixfmt
9726 } ,
9727 currency-symbol-position / after .code:n =
9728 {
9729 \cs_set_eq:NN \datatool_ZA_currency_position:nn \dtlcurrsuffixfmt
9730 } ,
9731 % \end{macrocode}
9732 % Separator between currency symbol (not code) and value:
9733 % \begin{macrocode}
9734 currency-symbol-sep .choice: ,
9735 currency-symbol-sep / none .code:n =
9736 {
9737 \tl_clear:N \l_datatool_ZA_sym_sep_tl
9738 } ,
9739 currency-symbol-sep / thin-space .code:n =
9740 {
9741 \tl_set:Nn \l_datatool_ZA_sym_sep_tl { \, }
9742 } ,
9743 currency-symbol-sep / space .code:n =
9744 {
9745 \tl_set:Nn \l_datatool_ZA_sym_sep_tl { ~ }
9746 } ,
9747 currency-symbol-sep / nbsp .code:n =
9748 {
9749 \tl_set:Nn \l_datatool_ZA_sym_sep_tl { \nobreakspace }
9750 } ,
9751 currency-symbol-sep .initial:n = { none } ,
9752 % \end{macrocode}
9753 % Date and time styles:
9754 % \begin{macrocode}
9755 date-style .choice: ,
9756 date-style / dmyyyy .code: n =
9757 {
9758 \tl_set:Nn \l__datatool_ZA_datestyle_tl { ddmmyyyy }
9759 } ,
9760 date-style / mdyyyy .code: n =
9761 {
9762 \tl_set:Nn \l__datatool_ZA_datestyle_tl { mmddyyyy }
9763 } ,
9764 date-style / yyyymd .code: n =
9765 {
9766 \tl_set:Nn \l__datatool_ZA_datestyle_tl { yyyymmdd }
9767 } ,
9768 date-style / dmyy .code: n =
9769 {
9770 \tl_set:Nn \l__datatool_ZA_datestyle_tl { ddmmyy }
9771 } ,
9772 date-style / mdyy .code: n =
9773 {
9774 \tl_set:Nn \l__datatool_ZA_datestyle_tl { mmddyy }
9775 } ,
9776 date-style / yymd .code: n =
9777 {
9778 \tl_set:Nn \l__datatool_ZA_datestyle_tl { yymmdd }
9779 } ,
9780 date-variant .choice: ,
9781 date-variant / slash .code:n =
9782 {
9783 \tl_set:Nn \l__datatool_ZA_datevariant_tl { slash }
9784 } ,
9785 date-variant / hyphen .code:n =
9786 {
9787 \tl_set:Nn \l__datatool_ZA_datevariant_tl { hyphen }
9788 } ,
9789 date-variant / dot .code:n =
9790 {
9791 \tl_set:Nn \l__datatool_ZA_datevariant_tl { dot }
9792 } ,
9793 date-variant / dialect .code:n =
9794 {
9795 \tl_set:Nn \l__datatool_ZA_datevariant_tl
9796 { \l_datatool_current_language_tl }
9797 } ,
9798 time-variant .choice: ,
9799 time-variant / colon .code:n =
9800 {
9801 \tl_set:Nn \l__datatool_ZA_timevariant_tl { colon }
9802 } ,
9803 time-variant / dot .code:n =
9804 {
9805 \tl_set:Nn \l__datatool_ZA_timevariant_tl { dot }
9806 } ,
9807 time-variant / dialect .code:n =
9808 {
9809 \tl_if_eq:NnTF \l__datatool_ZA_timevariant_tl { dot }
9810 {
9811 \tl_set:Nn \l__datatool_ZA_timevariant_tl
9812 { \l_datatool_current_language_tl _dot }
9813 }
9814 {
9815 \tl_if_in:NnF
9816 \l__datatool_ZA_timevariant_tl
9817 { \l_datatool_current_language_tl }
9818 {
9819 \tl_set:Nn \l__datatool_ZA_timevariant_tl
9820 { \l_datatool_current_language_tl _colon }
9821 }
9822 }
9823 } ,
9824 time-variant / dialect-colon .code:n =
9825 {
9826 \tl_set:Nn \l__datatool_ZA_timevariant_tl
9827 { \l_datatool_current_language_tl _colon }
9828 } ,
9829 time-variant / dialect-dot .code:n =
9830 {
9831 \tl_set:Nn \l__datatool_ZA_timevariant_tl
9832 { \l_datatool_current_language_tl _dot }
9833 } ,
9834 }
9835 % \end{macrocode}
9836 %
9837 %\subsection{Hooks}
9838 %Command to update temporal parsing commands for this region:
9839 % \begin{macrocode}
9840 \newcommand \datatoolZASetTemporalParsers
9841 {
9842 \renewcommand \DTLCurrentLocaleParseTimeStamp
9843 { \datatool_ZA_parse_timestamp:NnTF }
9844 \renewcommand \DTLCurrentLocaleParseDate
9845 { \datatool_ZA_parse_date:NnTF }
9846 \renewcommand \DTLCurrentLocaleParseTime
9847 { \datatool_ZA_parse_time:NnTF }
9848 \let
9849 \DTLCurrentLocaleGetTimeZoneMap
9850 \datatool_ZA_get_timezone_map:n
9851 }
9852 % \end{macrocode}
9853 %Set temporal formatting commands for this region. Currently this
9854 %just resets to the default, but may change in future.
9855 %Note that the defaults test if the applicable \sty{datetime2}
9856 %command is available and will fallback on ISO if not defined.
9857 %Bear in mind that the default style for \sty{datetime2} is
9858 %\texttt{iso} so there won't be a noticeable difference unless the
9859 %\sty{datetime2} regional setting is on.
9860 % \begin{macrocode}
9861 \newcommand \datatoolZASetTemporalFormatters
9862 {
9863 \let
9864 \DTLCurrentLocaleFormatDate
9865 \datatool_default_date_fmt:nnnn
9866 \let
9867 \DTLCurrentLocaleFormatTime
9868 \datatool_default_time_fmt:nnn
9869 \let
9870 \DTLCurrentLocaleFormatTimeZone
9871 \datatool_default_timezone_fmt:nn
9872 \let
9873 \DTLCurrentLocaleFormatTimeStampNoZone
9874 \datatool_default_timestamp_fmt:nnnnnnn
9875 \let
9876 \DTLCurrentLocaleFormatTimeStampWithZone
9877 \datatool_default_timestamp_fmt:nnnnnnnnn
9878 \renewcommand \DTLCurrentLocaleTimeStampFmtSep { ~ }
9879 }
9880 % \end{macrocode}
9881 %Command to update currency and temporal parsing commands for this region:
9882 % \begin{macrocode}
9883 \newcommand \DTLZALocaleHook
9884 {
9885 \datatoolZASetNumberChars
9886 \datatoolZASetCurrency
9887 \datatoolZASetTemporalParsers
9888 \datatoolZASetTemporalFormatters
9889 % \end{macrocode}
9890 %Allow language files to reference the region:
9891 % \begin{macrocode}
9892 \tl_set:Nn \l_datatool_current_region_tl { ZA }
9893 }
9894 % \end{macrocode}
9895 %
9896 % Finished with \LaTeX3 syntax.
9897 % \begin{macrocode}
9898 \ExplSyntaxOff
9899 % \end{macrocode}
9900 %Note that the hook is added to the captions by \sty{datatool-base}
9901 %not by the region file.
9902 %\iffalse
9903 % \begin{macrocode}
9904 %</datatool-ZA.ldf>
9905 % \end{macrocode}
9906 %\fi
9907 %\Finale
9908 \endinput