I’m working on multi-lang website. Trying to design optimal db schema for this purpose.

As you see, there are 2 tables: langs and menu. My idea is following:
For ex. lets take a look at multi-language navigation generation from MySQL table. In PHP backend, while generating navigation from database
- Get all data from
menutable’s row - Left join second table –
langs(bynamefield ofmenutable )
and get data from defined language’s column (for ex. en, ru)
How do you think, is it optimal way, or is there more efficient solution? Please, give me database related answers, not file. (for ex. gettext,… etc)
It would be better if the
langstable contained alanguagecolumn, with one row for each translation. This allows you to add another language later and only have to apply data changes (rather than having to re-write queries).As you’ve already implied, performing a left join and falling back to a default language held directly in the
menustable is also a good idea (in which case, you don’t need to hold a translation for e.g.enin thelangstable, since the english version will always be available).You may also want to consider storing country-specific translations (if, say, there are multiple spanish speaking countries where the translations can be different), and following a fallback strategy of finding:
language-country,language,Englishtranslations.