I am building a bi-lingual website and am wondering about the best design to use for the product database. The site will only ever use two languages, there are absolutely no plans to modify the site to use more than two languages in the future.
So with that in mind, what would be the easiest approach to designing the schema for the product database to support two languages? I can think of two ways of doing this:
- Have a separate record for each translation. Something like this:
product table:
id
date_created
price
product_info table:
id
product_name
description
language
product_id
With this design, we would create two entries in the product_info table for every entry in the product table. The two entries in the product info table would consist of one record containing the English text and the other record containing the Japanese text, and the language field acts as a flag to indicate the language that the record is stored in.
- The second approach would be to simply keep one record for both translations, but each record will have a Japanese and an English field to store the corresponding translation. Something like this:
product table:
id
date_created
price
product_info table:
id
product_name_en
description_en
product_name_jp
description_jp
product_id
I think the first design would make sense if we are working with more than 2 languages in the site, or if we have plans to extend the site into 3+ languages in the future. But in our case, the site will never use more than 2 languages. So, I am not sure if this is the best approach for design if we will only ever have 2 languages on the site. The second design seems like a simpler approach for 2 languages, but I am afraid I may be overlooking something here and am having a hard time deciding which approach to use.
Any thoughts/opinions on these approaches? I would love to hear.
Thanks!