Internationalization of user data

I have a client who wants to store data in a MySQL database with several languages ​​(in English, French, etc.) and be able to retrieve data (in the same language). i.e.: we have an English product description (varchar), which we intend to rewrite in French, and then on the server side find the description in the required locale.

I thought about wrapping the data in XML with language tags and then parsing the data?

What is the best way to serve multiple languages ​​in terms of user data? Is there a structure there?

J

+3
source share
3 answers

, Master-Detail:

TABLE Product 
--------------------
ID
ID_MANUFACTURER   
EAN13    
WHATEVER

TABLE Product_I18n
---------------------
ID_PRODUCT
ID_LOCALE
DESC

, Locale , XML...

+3

, , , $encoded_text, UTF-8 $#####.

0
0

Source: https://habr.com/ru/post/1770086/


All Articles