Quote from: Djamoer at Mar 16, 2006, 07:00 PMIf we need to replicate each chunk, site content, template variables, and templates, soon or later we will have a lot of tables filled up in the database. But considering that we are going to have only 2-4 translations at one site, so we need to have 8-16 tables to support the translation, compare to 4 tables, when we are not replicating the tables.
For multi language I think language files are required. So, it is not too difficult to maintain and it permits to not replicate all tables. Datas should be duplicate be only chunk and site content.
Templates can be writed only with snippets and chuncks : there is no necessary to duplicate each.
I think a great functionnality is chunck can contain language variables which will be replace by a core modx function from language files. For translated a chunck, we will not need to duplicate chunck but only add a new entry in a language file. With cache, I think Modx uses not more ressources of server.
Quote from: Djamoer at Mar 16, 2006, 07:00 PM
Now lets talk about the amount of rows needed. Lets say that each site usually contain 200 site contents, 5-15 template variables, which sum up as 1000-3000 rows, 1-5 templates, and 100-150 chunks. So if we want to duplicate into 4 languages without replicating table, here is the number of rows needed.
site contents: 800 rows
template variables: 4000-12000 rows
templates: 4-20 rows
chunks: 400-600 rows
It is enormous, it is right. With my previous proposition I think there will be much less duplicated rows.
All tables need not to be duplicated and it’s the same thing for all field.
For example, the table "site_content" can be splitted nearly like
bs said
I propose that :
[table]
[tr][td]
altered: modx_site_content[/td][td] [/td][td]
new: modx_site_content_[lang][/td][/tr]
[tr][td]docid[/td][td] [/td][td]docid[/td][/tr]
[tr][td]type[/td][td] [/td][td]published[/td][/tr]
[tr][td]contentType[/td][td] [/td][td]pub_date[/td][/tr]
[tr][td]parent[/td][td] [/td][td]unpub_date[/td][/tr]
[tr][td]isfolder[/td][td] [/td][td]createdby[/td][/tr]
[tr][td]richtext[/td][td] [/td][td]createdon[/td][/tr]
[tr][td]template[/td][td] [/td][td]editedby[/td][/tr]
[tr][td]menuindex[/td][td] [/td][td]editedon[/td][/tr]
[tr][td]searchable[/td][td] [/td][td]deleted[/td][/tr]
[tr][td]cacheable[/td][td] [/td][td]deletedby[/td][/tr]
[tr][td]donthit[/td][td] [/td][td]haskeywords[/td][/tr]
[tr][td]privateweb[/td][td] [/td][td]hasmetatags[/td][/tr]
[tr][td]privatemgr[/td][td] [/td][td]pagetitle[/td][/tr]
[tr][td]content_dispo[/td][td] [/td][td]longtitle[/td][/tr]
[tr][td]hidemenu[/td][td] [/td][td]description[/td][/tr]
[tr][td][/td][td] [/td][td]alias[/td][/tr]
[tr][td][/td][td] [/td][td]introtext[/td][/tr]
[tr][td][/td][td] [/td][td]content[/td][/tr]
[tr][td][/td][td] [/td][td]menutitle[/td][/tr]
[/table]
If you need to find a tractioon on only one language you can use a request with UNION.
If you need to list all available translated, another table is required to optimize :
[table]
[tr][td]
content_language[/td][/tr]
[tr][td]docid[/td][/tr]
[tr][td]langid[/td][/tr]
[/table]
A little request as this is very fast :
"SELECT COUNT(langid) FROM content_language WHERE docid=5"
I knox, I know, I’m very headstrong