Most field exceptions tell you what exactly is wrong when something's wrong, these two still don't.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | field_exception.patch | 1.4 KB | catch |
| field_exception.patch | 1.4 KB | catch |
Most field exceptions tell you what exactly is wrong when something's wrong, these two still don't.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | field_exception.patch | 1.4 KB | catch |
| field_exception.patch | 1.4 KB | catch |
Comments
Comment #1
moshe weitzman commentedComment #2
bjaspan commentedA quick grep reveals 77 instances of "throw new Foo(t(...))" and 136 instances of "throw new Foo(...)" (without t()), plus 7 throw new Foo(). It is not clear to me whether t() is right or not. I suspect core should be more consistent. Separate issue?
Comment #3
bjaspan commentedPerhaps a minor nit, but "Attempt to update an instance of a nonexistent field, @field" is incorrectly punctuated at least according to American English. Better would be:
* "Attempt to update an instance of nonexistent field @field", or
* "Attempt to update an instance of a nonexistent field: @field"
I see similar punctuation errors in Field module, I'm guessing from the same author. :-)
I'm just full of irrelevant suggestions tonight, eh?
Comment #4
catchRemoved the comma, I was using the "The Drupal 7 field API maintainer, Barry Jaspan" rule but that may only be for people.
t() in exceptions in field API appears to depend entirely on whether placeholders are used or not, that inconsistency wasn't introduced by me. In general I assume it depends on whether t() is available or not.
Comment #5
moshe weitzman commentedt() is always available in D7.
Having said that, I don't think we need to increase translator burden by including Exception strings. They are not supposed to be seen by devs and even then only in exceptional circumstances.
Comment #6
dries commentedI agree that we shouldn't translate exceptions. In general, exceptions are not meant to be output to the end-user.
Comment #7
dries commentedI committed the patch. We should create a new issue to deal with the t() situation. Thanks catch.
Comment #8
catchOpened #817160: Don't translate exceptions.