Follow up for #1987602: Convert ajax_form_callback() to a new style controller
Problem/Motivation
As specified in #1987602-79: Convert ajax_form_callback() to a new style controller Exception messages shouldn't be translated.
Reasons to not translate exceptions messages (from comments on this issue and #817160: Don't translate exceptions):
- "Additional uncaught exception while handling exception." Calling a whole huge codepath in our exception is liable to obscure the real problem in many situations.
- Adds a dependency on common.inc everywhere we want to throw (or test) an exception. Ugggghh.
- Exception messages are developer-facing strings, and as such, there is no real reason to translate them. As in SimpleTest, we don't need to pollute l.d.o with hundreds upon hundreds of strings no one will care about.
- Googling for translated error messages is more difficult.
- technical issues with ... calling t() ... [especially in the] bootstrap phase ... [and with] ... unit tests.
Proposed resolution
Remove translation of exceptions in code base.
However, it was pointed out that there are user facing exceptions, at least field errors are such., so we may have to specify when it is OK to translate exception messages or refactor these to error messages.
Remaining tasks
- Update Coding standards - PHP Exceptions.
- Create a patch (or several patches) that removes all translations of exception messages.
User interface changes
Not really, exceptions should not be shown to end users
API changes
No.
Original report by @xjm
#1987602-79: Convert ajax_form_callback() to a new style controller