Debian Codegraph @

texmf-dist/source/latex/datetime2-german/datetime2-de-DE.dtx

raw
1 %\iffalse
2 %<*package>
3 %% \CharacterTable
4 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
5 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
6 %% Digits \0\1\2\3\4\5\6\7\8\9
7 %% Exclamation \! Double quote \" Hash (number) \#
8 %% Dollar \$ Percent \% Ampersand \&
9 %% Acute accent \' Left paren \( Right paren \)
10 %% Asterisk \* Plus \+ Comma \,
11 %% Minus \- Point \. Solidus \/
12 %% Colon \: Semicolon \; Less than \<
13 %% Equals \= Greater than \> Question mark \?
14 %% Commercial at \@ Left bracket \[ Backslash \\
15 %% Right bracket \] Circumflex \^ Underscore \_
16 %% Grave accent \` Left brace \{ Vertical bar \|
17 %% Right brace \} Tilde \~}
18 %</package>
19 %
20 % Doc-Source file to use with LaTeX2e
21 % Copyright (C) 2015 Nicola Talbot, all rights reserved.
22 % Copyright (C) 2017-19 Sebastian Friedl, all rights reserved.
23 % \fi
24 %
25 %
26 %
27 % \subsection{German (de-DE): \texttt{datetime2-de-DE.ldf}}
28 % \changes{2.0}{2017-10-03}{Added regional variant: German (de-DE)}
29 %
30 % Identify Module.
31 % \begin{macrocode}
32 \ProvidesDateTimeModule{de-DE}[2019/12/13 v3.0]
33 % \end{macrocode}
34 % Require the base German module.
35 % \begin{macrocode}
36 \RequireDateTimeModule{german-base}
37 % \end{macrocode}
38 %
39 %
40 % Allow the user to configure the "de-DE" and "de-DE-numeric" styles.
41 % The package wide separators such as \cs{dtm@datetimesep} are not used
42 % in case other date formats are also required.
43 %
44 %\begin{macro}{\DTMdeDEdowdaysep}
45 % The separator between weekday and day.
46 % \begin{macrocode}
47 \newcommand*{\DTMdeDEdowdaysep}{,\space}
48 % \end{macrocode}
49 %\end{macro}
50 %
51 %\begin{macro}{\DTMdeDEdaymonthsep}
52 % The separator between the day and month for the text format.
53 % \begin{macrocode}
54 \newcommand*{\DTMdeDEdaymonthsep}{.\DTMtexorpdfstring{\protect~}{\space}}
55 % \end{macrocode}
56 %\end{macro}
57 %
58 %\begin{macro}{\DTMdeDEmonthyearsep}
59 % The separator between the month and year for the text format.
60 % \begin{macrocode}
61 \newcommand*{\DTMdeDEmonthyearsep}{\space}
62 % \end{macrocode}
63 %\end{macro}
64 %
65 %\begin{macro}{\DTMdeDEdatetimesep}
66 % The separator between the date and time blocks in the full format
67 % (either text or numeric).
68 % \begin{macrocode}
69 \newcommand*{\DTMdeDEdatetimesep}{,\space}
70 % \end{macrocode}
71 %\end{macro}
72 %
73 %\begin{macro}{\DTMdeDEtimezonesep}
74 % The separator between the time and zone blocks in the full format
75 % (either text or numeric).
76 % \begin{macrocode}
77 \newcommand*{\DTMdeDEtimezonesep}{\space}
78 % \end{macrocode}
79 %\end{macro}
80 %
81 %\begin{macro}{\DTMdeDEdatesep}
82 % The separator for the numeric date format.
83 % \begin{macrocode}
84 \newcommand*{\DTMdeDEdatesep}{.}
85 % \end{macrocode}
86 %\end{macro}
87 %
88 %\begin{macro}{\DTMdeDEtimesep}
89 % The separator for the numeric time format.
90 % \begin{macrocode}
91 \newcommand*{\DTMdeDEtimesep}{:}
92 % \end{macrocode}
93 %\end{macro}
94 %
95 % Provide keys that can be used in \cs{DTMlangsetup} to set these
96 % separators.
97 % \begin{macrocode}
98 \DTMdefkey{de-DE}{dowdaysep}{\renewcommand*{\DTMdeDEdowdaysep}{#1}}
99 \DTMdefkey{de-DE}{daymonthsep}{\renewcommand*{\DTMdeDEdaymonthsep}{#1}}
100 \DTMdefkey{de-DE}{monthyearsep}{\renewcommand*{\DTMdeDEmonthyearsep}{#1}}
101 \DTMdefkey{de-DE}{datetimesep}{\renewcommand*{\DTMdeDEdatetimesep}{#1}}
102 \DTMdefkey{de-DE}{timezonesep}{\renewcommand*{\DTMdeDEtimezonesep}{#1}}
103 \DTMdefkey{de-DE}{datesep}{\renewcommand*{\DTMdeDEdatesep}{#1}}
104 \DTMdefkey{de-DE}{timesep}{\renewcommand*{\DTMdeDEtimesep}{#1}}
105 % \end{macrocode}
106 %
107 %
108 % Define a boolean key that can switch between full and abbreviated formats for
109 % the month and day of week names.
110 % \begin{macrocode}
111 \DTMdefboolkey{de-DE}{abbr}[true]{}
112 % \end{macrocode}
113 %
114 % The default is to show the full names.
115 % \begin{macrocode}
116 \DTMsetbool{de-DE}{abbr}{false}
117 % \end{macrocode}
118 %
119 % Define a boolean key that determines if the time zone mappings
120 % should be used.
121 % \begin{macrocode}
122 \DTMdefboolkey{de-DE}{mapzone}[true]{}
123 % \end{macrocode}
124 % The default is to use mappings.
125 % \begin{macrocode}
126 \DTMsetbool{de-DE}{mapzone}{true}
127 % \end{macrocode}
128 %
129 % Define a boolean key that determines if the day of month should be
130 % displayed.
131 % \begin{macrocode}
132 \DTMdefboolkey{de-DE}{showdayofmonth}[true]{}
133 % \end{macrocode}
134 % The default is to show the day of month.
135 % \begin{macrocode}
136 \DTMsetbool{de-DE}{showdayofmonth}{true}
137 % \end{macrocode}
138 %
139 % Define a boolean key that determines if the year should be
140 % displayed.
141 % \begin{macrocode}
142 \DTMdefboolkey{de-DE}{showyear}[true]{}
143 % \end{macrocode}
144 % The default is to show the year.
145 % \begin{macrocode}
146 \DTMsetbool{de-DE}{showyear}{true}
147 % \end{macrocode}
148 %
149 %
150 % Define the "de-DE" style.
151 % \begin{macrocode}
152 \DTMnewstyle
153 {de-DE}% label
154 {% date style
155 \renewcommand*\DTMdisplaydate[4]{%
156 \ifDTMshowdow
157 \ifnum##4>-1
158 \DTMifbool{de-DE}{abbr}%
159 {\DTMgermanshortweekdayname{##4}}%
160 {\DTMgermanweekdayname{##4}}%
161 \DTMdeDEdowdaysep
162 \fi
163 \fi
164 %
165 \DTMifbool{de-DE}{showdayofmonth}%
166 {\DTMgermanordinal{##3}\DTMdeDEdaymonthsep}%
167 {}%
168 %
169 \DTMifbool{de-DE}{abbr}%
170 {\DTMgermanshortmonthname{##2}}%
171 {\DTMgermanmonthname{##2}}%
172 %
173 \DTMifbool{de-DE}{showyear}%
174 {%
175 \DTMdeDEmonthyearsep%
176 \number##1 % space intended
177 }%
178 {}%
179 }%
180 \renewcommand*\DTMDisplaydate[4]{%
181 \ifDTMshowdow
182 \ifnum##4>-1
183 \DTMifbool{de-DE}{abbr}%
184 {\DTMgermanshortweekdayname{##4}}%
185 {\DTMgermanweekdayname{##4}}%
186 \DTMdeDEdowdaysep
187 \fi
188 \fi
189 %
190 \DTMifbool{de-DE}{showdayofmonth}%
191 {\DTMgermanordinal{##3}\DTMdeDEdaymonthsep}%
192 {}%
193 %
194 \DTMifbool{de-DE}{abbr}%
195 {\DTMgermanshortmonthname{##2}}%
196 {\DTMgermanmonthname{##2}}%
197 %
198 \DTMifbool{de-DE}{showyear}%
199 {%
200 \DTMdeDEmonthyearsep%
201 \number##1 % space intended
202 }%
203 {}%
204 }
205 }%
206 {% time style (use default)
207 \renewcommand*\DTMdisplaytime[3]{%
208 \DTMtwodigits{##1}%
209 \DTMdeDEtimesep\DTMtwodigits{##2}%
210 \ifDTMshowseconds\DTMdeDEtimesep\DTMtwodigits{##3}\fi
211 }%
212 }%
213 {% zone style
214 \DTMresetzones
215 \DTMgermanzonemaps
216 \renewcommand*{\DTMdisplayzone}[2]{%
217 \DTMifbool{de-DE}{mapzone}%
218 {\DTMusezonemapordefault{##1}{##2}}%
219 {%
220 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
221 \ifDTMshowzoneminutes\DTMdeDEtimesep\DTMtwodigits{##2}\fi
222 }%
223 }%
224 }%
225 {% full style
226 \renewcommand*{\DTMdisplay}[9]{%
227 \ifDTMshowdate
228 \DTMdisplaydate{##1}{##2}{##3}{##4}%
229 \DTMdeDEdatetimesep
230 \fi
231 \DTMdisplaytime{##5}{##6}{##7}%
232 \ifDTMshowzone
233 \DTMdeDEtimezonesep
234 \DTMdisplayzone{##8}{##9}%
235 \fi
236 }%
237 \renewcommand*{\DTMDisplay}[9]{%
238 \ifDTMshowdate
239 \DTMDisplaydate{##1}{##2}{##3}{##4}%
240 \DTMdeDEdatetimesep
241 \fi
242 \DTMdisplaytime{##5}{##6}{##7}%
243 \ifDTMshowzone
244 \DTMdeDEtimezonesep
245 \DTMdisplayzone{##8}{##9}%
246 \fi
247 }%
248 }%
249 % \end{macrocode}
250 %
251 % Define the corresponding numeric style.
252 % \begin{macrocode}
253 \DTMnewstyle
254 {de-DE-numeric}% label
255 {% date style
256 \renewcommand*\DTMdisplaydate[4]{%
257 \ifDTMshowdow
258 \ifnum##4>-1
259 \DTMifbool{de-DE}{abbr}%
260 {\DTMgermanshortweekdayname{##4}}%
261 {\DTMgermanweekdayname{##4}}%
262 \DTMdeDEdowdaysep
263 \fi
264 \fi
265 %
266 \DTMifbool{de-DE}{showdayofmonth}%
267 {%
268 \DTMtwodigits{##3}%
269 \DTMdeDEdatesep
270 }%
271 {}%
272 \DTMtwodigits{##2}%
273 \DTMdeDEdatesep%
274 \DTMifbool{de-DE}{showyear}%
275 {%
276 \DTMifbool{de-DE}{abbr}%
277 {\DTMtwodigits{##1}}%
278 {\number##1 }% space intended
279 }%
280 {}%
281 }%
282 \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
283 }%
284 {% time style
285 \renewcommand*\DTMdisplaytime[3]{%
286 \DTMtwodigits{##1}%
287 \DTMdeDEtimesep\DTMtwodigits{##2}%
288 \ifDTMshowseconds\DTMdeDEtimesep\DTMtwodigits{##3}\fi
289 }%
290 }%
291 {% zone style
292 \DTMresetzones
293 \DTMgermanzonemaps
294 \renewcommand*{\DTMdisplayzone}[2]{%
295 \DTMifbool{de-DE}{mapzone}%
296 {\DTMusezonemapordefault{##1}{##2}}%
297 {%
298 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
299 \ifDTMshowzoneminutes\DTMgermantimesep\DTMtwodigits{##2}\fi
300 }%
301 }%
302 }%
303 {% full style
304 \renewcommand*{\DTMdisplay}[9]{%
305 \ifDTMshowdate
306 \DTMdisplaydate{##1}{##2}{##3}{##4}%
307 \DTMdeDEdatetimesep
308 \fi
309 \DTMdisplaytime{##5}{##6}{##7}%
310 \ifDTMshowzone
311 \DTMdeDEtimezonesep
312 \DTMdisplayzone{##8}{##9}%
313 \fi
314 }%
315 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
316 }
317 % \end{macrocode}
318 %
319 % Switch the style according to the \opt{useregional} setting.
320 % \begin{macrocode}
321 \DTMifcaseregional
322 {}% do nothing
323 {\DTMsetstyle{de-DE}}%
324 {\DTMsetstyle{de-DE-numeric}}%
325 % \end{macrocode}
326 %
327 % Redefine \cs{dategerman} (or \cs{date}\meta{dialect}) to prevent
328 % \sty{babel} from resetting \cs{today}. (For this to work,
329 % \sty{babel} must already have been loaded if it's required.)
330 % \begin{macrocode}
331 \ifcsundef{date\CurrentTrackedDialect}
332 {%
333 \ifundef\dategerman
334 {}% do nothing
335 {%
336 \def\dategerman{%
337 \DTMifcaseregional
338 {}% do nothing
339 {\DTMsetstyle{de-DE}}%
340 {\DTMsetstyle{de-DE-numeric}}%
341 }%
342 }%
343 }%
344 {%
345 \csdef{date\CurrentTrackedDialect}{%
346 \DTMifcaseregional
347 {}% do nothing
348 {\DTMsetstyle{de-DE}}%
349 {\DTMsetstyle{de-DE-numeric}}
350 }%
351 }%
352 % \end{macrocode}
353 %
354 \endinput