I have made very simple system: MySQL tables: category and content in content : catId, id, title, abstract and body, I want to translate site with adding title_en, and body_en .
What is the best way for do this? (not file system)
Thanks in advance
I would create a separate language table, then any language specific information for a certain table needs to go in a further table which uses the language id and the id of the original row.
Bit of a complicated sound explanation, I’ll try and come up with an example!
languages
language_id
language_name[B]
products
[/B]product_id
product_price
product_stock
…etc…
products_lang
product_id
language_id
title
description
…other language specific information…
The trouble with using title_en or whatever - storing language information in the same table with different column names - is that if you ever come to add a new language, you have to modify your database structure. This way, you can add a new entry to the languages table, and then add the relevant information in to the x_lang tables - without modifying the database completely. The queries on the site then just need to select the appropriate entry from the x_lang tables based on their current language choice. You can even just use a join to make the result appear as it did before you introduced the multiple languages.
Using relational database, Its perfect!
Thanks for help.