Connecting Tech Pros Worldwide Forums | Help | Site Map

How to make multilingual website?

CAH
Guest
 
Posts: n/a
#1: Apr 5 '07
I need to make at multilingual website, with php and mysql, and I have
placed the different language in different columns in a database. But
when the user chooses a language, should I make the choice stick with
a cookie or a session or something else?

Mads


mickysoft.org@gmail.com
Guest
 
Posts: n/a
#2: Apr 5 '07

re: How to make multilingual website?


On Apr 5, 10:40 am, "CAH" <madsgormlar...@gmail.comwrote:
Quote:
I need to make at multilingual website, with php and mysql, and I have
placed the different language in different columns in a database. But
when the user chooses a language, should I make the choice stick with
a cookie or a session or something else?
>
Mads
You can store the user`s selection in their session file or if they`re
a registered user you can store it in their profile in the database.
If you need help dooing any of this just ask :)

Micky

Erwin Moller
Guest
 
Posts: n/a
#3: Apr 5 '07

re: How to make multilingual website?


mickysoft.org@gmail.com wrote:
Quote:
On Apr 5, 10:40 am, "CAH" <madsgormlar...@gmail.comwrote:
Quote:
>I need to make at multilingual website, with php and mysql, and I have
>placed the different language in different columns in a database. But
>when the user chooses a language, should I make the choice stick with
>a cookie or a session or something else?
>>
>Mads
>
You can store the user`s selection in their session file or if they`re
a registered user you can store it in their profile in the database.
If you need help dooing any of this just ask :)
>
Micky
Yup, good advise.
Additionally: Make sure you set per column with a language the right
character encodingscheme fit for that language.
And send back the right headers in ALL your responses to the client.
So your PHP scripts must overrule the default charset set in php.ini.

If you only use languages that have the same characterset/coding, don't
worry. ;-)

Regrads,
Erwin Moller
CAH
Guest
 
Posts: n/a
#4: Apr 5 '07

re: How to make multilingual website?


On Apr 5, 10:03 am, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
Quote:
mickysoft....@gmail.com wrote:
Quote:
On Apr 5, 10:40 am, "CAH" <madsgormlar...@gmail.comwrote:
Quote:
I need to make at multilingual website, with php and mysql, and I have
placed the different language in different columns in a database. But
when the user chooses a language, should I make the choice stick with
a cookie or a session or something else?
>
Quote:
Quote:
Mads
>
Quote:
You can store the user`s selection in their session file or if they`re
a registered user you can store it in their profile in the database.
If you need help dooing any of this just ask :)
>
Thansk for both replies.
I do not have an option to register, it would not make sense on this
kind of site. But is there not an option to save as cookie if
possible, and if cookies are not enabled then use a session ? It would
be annoying for the user to make the selection each time they visit,
so a cookie would seam like the ideal solution. But then not all have
cookies enabled, so therefore the automatic switch to session.
Mads

Schraalhans Keukenmeester
Guest
 
Posts: n/a
#5: Apr 5 '07

re: How to make multilingual website?


CAH wrote:
Quote:
On Apr 5, 10:03 am, Erwin Moller
<since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
Quote:
>mickysoft....@gmail.com wrote:
Quote:
>>On Apr 5, 10:40 am, "CAH" <madsgormlar...@gmail.comwrote:
>>>I need to make at multilingual website, with php and mysql, and I have
>>>placed the different language in different columns in a database. But
>>>when the user chooses a language, should I make the choice stick with
>>>a cookie or a session or something else?
>>>Mads
>>You can store the user`s selection in their session file or if they`re
>>a registered user you can store it in their profile in the database.
>>If you need help dooing any of this just ask :)
>
Thansk for both replies.
I do not have an option to register, it would not make sense on this
kind of site. But is there not an option to save as cookie if
possible, and if cookies are not enabled then use a session ? It would
be annoying for the user to make the selection each time they visit,
so a cookie would seam like the ideal solution. But then not all have
cookies enabled, so therefore the automatic switch to session.
Mads
>
If people can't log in, _and_ have cookies switched off, how would your
server know who's who at their next visit? For sessions to work in a
helpful manner you'd still have to be able to retrieve some unique data
from the client identifying them at each new visit.
I don't think it's too much asked from visitors to allow cookies for
your domain if they want to enjoy the luxury of having their preferences
kept across visits.

Sh.
CAH
Guest
 
Posts: n/a
#6: Apr 9 '07

re: How to make multilingual website?


If people can't log in, _and_ have cookies switched off, how would your
Quote:
server know who's who at their next visit? For sessions to work in a
helpful manner you'd still have to be able to retrieve some unique data
from the client identifying them at each new visit.
I don't think it's too much asked from visitors to allow cookies for
your domain if they want to enjoy the luxury of having their preferences
kept across visits.
>
But from what I read search engines ignore cookies, and at the
same time I would like the users to be able to send links in there
choice of language to there friends, so I would like this sort of url
scheme.


www.site.com/en/
www.site.com/de/
www.site.com/fr/
.....


But I donīt like the idea of having a lot of duplicate files, with
the
only difference being a reference to a specific column in my sql
database. What to do? How do others solve these problems?


Thanks for any advice
CAH

www.winches.dk



Crispy Beef
Guest
 
Posts: n/a
#7: Apr 10 '07

re: How to make multilingual website?


CAH wrote:
Quote:
Quote:
>If people can't log in, _and_ have cookies switched off, how would your
>server know who's who at their next visit? For sessions to work in a
>helpful manner you'd still have to be able to retrieve some unique data
>from the client identifying them at each new visit.
>I don't think it's too much asked from visitors to allow cookies for
>your domain if they want to enjoy the luxury of having their preferences
>kept across visits.
>>
>
But from what I read search engines ignore cookies, and at the
same time I would like the users to be able to send links in there
choice of language to there friends, so I would like this sort of url
scheme.
>
>
www.site.com/en/
www.site.com/de/
www.site.com/fr/
....
>
>
But I donīt like the idea of having a lot of duplicate files, with
the
only difference being a reference to a specific column in my sql
database. What to do? How do others solve these problems?
Why not have a look at the PHP gettext functions, they would surely help you
do exactly what you want to do?

http://uk2.php.net/manual/en/ref.gettext.php

Have a play with the language settings on www.php.net to see how it works.

Just a thought. ;)

Paul
Closed Thread