Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Pi multi-language site structure best practices #336
I searched through Wiki and all documentation but wasn't able to find any topic related to creating multi-lingual site (except the i18 translation feature).
Having the ability to create and edit content in many languages is the MUST HAVE feature for any CMS. Unfortunately, only few of them are able to achieve this.
What clients actually want is
So far, I've used different ways to create multilingual site in other CMS described bellow. In both cases the url structure is www.somesite.com/EN/page for english language, www.somesite.com/DE/page for German etc. The key point is that the content of a page could be different for different languages, not just translated with i18.
I think that three CMS could be used as a good example how to properly handle this issue:
What do you guys think about this and what are best practices for creating a site that will support many languages using Pi?
This inspired me to write an article today about multi-lingual site structure approaches. You can read it at: http://www.loneshooter.com/multi-lingual-site-content-structure-best-practices/.
I also suggest that you take a look at SilverStripe CMS and OpenCart because they have very intuitive way for editing multilingual content as well as great database design to support this (nothing special, but one record per language pointing to "master" content"). Working for years for clients that speak different languages I've found this way far the best comparing to other solutions.
I saw some CMS have language field in content DB , All contents modules have it.
But I don't like this method. I think multi-site system is better. If we can install new Pi for each language ( usr and lib folder is Common ) and Share some tables to all websites ( like user )
If I understood correctly, you would like to have separate Pi installation for each language sharing only "common" data, right?
If so, I have to say that it will lead to a lot of troubles. I have been working with similar in-house built-in solutions for clients and believe me it's a pain in the brain. You have to take care of themes, uploaded contents, especially the cache mechanism and valid paths, then permission system and many other "small" things.
I'm not sure what would stay of the current Pi Engine code if we go this way, so I believe that we need to take care only of content structure in the database itself.
@LoneShooter You are talking about two different use cases: A. Content-first, or
about multi-lingual content, could it be a sort of wide category?
i don"t know if Pi-Engine, permits this. if i remember well, Drupal permits this
@MarcoXoops, that's exactlly what I want to achieve, but it seems that for now it's not possible. I'm not sure about Drupal, but SilverStripe has all this feature at once.
@taiwen, I'm affraid that I don't really understand differences between: A (content-first) and B (structure first). Could you please provide more information or an example?
I assumed content and structure as the same thing, i.e. the structure is not a subsite (see NOTE section below), but only different site content tree for different languages.
Let's look the following scenario:
I would like to have my site in english and german languages, but some content will be available for both languages, while some other content will be available in german or english only. So the urls will be as follows:
// English lang
// German lang
So, for this situation I don't want to have two Pi instances (neither my clients do in 100% of their requests!). What we actually want is:
It sounds complicate but it's actually very easy and simple to solve. Just look how SilverStripe CMS implemented all these requests without any problems and duplicated files and instances etc. The screenshot represents language tree switcher in admin panel for a client of mine:
I'm not talking here about subsites (subsite definition: "A subdirectory of a Web site that is a complete site."). In the scenario above the site in english and german languages is THE SAME site just with different content and tree structure, and NOT separated websites. If a user want to have completely different logic for different sites together with different content types and basically completely different site as a part of existing site then the new instance or partial instance files need to be used.
I hope that I was clear in explanation what I would like to achieve for my clients and myself.