The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

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.

I think the best way is to let the user choose and change the language via a set of links. These links can be put at the very top of the page, or somewhere obvious. The links can be written in text using UTF-8 encoding, or use images, but it should be written in the designated language. So it doesn't really make sense to have the language links written all in English.

Another point in php to remember is the string functions. If you multi-byte languages, e.g. eastern asian languages CJK (Chinese, Japanses, Korean), then functions like "strlen", "substr" will NOT work, you need to see the MB String functions, http://au2.php.net/mbstring

Other point to consider is collation if sorting is required. This gets tricky in php as the collation is depedent on the server platform.

Just as a side thought, you could always download the open source CMS Mambo and install the mambelfish component. You will then have a full CMS with multilanguage capabilities. Although it does take the time, effort and fun out of building your own app.

Just as a side thought, you could always download the open source CMS Mambo and install the mambelfish component. You will then have a full CMS with multilanguage capabilities. Although it does take the time, effort and fun out of building your own app.

I know this may sound silly, actually it may sound like i'm jumping to conclusions since I never even heard of mambo, but from the looks of it it's a website translator right? (like babelfish, but for websites)

Really, I don't think I'd recommend to do it this way, unless they have improved the translation accuracy a bit

I never heard of it a month ago. But now I'm using it in my http://dev.gauldong.net site.
It's very good and user friendly. Albeit I've discovered a VERY SERIOUS BUG regarding database, but I think it's one of the Mambo's components which is the culprit.

Reminds me of the old days when my site (and thousands of others) got hacked because of phpBB exploit (and the saga continues...)

You should take a look at ez publish, typo3, and also the ones at opensourcecms.com as you can try these.

BTW actually you can just rip apart the framework for your favorite CMS and use that to build your app. Or better, you can just use the CMS as is and build your app as a module/extension/component/whatever of it. It's much easier that way.

Okay, I admit that I've been pretty ignorant of Content Management Systems and any other script out there that does something happily for me. I am pretty much a write my own code from scratch kinda guy, but I also think that I realize the benefits of looking at another person's source code. It's a downfall of mine that I don't do that nearly as much as I should..

actually you can just rip apart the framework for your favorite CMS and use that to build your app

WHOA THERE! Someone needs to read and understand the terms of the GPL if they are going to be selling any of this code!!

Aside from that: Mambo is good if you want a solution-in-a-box, but it's still not standards driven I believe, and is a bit 'boxy'. If you want a *real* content management system, check out what you can do with eZpublish at http://ez.no/ez_publish/references - some of the sites there are just blinding and they follow standards generally too. Bit of a learning curve though.

Thanks for all the info about languages - I quite like the system that osCommerce uses, never had a problem with that. It has a folder containing subfolders with each languages individual language files - easy to make a translation. Not sure what happens when you put *loads* of languages in there though...

I'm not sure what the code for it is, but it might be best to detect what country they are coming from, and somehow have a default language for that country.

I would have to disagree. I live in Germany, but I am US American and all the sites I use regularly are in English. I do not surf German sites much. I find it irritating to call up a .com site and get German, if I want German I will use DE. Google is bad at that, I request Google.com and it feeds me Google.de and I have to manually switch. If I wanted Google.de I would write Google.de.