fix(plg): fixed javascript translations

This commit is contained in:
Eric Schultz
2020-12-07 16:32:18 -07:00
parent f78a684613
commit 5cedd0c5db
+21 -21
View File
@@ -653,7 +653,7 @@ function registerServer(button) {
var failure = function(data) {
var status = data.status;
var obj = data.responseJSON;
var msg = _("Sorry, an error occurred") + "<br>" + _("The error is") + ": " + obj.error + ".";
var msg = "_(Sorry, an error occurred)_<br>_(The error is)_: " + obj.error + ".";
$(button).prop("disabled", false).html(oldlabel);
swal('Oops',msg,'error');
};
@@ -668,17 +668,17 @@ function registerServer(button) {
"remote_wanport": $('#wanport').val()
},function(data2) {
<?if(!$isRegistered):?>
swal({title:"",text:_("Your server has been registered"),type:"success",allowEscapeKey:false},function(){button.form.submit();});
swal({title:"",text:"_(Your server has been registered)_",type:"success",allowEscapeKey:false},function(){button.form.submit();});
<?else:?>
button.form.submit();
<?endif?>
});
} else {
failure({"status": 403, "responseJSON": {"error": _("Unable to register this Unraid Server")}});
failure({"status": 403, "responseJSON": {"error": "_(Unable to register this Unraid Server)_"}});
}
};
$(button).prop("disabled", true).html(_("Applying") + " <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
$(button).prop("disabled", true).html("_(Applying)_ <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
$.post("/webGui/include/UpdateDNS.php",{username:$('#ips_username').val(),password:$('#ips_password').val(),externalport:$('#wanport').val(),remoteaccess:$('#wanaccess').val()},success).fail(failure);
}
@@ -688,7 +688,7 @@ function dnsCheckServer(button) {
var failure = function(data) {
var status = data.status;
var obj = data.responseJSON;
var msg = _("Sorry, an error occurred") + "<br>" + _("The error is") + ": "+obj.error+".";
var msg = "_(Sorry, an error occurred)_<br>_(The error is)_: " + obj.error + ".";
$(button).prop("disabled", false).html(oldlabel);
swal('Oops',msg,'error');
};
@@ -696,13 +696,13 @@ function dnsCheckServer(button) {
var success = function(data) {
$(button).prop("disabled", false).html(oldlabel);
if (data.status) {
swal("",_("Your Unraid Server is reachable from the internet"),"success");
swal("","_(Your Unraid Server is reachable from the internet)_","success");
} else {
swal("Oops",_("This Unraid Server was unreachable from the outside"),"error");
swal("Oops","_(This Unraid Server was unreachable from the outside)_","error");
}
};
$(button).prop("disabled", true).html(_("Checking") + " <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
$(button).prop("disabled", true).html("_(Checking)_ <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
$.post("https://keys.lime-technology.com/account/server/checkdns",{externalport:$('#wanport').val(),keyfile:"<?=$keyfile?>"},success).fail(failure);
}
@@ -720,7 +720,7 @@ function enableFlashBackup(button) {
var failure = function(data) {
var status = data.status;
var obj = data.responseJSON;
var msg = _("Sorry, an error occurred") + "<br>" + _("The error is") + ": "+obj.error+".";
var msg = "_(Sorry, an error occurred)_<br>_(The error is)_: " + obj.error + ".";
$(button).prop("disabled", false).html(oldlabel);
swal({title:"",text:msg,type:"error",allowEscapeKey:false},function(){button.form.submit();});
};
@@ -730,28 +730,28 @@ function enableFlashBackup(button) {
button.form.submit();
};
if (oldlabel == _("Activate")) {
$(button).prop("disabled", true).html(_("Activating") + " <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
if (oldlabel == "_(Activate)_") {
$(button).prop("disabled", true).html("_(Activating)_ <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
$.post("/plugins/dynamix.unraid.net/include/UpdateFlashBackup.php",{command:"activate"},success).fail(failure);
}
if (oldlabel == _("Deactivate")) {
swal({title:_("Deactivate"),text:_("Are you sure you want pause communication with your remote flash backup on unraid.net?"),type:'warning',confirmButtonText:_("Deactivate"),showCancelButton:true},function(){
$(button).prop("disabled", true).html(_("Deactivating") + " <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
if (oldlabel == "_(Deactivate)_") {
swal({title:"_(Deactivate)_",text:"_(Are you sure you want pause communication with your remote flash backup on unraid.net?)_",type:'warning',confirmButtonText:"_(Deactivate)_",showCancelButton:true},function(){
$(button).prop("disabled", true).html("_(Deactivating)_ <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
$.post("/plugins/dynamix.unraid.net/include/UpdateFlashBackup.php",{command:"deactivate"},success).fail(failure);
});
}
if (oldlabel == _("Update")) {
$(button).prop("disabled", true).html(_("Updating") + " <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
if (oldlabel == "_(Update)_") {
$(button).prop("disabled", true).html("_(Updating)_ <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
$.post("/plugins/dynamix.unraid.net/include/UpdateFlashBackup.php",{command:"flush"},success).fail(failure);
}
if (oldlabel == _("Reinitialize")) {
swal({title:_("Reinitialize"),text:_("Are you sure you want to erase all change history in both local and unraid.net remote?"),type:'warning',confirmButtonText:_("Reinitialize"),showCancelButton:true},function(){
$(button).prop("disabled", true).html(_("Reinitializing") + " <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
if (oldlabel == "_(Reinitialize)_") {
swal({title:"_(Reinitialize)_",text:"_(Are you sure you want to erase all change history in both local and unraid.net remote?)_",type:'warning',confirmButtonText:"_(Reinitialize)_",showCancelButton:true},function(){
$(button).prop("disabled", true).html("_(Reinitializing)_ <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
$.post("/plugins/dynamix.unraid.net/include/UpdateFlashBackup.php",{command:"reinit"},success).fail(failure);
});
}
if (oldlabel == _("Changes")) {
openBox("/webGui/include/gitstatus.php", _("Changes"), 600,600, false);
if (oldlabel == "_(Changes)_") {
openBox("/webGui/include/gitstatus.php", "_(Changes)_", 600,600, false);
}
}