| | |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.support.ResourceBundleMessageSource; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.servlet.LocaleResolver; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.time.Duration; |
| | |
| | | */ |
| | | @Configuration |
| | | public class MessageLocalConfig { |
| | | |
| | | |
| | | @Bean |
| | | public MessageSourceProperties messageSourceProperties() { |
| | |
| | | properties.setUseCodeAsDefaultMessage(true); |
| | | return properties; |
| | | } |
| | | |
| | | |
| | | @Bean |
| | | public MessageSource messageSource(MessageSourceProperties properties) { |
| | |
| | | } |
| | | |
| | | |
| | | @Bean//注册国际化组件 |
| | | public LocaleResolver localeResolver(){ |
| | | return new MyLocaleResolver(); |
| | | } |
| | | // @Bean//注册国际化组件 |
| | | // public LocaleResolver localeResolver(){ |
| | | // return new MyLocaleResolver(); |
| | | // } |
| | | |
| | | } |