M
M
Maxim Timofeev2016-03-31 14:38:18
MySQL
Maxim Timofeev, 2016-03-31 14:38:18

How to store cities in different languages?

There is a base, let's say id city_name
The user must select his city, let's say through select2 with ajax. I entered 3 letters, the request went, like 3 letters got out, json returned. Everything is clear here.
Up to the point that cities can be in different languages. And initially there are 3 of them, and then they will be added. Do in the database city_name_ru city_name_en, etc. not very convenient. Multilingualism itself is implemented by regular means of yii2.
Who faced, what are the developments on this topic?
Create different databases for each language with id city_name? What would id match?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2016-03-31
@webinar

Separate table (`city_id`, `language`, `city_name`), primary key (`city_id`, `language`)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question