Rename the display name of the field in the Grails domain class

Given the following Grails domain classes, how do I rename the display field name for isbn to "ISBN" (as opposed to the default "Isbn") and the authors to "Author (s)" (as opposed to the default "Authors")?

class Book { String name String isbn static hasMany = [ authors: Author ] } class Author { String name } 
+6
source share
1 answer

You can simply use the messages.properties file for this. Go to grails-app -> i18n -> messages.properties

and define a message like:

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

book.isbn.label = ISBN

+6
source

Source: https://habr.com/ru/post/918800/


All Articles