S
S
Svet Valentin2016-08-09 13:00:14
MySQL
Svet Valentin, 2016-08-09 13:00:14

How to structure a MYSQL database on a multilingual site?

Good day to all!
I can’t cope with the task at hand, somewhere I’m sharply stupid!
It is necessary to create a multilingual database in MYSQL (codeigniter)
before the table was written like this (note blog post)

id
title_ru
title_en
short_ru
short_en 
...

but it's too clumsy now I understand that it takes a lot of memory when deriving from the database
there is an idea like this
id
lang
title
short
...

where, when outputting from the database, we simply output all posts with the lang marker, where lang is an abbreviation of the language like en,ru
- but there are fields that do not need to be translated, such as image,category_id, etc.
Tell the junior what to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2016-08-09
@walyk

In the CMS with which I sometimes work, it is implemented by XML. Fields that do not need to be searched are stored in the content field and parsed through extractvalue. Those. all fields, including multilingual versions. You can also parse already on php or even on the client.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question