dutch (original), english and swedish also..
each language get it's own MySql database
with the data stored. By choosing a language
the site decides wich DB to use.
what is the best way to store the language?
a session, a cookie?.. or maybe some other method
And is there also a way to find out from which country
a site visitor comes from?..
Cookies and sessions confuse search engines. I'd pass a variable in the URL all the time. This way your users will be able to "link" to a certain page too.
I always use a mod_rewrite method to rewrite the URLs, so they look like this: example.com/en/file.html
... which in reality is example.com/file.php?lang=en
As for the country, yes. It's possible in most cases. Google for "IP 2 Country", and you'll find some scripts. You can also use the browser's "Accept-Language".
I already got an htaccess file.. with this content:
Code:
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName isloep.nl
AuthUserFile /var/www/vhosts/isloep.nl/httpdocs/_vti_pvt/service.pwd
AuthGroupFile /var/www/vhosts/isloep.nl/httpdocs/_vti_pvt/service.grp
It's rather bad to store it in a database. I suggest to create a php file with an array that contains the texts. All you have to do is include it, and you can access it.
I'd say it depends on the size of the site. If it was a smaller site, I'd use flat files as well. But if it's bigger, then I'd use a database, 'cause it's easier to manage, edit, etc...