How to use i18n with a Grails/Groovy enum in a g:select?

前端 未结 3 1712
谎友^
谎友^ 2021-02-04 16:10

i am trying to get i18n localisation working on an Grails/Groovy enum,

public enum Notification  {
    GENERIC(0),
    CONFIRM_RESERVATION(100),
    CONFIRM_ORDE         


        
3条回答
  •  情歌与酒
    2021-02-04 16:25

    One method is shown in this blog post by Rob Fletcher (from 2009)

    Make sure your enum class implements org.springframework.context.MessageSourceResolvable

    Then implement the methods it defines

提交回复
热议问题