tv4
tv4 copied to clipboard
Rewrite languages as error reporters?
Instead of filling out the message from a particular language template when it's found, how about the error just contains a code and a set of fixed/documented parameters?
Then, if a human-readable version is required, that can be done in a separate pass.
I'm partly thinking of this because my schema2js project (code-generation for validation) returns tv4-compatible error codes and parameters, and with a bit of refactoring they could share all the language stuff and formatting.