Permalink
Browse files

Look up each message code with additional suffix ".error"

  • Loading branch information...
1 parent 9a80aee commit e2489a334064d367224cd37d6913369d4bf2d40c @limcheekin committed Dec 8, 2010
Showing with 12 additions and 1 deletion.
  1. +5 −1 Todo.txt
  2. +7 −0 grails-app/taglib/org/grails/jquery/validation/ui/JQueryValidationUiTagLib.groovy
View
@@ -1,3 +1,7 @@
1. Support error messages display at top like Grails default
2. Configuration support for tooltip style.
-3. Customize scaffolding templates to support the new style of validation message
+3. Customize scaffolding templates to support the new style of validation message
+
+Outstanding:
+1. i18n messages.properties not display properly for constraints
+ such as size, validator, etc. in command object
@@ -533,10 +533,17 @@ rules: {
def defaultMessage = "Error message for ${code} undefined."
def message = messageSource.getMessage(code, args == null ? null : args.toArray(), null, locale)
+ if (!message) {
+ message = messageSource.getMessage("${code}.error", args == null ? null : args.toArray(), null, locale)
+ }
if (!message) {
code = "${GrailsNameUtils.getPropertyName(validatableClass)}.${propertyName}.${constraintName}"
message = messageSource.getMessage(code, args == null ? null : args.toArray(), null, locale)
}
+
+ if (!message) {
+ message = messageSource.getMessage("${code}.error", args == null ? null : args.toArray(), null, locale)
+ }
if (!message) {
code = DEFAULT_ERROR_MESSAGE_CODES_MAP[constraintName]
message = messageSource.getMessage(code, args == null ? null : args.toArray(), defaultMessage, locale)

0 comments on commit e2489a3

Please sign in to comment.