Class EasyDeskMessageSource

java.lang.Object
org.springframework.context.support.MessageSourceSupport
org.springframework.context.support.AbstractMessageSource
com.easydesk.localization.EasyDeskMessageSource
All Implemented Interfaces:
org.springframework.context.HierarchicalMessageSource, org.springframework.context.MessageSource

public class EasyDeskMessageSource extends org.springframework.context.support.AbstractMessageSource
EasyDeskLocalizationService 를 Spring MessageSource 로 쓰기 위한 adapter.

Thymeleaf(#{key}) 처럼 MessageSource 를 받는 곳에서 EasyDesk bundle 을 같은 규칙(여러 bundle 검색, 번역이 없으면 기본 locale)으로 쓰게 해 준다. 기본 생성자는 매번 Localization.getService() 를 쓰므로, 나중에 Spring bean 이 등록되면 그 bean 을 따라간다.

일부러 bean 이름 messageSource 로 등록하지 않는다 - web 쪽(Spring Boot) 의 화면용 MessageSource 를 덮어쓰지 않도록.

Author:
Youngho Cho
  • Constructor Details

  • Method Details

    • resolveCodeWithoutArguments

      protected String resolveCodeWithoutArguments(String code, Locale locale)
      Overrides:
      resolveCodeWithoutArguments in class org.springframework.context.support.AbstractMessageSource
    • resolveCode

      protected MessageFormat resolveCode(String code, Locale locale)
      Specified by:
      resolveCode in class org.springframework.context.support.AbstractMessageSource