- Interceptor에서 Accept-Language 헤더를 파싱 - 요청 단위 LangContext에 언어 정보 저장 - 서비스 및 예외 처리 계층에서 언어 컨텍스트 주입 - enum 및 when 기반 언어 정책을 한 곳으로 통합
16 lines
310 B
Kotlin
16 lines
310 B
Kotlin
package kr.co.vividnext.sodalive.i18n
|
|
|
|
import org.springframework.stereotype.Component
|
|
import org.springframework.web.context.annotation.RequestScope
|
|
|
|
@Component
|
|
@RequestScope
|
|
class LangContext {
|
|
var lang: Lang = Lang.KO
|
|
internal set
|
|
|
|
fun setLang(lang: Lang) {
|
|
this.lang = lang
|
|
}
|
|
}
|