If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > db structure for multiple languages

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-22-11, 02:06
neman69 neman69 is offline
Registered User
 
Join Date: May 2011
Posts: 2
db structure for multiple languages

I am configuring a new db for a website that will have inputs in multiple languages - at present english and spanish, but this will expand to other languages in the future.

I need some advice for the best way to structure the db to support this scenario...multiple tables? one for english? another for spanish?

Also is there a translation function within mysql to support translation of data queried say from spanish to be read in english...depending upon the chosen language of the querier???

Any suggestions are appreciated.
Reply With Quote
  #2 (permalink)  
Old 05-22-11, 07:05
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
Quote:
Originally Posted by neman69 View Post
multiple tables? one for english? another for spanish?
Definitely not! This would mean rewriting all your SQL each time you add a new language and it would be a pain to look after.


Quote:
Originally Posted by neman69 View Post
Also is there a translation function within mysql to support translation of data queried say from spanish to be read in english...depending upon the chosen language of the querier???
I'm sure MySQL cannot do this but there are interfaces available for google translator. Not sure how good this is though.

You'll want to store a language code alongside each input and a similar code for each user. Difficult to offer more advice without knowing more about the application.
__________________
Mike
Reply With Quote
  #3 (permalink)  
Old 05-22-11, 09:53
neman69 neman69 is offline
Registered User
 
Join Date: May 2011
Posts: 2
db structure for multiple languages reply

This db application is for a new social networking/dating website I am building. Basically english and spanish are the initial languages. I want people to be able to enter their info in their native language but I want their info queryable in another language, i.e. enter in spanish and someone speaking english can query your info and receive it in english....

Any suggestions???
Reply With Quote
  #4 (permalink)  
Old 05-22-11, 15:36
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
I have to ask this - if some young lady has entered all her details in Spanish and I can only speak English then is there much point in me being able to read her details? or would you provide a translator for the initial date?

It would also be be very inefficient to search through tables while doing "on the fly" translations. Easiest to code would be having drop down lists for the things that people search for and then just store a code for each interest etc but store and display the correct translation for each language. This will be efficient but won't allow people to be very descriptive ie someone might be able to choose "I like animals" from a drop down but then probably won't be able to select "but I only like spiders".

Perhaps the drop down fields will be the only searchable fields while the text entry fields (in the users language) can be translated into other languages if a user wants to see them. You could also cache these translations so you don't have to translate them again.

Perhaps it would be better to translate everything the user types in into all the languages that the user can speak (no point showing the user to people who she can't communicate with). Then you could do searches on the translations.
__________________
Mike
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On