Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename Displayed Field Name in Grails Domain Class

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
}
like image 216
starryknight64 Avatar asked Jun 22 '12 22:06

starryknight64


1 Answers

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

like image 149
sanghavi7 Avatar answered Oct 23 '22 16:10

sanghavi7