pass i18n object to each js util instance
This commit is contained in:
parent
bd334c73d5
commit
e0c7edc1ca
@ -22,6 +22,11 @@
|
|||||||
|
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
|
// i18n
|
||||||
|
if (window.I18N) {
|
||||||
|
options.i18n = window.I18N;
|
||||||
|
}
|
||||||
|
|
||||||
var listener = function(event) {
|
var listener = function(event) {
|
||||||
|
|
||||||
if (event.detail.targetUtil !== utilName) {
|
if (event.detail.targetUtil !== utilName) {
|
||||||
|
|||||||
@ -35,14 +35,16 @@ function setupDatepicker(wrapper) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
// this global I18N object will be picked up automatically by the setup util
|
||||||
var I18N = {
|
window.I18N = {
|
||||||
filesSelected: 'Dateien ausgewählt', // TODO: interpolate these to be translated
|
filesSelected: 'Dateien ausgewählt', // TODO: interpolate these to be translated
|
||||||
selectFile: 'Datei auswählen',
|
selectFile: 'Datei auswählen',
|
||||||
selectFiles: 'Datei(en) auswählen',
|
selectFiles: 'Datei(en) auswählen',
|
||||||
};
|
asyncFormFailure: 'Da ist etwas schief gelaufen, das tut uns Leid.<br>Falls das erneut passiert schicke uns gerne eine kurze Beschreibung dieses Ereignisses über das Hilfe-Widget rechts oben.<br><br>Vielen Dank für deine Hilfe',
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
window.utils.setup('flatpickr', document.body, { setupFunction: setupDatepicker });
|
window.utils.setup('flatpickr', document.body, { setupFunction: setupDatepicker });
|
||||||
window.utils.setup('showHide', document.body);
|
window.utils.setup('showHide', document.body);
|
||||||
window.utils.setup('inputs', document.body, { i18n: I18N });
|
window.utils.setup('inputs', document.body);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user