6

Given the following Grails Domain Classes, how do I go about renaming the displayed field name for isbn to be "ISBN" (as opposed to the default "Isbn") and authors to be "Author(s)" (as opposed to the default "Authors")?

class Book {
    String name
    String isbn
    static hasMany = [ authors: Author ]
}

class Author {
    String name
}
starryknight64
  • 504
  • 7
  • 15

1 Answers1

8

You can just use messages.properties file for that. Go to grails-app --> i18n --> messages.properties

and define message like:

'<full packagePath>.<domain name>.<propertyName>.<attribute>' = <message>

book.isbn.label = ISBN

Community
  • 1
  • 1
sanghavi7
  • 758
  • 1
  • 15
  • 38
  • 1
    Thanks that worked! I did have to pay special attention to the case of the package path, domain class name, etc (camelCase) in case that helps anyone else. – starryknight64 Jun 25 '12 at 13:46
  • yeah you need to pay attention for package hierarchy and class name and other things also.. – sanghavi7 Jun 26 '12 at 04:32