Opened 10 years ago

Closed 9 years ago

#77 closed improve feature (fixed)

automatic detection of language

Reported by: Pierre Charles Owned by:
Priority: major Milestone: 0.6-long
Component: BW General Keywords: language selection automatic
Cc:

Description (last modified by micha)

Following the conversation http://www.bevolunteer.org/forum/index.php?topic=484.0

  1. At connection on www.bewelcome.org (or other page which google may link?), detecting the language used by the surfer (spying the default language of his OS, for example, or other appropriated technics) and switching to it if we have it available.
  1. With algorithms, detecting the language of texts entered by a member. We will use it for signup form (SignupPage), posting message in forum, sending message to member
  1. displaying in the “send a message” page, the languages spoken by the recipient of the message. So it’s more probable that the writter will never write in a language not spoken by the recipient, or may make an effort to write in his mother tongue.

By Pierre Charles at https://www.bewelcome.org/flyspray/task/77

Change History (8)

comment:1 Changed 10 years ago by guaka

  • Priority changed from major to minor
  • Type changed from bug to improve feature

comment:2 Changed 10 years ago by lemon-head

  • Description modified (diff)

comment:3 Changed 10 years ago by micha

  • Description modified (diff)
  • Milestone set to unassigned
  • Reporter changed from guaka to Pierre Charles
  • Summary changed from automatic detection of language (2) to automatic detection of language
  • version set to all

Comment by Pierre-Charles (pietshah) - Sunday, 15 July 2007, 15:04 GMT+1 — Edit — Delete

I'm realizing this lack is quite problematic for promoting BW in South America... Since almost nobody speaks english, I cant send a www.bewelcome.org link to a friend of mine without him reaching the english page!! (hoping that he might see the spanish flag...)

comment:4 Changed 10 years ago by feuerdaemon

  • follow_up set to none
  • freq_reported set to 1
  • Milestone changed from unassigned to BigPicture
  • show_on_bw set to 0

comment:5 Changed 10 years ago by lemon-head

  • Priority changed from minor to major

i make this major.. I think it's important.

comment:6 Changed 10 years ago by philipp

  • Milestone changed from BigPicture to unassigned

Milestone BigPicture? deleted

comment:7 Changed 9 years ago by micha

  • Keywords language selection automatic added
  • Milestone changed from unassigned to 0.6-long
<?php
//check first to see if they've been nice and
//set the language
if (isset($_SERVER["HTTP_ACCEPT_language"])) {

//grab all the languages
$langs=explode(",",$_SERVER["HTTP_ACCEPT_language"]);

//start going through each one
foreach ($langs as $value) {

//select only the first two letters
$choice=substr($value,0,2);

//redirect to the different language page
//based on their first chosen language
switch ($choice) {
case "fr":
Header("Location: french.php");
exit;
case "en":
Header("Location: english.php");
exit;
case "es":
Header("Location: spanish.php");
exit;
}
}
}

//If the language is not set then use this
//as default
else {
Header("Location: english.php");
exit;
}
?> 






The above should do the trick. We just have to implement it somewhere. the link to this code:
http://www.webmasterworld.com/forum88/3779.htm

comment:8 Changed 9 years ago by micha

  • Resolution set to fixed
  • Status changed from new to closed

moved to production in r6196

Note: See TracTickets for help on using tickets.