79669174

Date: 2025-06-17 13:33:36
Score: 1
Natty:
Report link
  1. 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: さようなら
    
  2. Call this properties in Java File in Spring boot through of @Value Annotation.
    @Value("${messages.greeting}")
    private String greetingMessage;

  3. 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.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Value
  • Low reputation (1):
Posted by: Akash Singhal