if (!canMakePayment) { throw new Error('Cannot make payment'); }
Here is an example that includes a hardcoded string. This is probably fine as "merely an example". JS doesn't currently provide an in-built localization solution and there are plenty of libraries and frameworks that developers use to accomplish localization. The hardcoded string makes the example clear. I18N and our specdev checklist should probably have better guidance on how to handle H/C strings or maybe a note about them.
We expect you'll probably close this issue, but you might consider adding a code comment about the I18N bug represented by the static message, e.g.:
if ( ! canMakePayment ) {
// string hardcoded for clarity
throw new Error('Cannot make payment');
}
@aphillips, based on discussion at TPAC with @stephenmcgruer, I think we will remove the hardcoded string and just put a comment that the developer needs to handle the error case.
section 1.2.2 https://www.w3.org/TR/secure-payment-confirmation/#sctn-sample-authentication
Here is an example that includes a hardcoded string. This is probably fine as "merely an example". JS doesn't currently provide an in-built localization solution and there are plenty of libraries and frameworks that developers use to accomplish localization. The hardcoded string makes the example clear. I18N and our specdev checklist should probably have better guidance on how to handle H/C strings or maybe a note about them.
We expect you'll probably close this issue, but you might consider adding a code comment about the I18N bug represented by the static message, e.g.: