Icons work #550 + Italian language

This commit is contained in:
Jokob-sk
2024-04-05 19:20:43 +11:00
parent f56d7c686d
commit 1f735e9ed5
17 changed files with 829 additions and 17 deletions

View File

@@ -201,7 +201,7 @@ function cacheStrings()
if(!getCache('completedCalls').includes('cacheStrings'))
{
// handle core strings and translations
var allLanguages = ["en_us", "es_es", "de_de", "fr_fr", "ru_ru", "nb_no"]; // needs to be same as in lang.php
var allLanguages = ["en_us", "es_es", "de_de", "fr_fr", "it_it", "ru_ru", "nb_no"]; // needs to be same as in lang.php
allLanguages.forEach(function (language_code) {
$.get(`php/templates/language/${language_code}.json?nocache=${Date.now()}`, function (res) {
@@ -254,6 +254,9 @@ function getString (key) {
case 'Norwegian':
lang_code = 'nb_no';
break;
case 'Italian':
lang_code = 'it_it';
break;
case 'Russian':
lang_code = 'ru_ru';
break;
@@ -340,6 +343,23 @@ function showModalWarning (title, message, btnCancel=getString('Gen_Cancel'), bt
$('#modal-warning').modal('show');
}
// -----------------------------------------------------------------------------
function showModalInput (title, message, btnCancel=getString('Gen_Cancel'), btnOK=getString('Gen_Okay'), callbackFunction=null) {
// set captions
$('#modal-input-title').html (title);
$('#modal-input-message').html (message);
$('#modal-input-cancel').html (btnCancel);
$('#modal-input-OK').html (btnOK);
if ( callbackFunction != null)
{
modalCallbackFunction = callbackFunction;
}
// Show modal
$('#modal-input').modal('show');
}
// -----------------------------------------------------------------------------
function modalDefaultOK () {
// Hide modal
@@ -351,6 +371,17 @@ function modalDefaultOK () {
}, 100);
}
// -----------------------------------------------------------------------------
function modalDefaultInput () {
// Hide modal
$('#modal-input').modal('hide');
// timer to execute function
window.setTimeout( function() {
window[modalCallbackFunction]();
}, 100);
}
// -----------------------------------------------------------------------------
function modalWarningOK () {
// Hide modal
@@ -404,6 +435,15 @@ function jsonSyntaxHighlight(json) {
});
}
function isValidBase64(str) {
// Base64 characters set
var base64CharacterSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
// Remove all valid characters from the string
var invalidCharacters = str.replace(new RegExp('[' + base64CharacterSet + ']', 'g'), '');
// If there are any characters left, the string is invalid
return invalidCharacters === '';
}
// -----------------------------------------------------------------------------
// General utilities