Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a website in Django using MySQL, and I have more than 4.000 entries that I want to translate.

What's the best way to do it? Create a new database for every language? Create other table for every language? Or create more entries?

I want 6 or 8 languages so I thought it might be bad to have a table with many records.

share|improve this question

closed as too broad by RolandoMySQLDBA, Kin, Mark Storey-Smith, Max Vernon, Jon Seigel Apr 21 '14 at 18:32

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 2 down vote accepted

You want to use a TRANSLATIONS table, that looks something like:

  translation_id    INTEGER,
  language_id       INTEGER,
  translation       VARCHAR(255),
  PRIMARY KEY (translation_id, language_id)

Then edit your current schema and/or code to reference the TRANSLATIONS table, rather than any hard-coded values (using translation_id,language_id to lookup). For example, rather than having a VARCHAR column in a table, you'd instead have a NUMBER column that would "link" to the TRANSLATIONS table.

Probably also best to have a LANGUAGES table that lists what each language_id represents.

For example:

  language_id   NUMBER PRIMARY KEY,
  iso_code      CHAR(4), -- eg "en"
  language_name VARCHAR(32) -- eg "English"
share|improve this answer

The answer relies on what kind of data you store and how. I would never suggest making separate database. Depending on the data you can either:

  • Create separate rows in same tables and add "language" column to specify which language the content is in.
  • Create separate table per langauge to completely separate content.

Which way to go depends on your data, the way you plan to perform queries etc. and is too broad question to answer. You will likely have to apply different method for different tables.

share|improve this answer
It's a table of activities. I only want to translate the title and description – Marcos Aguayo Apr 15 '14 at 11:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.