When working with form objects through models, views, and controllers, the locale strings come from *three* locations: the model locale file, the controller locale file, and the filter locale file.
When you call the record's newForm()
method, it
will generate labels and descriptions for the form elements from the
LABEL_*
and DESCR_*
keys from
the *model* locale file. This is because it is the model record
generating the form object.
When you add fieldsets, groups, etc. in the view, the locale strings come from the *controller* locale file. This is because you are no longer operating inside the model record; you are in a view being generated by the controller.
When a record has an invalid property, its invalidation message
normally comes from the the filter locale file. If a validation
filter ValidateAlpha
on a property
column_name
fails, then the translation key
will be INVALID_VALIDATE_ALPHA
. You can
override these validation-specific messages in your
vendor-specific filter locale file.
Alternatively, you can provide an override translation key for
invalid model properties based on the property name. In the model
locale file, if you have INVALID_COL_NAME
, that
translation key will be used any time the property is invalid, no
matter which validation filter fails for that property.