View Full Version : Guidelines for multilanguage site

05-27-2005, 04:18 PM
I'm considering doing a site with at least 2 languages. I want to do it right from the beginning and use CSS and xhtml. I want to separate the text from the layout in some way so I can easily add more languages after a while.
What's my options here?

I have an idea to use php like this:

if ($_GET["language"] == "swedish")
include ("swedish.txt")

and call the page with ?language=swedish in the url.
So the swedish.txt may contain the actual Swedish text of the site. But just have each textblock on one row in the file may not work. It's is better to have some id-tag on the www-page and in the language-file. That way I can change position of the textblock at the site.

Any other ideas? Can this be done in pure css?

05-27-2005, 04:38 PM
I'm not up to scratch with PHP but I'm asuming that php code works out the language automatically... but what if you want to view the site in another country where you don't speak the language?

What I'd do is have essentially two sites where the user can select the language they require. You could still use SSI to import the correct language text file based on the url using php.

05-27-2005, 05:01 PM
Yes I agree with mark have two sites.