如何在DB中引入字典国际化
我有数据库和很多字典。到目前为止,它是用英语编写的,但客户希望在数据库级别引入国际化(以支持西班牙语和英国英语)。因此,登录我们系统的用户应该会看到所有文本,具体取决于他的国际化设置。
大多数字典表都是这样的形式:
CREATE TABLE UserPermissionTypes (
Id [INT],
Title NVARCHAR(100),
Description NVARCHAR (500) )
此时我正在考虑为每个字典创建重复的表,其形式类似于此:
CREATE TABLE UserPermissionTypesTranslations (
UserPermissionTypesId [INT],
LanguageCodeId [INT]
Title NVARCHAR(100),
Description NVARCHAR (500), )
我知道这不是完美的解决方案,所以我想知道实现的最佳方法是什么表格国际化? 是否有某种标准方法可以实现国际化?
I have DB with many dictionaries. Till this moment it was written in english, but customer want to introduce internationalization on DB level (to support spanish and UK english). So users that will login to our system should see all text depending on his internationalization settings.
Most of dictionay tables are in form:
CREATE TABLE UserPermissionTypes (
Id [INT],
Title NVARCHAR(100),
Description NVARCHAR (500) )
At this moment I'm thinking about creating duplicated tables for each dictionary in form similiar to this one:
CREATE TABLE UserPermissionTypesTranslations (
UserPermissionTypesId [INT],
LanguageCodeId [INT]
Title NVARCHAR(100),
Description NVARCHAR (500), )
I know that it is not perfect solution, so I want to know what is the best method to implement internationalization in tables?
Is there some standard way to do that inernationalization?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如何制作额外的翻译表并使用它的 ID 而不是文本(在评论后修改):
How about making extra table for translations and use it's ID instead of texts (modified after comments) :