Suggestion about structure and logic of multi
I started a website and now it needs to be in different languages. The website is a simple product showcase with a few news. I'll briefly explain my structure: www.website.com is the root and for each language I simply have a folder (en/, de/ it/) and within these folders I would have only the main pages .php (index, contacts, news, etc..) without any other folder like images, js, css and so on.
The two things I am not sure how to manage is the CRUD system for products and news. The products are the same in each language, so only the words changes. The news are different for each language, so this is a bit easier.
Right now, having to deal only with one language, I have a simple admin control panel where I insert/edit/delete products and news. The main problem is how should I structure the database ? I was thinking of making as many 'product_tables' as are my languages, and the same thing for the news. Then, from the admin panel, I would choose where the news/product should be inserted, in which table (products_en, products_de, products_it, ...). This way I would have to insert the same product as many times as the languages are. What do you think, is there a better way to do it ?
Sorry if it's been asked already, but from my researches I couldn't find an answer to fit my situation. Thank you
LE Thanks for suggestions. The main thing is that this website will be very rarely updated, let's say 5 news/year and 10 products/year so I don't want to re-do all the website with a template. I need only some suggestion for db-structure
To begin with, I would not build something like this, but just use a Shop-System. Or a plugin for Wordpress.
But if you really wanna do it:
We have one product table in the DB and then just different columns for ever language. Eg. product_name_de, product_name_en, etc.
Cheers
Remy
链接地址: http://www.djcxy.com/p/37500.html上一篇: JSON中的语言数据(MySQL)
下一篇: 关于多结构逻辑的建议