Move bad log parsing to utils.js and add section headers

This commit is contained in:
2026-02-16 22:58:58 +01:00
parent 4962d398a1
commit 0d551ede53
7 changed files with 179 additions and 249 deletions

View File

@@ -1,7 +1,10 @@
// Translation functions for Fail2ban UI
// Translation implementation for Fail2ban UI.
"use strict";
// Loads translation JSON file for given language (e.g., en, de, etc.)
// =========================================================================
// Translation Engine
// =========================================================================
function loadTranslations(lang) {
$.getJSON('/locales/' + lang + '.json')
.done(function(data) {
@@ -13,7 +16,6 @@ function loadTranslations(lang) {
});
}
// Updates all elements with data-i18n attribute with corresponding translation.
function updateTranslations() {
$('[data-i18n]').each(function() {
var key = $(this).data('i18n');
@@ -21,7 +23,6 @@ function updateTranslations() {
$(this).text(translations[key]);
}
});
// Updates placeholders.
$('[data-i18n-placeholder]').each(function() {
var key = $(this).data('i18n-placeholder');
if (translations[key]) {
@@ -43,4 +44,3 @@ function getTranslationsSettingsOnPageload() {
loadTranslations('en');
});
}