I am implementing a database for a multilanguage online dictionary. At the moment I have only 2 languages (RO - Romanian, CS - Czech), but I think maybe in future I will want to add more languages (for example EN - english).
The website will be multilanguage too, so a romanian user can look for czech words and a czech user can look for romanian words.
I'm thinking how could I implement the TRANSLATIONS table for multiple translations. At the moment I have this implementation, but it's not the way to go, because in case I will add another 10 languages, I would have to add another 10 columns:
WORD (id,word,language_id,..)
TRANSLATIONS(id,ro_id,cs_id)
LANGUAGE(id,code)
LANGUAGE
id code
1 ro
2 cs
WORD
id word language_id
1 xxx 1
2 yyy 2
TRANSLATIONS
id ro_id cs_id
1 1 2
I could make a table like:
TRANSLATIONS(id,word_id,translation_id)
but in this case I don't know how to search for translation and i would have to add both cases:
TRANSLATIONS
id word_id translation_id
1 1 2
2 2 1
Some ideas? I hope my description makes sense.
Thanks.
UPDATE: Another approach could be a table with JSON column like:
TRANSLATIONS(id,data)
id data
1 {"ro":1,"cs":2,"another_lang": "another_id"}
but is this a good idea?