added translations

This commit is contained in:
Hendrik Behme committed 2026-10-09 16:37:53 +02:00
1 parent 36ed3880e8
commit 71635eb574
33 files changed
+1025 -241

No files matched your search

+13 -9
View File
@@ -1,6 +1,7 @@
// Shared date-range handling for Browse Events and both maps — remembered
// across pages the way location.js remembers the place, validated in one
// spot, and bound to German-format (dd.mm.yyyy) date pickers. Pages still
// spot, and bound to date pickers shown in the page language (format and
// calendar names from i18n.js / the flatpickr locale). Pages still
// own what a range *does* (a server-side filter on Browse, a client-side
// one on the maps); this only owns the range itself.
(function (window) {
@@ -64,11 +65,12 @@
} catch (e) { /* localStorage disabled/unavailable */ }
}
// Turns a pair of <input type="date"> into German-format pickers when
// flatpickr is loaded. A native date input displays in the *browser's*
// locale and can't be forced to dd.mm.yyyy, so the visible field is
// flatpickr's alt input (d.m.Y, German calendar) while the original input
// keeps holding the machine-readable "Y-m-d" value everything else reads.
// Turns a pair of <input type="date"> into pickers in the page language
// when flatpickr is loaded. A native date input displays in the *browser's*
// locale and can't be forced to the site's format, so the visible field is
// flatpickr's alt input (e.g. d.m.Y with a German calendar) while the
// original input keeps holding the machine-readable "Y-m-d" value
// everything else reads.
// Without flatpickr (e.g. its CDN is unreachable) the native inputs keep
// working as they are.
//
@@ -79,10 +81,12 @@
var pickers = [];
if (window.flatpickr) {
var options = {
locale: 'de',
// flatpickr ships a file per language (loaded by
// _datepicker_scripts.html.twig); English is built in.
locale: (window.flatpickr.l10ns && window.flatpickr.l10ns[window.VindnI18n.locale]) ? window.VindnI18n.locale : 'default',
dateFormat: 'Y-m-d',
altInput: true,
altFormat: 'd.m.Y',
altFormat: window.VindnI18n.dateFormat,
allowInput: true,
disableMobile: true, // the native mobile picker would bring the device locale back
static: true, // rendered inside the card, so it also shows in a fullscreen map
@@ -105,7 +109,7 @@
alt.id = el.id + 'Display';
if (label) label.setAttribute('for', alt.id);
alt.setAttribute('aria-label', el.getAttribute('aria-label') || '');
alt.setAttribute('placeholder', 'TT.MM.JJJJ');
alt.setAttribute('placeholder', window.VindnI18n.t('dates.placeholder'));
return picker;
});
}