rhakdnj / kopring

0 stars 0 forks source link

REST API 국제화 #21

Open rhakdnj opened 7 months ago

rhakdnj commented 7 months ago

internationalization - i18n

Request Header

"resources/messages.yaml"

"resources/messages-kr.yaml"


class HelloController(
  private val messageSource: MessageSource
) {
  @GetMapping
  fun hello(): String {
     val locale = LocaleContextHolder.getLocale(); 
     return messageSource.get("good.morning.message", null, "DefaultMessage, locale)
  }
}