Internationalization

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Skeptical
Forum Newbie
Posts: 8
Joined: Mon Sep 18, 2006 10:23 pm

Internationalization

Post by Skeptical »

I'm looking to internationalize my community application.

For front-end templates, I will be using different language folders for each language. That's the easy part.

The hard part is internationalizing the database data end.

It's not just articles that will need to be translated. It's also user profile fields such as names, addresses, etc. stored in the database.

Here's an idea. Tell me what you think...

Create a duplicate database for each language, complete with data. The English version will be named EN, and a Spanish version will be named SP.

Now, suppose user John selects Spanish for his language preference, all data will be now be read from the SP database.

John adds a new friend in the system. This data is saved in the SP database. Obviously this data needs to replicate to the other language databases. The database has a trigger which copies data to the EN database. It's all wrapped in a transaction so in case the trigger update doesn't work, everything rolls back.

Next, John writes a new blog entry XYDD. This entry is then saved in the SP database. However, since no such blog ID exists in the EN database, the trigger also copies it there.

Now, John switches to the English language, and thus the EN database. He then views the XYDD blog entry, and sees the Spanish content. He modifies it to English and saves it. Since the default language of the site is English, triggers in the EN database are different in that they will try to replicate the change to all databases that don't have the XYDD blog entry content.

Would something like this work? It sounds like a lot of data duplication, but the advantages are:
  • Less code change for internationalization
  • Less per-database bloat, so performance is gained
Problems I see are:
  • More chance of errors when writing data, since multiple sources must also successfully update.
  • Triggers, which nobody seems to like... although I say this one might be ok, since it's not really altering data in the same database. It's altering the same fields in another database.
  • Something I'm not seeing, since I haven't seen anyone propose doing it this way before.
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: Internationalization

Post by yacahuma »

Are you planning to manually change any user input into all other languages?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Internationalization

Post by Christopher »

Yes, how and why would you translate user profile fields such as names, addresses, etc.?
(#10850)
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Internationalization

Post by josh »

Well you wouldnt wanna translate a username or address, but there are services that plug into your web app, and as users submit new data it automatically gets queued for human translation. the services usually charge per word per language, and charge more based on SLAs ( like text needs to be translated within 30 minutes, or 6hrs, or 48hrs, etc... )

Not cheap though.
Post Reply