| 1 | package com.github.netkorp.telegram.framework.configuration; |
||
|
0 ignored issues
–
show
Code Smell
introduced
by
Loading history...
|
|||
| 2 | |||
| 3 | import org.springframework.context.MessageSource; |
||
| 4 | import org.springframework.context.annotation.Bean; |
||
| 5 | import org.springframework.context.annotation.Configuration; |
||
| 6 | import org.springframework.context.support.ReloadableResourceBundleMessageSource; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Contains the configuration of locale for the bot. |
||
| 10 | */ |
||
| 11 | @Configuration |
||
| 12 | public class LocaleConfiguration { |
||
|
0 ignored issues
–
show
|
|||
| 13 | |||
| 14 | /** |
||
| 15 | * Returns a custom {@link MessageSource} for resolving the Telegram Framework messages. |
||
| 16 | * |
||
| 17 | * @return the custom {@link MessageSource} instance. |
||
| 18 | */ |
||
| 19 | @Bean("TelegramFrameworkMessageSource") |
||
| 20 | public MessageSource messageSource() { |
||
|
0 ignored issues
–
show
|
|||
| 21 | ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); |
||
|
0 ignored issues
–
show
|
|||
| 22 | messageSource.setBasenames("classpath:default/messages", "classpath:messages/messages"); |
||
| 23 | messageSource.setDefaultEncoding("UTF-8"); |
||
| 24 | return messageSource; |
||
| 25 | } |
||
| 26 | } |
||
| 27 |