Take the 2-minute tour ×
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. It's 100% free, no registration required.

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 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.

2 Answers 2

up vote 2 down vote accepted

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

CREATE TABLE TRANSLATIONS 
(
  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:

CREATE TABLE LANGUAGES
(
  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 at 11:34

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