Forum Moderators: coopster

Message Too Old, No Replies

Internationalization and Localization

How do you do it?

         

coopersita

9:57 pm on Jun 15, 2005 (gmt 0)

10+ Year Member



I'm interested in learning how to create sites that offer the same content in different languages.

Do you just have many versions of the site in different languages, or are there more php-MySQL driven options?

Does anyone know of any good resources (books, sites)?

I know this is a big topic, but if anyone can point me in the right direction. I'll appreciate it

Blackie

6:48 am on Jun 16, 2005 (gmt 0)

10+ Year Member



Hi there,

I do support three languages with a php/perl/mysql combination though I have poblems with search engines (every page that get indexed always have an error message at the top, since bots ain't people and do not get any language cookie :-( and this looks pretty ugly on SERPs, the good thing is that it looks like indexing is going pretty well and many pages get indexed).

This problem made me think of having three separate sites, but I have enought trouble with one, and probably when the amount of work triple I simply could note hold it up.

So I think I stick to the present solution.

mcibor

10:59 am on Jun 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can store info in db for each language and use an xml template. Or just have separate files for each language and include them at will.

About the language you can check the default language of the user (windows and linux send that). More complicated way would be to check the IP of the user, but that is much harder to acomplish (you have to know what ip is what country).

Completely separate pages aren't very good - takes space on your server, but may be an option with small sites.

As for bots and spiders always have a default language (best your own, or the company's). Then if the data isn't sent, you use your default and there's no error coming.

Best regards
Michal Cibor

mincklerstraat

11:24 am on Jun 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I once gave a rather short answer to this question at [webmasterworld.com...]

coopersita

3:32 pm on Jun 16, 2005 (gmt 0)

10+ Year Member



Thanks.

I've seen how some CMSs do it with language files and constants, but what if you want to do the same with content (not just the static menu and standard messages)?

I'd love to know of any books or sites that talk about this in depth.

mincklerstraat

8:48 am on Jun 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Most nuke-a-like CMS's have language options which, when you select a language, will only show the articles published in that language (the language of the article is stored in a row in the article table). This is one way of doing it.

Most multi-lingual sites, however, want to have many (if not all) pages translated into different languages, so you have a version in each language for each important page - not just an article here in Spanish, an article there in Dutch. Most give you an option at the beginning of clicking on a language, and that language is a whole extra 'tree' of the site. From each page, it's possible to click on a different language, but this brings you back to the root page of that language, and not the same article you're reading. This is probably the easiest way to create the site initially, but not the best for your user, especially if some translations are less than top-notch. Multi-lingual users will often want to see if there isn't a different, better translation (maybe the original). It's best if clicking on the option takes them directly to the same article in that different language, so they don't have to navigate back up the whole tree to find the article.

However, creating a site like this adds an extra challenge. You may want to add pages before you have time to translate to all the other languages. Then you also don't want to display the language links when that page doesn't exist in that particular language.

When you begin (if you're coding from scratch), you'll have to ask yourself how you organize your database, and this will be a very important step. A separate table for each language? Each article with an id number? etc. I once designed a CMS-ish site along these lines, but it hasn't gone past the flat-files prototype stage yet, and I'd never nailed down the structure of the database. In the part where you display the languages available, you could then have a function that checks the article tables for each language, sees if that id number is present for each, and if so, displays the link to that article in the other language.