简体   繁体   English

如何为具有多语言支持的内容管理系统(cms)设计数据库模式?

[英]How to design database schema for a content management system (cms) with multiple language support?

I am going to build a site with multiple language support, and I need to have the ability to control the workflow of the articles, companies, products. 我将构建一个具有多语言支持的站点,我需要能够控制文章,公司和产品的工作流程。 All with multiple language support and multiple versioning. 全部具有多语言支持和多版本控制。 Does anyone have the solution for this already or I need to start from scratch? 有没有人已经有解决方案,或者我需要从头开始?

As your question is very broad, I will attempt to give you an answer with a simple example. 由于您的问题非常广泛,我将尝试用一个简单的例子给您一个答案。 This can be extended to every entity you want to store. 这可以扩展到您要存储的每个实体。 Let us assume you have an article entity. 我们假设您有一个文章实体。
Article (articleID, langID, ENUTitle, ENUContent, authorID) 文章(articleID,langID,ENUTitle,ENUContent,authorID)

By default you can store English language content in the main table. 默认情况下,您可以在主表中存储英语语言内容。 The same content or translated content can be stored in a separate language translation table. 相同的内容或翻译的内容可以存储在单独的语言翻译表中。

Article_Translation(ID, articleID, langID, langTitle, langContent) Article_Translation(ID,articleID,langID,langTitle,langContent)

example of content 内容的例子

insert into article values ('art101','ENU','New Website for Developers','Stackoverflow is new and useful','BKM')

Insert into article_translation (1023, 'art101','FRA','nouveau site Web pour les développeurs','stackoverflow est nouveau et utile','BKM')

Insert into article_translation (1024, 'art101','SPA','nuevo sitio web para desarrolladores','Stackoverflow es nuevo y útil','BKM')

Depending on your user language preference, content can either be displayed from article table or article translation table 根据您的用户语言首选项,可以从文章表或文章转换表中显示内容

In general, for every entity that needs translation, you will need a main table and language translation table. 通常,对于需要翻译的每个实体,您都需要一个主表和语言转换表。

Have you tried looking at the Database models at Database Answers ? 您是否尝试在Database Answers查看数据库模型?

Of course, you could use MS SharePoint. 当然,您可以使用MS SharePoint。

Have you looked at: 你看过了吗:

Joomla is an award-winning content management system (CMS), which enables you to build Web sites and powerful online applications. Joomla是一个屡获殊荣的内容管理系统(CMS),它使您能够构建网站和强大的在线应用程序。 Many aspects, including its ease-of-use and extensibility, have made Joomla the most popular Web site software available. 许多方面,包括易用性和可扩展性,使Joomla成为最受欢迎的网站软件。 Best of all, Joomla is an open source solution that is freely available to everyone. 最重要的是,Joomla是一个免费提供给所有人的开源解决方案。

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

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