ITZone

Build multi-lingual database

In this globalization era, companies – including software developers – are always interested in expanding into new markets. This usually means localizing their products for different areas. In this article, I will introduce a few ways to handle this problem. Specifically with content management in multiple languages.

What is localization?

Localization is a target of many companies in commerce, service, … or even it is called with the phrase “preserving identity” on television channels. The most specific example you can see is chinatown, but these are not in the realm of your writing and knowledge. Should be shortened to localization in IT services as follows:

Ways to build databases serving Localization.

Idea 1: Add a column of each language that needs support for the fields to change

This is the simplest approach in terms of development. It can be done by adding a language column for each field.

Advantages

Defect

Compare MongoDB and MySQL: Which database is better?
The basic steps to build up a database

Idea 2: Create a separate table for translated text

Advantages

For example, assume the customer name and product name are identical. In this case, only one record will be inserted into the translation table and the same record is referenced in both the customer and product tables.

Defect

The query sentence to use it is as follows:

Add 1 more observant you will immediately recognize our translation table that always increases n row in one insert in which n is the number of tables to translate. so I redesigned a bit so that the query would be faster and the translation table would be better.

As for the query, please refer to the above sentence and write it yourself.

Idea 3: Translation by row

So we just need to add 1 language table to include the fields {id, name} are okay.

Advantages

Defect

As for the query, you can write it yourself.

Idea 4: Turn the fields to be translated into a separate table

In this solution, entity tables contain one or more translated fields divided into two classes: one for the translated fields and one for the untranslated fields. In this way, we can create separate classes for each table.

Advantages

Query

Finally I have 2 ideas but very rarely used but you can refer to them.

Idea 5:

For example:

Advantages:

Defect

Idea 6: Multiple database

Conclude

It’s too long to write, so no more conclusions. Although I know there are very important things or use in multiple languages ​​like DateTime. But it’s too long.

The article is referenced from here .

Thanks for reading

Choose the type of database that is suitable for your project – easy to think!

Steps to standardize basic database
Share the news now