I am looking for the best way to localize dynamic (user created) content on my website. I am using spring -mvc, which has found a very good structure, but now I need to make several objects available in several languages. I found out that for static texts i18n is the best way that I agree, but if I understood it correctly, it cannot be used to localize anything stored in the database.
There I have to store both localized and original content in the database, and now I need to know that this is the best way to do this, for example, I have an entity:
@Entity public class Article { private Long id; private String title; private String body; }
What does it look like if I want it to support localization?
@Entity public class Article { private Long id; @OneToMany private Set<LocalizedTitle> localizedTitles; private String body; }
I don't like this tbh solution, but I can't think of a better way why I come to this place ... maybe there is something built into jpa / hibernate that I can use?
thanks for the help
source share