I have reexamined the error messages with respect to localization. First of all, 2850E, 2850H.C, 2850I.C and 2850J.C are not merged due to the problem described by Dag.
28506 and 2850G can be merged into one message
' does not have
If this is done, however, the former "table" and "object" words will be replaced with "Table/View" since this is what is returned from TableDescriptor#getDescriptorType. Hence, the messages
ERROR 28506: User 'USER2' does not have insert permission on table 'USER1'.'DERBYDB'.
ERROR 2850G: User 'USER2' does not have grant permission on object 'USER1'.'TEST'.
will be replaced with
ERROR 28506: User 'USER2' does not have insert permission on Table/View 'USER1'.'DERBYDB'.
ERROR 28506: User 'USER2' does not have grant permission on Table/View 'USER1'.'TEST'.
Note that the privilege names ("select/insert/grant" etc) are not localized in the current code (TablePrivilegeInfo#checkPrivileges and StatementTablePermission#check). If the word "execute" of ERROR 2850A can be non-localized similarly, 2850A can also be merged with 28506 and 2850G.
1) Should 28506 and 2850G be merged with the described "Table/View" effect?
2) Should 2850A also be merged with these, resulting in non-localized "execute"?
The merging of errors 28507 and 2850B inherits both 1) and 2). Hence, if the answer is yes to both questions, they
will be merged.