简而言之,我已经按照这里描述的传统方式在 Spring Boot 中实现了本地化和国际化: https ://www.baeldung.com/spring-boot-internationalization 简单地说,所有本地化文件都存储在 messages.properties 中,相应地,如有必要,他们从那里得到。但是数据库中存储了一些动态内容,这也需要本地化。不要每次都编辑 messages.properties 文件。我找到了以下实现,当为本地化创建一个单独的实体时,它以键值对的形式存储在数据库中。 https://medium.com/i18n-and-l10n-resources-for-developers/database-stored-messages-for-i18n-in-spring-boot-11dc2ee5c1f7 如果计划将本地化文本存储在实体类的相应表中,情况会怎样?例如,有实体 - 文章。因此,将有列 title_ru content_ru title_en content_en 并相应地在访问时获得必要的翻译......在这种情况下,良好形式的规则是什么?在此先感谢您的帮助!
使用此处找到的解决方案 - https://medium.com/i18n-and-l10n-resources-for-developers/database-stored-messages-for-i18n-in-spring-boot-11dc2ee5c1f7