Skip to content

Commit

Permalink
moneymanagerex#25 Translation: restore javascript files
Browse files Browse the repository at this point in the history
Unable to use $lang inside javascript. Need alternative solution like API call to obtain localized strings?
  • Loading branch information
lucaritossa committed Oct 24, 2023
1 parent 848ab95 commit 84bfa59
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
21 changes: 12 additions & 9 deletions WebApp/languages/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,11 @@
$lang["sec.password.placeholder"] = "Insert Password";
$lang["sec.login"] = "Login";
$lang["sec.logout"] = "Logout";
$lang["sec.password_not_matching"] = "Password doesn't match!";

$lang["return_to_menu"] = "Return to menu";

$lang["db_successfully_updated_to_version"] = "Database successfully updated to version ";

$lang["browser_not_support_html5"] = "Seems that the browser doesn't fully supports HTML5\n\nPlease make attention because it doesn't validate fields!";

$lang["attachment.upload_failed"] = "There was an error attempting to upload the file.";
$lang["attachment.upload_canceled"] = "The upload has been canceled by the user or the browser dropped the connection.";

$lang["trans.msg.not_all_fields_are_valid"] = "Not all fields are valid";
$lang["trans.msg.do_you_want_to_add_new_payee"] = "Do you want to add the new payee";
$lang["trans.msg.add-next"] = "Add next";
$lang["trans.msg.action-added.successfully"] = "Added successfully";
$lang["trans.msg.action-duplicated.successfully"] = "Duplicated successfully";
Expand Down Expand Up @@ -98,4 +90,15 @@
$lang["show.add_new"] = "Add new";
$lang["show.delete"] = "Delete";
$lang["show.new"] = "New transaction";
$lang["show.no_trans_selected"] = "No transaction selected!";
$lang["show.no_trans_selected"] = "No transaction selected!";

/*
* THESE TRANSLATIONS ARE STILL NOT USED.
* THEY ARE READY FOR JAVASCRIPT FILES: functions-1.2.0.js and new_transaction-1.0.4.js
*/
$lang["browser_not_support_html5"] = "Seems that the browser doesn't fully supports HTML5\n\nPlease make attention because it doesn't validate fields!";
$lang["sec.password_not_matching"] = "Password doesn't match!";
$lang["attachment.upload_failed"] = "There was an error attempting to upload the file.";
$lang["attachment.upload_canceled"] = "The upload has been canceled by the user or the browser dropped the connection.";
$lang["trans.msg.not_all_fields_are_valid"] = "Not all fields are valid";
$lang["trans.msg.do_you_want_to_add_new_payee"] = "Do you want to add the new payee";
21 changes: 12 additions & 9 deletions WebApp/languages/it.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,11 @@
$lang["sec.password.placeholder"] = "Inserisci la Password";
$lang["sec.login"] = "Accedi";
$lang["sec.logout"] = "Esci";
$lang["sec.password_not_matching"] = "La password non corrisponde!";

$lang["return_to_menu"] = "Ritorna al menu";

$lang["db_successfully_updated_to_version"] = "Database aggiornato con successo alla versione ";

$lang["browser_not_support_html5"] = "Sembra che il browser non supporti l'HTML5\n\nPresta attenzione perché i campi non verranno validati!";

$lang["attachment.upload_failed"] = "Si è verificato un errore al caricamento del file.";
$lang["attachment.upload_canceled"] = "Il caricamento è stato annullato dall'utente o il browser ha interrotto la connessione.";

$lang["trans.msg.not_all_fields_are_valid"] = "Alcuni campi non sono validi";
$lang["trans.msg.do_you_want_to_add_new_payee"] = "Confermi la creazione del nuovo beneficiario";
$lang["trans.msg.add-next"] = "Aggiungi altra operazione";
$lang["trans.msg.action-added.successfully"] = "Aggiungo con successo";
$lang["trans.msg.action-duplicated.successfully"] = "Duplicato con successo";
Expand Down Expand Up @@ -98,4 +90,15 @@
$lang["show.add_new"] = "Nuova operazione";
$lang["show.delete"] = "Cancella";
$lang["show.new"] = "Nuova operazione";
$lang["show.no_trans_selected"] = "Nessuna operazione selezionata!";
$lang["show.no_trans_selected"] = "Nessuna operazione selezionata!";

/*
* THESE TRANSLATIONS ARE STILL NOT USED.
* THEY ARE READY FOR JAVASCRIPT FILES: functions-1.2.0.js and new_transaction-1.0.4.js
*/
$lang["browser_not_support_html5"] = "Sembra che il browser non supporti l'HTML5\n\nPresta attenzione perché i campi non verranno validati!";
$lang["sec.password_not_matching"] = "La password non corrisponde!";
$lang["attachment.upload_failed"] = "Si è verificato un errore al caricamento del file.";
$lang["attachment.upload_canceled"] = "Il caricamento è stato annullato dall'utente o il browser ha interrotto la connessione.";
$lang["trans.msg.not_all_fields_are_valid"] = "Alcuni campi non sono validi";
$lang["trans.msg.do_you_want_to_add_new_payee"] = "Confermi la creazione del nuovo beneficiario";
8 changes: 4 additions & 4 deletions WebApp/res/app/functions-1.2.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function test_html5 ()
//|| !Modernizr.input.step //Used but not prerequisite
)
{
alert($lang["browser_not_support_html5"]);
alert("Seems that the browser doesn't fully supports HTML5" + '\n' + '\n' + "Please make attention because it doesn't validate fields!");
//close();
}
}
Expand Down Expand Up @@ -149,7 +149,7 @@ function check_passwor_error()
function check_password_match_and_submit (Password1,Password2,formid)
{
if (document.getElementById(Password1).value !== document.getElementById(Password2).value)
{alert($lang["sec.password_not_matching"]);}
{alert("Password doesn't match!");}
else
{document.getElementById(formid).submit();}
}
Expand Down Expand Up @@ -232,12 +232,12 @@ function attachment_uploadComplete(evt)

function attachment_uploadFailed(evt)
{
alert($lang["attachment.upload_failed"]);
alert("There was an error attempting to upload the file.");
}

function attachment_uploadCanceled(evt)
{
alert($lang["attachment.upload_canceled"]);
alert("The upload has been canceled by the user or the browser dropped the connection.");
}

function attachment_delete(FileName,TrID)
Expand Down
4 changes: 2 additions & 2 deletions WebApp/res/app/new_transaction-1.0.4.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ var transactions = {
submit_form = true;
}else{
form.find(':invalid').first().focus();
alert($lang["trans.msg.not_all_fields_are_valid"]);
alert("Not all fields are valid");
}

// Confirm add new payee
if(submit_form){
if(app.confirmIfNotPresentInDatalist('Payee', PayeeList, $lang["trans.msg.do_you_want_to_add_new_payee"])){
if(app.confirmIfNotPresentInDatalist('Payee', PayeeList, "Do you want to add the new payee")){
submit_form = true;
}else{
$('#Payee').focus();
Expand Down

0 comments on commit 84bfa59

Please sign in to comment.