Forum Moderators: coopster

Message Too Old, No Replies

Persistance for Multi Languages

Which is better? Cookies or Query Strings

         

neophyte

9:14 am on Sep 10, 2010 (gmt 0)

10+ Year Member



Hello All -

I've been going back and forth on this for a week while preparing for a client upgrade which requires multi-language content, but now I've got to get going on the coding and still can't make up my mind whether or not it's better to set a project's content language via a query string for each request, or just once via a dropped cookie.

Or maybe there's another way that I haven't thought of.

Cookies, of course, are problematic because the user can block them via their browser which makes me lean toward the query string solution.

What's the opinion of the good guys and gals at WebmasterWorld on this subject?

Neophyte

JAB Creations

1:17 pm on Sep 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm going to take a guess and say URL based implementation would work better...because now you have content in two or more languages that can be crawled by search engines. I would recommend also posting this though in that context in a search engine forum here at the site. I'm mostly posting to subscribe though as I have only implemented translations through third party websites.

- John

penders

5:08 pm on Sep 12, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If using a query string (and no cookie?), you're going to have to make sure the query string is appended to every link on the page and not lost. You could perhaps generate a 'friendly URL' with the help of mod_rewrite?
- www.example.com/uk/mypage -> www.example.com/mypage.php?lang=uk
Possibly better for search engines and users are less likely to chop it off?

I would have thought there would need to be something in the URL in order to indicate language (at the other end of the scale this would be implemented as a completely separate site/domain). If solely a cookie/session then presumably the user would need to be asked the question, "What language?" - and the URL would not be bookmarkable in their chosen language.