Sign in to follow this  
Prozak

Developing WebSites in Multiple Languages

Recommended Posts

I'm developing a website engine, and one of the features i'm aiming for is the ability to render the site in multiple languages. I would just like to ask if anyone here has developed multi-language sites, and how does one go about handling languages like Japanese, Korean, Russian, not only on the html, but also on the DB (mySQL). Thanks for any tips on this! [wink]

Share this post


Link to post
Share on other sites
As far as storing the actual text, look into UTF-8 encoding. It uses 1 to 6 bytes to represent a single character, and can handle pretty much any character used in modern languages. It's also backwards compatible with ascii, so 7-bit ascii characters are encoded itentically under UTF8 (not sure exactly what happens with the upper half of the ascii table, like é, à, and so on).

As far as the code goes, you will want to come up with a system where you do ALL of your development in English, but wrap all strings into some translator call (so instead of "click here", you would have getTranslatedText("click here"), which would look up the correct string). I'm sure libraries exist that make this stuff simpler. Although it's always helpful to keep translations in a database, I recommend that when your website renders the localized text, it doesn't query a db for every single string. Instead, have some script run every now and then (nightly?) that creates english->other_language mappings in a more easily-accessible location (e.g. a Berkeley DB or something).

Just random thoughts.

Share this post


Link to post
Share on other sites
For most work I have done, when it comes to html, I use php and I simply replace all outputted text with a variable. so instead of print("Hello world"); it ends up being print($hello_world); At the beginning of the file I do an #include "language.php", where language is english, spanish, etc. In that file you just have a list like this:

$hello_world = "Hello World";
$string2 = "Another string";

Not sure how you would / could handle the db though.


Hmm.. Maybe I read that question wrong.. =)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this