Is there any best practice to store a multilanguage string using the Spring / Spring boot framework? For instance, I am designing an Account class.
public class Account {
private String nameEn;
private String nameDe;
// getters and setters are omitted
}
Is there an already designed class to store such kind of fields in one field on the Entity level? Or is it better to design my own class with @Embedded annotation like below?
class MultilingualString {
private String stringEn;
private String stringDe;
public String getString(String locale){
// get string by locale like "en", "ru"
}
public String getString(Locale locale){
// get string by locale
}
}