0

What is the optimal database schema for storing multi-language data? There are many examples around the internet, to list just a few:

They are all more or less based on the same idea, and are clear enough: There should be one table storing all language-neutral data of a model, and another table storing in each row a translation with the corresponding language code.

What I am missing here is how do I translate the actual meta-data for a model? For example, if I have a Product model defined with name, description and manufacturer columns, all three previous examples show how to store the translated content. The result would be:

(English) Product Name: Chair Description: A sitting product Manufacturer: Ikea (Spanish) Product Name: Silla Description: Un producto para sentarse Manufacturer: Ikea 

But how would I store translations for the actual model's taxonomy, such as Product, Name, Description, Manufacturer? In the examples above those are either a table name or column names. How do I structure my database to keep translations for those too?

I'm not sure if this is of any importance, but my app is built in PHP (using Laravel framework). And I do know that I could use PHP's gettext(), or store such meta-data in a method and return it as needed, but I would like to avoid that, as I believe storing it in a database provides much better flexibility.

2
  • I think it will be a mistake to try translating database column names. What you need to translate are the various GUI labels (which may or may not relate to the database columns). Unlike the actual data, the labels are translated only once for the app. Commented Jul 26, 2015 at 17:24
  • @Vatev I might have expressed myself wrongly. I didn't imply that I want to translate column names. After all, an app user does not need to even know that the database exists. I only asked how to implement translating meta-data for a model. I got the part about translating content, but where should I store translations for the Product's field labels (product name, product description, product manufacturer)? Commented Jul 26, 2015 at 17:44

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.