That I believe is a nice way to avoid hardcoding any English literals in the script files.
For example in public.onepagecheckout.js on line 333 we see something like this
validate: function () {
var methods = document.getElementsByName('paymentmethod');
if (methods.length == 0) {
alert('Your order cannot be completed at this time as there is no payment methods available for it.');
return false;
}
This can easily be replaced by
validate: function () {
var methods = document.getElementsByName('paymentmethod');
if (methods.length == 0) {
alert(localized_data.NoPaymentMethodsError);
return false;
}
where localized_data is a javascript object parameter that'll be passed from the view itself.