Reply
I am a little confussed on translating with $_server['HTTP_ACCEPT_LANGUAGE']
Old 03-09-2007, 09:39 PM I am a little confussed on translating with $_server['HTTP_ACCEPT_LANGUAGE']
goheadtry's Avatar
Webmaster Talker

Posts: 708
Name: John
Location: United States of America, California
Does anyone know how translate with redirects
if they are from a country with a spanish speaking country

$_server['HTTP_ACCEPT_LANGUAGE']
is what I wan't to use to translate and redirect But I am a little confused on how to do this script wise

I want it to redirect here if it is mexico, spain etc by browser language
technologyforever.com/es
and here if french
technologyforever.com/fr
goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
When You Register, These Ads Go Away!
     
Old 03-10-2007, 01:45 PM Re: I am a little confussed on translating with $_server['HTTP_ACCEPT_LANGUAGE']
Insensus's Avatar
Ultra Talker

Posts: 275
Name: Mark Stegeman
Location: Netherlands, Europe
It doesn't actually contain the language of the user.
It only contains which language the browser chooses first if he could. This can be set for each browser.

If you really want to use it, use this:
PHP Code:
<?php
$country 
substr(explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']),0,2);  // Makes 'en' from 'en-us'
?>
Here are all the land codes:
http://www.phptutorial.info/scripts/languages.php
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to I am a little confussed on translating with $_server['HTTP_ACCEPT_LANGUAGE']
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11396 seconds with 13 queries