Quote:
why whole separate db's? Every bit of content stored in the DB has an identifier. Why not make a module or a core feature that one can enable, that lets editors add a second or thrid or as many languages as you want to a site, by linking the unique item ID to the translated content?.
Agreed. I used to work in a company whose site was translated in 5 languages. Once an article was added in one language, translators team was notified of it, then they could go the the admin interface, click "translate" and the article was duplicated ready to be translated in another language.
If you want to talk of interface stuff, it means:
- One possibility to indicate the languages available somewhere in admin + specifying a default language
- An additional selectbox (containing the above languages) in each form used to submit content, allowing poster to specify which language is used in his post
- A "translate" button available in the forms/admin, so an item can be duplicated and used as a starting point for the translation while staying "linked" with the original
- An additional pref for each user, allowing them to specify one or more languages and the order of preference
Technically, we don't even need to duplicate tables or have separate ones. It's just about creating another table that links content to languages.
Translation_table:
transid newsid univnewsid lang
transid is the primary key,
newsid allows us to retrieve the news item by itself
univnewsid is what links translations
lang is the language code of this item
Another (and more simple) solution would be to add the 2 (univnewsid + lang) columns to the existing content tables.
So, if we create a entirely new news item, it is added to the news table as usual, and a row with a new
univnewsid is also generated.
If we want to translate an already existing news, we duplicate it, change the content, and add another line to the translation table which will have the same
univnewsid as the original.
Like this:
- we can query the items in a specific language
- we can also query all the translations of a specific item using the "univ" field (to show a "translate to" selectbox in the article page that will give people access to available translations)
- If using the "additional table" choice, we can even trick the system so the same item is marked as being in different languages, without the information being actually duplicated (i.e: some admins may want a specific english item to appear in all the site even in foreign versions)
etc...
For core/module handling: a little part should be handled by the kernel itself (specifying avail languages / user pref), but module writers will have to take care of the rest (anyway it's not too difficult to implement I think...)
Skalpa.>