localize Download Template success/fail message.

This commit is contained in:
Jessica Wang 2011-02-02 15:35:08 -08:00
parent d3fe06eddc
commit 5aa91b6d55
4 changed files with 13 additions and 15 deletions

View File

@ -6,8 +6,9 @@ label.numretries = Number of Retries
label.timeout.in.second = Timeout(seconds)
message.action.delete.external.firewall=Please confirm that you would like to remove this external firewall. Warning: If you are planning to add back the same external firewall, you must reset usage data on the device.
message.action.delete.external.load.balancer=Please confirm that you would like to remove this external load balancer. Warning: If you are planning to add back the same external load balancer, you must reset usage data on the device.
message.download.ISO=Please click <a href="#">#</a> to download ISO
message.download.template=Please click <a href="#">#</a> to download template
message.download.ISO=Please click <a href="#">#</a> to download ISO
#Labels
label.account.id=Account ID
label.account.name=Account Name

View File

@ -16,7 +16,8 @@ dictionary = {
'label.action.copy.template.processing' : '<fmt:message key="label.action.copy.template.processing"/>',
'label.action.create.vm' : '<fmt:message key="label.action.create.vm"/>',
'label.action.create.vm.processing' : '<fmt:message key="label.action.create.vm.processing"/>',
'label.action.download.template' : '<fmt:message key="label.action.download.template"/>'
'label.action.download.template' : '<fmt:message key="label.action.download.template"/>',
'message.download.template': '<fmt:message key="message.download.template"/>'
};
</script>

View File

@ -731,14 +731,8 @@ function doDownloadISO($actionLink, $detailsTab, $midmenuItem1) {
var htmlMsg2 = htmlMsg.replace(/#/g, url);
$infoContainer.find("#info").html(htmlMsg2);
$infoContainer.show();
} else if (result.jobstatus == 2) { // Failed
var label = $actionLink.data("label");
var label2;
if(label in dictionary)
label2 = dictionary[label];
else
label2 = label;
var errorMsg = label2 + " - " + g_dictionary["label.failed"] + " - " + g_dictionary["label.error.code"] + " " + fromdb(result.jobresult.errorcode);
} else if (result.jobstatus == 2) { // Failed
var errorMsg = g_dictionary["label.failed"] + " - " + g_dictionary["label.error.code"] + " " + fromdb(result.jobresult.errorcode);
handleErrorInDialog2(errorMsg, $dialogDownloadISO);
}
}

View File

@ -761,11 +761,13 @@ function doDownloadTemplate($actionLink, $detailsTab, $midmenuItem1) {
$infoContainer.removeClass("error");
$infoContainer.find("#icon,#info").removeClass("error");
var url = decodeURIComponent(json.queryasyncjobresultresponse.jobresult.template.url);
var htmlMsg = "Please click <a href='" + url + "'>" + url + "</a>" + " to download template";
$infoContainer.find("#info").html(htmlMsg);
var htmlMsg = dictionary["message.download.template"];
var htmlMsg2 = htmlMsg.replace(/#/g, url);
$infoContainer.find("#info").html(htmlMsg2);
$infoContainer.show();
} else if (result.jobstatus == 2) { // Failed
handleErrorInDialog2(fromdb(result.jobresult.errortext), $dialogDownloadTemplate);
} else if (result.jobstatus == 2) { // Failed
var errorMsg = g_dictionary["label.failed"] + " - " + g_dictionary["label.error.code"] + " " + fromdb(result.jobresult.errorcode);
handleErrorInDialog2(errorMsg, $dialogDownloadTemplate);
}
}
},