简体   繁体   English

在数据库上使用多语言数据的最佳方法

[英]Best way for having multilanguage data on Database

What is the best way for having multi-language data on Database. 在数据库上使用多语言数据的最佳方法是什么?

I want to provide data of cities and the rules is title can't be null (if we add new language, we will provide translate of it too) 我想提供城市数据,规则是标题不能为空 (如果我们添加新语言,我们也会提供它的翻译)

Look at image please, part B is easily to provide, edit and load 请看图像,B部分很容易提供,编辑和加载 在此输入图像描述 But I don't know part B works fine for big data or not 但我不知道B部分是否适用于大数据

Will you ever possibly have a situation where a new language is phased in? 您是否可能会遇到分阶段使用新语言的情况? There are a lot of advantages to a design similar to A but with a fallback/default language in the main table. 类似于A的设计有很多优点,但在主表中使用了回退/默认语言。

This then means that the new language can be added into the auxiliary table and be immediately "usable" even if only half of the translations are available yet. 这意味着可以将新语言添加到辅助表中并立即“可用”,即使只有一半的翻译可用。

It also means that a new language doesn't require schema changes. 这也意味着新语言不需要更改架构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM