Setting up UTF-8 Encoding - Ensure your application.yaml
file is saved in UTF-8 encoding. If non-UTF-8 encoding is used, Japanese characters otherwise not display correctly.
messages:
greeting: こんにちは
farewell: さようなら
Call this properties in Java File in Spring boot through of @Value Annotation.
@Value("${messages.greeting}")
private String greetingMessage;
Using @ConfigurationProperties
@Configuration
@ConfigurationProperties(prefix = "messages")
public class MessageConfig {
private String greeting;
private String farewell;
// Getters and Setters
}
If you are use Multi-language So you can handle the through of message.properties and as well as store the multi-language in Database also.