Issues (369)

framework/configuration/LocaleConfiguration.java (5 issues)

1
package com.github.netkorp.telegram.framework.configuration;
0 ignored issues
show
It is a best practice to supply a copyright/licence header in your code. Your organisation probably has a template for that.
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
Move this left curly brace to the beginning of next line of code.
Loading history...
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
Make this line start at column 3.
Loading history...
Move this left curly brace to the beginning of next line of code.
Loading history...
21
        ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
0 ignored issues
show
Make this line start at column 5.
Loading history...
22
        messageSource.setBasenames("classpath:default/messages", "classpath:messages/messages");
23
        messageSource.setDefaultEncoding("UTF-8");
24
        return messageSource;
25
    }
26
}
27