Jump to content
Larry Ullman's Book Forums

Products Table In Another Language


Recommended Posts

Products fetched from tables are in English (e.g. drop down menu of Fig. 8.4). In addition to getting them in English, how to get same results in other languages? Do we have to make a different identical table per language, or there is a script that translate the fetched products into other languages? Pls. share such a script, or any other method to achieve this goal.

Link to comment
Share on other sites

It depends on how much you want to translate. If you just want to translate the displayed text, I'd add a field to the products table with the appropriate translations.

 

If you can't do the translations yourself, either have someone do them for you, or use Google Translate, for which the results are shaky, at best

Link to comment
Share on other sites

Thanks for the replies. Let me be more specific about what I want to achieve. I want a multi-language website (English, French, Chinese, etc.). The drop-down menu of products (figure 8.4) should be in English for the English page, in French for the French page, etc. Do I need a separate products table in French, another table in Chinese? The suggested additional columns per languages could be a good solution, though I have not tried it yet. Is there a more professional way of doing this?

Link to comment
Share on other sites

Not sure what you mean by "more professional", but if the label display on the screen is the only difference between languages (i.e., the price, ID, etc. are all the same across languages), then adding a new field for each language is best, I think, yeah.

 

Beyond that, you need to organize the PHP logic to handle multiple languages.

 

That's all there is to it.

Link to comment
Share on other sites

 Share

×
×
  • Create New...